microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.08k stars 29.21k forks source link

ssh remote connection failed #224457

Closed Mactarvish closed 3 months ago

Mactarvish commented 3 months ago

Type: Bug

[11:32:44.202] Log Level: 2 [11:32:44.208] SSH Resolver called for "ssh-remote+h3c_test", attempt 1 [11:32:44.209] "remote.SSH.useLocalServer": false [11:32:44.209] "remote.SSH.useExecServer": true [11:32:44.209] "remote.SSH.showLoginTerminal": false [11:32:44.209] "remote.SSH.remotePlatform": {"aliyun":"linux","pi":"linux","h3c_mck":"linux","remote_mck":"linux","202.105.108.147":"linux","qidi_jumper":"linux","121.46.233.93":"linux","jump.qidi.co":"linux"} [11:32:44.209] "remote.SSH.path": undefined [11:32:44.209] "remote.SSH.configFile": undefined [11:32:44.209] "remote.SSH.useFlock": true [11:32:44.209] "remote.SSH.lockfilesInTmp": false [11:32:44.209] "remote.SSH.localServerDownload": auto [11:32:44.210] "remote.SSH.remoteServerListenOnSocket": false [11:32:44.210] "remote.SSH.showLoginTerminal": false [11:32:44.210] "remote.SSH.defaultExtensions": [] [11:32:44.210] "remote.SSH.loglevel": 2 [11:32:44.210] "remote.SSH.enableDynamicForwarding": true [11:32:44.210] "remote.SSH.enableRemoteCommand": false [11:32:44.210] "remote.SSH.serverPickPortsFromRange": {} [11:32:44.210] "remote.SSH.serverInstallPath": {} [11:32:44.215] VS Code version: 1.91.1 [11:32:44.215] Remote-SSH version: remote-ssh@0.112.0 [11:32:44.215] win32 x64 [11:32:44.217] SSH Resolver called for host: h3c_test [11:32:44.217] Setting up SSH remote "h3c_test" [11:32:44.220] Using commit id "f1e16e1e6214d7c44d078b1f0607b2388f29d729" and quality "stable" for server [11:32:44.221] Install and start server if needed [11:32:45.432] Checking ssh with "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1\bin\ssh.exe -V" [11:32:45.435] Got error from ssh: spawn C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1\bin\ssh.exe ENOENT [11:32:45.435] Checking ssh with "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1\libnvvp\ssh.exe -V" [11:32:45.436] Got error from ssh: spawn C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1\libnvvp\ssh.exe ENOENT [11:32:45.436] Checking ssh with "C:\Windows\system32\ssh.exe -V" [11:32:45.437] Got error from ssh: spawn C:\Windows\system32\ssh.exe ENOENT [11:32:45.437] Checking ssh with "C:\Windows\ssh.exe -V" [11:32:45.438] Got error from ssh: spawn C:\Windows\ssh.exe ENOENT [11:32:45.438] Checking ssh with "C:\Windows\System32\Wbem\ssh.exe -V" [11:32:45.439] Got error from ssh: spawn C:\Windows\System32\Wbem\ssh.exe ENOENT [11:32:45.439] Checking ssh with "C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe -V" [11:32:45.440] Got error from ssh: spawn C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe ENOENT [11:32:45.440] Checking ssh with "C:\Windows\System32\OpenSSH\ssh.exe -V" [11:32:45.465] > OpenSSH_for_Windows_8.6p1, LibreSSL 3.4.3

[11:32:45.470] Running script with connection command: "C:\Windows\System32\OpenSSH\ssh.exe" -T -D 60625 "h3c_test" bash [11:32:45.471] Terminal shell path: C:\WINDOWS\System32\cmd.exe [11:32:45.997] > test@121.46.233.93's password:]0;C:\WINDOWS\System32\cmd.exe [11:32:45.997] Got some output, clearing connection timeout [11:32:45.998] Showing password prompt [11:32:49.770] Got password response [11:32:49.771] "install" wrote data to terminal: "****" [11:32:49.817] > [11:32:50.158] > 773bb362acdf: running

