VS Code服务器启动SSH失败。

3
尝试通过Visual Studio Code的远程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:

我已验证:

  • 两者在同一网络中
  • 通过ping命令可以到达主机
  • 我能够在其他终端上使用ssh连接它,如命令提示符和PowerShell,只有在VS Code远程SSH上出现了问题。 它之前几天都正常工作,但突然间停止工作了。

VS Code版本号为 Version: 1.60.2。

有没有关于如何调试和解决此远程SSH问题的建议?


它告诉你:预编译的二进制文件vscode试图上传到远程侧需要比远程盒子上的版本更高的libstdc++版本。您需要以某种方式升级远程盒子。这可能会因系统而异,具有任意难度。 - oakad
4个回答

1

就我所知,我的问题与原帖作者相同,原因是我正在使用已经接近5年的Jesse版本。我按照这篇指南将我的树莓派内核从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的升级。

一旦一切稳定,您可以从远程计算机安装和运行vscode-server。


0

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


0

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

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

sudo apt-get update

  • 这个线程解决了libstdc++.so.6: version `GLIBCXX_3.4.22' not found问题

所以我尝试了

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 

这并没有帮助,只是将 RPi 3B 升级到了 RPi 4。 现在 Visual Studio Code 的 Remote-SSH 在其上运行得非常完美。 (不确定是否有一些最近的更新不再支持旧版本的 Raspbian)


0

我曾经遇到过同样的问题。这是解决方法:

  1. 从VS Code的命令面板中选择Remote-SSH: Kill VS Code Server on Host。这将从远程机器中删除VS Code服务器。
  2. 通过从命令面板中选择Remote-SSH: Connect to Host...并输入您的凭据来建立与主机的新连接。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接