尝试通过Visual Studio Code的Remote-SSH连接到主机,我得到以下弹出错误:
Could not establish connection to 100.xxx.xx.xx The vscode server failed to start SSH
输出端的错误信息如下:
[16:22:19.929] > Waiting for server log...
[16:22:19.981] > Waiting for server log...
[16:22:20.034] > Waiting for server log...
[16:22:20.088] >
> *
> * Reminder: You may only use this software with Visual Studio family products,
> * as described in the license (https://go.microsoft.com/fwlink/?linkid=2077057)
> *
>
[16:22:20.102] >
[16:22:20.130] > Server did not start successfully. Full server log at /home/pi/.vscode-server/.
> 7f6ab5485bbc0083e155244e.log >>>
> /home/pi/.vscode-server/bin/7f6ab5485bbc0083e155244e/node: /usr/
> lib/arm-linux-gnueabihf/libstdc++.so.6: version `CXXABI_1.3.9' not found (requir
> ed by /home/pi/.vscode-server/bin/7f6ab5485bbc0083e155244e/node)
> /home/pi/.vscode-server/bin/7f6ab5485bbc0083e155244e/node: /usr/
> lib/arm-linux-gnueabihf/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (requ
> ired by /home/pi/.vscode-server/bin/7f6ab5485bbc0083e155244e/nod
> e)
[16:22:20.136] >
> <<< End of server log
[16:22:20.142] >
> 2f61c0e4f600: start
> exitCode==32==
> listeningOn====
> osReleaseId==raspbian==
> arch==armv7l==
> tmpDir==/run/user/1000==
> platform==linux==
[16:22:20.148] >
> unpackResult==success==
> didLocalDownload==0==
> downloadTime==15126==
> installTime==4341==
> extInstallTime====
> serverStartTime==7826==
> 2f61c0e4f600: end
[16:22:20.148] Received install output:
exitCode==32==
listeningOn====
osReleaseId==raspbian==
arch==armv7l==
tmpDir==/run/user/1000==
platform==linux==
unpackResult==success==
didLocalDownload==0==
downloadTime==15126==
installTime==4341==
extInstallTime====
serverStartTime==7826==
[16:22:20.149] Resolver error: Error: The VS Code Server failed to start
at Function.ServerInstallError (c:Userssa.vscodeextensionsms-vscode-remote.remote-ssh-0.65.8outextension.js:1:39675)
at u (c:Userssa.vscodeextensionsms-vscode-remote.remote-ssh-0.65.8outextension.js:1:391298)
at Object.t.handleInstallOutput (c:Userssa.vscodeextensionsms-vscode-remote.remote-ssh-0.65.8outextension.js:1:39717)
at Object.t.tryInstall (c:Userssa.vscodeextensionsms-vscode-remote.remote-ssh-0.65.8outextension.js:1:48914)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async c:Userssa.vscodeextensionsms-vscode-remote.remote-ssh-0.65.8outextension.js:1:45110
at async Object.t.withShowDetailsEvent (c:Userssa.vscodeextensionsms-vscode-remote.remote-ssh-0.65.8outextension.js:1:45660)
at async Object.t.resolve (c:Userssa.vscodeextensionsms-vscode-remote.remote-ssh-0.65.8outextension.js:1:45189)
at async c:Userssa.vscodeextensionsms-vscode-remote.remote-ssh-0.65.8outextension.js:1:52942
[16:22:20.153] ------
[16:22:20.652] >
[16:22:21.437] "install" terminal command done
[16:22:21.438] Install terminal quit with output:
我验证
- 两者在同一网络
- 主机可通过ping到达
- 我可以在命令提示符和powershell等其他终端上ssh到它,我只在VS Code远程ssh上看到问题。前几天还好,现在突然不工作了。
VS Code version is version: 1.60.2
关于我如何调试和修复这个远程SSH问题的任何建议?
不管怎样,我和OP有同样的问题,这是因为我在运行Jesse,它现在已经快5岁了。我更新了我的树莓派的内核从Jesse到Buster(2021)遵循这个指南:https://djangocas.dev/blog/upgrade-existing-jessie-to-buster-without-re-image/
简而言之,将内核更新为更现代的版本。短版:
$ sudo sed -i 's/jessie/stretch/g' /etc/apt/sources.list
$ sudo sed -i 's/jessie/stretch/g' /etc/apt/sources.list.d/raspi.list
$ sudo apt-get update
$ sudo apt-get -y dist-upgrade
$ sudo reboot
从jessie到stretch这样做之后,从stretch到buster也这样做(如链接文章中所述)。
一旦一切都稳定了,你就可以在远程机器上安装和运行vcode -server了。
我遇到了同样的错误消息,因为我从Windows机器访问Linux服务器。我通过添加一个允许传入流量到VSCode的windows防火墙规则来解决这个问题(顺便说一句,我之前已经设置了一个允许传出流量的规则)。
@oakad感谢您在远程端升级libstdc++的建议和指点。
- 我使用的主机是RPi 3B Debian(Jessie)。我试过远程升级框vs代码和
sudo apt-get update
- 这个线程地址是libstdc++.so。版本' GLIBCXX_3.4.22'未找到问题
所以尝试
sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update sudo apt-get install gcc-4.9 sudo apt-get upgrade libstdc++6
后面跟着add-apt-repository: command not found error进一步尝试
sudo apt install software-properties-common
sudo apt update
没有帮助,只是升级零售物价指数3 b零售物价指数4现在Visual Studio Code的Remote-SSH在它上面工作得很好。(不确定是否有一些最近的更新,不再支持旧Raspbian版)
我也面临着同样的问题。
- 从VS Code的命令面板中选择
Remote-SSH: Kill VS Code Server on Host
。这消除了VS代码服务器从远程机器。 - 通过从命令面板中选择
Remote-SSH: Connect to Host...
并输入您的凭据,建立到主机的新连接。