VSCode ssh Server卡在Setting up SSH Host XX: Downloading VS Code Server

本文介绍如何在华为GPU服务器因无网络连接而卡在VSCode Remote-SSH下载阶段时,通过手动下载并上传vscode-server解决连接问题。步骤包括获取commitid、下载服务器版本、上传到服务器并解压。

VSCode ssh Server卡在Setting up SSH Host XX: Downloading VS Code Server

问题

使用VSCode Remote-SSH插件,想连接远程的华为GPU服务器,但就是无法连接上,以前其他的服务器连接没有出现过这种情况。

发现是因为服务器端会下载vscode-server-linux-x64.tar.gz这个文件,但如果无法连接外网,又没设置代理的情况下,是无法下载的,所以一直卡在Downloading VS Code Server.

解决方案

查看下载过程的detail信息,可以看到/root/.vscode-server-insiders/bin/71b299184f7908491345aec5e231599c3ae8753b/vscode-remote-lock.root.Using commit id "71b299184f7908491345aec5e231599c3ae8753b" and quality "insider" for server这样的信息。【这里的commit id可能不同,按照自己的来】,第一个信息是服务器希望将文件下载/root/.vscode-server-insiders/bin/[commit id]/目录下,第二个信息表示我们想下载insider版本(注意有stable, insider两个版本)

知道了下载的目标目录,我们可以自行下载。

1.得到commit id,自己查看detail信息获取
2.在本地下载vscode server: https://update.code.visualstudio.com/commit:${commit_id}/server-linux-x64/insider${commit_id}insider根据你的信息进行替换】
3.上传至服务器: scp vscode-server-linux-x64.tar.gz root@[server ip]
3.mkdir -p /root/.vscode-server-insiders/bin/${commit_id}
4.tar zxvf ./vscode-server-linux-x64.tar.gz -C /root/.vscode-server-insiders/bin/${commit_id} --strip 1
5.touch /root/.vscode-server-insiders/bin/${commit_id}/0

参考:
1.How can I install vscode-server in linux offline

