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文件夹是无法成功配置的。

相关推荐
行云流水剑16 分钟前
【学习记录】在 Ubuntu 中将新硬盘挂载到 /home 目录的完整指南
服务器·学习·ubuntu
cnkeysky30 分钟前
vscode 配置 latex
vscode·latex
搬码临时工1 小时前
如何把本地服务器变成公网服务器?内网ip网址转换到外网连接访问
运维·服务器·网络·tcp/ip·智能路由器·远程工作·访问公司内网
鳄鱼杆2 小时前
服务器 | Centos 9 系统中,如何部署SpringBoot后端项目?
服务器·spring boot·centos
weixin_461259413 小时前
[C]C语言日志系统宏技巧解析
java·服务器·c语言
m0_637146933 小时前
C语言基础面试问答
运维·服务器
Clownseven4 小时前
SSH/RDP无法远程连接?腾讯云CVM及通用服务器连接失败原因与超全排查指南
服务器·ssh·腾讯云
ricky_fan4 小时前
window下配置ssh免密登录服务器
运维·服务器·ssh
2401_858286114 小时前
OS11.【Linux】vim文本编辑器
linux·运维·服务器·编辑器·vim
朱包林4 小时前
day27-shell编程(自动化)
linux·运维·服务器·网络·shell脚本