Installing to /home/test/.vscode-server... 773bb362acdf%%1%% [11:32:50.178] > Downloading with wget [11:32:57.520] > wget download failed wget: 无法解析主机地址 ‘vscode.download.prss.microsoft.com’ printenv: SHELL=/bin/sh LANGUAGE=zh_CN:zh PWD=/home/test/.vscode-server LOGNAME=test XDG_SESSION_TYPE=tty MOTD_SHOWN=pam HOME=/home/test LANG=zh_CN.UTF-8 VSCODE_AGENT_FOLDER=/home/test/.vscode-server SSH_CONNECTION=202.105.108.147 60628 192.168.1.6 22 XDG_SESSION_CLASS=user USER=test SHLVL=0 XDG_SESSION_ID=24 XDG_RUNTIME_DIR=/run/user/1012 SSH_CLIENT=202.105.108.147 60628 22 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin DBUS_SESSION_BUSADDRESS=unix:path=/run/user/1012/bus OLDPWD=/home/test =/usr/bin/printenv Trigger local server download 773bb362acdf:trigger_server_download artifact==cli-alpine-x64== destFolder==/home/test/.vscode-server== destFolder2==/vscode-cli-f1e16e1e6214d7c44d078b1f0607b2388f29d729.tar.gz==
773bb362acdf:trigger_server_download_end Waiting for client to transfer server archive... Waiting for /home/test/.vscode-server/vscode-cli-f1e16e1e6214d7c44d078b1f0607b23 388f29d729.tar.gz.done and vscode-server.tar.gz to exist [11:32:57.521] Got request to download on client for {"artifact":"cli-alpine-x64","destPath":"/home/test/.vscode-server/vscode-cli-f1e16e1e6214d7c44d078b1f0607b2388f29d729.tar.gz"} [11:32:57.521] Downloading VS Code server locally... [11:32:57.540] >

[11:32:58.896] Downloaded VS Code server to c:\Users\29184\AppData\Local\Temp\8e1eb9e2-264f-4344-b0bb-f59b99c49d57 [11:32:58.897] Renamed VS Code server to c:\Users\29184\AppData\Local\Temp\vscode_server_1722483178896\vscode-cli-f1e16e1e6214d7c44d078b1f0607b2388f29d729.tar.gz [11:32:58.900] Checking ssh with "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1\bin\ssh.exe -V" [11:32:58.901] Got error from ssh: spawn C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1\bin\ssh.exe ENOENT [11:32:58.901] Checking ssh with "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1\libnvvp\ssh.exe -V" [11:32:58.902] Got error from ssh: spawn C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1\libnvvp\ssh.exe ENOENT [11:32:58.902] Checking ssh with "C:\Windows\system32\ssh.exe -V" [11:32:58.903] Got error from ssh: spawn C:\Windows\system32\ssh.exe ENOENT [11:32:58.903] Checking ssh with "C:\Windows\ssh.exe -V" [11:32:58.904] Got error from ssh: spawn C:\Windows\ssh.exe ENOENT [11:32:58.904] Checking ssh with "C:\Windows\System32\Wbem\ssh.exe -V" [11:32:58.905] Got error from ssh: spawn C:\Windows\System32\Wbem\ssh.exe ENOENT [11:32:58.905] Checking ssh with "C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe -V" [11:32:58.906] Got error from ssh: spawn C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe ENOENT [11:32:58.906] Checking ssh with "C:\Windows\System32\OpenSSH\ssh.exe -V" [11:32:58.931] > OpenSSH_for_Windows_8.6p1, LibreSSL 3.4.3

