VS Code insiders 连接远程服务器的坑(杂记)

Posted Rudon滨海渔村

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了VS Code insiders 连接远程服务器的坑(杂记)相关的知识,希望对你有一定的参考价值。

ssh installation not found

VS Code remote development tool error - An SSH installation couldn't be found
https://frederick-s.github.io/2019/08/08/ssh-installation-couldnot-be-found-error-when-running-remote-ssh-in-vscode/

解决办法:

VS Code will look for the ssh command in the PATH. Failing that, on Windows it will attempt to find ssh.exe in the default Git for Windows install path. You can also specifically tell VS Code where to find the SSH client by adding the remote.SSH.path property to settings.json

按下F1,编辑settings.json,指定:
"remote.SSH.path": "D:/Program Files/Git/usr/bin/ssh.exe",

Can't open user config file vps: No such file or directory
> 过程试图写入的管道不存在。
Install terminal quit with output: 过程试图写入的管道不存在。
Received install output: 过程试图写入的管道不存在。

解决办法:

按下F1,编辑settings.json,指定:
"remote.SSH.configFile": "D:/Program Files/Microsoft VS Code Insiders/vps",

wget download failed
> ERROR: cannot verify update.code.visualstudio.com's certificate, issued by ‘CN=Microsoft Azure TLS Issuing CA 05,O=Microsoft Corporation,C=US’: Unable to locally verify
>  the issuer's authority. To connect to update.code.visualstudio.com insecurely, use `--no-check-certificate'.

解决办法(HTTPS协议无法在Linux上运行的部分):

用Git bash连接到服务器,然后手动下载,
ubuntu@VM-0-13-ubuntu:~/tmp$ curl -sSL “https://update.code.visualstudio.com/commit:${commit_id}/server-linux-x64/stable” -o vscode-server-linux-x64.tar.gz
curl: (1) Protocol "“https" not supported or disabled in libcurl
ubuntu@VM-0-13-ubuntu:~/tmp$
怎么解决呢?

对应解决方法是重新安装curl  可参考:(https://www.cnblogs.com/zhishuai/p/8094855.html

wget http://archive.ubuntu.com/ubuntu/pool/main/c/curl/curl_7.35.0.orig.tar.gz
tar -xzvf curl_7.35.0.orig.tar.gz
cd curl-7.35.0/
./configure
make
sudo make install

装好后,curl -V能看到,能支持https。

但是还是不行?那就是格式问题了,

原命令:

curl -sSL “https://update.code.visualstudio.com/commit:${commit_id}/server-linux-x64/stable” -o vscode-server-linux-x64.tar.gz

正确命令:注意双引号

curl -sSL "https://update.code.visualstudio.com/commit:${commit_id}/server-linux-x64/stable" -o vscode-server-linux-x64.tar.gz

ok了!

但是,vscode下面还是无法连接远程Linux,如下

解决办法(证书问题update.code.visualstudio.com's certificate):

[12:50:56.796] > wget download failed
> ERROR: cannot verify update.code.visualstudio.com's certificate, issued by ‘CN=Microsoft Azure TLS Issuing CA 05,O=Microsoft Corpora
> tion,C=US’: Unable to locally verify the issuer's authority. To connect to update.code.visualstudio.com insecurely, use `--no-check-
> certificate'.

正确步骤:

1.手动Bash通过ssh连接到Linux

2. sudo vi /etc/wgetrc

3. 最后一行加上check_certificate = off

4. 重新再试下

参考自 https://stackoverflow.com/questions/66067901/update-vs-code-and-kaspersky-certificate

以下这两个方法试了都不行

---- 无效idea 1----

1)VScode中按F1,输入settings.json

2)添加一行用来忽略HTTPS:  "http.proxyStrictSSL": false

---- 无效idea 2----

1.手动安装最新的vs-code-server,先在Linux上弄个sh脚本download-vs-code-server.sh,内容参考:https://gist.github.com/b01/0a16b6645ab7921b0910603dfb85e4fb#file-download-vs-code-server-sh

2.chmod +x download-vs-code-server.sh

3.运行这脚本 ./download-vs-code-server.sh

4. 。。。。这方法不行。。。

连接成功!

以上是关于VS Code insiders 连接远程服务器的坑(杂记)的主要内容,如果未能解决你的问题,请参考以下文章

VS Code 远程连接服务器

使用VS Code配合Remote Development插件连接远程服务器(Mac/Linux+Windows) | Using VS Code with Remote Development Co

vscode配置远程连接失败:过程试图写入的管道不存在(已解决)

“An SSH installation couldn‘t be found“ - VScode无法远程接连Linux - Visual Studio Code - Insiders

VS Code 进行远程Cmake编译

VS Code 远程连接 Jupyter