[14:10:59.703] Log Level: 2 [14:10:59.709] SSH Resolver called for "ssh-remote+192.168.124.6", attempt 1 [14:10:59.710] "remote.SSH.useLocalServer": false [14:10:59.710] "remote.SSH.useExecServer": false [14:10:59.710] "remote.SSH.showLoginTerminal": false [14:10:59.710] "remote.SSH.remotePlatform": {} [14:10:59.710] "remote.SSH.path": undefined [14:10:59.710] "remote.SSH.configFile": undefined [14:10:59.710] "remote.SSH.useFlock": true [14:10:59.710] "remote.SSH.lockfilesInTmp": false [14:10:59.710] "remote.SSH.localServerDownload": auto [14:10:59.710] "remote.SSH.remoteServerListenOnSocket": false [14:10:59.710] "remote.SSH.showLoginTerminal": false [14:10:59.710] "remote.SSH.defaultExtensions": [] [14:10:59.710] "remote.SSH.loglevel": 2 [14:10:59.710] "remote.SSH.enableDynamicForwarding": true [14:10:59.710] "remote.SSH.enableRemoteCommand": false [14:10:59.711] "remote.SSH.serverPickPortsFromRange": {} [14:10:59.711] "remote.SSH.serverInstallPath": {} [14:10:59.712] VS Code version: 1.85.2 [14:10:59.712] Remote-SSH version: remote-ssh@0.108.2023112915 [14:10:59.712] win32 x64 [14:10:59.713] SSH Resolver called for host: 192.168.124.6 [14:10:59.713] Setting up SSH remote "192.168.124.6" [14:10:59.716] Using commit id "8b3775030ed1a69b13e4f4c628c612102e30a681" and quality "stable" for server [14:10:59.719] Install and start server if needed [14:11:00.628] Checking ssh with "C:\Program Files (x86)\Common Files\Oracle\Java\java8path\ssh.exe -V" [14:11:00.630] Got error from ssh: spawn C:\Program Files (x86)\Common Files\Oracle\Java\java8path\ssh.exe ENOENT [14:11:00.630] Checking ssh with "C:\Program Files (x86)\Common Files\Oracle\Java\javapath\ssh.exe -V" [14:11:00.631] Got error from ssh: spawn C:\Program Files (x86)\Common Files\Oracle\Java\javapath\ssh.exe ENOENT [14:11:00.631] Checking ssh with "C:\Windows\system32\ssh.exe -V" [14:11:00.632] Got error from ssh: spawn C:\Windows\system32\ssh.exe ENOENT [14:11:00.632] Checking ssh with "C:\Windows\ssh.exe -V" [14:11:00.632] Got error from ssh: spawn C:\Windows\ssh.exe ENOENT [14:11:00.632] Checking ssh with "C:\Windows\System32\Wbem\ssh.exe -V" [14:11:00.633] Got error from ssh: spawn C:\Windows\System32\Wbem\ssh.exe ENOENT [14:11:00.633] Checking ssh with "C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe -V" [14:11:00.634] Got error from ssh: spawn C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe ENOENT [14:11:00.634] Checking ssh with "C:\Windows\System32\OpenSSH\ssh.exe -V" [14:11:00.654] > OpenSSH_for_Windows_9.5p1, LibreSSL 3.8.2 [14:11:00.657] Running script with connection command: "C:\Windows\System32\OpenSSH\ssh.exe" -T -D 58191 "192.168.124.6" bash [14:11:00.658] Terminal shell path: C:\Windows\System32\cmd.exe [14:11:01.076] > root@192.168.124.6's password:]0;C:\Windows\System32\cmd.exe [14:11:01.076] Got some output, clearing connection timeout [14:11:01.077] Showing password prompt [14:11:03.383] Got password response [14:11:03.383] "install" wrote data to terminal: "******" [14:11:03.428] > [14:11:03.987] > 43b74eacbca4: running [14:11:04.112] > Acquiring lock on /root/.vscode-server/bin/8b3775030ed1a69b13e4f4c628c612102e30a681/vscode-remote-lock.root.8b3775030ed1a69b13e4f4c628c612102e30a681 [14:11:04.127] > Installing to /root/.vscode-server/bin/8b3775030ed1a69b13e4f4c628c612102e30a681... [14:11:04.143] > 43b74eacbca4%%1%% [14:11:04.160] > Downloading with wget [14:11:11.206] > wget download failed > wget: unable to resolve host address ‘update.code.visualstudio.com’ > printenv: > SSH_CONNECTION=192.168.124.33 58192 192.168.124.6 22 > LANG=en_US.UTF-8 > XDG_SESSION_ID=1 > USER=root > PWD=/root/.vscode-server/bin/8b3775030ed1a69b13e4f4c628c612102e30a681 > HOME=/root > SSH_CLIENT=192.168.124.33 58192 22 > MAIL=/var/mail/root > SHELL=/bin/bash > SHLVL=2 > VSCODE_AGENT_FOLDER=/root/.vscode-server > LOGNAME=root > DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/0/bus > XDG_RUNTIME_DIR=/run/user/0 > PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin > _=/usr/bin/printenv > OLDPWD=/root > Trigger local server download > 43b74eacbca4:trigger_server_download > artifact==server-linux-arm64== > destFolder==/root/.vscode-server/bin/== > destFolder2==/8b3775030ed1a69b13e4f4c628c612102e30a681/vscode-server.tar.gz== > 43b74eacbca4:trigger_server_download_end > Waiting for client to transfer server archive... > Waiting for /root/.vscode-server/bin/8b3775030ed1a69b13e4f4c628c612102e30a681/vs > scode-server.tar.gz.done and vscode-server.tar.gz to exist [14:11:11.206] Got request to download on client for {"artifact":"server-linux-arm64","destPath":"/root/.vscode-server/bin//8b3775030ed1a69b13e4f4c628c612102e30a681/vscode-server.tar.gz"} [14:11:11.206] Downloading VS Code server locally... [14:11:11.221] > > [14:11:11.456] Resolver error: Error: XHR failed at k.onerror (vscode-file://vscode-app/d:/VSC/resources/app/out/vs/workbench/workbench.desktop.main.js:95:2027) [14:11:11.462] ------
06-22
[19:46:00.350] Log Level: 2 [19:46:00.377] SSH Resolver called for "ssh-remote+120.27.200.220", attempt 1 [19:46:00.384] remote.SSH.useLocalServer = false [19:46:00.384] remote.SSH.useExecServer = true [19:46:00.384] remote.SSH.bindHost = {} [19:46:00.384] remote.SSH.showLoginTerminal = false [19:46:00.384] remote.SSH.remotePlatform = {} [19:46:00.385] remote.SSH.path = [19:46:00.385] remote.SSH.configFile = [19:46:00.385] remote.SSH.useFlock = true [19:46:00.385] remote.SSH.lockfilesInTmp = false [19:46:00.385] remote.SSH.localServerDownload = auto [19:46:00.385] remote.SSH.remoteServerListenOnSocket = false [19:46:00.385] remote.SSH.defaultExtensions = [] [19:46:00.385] remote.SSH.defaultExtensionsIfInstalledLocally = [] [19:46:00.385] remote.SSH.loglevel = 2 [19:46:00.386] remote.SSH.enableDynamicForwarding = true [19:46:00.386] remote.SSH.enableRemoteCommand = false [19:46:00.386] remote.SSH.serverPickPortsFromRange = {} [19:46:00.386] remote.SSH.serverInstallPath = {} [19:46:00.386] remote.SSH.permitPtyAllocation = false [19:46:00.386] remote.SSH.preferredLocalPortRange = undefined [19:46:00.386] remote.SSH.useCurlAndWgetConfigurationFiles = false [19:46:00.386] remote.SSH.experimental.chat = true [19:46:00.386] remote.SSH.experimental.enhancedSessionLogs = true [19:46:00.387] remote.SSH.httpProxy = {"*":""} [19:46:00.387] remote.SSH.httpsProxy = {"*":""} [19:46:00.400] VS Code version: 1.105.1 [19:46:00.400] Remote-SSH version: remote-ssh@0.120.0 [19:46:00.400] win32 x64 [19:46:00.404] SSH Resolver called for host: 120.27.200.220 [19:46:00.404] Setting up SSH remote "120.27.200.220" [19:46:00.416] Using commit id "7d842fb85a0275a4a8e4d7e040d2625abbf7f084" and quality "stable" for server [19:46:00.416] Extensions to install: [19:46:00.423] Install and start server if needed [19:46:06.970] Checking ssh with "C:\Windows\system32\ssh.exe -V" [19:46:06.974] Got error from ssh: spawn C:\Windows\system32\ssh.exe ENOENT [19:46:06.974] Checking ssh with "C:\Windows\ssh.exe -V" [19:46:06.975] Got error from ssh: spawn C:\Windows\ssh.exe ENOENT [19:46:06.975] Checking ssh with "C:\Windows\System32\Wbem\ssh.exe -V" [19:46:06.976] Got error from ssh: spawn C:\Windows\System32\Wbem\ssh.exe ENOENT [19:46:06.977] Checking ssh with "C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe -V" [19:46:06.978] Got error from ssh: spawn C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe ENOENT [19:46:06.978] Checking ssh with "C:\Windows\System32\OpenSSH\ssh.exe -V" [19:46:07.025] > OpenSSH_for_Windows_9.5p1, LibreSSL 3.8.2 [19:46:07.030] Running script with connection command: "C:\Windows\System32\OpenSSH\ssh.exe" -T -D 49460 "120.27.200.220" sh [19:46:07.032] Generated SSH command: 'type "C:\Users\Administrator\AppData\Local\Temp\vscode-linux-multi-line-command-120.27.200.220-463271373.sh" | "C:\Windows\System32\OpenSSH\ssh.exe" -T -D 49460 "120.27.200.220" sh' [19:46:07.032] Using connect timeout of 17 seconds [19:46:07.034] Terminal shell path: C:\Windows\System32\cmd.exe [19:46:07.696] > [19:46:07.697] Got some output, clearing connection timeout [19:46:08.377] > The authenticity of host '120.27.200.220 (120.27.200.220)' can't be established. > ED25519 key fingerprint is SHA256:c0vC87E71ChnCTPmqR2ztC4+qLHMdJU8wIJNSzDqSsA. > This key is not known by any other names. > Are you sure you want to continue connecting (yes/no/[fingerprint])? [19:46:08.377] Detected fingerprint confirmation message [19:46:08.377] Showing fingerprint confirmation dialog [19:46:13.124] Got fingerprint response: yes [19:46:13.125] "install" wrote data to terminal: "yes" [19:46:13.154] > y [19:46:13.168] > es > Warning: Permanently added '120.27.200.220' (ED25519) to the list of known hosts. [19:46:13.247] > root@120.27.200.220's password: [19:46:13.247] Showing password prompt [19:46:23.773] Got password response [19:46:23.773] "install" wrote data to terminal: "*********" [19:46:23.807] > [19:46:24.127] > a7fece7172f7: running > Script executing under PID: 1371 [19:46:29.339] > Installing to /root/.vscode-server... [19:46:29.353] > a7fece7172f7%%1%% > Downloading with wget [19:46:29.369] > wget is from busybox: no > Program 'wget' is not available or does not appear to support flag '--no-config' > Detected that this version of wget does not support '--no-config'. Will not ignore wget default configuration files. [19:46:31.490] > Download complete [19:46:31.538] > a7fece7172f7%%2%% [19:46:31.553] > tar --version: tar (GNU tar) 1.26 > Copyright (C) 2011 Free Software Foundation, Inc. > License GPLv3+: GNU GPL version 3 or later <http://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.Written by John Gilmore and Jay Fenlason. [19:46:32.094] > code 1.105.1 (commit 7d842fb85a0275a4a8e4d7e040d2625abbf7f084) [19:46:32.108] > Starting VS Code CLI... [19:46:32.124] > Spawned remote CLI: 1426 [19:46:32.156] > Waiting for server log... [19:46:32.204] > Waiting for server log... [19:46:32.242] > Exec server process not found > sh: line 418: kill: (1426) - No such process > [2025-11-12 19:46:37] error This machine does not meet Visual Studio Code Server > r's prerequisites, expected either... > - find GLIBC >= v2.28.0 (but found v2.17.0 instead) 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 > a7fece7172f7: start > exitCode==207== > listeningOn==== > osReleaseId==centos== > arch==x86_64== > vscodeArch==x64== > bitness==64== > tmpDir==/run/user/0== > platform==linux== > unpackResult==success== > didLocalDownload==0== > downloadTime==2160== > installTime==548== > serverStartTime==== > execServerToken==1111111a-111a-11aa-a1a1-a1a11a11a1a1== > platformDownloadPath==cli-alpine-x64== > SSH_AUTH_SOCK==== > DISPLAY==== [19:46:32.257] > > a7fece7172f7: end [19:46:32.257] Received install output: exitCode==207== listeningOn==== osReleaseId==centos== arch==x86_64== vscodeArch==x64== bitness==64== tmpDir==/run/user/0== platform==linux== unpackResult==success== didLocalDownload==0== downloadTime==2160== installTime==548== serverStartTime==== execServerToken==1111111a-111a-11aa-a1a1-a1a11a11a1a1== platformDownloadPath==cli-alpine-x64== SSH_AUTH_SOCK==== DISPLAY==== [19:46:32.259] Resolver error: Error: 远程主机不满足运行VS Code服务器的先决条件 at y.ServerInstallError (c:\Users\Administrator\.vscode\extensions\ms-vscode-remote.remote-ssh-0.120.0\out\extension.js:2:744694) at p (c:\Users\Administrator\.vscode\extensions\ms-vscode-remote.remote-ssh-0.120.0\out\extension.js:2:739113) at t.handleInstallOutput (c:\Users\Administrator\.vscode\extensions\ms-vscode-remote.remote-ssh-0.120.0\out\extension.js:2:740589) at t.tryInstall (c:\Users\Administrator\.vscode\extensions\ms-vscode-remote.remote-ssh-0.120.0\out\extension.js:2:865534) at async c:\Users\Administrator\.vscode\extensions\ms-vscode-remote.remote-ssh-0.120.0\out\extension.js:2:824246 at async t.withShowDetailsEvent (c:\Users\Administrator\.vscode\extensions\ms-vscode-remote.remote-ssh-0.120.0\out\extension.js:2:827501) at async A (c:\Users\Administrator\.vscode\extensions\ms-vscode-remote.remote-ssh-0.120.0\out\extension.js:2:820760) at async t.resolve (c:\Users\Administrator\.vscode\extensions\ms-vscode-remote.remote-ssh-0.120.0\out\extension.js:2:824898) at async c:\Users\Administrator\.vscode\extensions\ms-vscode-remote.remote-ssh-0.120.0\out\extension.js:2:1113660 [19:46:32.265] ------ [19:46:32.266] ---------- [Session Summary] ----------- [19:46:32.266] [LinuxPrereqs]: 远程主机可能不符合 glibc 和 libstdc++ VS Code 服务器的先决条件 (远程主机不满足运行VS Code服务器的先决条件) [19:46:32.266] ---------------------------------------- [19:46:33.539] "install" terminal command done [19:46:33.539] Install terminal quit with output:
最新发布
11-13
[2025-09-24 07:48:33.807] Extension version: 0.104.2 [2025-09-24 07:48:33.808] L10N bundle: file:///c%3A/Users/a/.vscode/extensions/ms-vscode-remote.remote-wsl-0.104.2/l10n/bundle.l10n.zh-cn.json [2025-09-24 07:48:33.817] authorityHierarchy: wsl+Ubuntu-18.04 [2025-09-24 07:48:33.817] WSL extension activating for a local WSL instance [2025-09-24 07:48:33.843] Download in background is enabled [2025-09-24 07:48:33.844] Resolving wsl+Ubuntu-18.04, resolveAttempt: 1 [2025-09-24 07:48:33.844] NodeExecServer run: C:\WINDOWS\System32\wsl.exe --status [2025-09-24 07:48:33.912] WSL feature installed: true (wsl --status), using utf-8 encoding [2025-09-24 07:48:33.913] NodeExecServer run: C:\WINDOWS\System32\wsl.exe --list --verbose [2025-09-24 07:48:33.958] 1 distros found [2025-09-24 07:48:33.959] Starting VS Code Server inside WSL (wsl2) [2025-09-24 07:48:33.959] Windows build: 26100. Multi distro support: available. WSL path support: enabled [2025-09-24 07:48:33.960] Scriptless setup: false [2025-09-24 07:48:33.960] No shell environment set or found for current distro. [2025-09-24 07:48:34.098] WSL daemon log file: [2025-09-24 07:48:34.100] Probing if server is already installed: if [ -d ~/.vscode-server/bin/f220831ea2d946c0dcb0f3eaa480eb435a2c1260 ]; then printf 'install-found '; fi; if [ -f /etc/alpine-release ]; then printf 'alpine-'; fi; uname -m; [2025-09-24 07:48:34.101] NodeExecServer run: C:\WINDOWS\System32\wsl.exe -d Ubuntu-18.04 -e sh -c if [ -d ~/.vscode-server/bin/f220831ea2d946c0dcb0f3eaa480eb435a2c1260 ]; then printf 'install-found '; fi; if [ -f /etc/alpine-release ]; then printf 'alpine-'; fi; uname -m; [2025-09-24 07:48:42.124] Probing result: x86_64 [2025-09-24 07:48:42.125] No server install found in WSL, needs linux-x64 [2025-09-24 07:48:42.125] Getting server from client side [2025-09-24 07:48:42.126] Downloading VS Code Server stable - f220831ea2d946c0dcb0f3eaa480eb435a2c1260 into C:\Users\a\vscode-remote-wsl\stable\f220831ea2d946c0dcb0f3eaa480eb435a2c1260\vscode-server-stable-linux-x64.tar.gz. [2025-09-24 07:48:42.164] Unable to download server on client side: Error: Request downloadRequest failed with message: read ECONNRESET. Will try to download on WSL side. [2025-09-24 07:48:42.165] NodeExecServer run: C:\WINDOWS\System32\wsl.exe -d Ubuntu-18.04 sh -c '"$VSCODE_WSL_EXT_LOCATION/scripts/wslServer.sh" f220831ea2d946c0dcb0f3eaa480eb435a2c1260 stable code-server .vscode-server --host=127.0.0.1 --port=0 --connection-token=2492281583-3324208731-904610584-1391618391 --use-host-proxy --without-browser-env-var --disable-websocket-compression --accept-server-license-terms --telemetry-level=all' [2025-09-24 07:48:42.354] Setting up server environment: Looking for /home/xyx/.vscode-server/server-env-setup. Not found. [2025-09-24 07:48:42.354] WSL version: 6.6.87.2-microsoft-standard-WSL2 Ubuntu-18.04 [2025-09-24 07:48:42.354] Updating VS Code Server to version f220831ea2d946c0dcb0f3eaa480eb435a2c1260 [2025-09-24 07:48:42.354] Removing previous installation... [2025-09-24 07:48:42.354] Installing VS Code Server for Linux x64 (f220831ea2d946c0dcb0f3eaa480eb435a2c1260) [2025-09-24 07:48:42.354] Downloading: 100% [2025-09-24 07:48:42.354] Failed [2025-09-24 07:48:42.355] --2025-09-24 15:48:42-- https://update.code.visualstudio.com/commit:f220831ea2d946c0dcb0f3eaa480eb435a2c1260/server-linux-x64/stable [2025-09-24 07:48:42.355] Connecting to 127.0.0.1:50778... connected. [2025-09-24 07:48:42.355] Unable to establish SSL connection. [2025-09-24 07:48:42.355] ERROR: Failed to download https://update.code.visualstudio.com/commit:f220831ea2d946c0dcb0f3eaa480eb435a2c1260/server-linux-x64/stable to /home/xyx/.vscode-server/bin/f220831ea2d946c0dcb0f3eaa480eb435a2c1260-1758700122.tar.gz [2025-09-24 07:48:42.355] 有关启动问题的帮助,请转到 https://code.visualstudio.com/docs/remote/troubleshooting#_wsl-tips
09-25
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值