[11:32:58.932] Expecting scp to be next to ssh at C:\Windows\System32\OpenSSH\scp.exe [11:32:58.932] Testing scp with "C:\Windows\System32\OpenSSH\scp.exe" [11:32:58.963] scp exited with code: 1 [11:32:58.964] Got stderr from scp: usage: scp [-346ABCpqrTv] [-c cipher] [-F ssh_config] [-i identity_file] [-J destination] [-l limit] [-o ssh_option] [-P port] [-S program] source ... target [11:32:58.964] Copying file to remote with "C:\Windows\System32\OpenSSH\scp.exe" "c:\Users\29184\AppData\Local\Temp\vscode_server_1722483178896\vscode-cli-f1e16e1e6214d7c44d078b1f0607b2388f29d729.tar.gz" "vscode-cli-f1e16e1e6214d7c44d078b1f0607b2388f29d729.tar.gz.done" "h3c_test":"/home/test/.vscode-server" [11:32:58.964] Using cwd: file:///c%3A/Users/29184/AppData/Local/Temp/vscode_server_1722483178896 [11:32:58.964] Terminal shell path: C:\WINDOWS\System32\cmd.exe [11:32:59.586] > test@121.46.233.93's password:]0;C:\WINDOWS\System32\cmd.exe [11:32:59.587] Showing password prompt [11:33:04.823] Got password response [11:33:04.823] "Copy server to host" wrote data to terminal: "****" [11:33:04.866] > [11:33:05.228] > vscode-cli-f1e16e1e6214d7c44d078b1f0607b2388f29d729.tar.gz 0% 0 0.0KB/ [11:33:06.323] > vscode-cli-f1e16e1e6214d7c44d078b1f0607b2388f29d729.tar.gz 76% 6720KB 6.0MB/ [11:33:07.704] > vscode-cli-f1e16e1e6214d7c44d078b1f0607b2388f29d729.tar.gz 100% 8755KB 3.5MB/ [11:33:07.734] > vscode-cli-f1e16e1e6214d7c44d078b1f0607b2388f29d729.tar.gz.done 0% 0 0 [11:33:07.766] > vscode-cli-f1e16e1e6214d7c44d078b1f0607b2388f29d729.tar.gz.done 100% 9 0 [11:33:09.033] "Copy server to host" terminal command done [11:33:09.525] > Found flag and server on host

773bb362acdf%%2%% tar --version: [11:33:09.540] > tar (GNU tar) 1.34 Copyright (C) 2021 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later https://gnu.org/licenses/gpl.html. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

由 John Gilmore 和 Jay Fenlason 所写。 [11:33:09.724] > code 1.91.1 (commit f1e16e1e6214d7c44d078b1f0607b2388f29d729) Starting VS Code CLI... "/home/test/.vscode-server/code-f1e16e1e6214d7c44d078b1f f0607b2388f29d729" command-shell --cli-data-dir "/home/test/.vscode-server/cli" - --on-port --on-host=127.0.0.1 --parent-process-id 11987 &> "/home/test/.vscode-se erver/.cli.f1e16e1e6214d7c44d078b1f0607b2388f29d729.log" < /dev/null printenv: SHELL=/bin/sh LANGUAGE=zh_CN:zh PWD=/home/test LOGNAME=test XDG_SESSION_TYPE=tty MOTD_SHOWN=pam HOME=/home/test LANG=zh_CN.UTF-8 VSCODE_AGENT_FOLDER=/home/test/.vscode-server SSH_CONNECTION=202.105.108.147 60628 192.168.1.6 22 XDG_SESSION_CLASS=user USER=test SHLVL=0 XDG_SESSION_ID=24 XDG_RUNTIME_DIR=/run/user/1012 SSH_CLIENT=202.105.108.147 60628 22 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games s:/usr/local/games:/snap/bin DBUS_SESSION_BUSADDRESS=unix:path=/run/user/1012/bus OLDPWD=/home/test/.vscode-server =/usr/bin/printenv Spawned remote CLI: 12332 [11:33:09.757] > [11:33:09.788] > Exec server process not found [2024-08-01 11:33:10] error This machine does not meet Visual Studio Code Server r's prerequisites, expected either...

  • find libstdc++.so or ldconfig for GNU environments
  • find /lib/ld-musl-x86_64.so.1, which is required to run the Visual Studio Co ode Server in musl environments 773bb362acdf: start SSH_AUTH_SOCK==== DISPLAY==== listeningOn==== osReleaseId==ubuntu== arch==x86_64== vscodeArch==x64== bitness==64== tmpDir==/run/user/1012== platform==linux== unpackResult==success== didLocalDownload==1== downloadTime==== installTime==180== serverStartTime==53== [11:33:09.820] > execServerToken==1a1a1a1a-1111-1aa1-a1a1-a111aa1aa1a1== 773bb362acdf: end [11:33:09.820] Received install output: SSH_AUTH_SOCK==== DISPLAY==== listeningOn==== osReleaseId==ubuntu== arch==x86_64== vscodeArch==x64== bitness==64== tmpDir==/run/user/1012== platform==linux== unpackResult==success== didLocalDownload==1== downloadTime==== installTime==180== serverStartTime==53== execServerToken==1a1a1a1a-1111-1aa1-a1a1-a111aa1aa1a1==

