vscode 服务器无法启动 SSH

The vscode server failed to start SSH

尝试通过 Visual Studio 代码的远程 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:\Users\sa\.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.8\out\extension.js:1:39675)
    at u (c:\Users\sa\.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.8\out\extension.js:1:391298)
    at Object.t.handleInstallOutput (c:\Users\sa\.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.8\out\extension.js:1:39717)
    at Object.t.tryInstall (c:\Users\sa\.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.8\out\extension.js:1:48914)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async c:\Users\sa\.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.8\out\extension.js:1:45110
    at async Object.t.withShowDetailsEvent (c:\Users\sa\.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.8\out\extension.js:1:45660)
    at async Object.t.resolve (c:\Users\sa\.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.8\out\extension.js:1:45189)
    at async c:\Users\sa\.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.8\out\extension.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:

我验证了

VS Code version is版本:1.60.2

关于如何调试和修复此远程 SSH 问题的任何建议?

@oakad 感谢您建议并指出在远程端升级 libstdc++。

  • 我使用的主机是 RPi 3B Debian(Jessie)。我尝试过了 在 vs code 和
  • 上升级远程盒子

sudo apt-get update

  • This thread 已解决 libstdc++.so.6:未找到版本“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 

它没有帮助,只是将树莓派 3B 升级到树莓派 4 现在 Visual Studio 代码的 Remote-SSH 在上面运行得非常好。 (不确定最近是否有一些不再支持旧 Raspbian 版本的更新)

无论如何,我遇到了与 OP 相同的问题,那是因为我 运行ning Jesse,is nearly 5 years old now. I updated my Raspberry Pi's kernel from Jesse to Buster (2021) by following this guide: 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 执行相同的操作(如链接 post 中所述)。

一切稳定后,您可以从远程机器安装 运行 vscode-服务器。

当我从 Windows 机器访问 Linux 服务器时,我遇到了同样的错误消息。 我通过添加允许传入流量到 VSCode 的 windows 防火墙规则解决了这个问题(顺便说一句,我之前已经设置了一个允许传出流量的规则)。