问题描述

此前,本人参考网上教程在VS Code中配置了“Remote SSH”插件,本人是在Windows中使用VS Code来连接远程的Linux服务器。但是今天使用遇到了问题Error: Running the contributed command: '_workbench.downloadResource' failed,截图如下:

vscode远程主机_Code


vscode远程主机_服务器_02

解决方法

本教程使用的vscode版本是 1.60.2

vscode远程主机_服务器_03


Remote - SSH: Editing Configuration Files 版本是0.65.8

vscode远程主机_Code_04

wget https://update.code.visualstudio.com/commit:${commit_id}/server-linux-x64/stable

mkdir -p ~/.vscode-server/bin/${commit_id}/
tar xf vscode-server-linux-x64.tar.gz -C ~/.vscode-server/bin/${commit_id}/
cd ~/.vscode-server/bin/${commit_id}/
mv vscode-server-linux-x64/* .
  • 下载包是有一个commit_id的,也是查看版本中第二行【提交】这一串字符。
  • 如无法下载包的话,可以下载本人上传到百度云的连接是:https://pan.baidu.com/s/1wG5HJuUeYRjj-ubNGmKunQ ,提取码:edxl。上传到服务器上,然后继续往下操作。

左下角有下面提示,则表示已连接成功了。可以开发调式代码了

vscode远程主机_Code_05