[11:33:09.821] Failed to parse remote port from server output [11:33:09.822] Resolver error: Error: at g.Create (c:\Users\29184.vscode\extensions\ms-vscode-remote.remote-ssh-0.112.0\out\extension.js:2:499918) at t.handleInstallOutput (c:\Users\29184.vscode\extensions\ms-vscode-remote.remote-ssh-0.112.0\out\extension.js:2:497240) at t.tryInstall (c:\Users\29184.vscode\extensions\ms-vscode-remote.remote-ssh-0.112.0\out\extension.js:2:621085) at async c:\Users\29184.vscode\extensions\ms-vscode-remote.remote-ssh-0.112.0\out\extension.js:2:580730 at async t.withShowDetailsEvent (c:\Users\29184.vscode\extensions\ms-vscode-remote.remote-ssh-0.112.0\out\extension.js:2:584036) at async k (c:\Users\29184.vscode\extensions\ms-vscode-remote.remote-ssh-0.112.0\out\extension.js:2:577649) at async t.resolve (c:\Users\29184.vscode\extensions\ms-vscode-remote.remote-ssh-0.112.0\out\extension.js:2:581407) at async c:\Users\29184.vscode\extensions\ms-vscode-remote.remote-ssh-0.112.0\out\extension.js:2:848023 [11:33:09.827] ------

[11:33:10.384] Opening exec server for ssh-remote+h3c_test [11:33:10.408] Initizing new exec server for ssh-remote+h3c_test [11:33:10.409] Using commit id "f1e16e1e6214d7c44d078b1f0607b2388f29d729" and quality "stable" for server [11:33:10.411] Install and start server if needed [11:33:10.435] Opening exec server for ssh-remote+h3c_test [11:34:08.899] getPlatformForHost was canceled [11:34:08.899] Exec server for ssh-remote+h3c_test failed: Error: Connecting was canceled [11:34:08.899] Existing exec server for ssh-remote+h3c_test errored (Error: Connecting was canceled) [11:34:08.900] Initizing new exec server for ssh-remote+h3c_test [11:34:08.900] Using commit id "f1e16e1e6214d7c44d078b1f0607b2388f29d729" and quality "stable" for server [11:34:08.903] Error opening exec server for ssh-remote+h3c_test: Error: Connecting was canceled [11:34:08.903] Install and start server if needed

VS Code version: Code 1.91.1 (f1e16e1e6214d7c44d078b1f0607b2388f29d729, 2024-07-09T22:06:49.809Z) OS version: Windows_NT x64 10.0.22631 Modes: Connection to 'SSH' could not be established

System Info |Item|Value| |---|---| |CPUs|12th Gen Intel(R) Core(TM) i7-12700H (20 x 2688)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|15.70GB (3.08GB free)| |Process Argv|--crash-reporter-id 5cc2e73d-faaf-475d-b098-f09eebe529d3| |Screen Reader|no| |VM|0%| Connection to 'SSH' could not be established
Extensions: none
A/B Experiments ``` vsliv368cf:30146710 vspor879:30202332 vspor708:30202333 vspor363:30204092 vswsl492:30256859 vscod805:30301674 binariesv615:30325510 vsaa593cf:30376535 py29gd2263:31024239 c4g48928:30535728 azure-dev_surveyone:30548225 2i9eh265:30646982 962ge761:30959799 pythongtdpath:30769146 welcomedialog:30910333 pythonnoceb:30805159 asynctok:30898717 pythonregdiag2:30936856 pythonmypyd1:30879173 h48ei257:31000450 pythontbext0:30879054 accentitlementst:30995554 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:31000557 dsvsc020:30976470 pythonait:31006305 dsvsc021:30996838 g316j359:31013175 pythoncenvpt:31062603 a69g1124:31058053 dvdeprecation:31068756 dwnewjupytercf:31046870 impr_priority:31102340 nativerepl2:31104044 refactort:31108082 ccplt:31103426 pythonrstrctxt:31103193 ```
Mactarvish commented 3 months ago

solved by installing

find libstdc++.so or ldconfig for GNU environments
find /lib/ld-musl-x86_64.so.1, which is required to run the Visual Studio Co

Hope auto install them by remote ssh.

PunchyRascal commented 3 months ago

Could you please elaborate what/how exactly you installed?

Mactarvish commented 3 months ago
sudo apt-get install libstdc++6
sudo apt-get install musl-tools