vscode 连接远程服务器 服务器无法上网 离线配置 .vscode-server

离线配置 vscode 连接远程服务器 .vscode-server

1. .vscode-server下载

使用vscode连接远程服务器时会自动下载配置.vscode-server文件夹,如果远程服务器无法联网,则需要手动下载

1)网址:https://update.code.visualstudio.com/commit:\&替换为自己的vscode软件的id\&/server-linux-x64/stable

2)vscode commit id获取

点击导航栏中的Help-->About-->获取commit-->复制到上方网址即可下载vscode-server-linux-x64.tar.gz 文件

2. .vscode-server配置

1)创建**.vscode-server/bin/&commit id&**文件夹

命令: mkdir -p ~/.vscode-server/bin/5c....

2)解压vscode-server-linux-x64.tar.gz到.vscode-server/bin/&commit id&文件夹

命令tar -xvf vscode-server-linux-x64.tar.gz -C ~/.vscode-server/bin/5c... --strip 1

3)解压后的目录结构如下

3. 使用

打开vscode连接远程服务器即可
注意:作者使用上述步骤仍然无法成功配置。但是其他博客却可以成功。

核查原因后发现,除了bin中文件.vscode-server文件夹内还需要以下文件:

这些文件作者是通过以下命令下载的:
curl -x http://192.... "https://update.code.visualstudio.com/commit:5c.../server-linux-x64/stable" -o vscode-server-linux-x64.tar.gz

其中,http://192...是作者使用的代理服务器地址(也就是说最后还是在服务器端联网了)

有其他博客说这个命令curl "https://update.code.visualstudio.com/commit:5c.../server-linux-x64/stable" -o vscode-server-linux-x64.tar.gz是用于下载vscode-server-linux-x64.tar.gz的,但是作者通过这个命令下载的vscode-server-linux-x64.tar.gz只有1kb,.vscode-server文件夹内却多了图中文件,使得vscode-server配置成功。
实测,只有bin文件夹是无法成功配置的。

相关推荐
invicinble3 小时前
对linux形成认识
linux·运维·服务器
Howrun7773 小时前
VSCode烦人的远程交互UI讲解
ide·vue.js·vscode
技术路上的探险家3 小时前
8 卡 V100 服务器:基于 vLLM 的 Qwen 大模型高效部署实战
运维·服务器·语言模型
Ashley的成长之路3 小时前
2025 年最新:VSCode 中提升 React 开发效率的必备插件大全
ide·vscode·react.js·工作提效·react扩展
半桔4 小时前
【IO多路转接】高并发服务器实战:Reactor 框架与 Epoll 机制的封装与设计逻辑
linux·运维·服务器·c++·io
绵绵细雨中的乡音4 小时前
深入理解 ET 与 LT 模式及其在 Reactor 模型中的应用
服务器·网络·php
HABuo4 小时前
【linux文件系统】磁盘结构&文件系统详谈
linux·运维·服务器·c语言·c++·ubuntu·centos
m0_555762904 小时前
VSCODE CLAUDE CODE
ide·vscode·编辑器
Howrun7774 小时前
关于Linux服务器的协作问题
linux·运维·服务器
yunfuuwqi6 小时前
OpenClaw✅真·喂饭级教程:2026年OpenClaw(原Moltbot)一键部署+接入飞书最佳实践
运维·服务器·网络·人工智能·飞书·京东云