-
Notifications
You must be signed in to change notification settings - Fork 302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SSH Connection Timeout after moving to a new location #10580
Comments
你好,我也遇到了同样的问题,不过已经解决了。 |
Thanks for the tip @mo7cc, I deleted vscode config and cache files, and updated to vscode v1.96.2 and remote-ssh v0.116.1, but unfortunately the problem still persists, albeit with different behavior. Every time the connection drops (every 1 - 2 min), vscode asks to reload the window and enter the remote device password. Below is the log output from VS Code with UTM Windows VM: [01:37:55.730] Log Level: 2 [01:37:55.802] No hints found in the recent session. [01:39:35.909] SSH Resolver called for "ssh-remote+7b22686f73744e616d65223a223139322e3136382e312e3136222c2275736572223a226a75616e775f227d", attempt 2, (Reconnection) [01:39:35.929] askpass server listening on /var/folders/3z/kt7fvb3x5z11rkm9ymn1r4n00000gn/T/vscode-ssh-askpass-219bbb773ab4c73d45a9ea9e11177f25580110bb.sock [01:39:36.008] WARN: $PLATFORM is undefined in installation script output. Errors may be dropped. ################################################ [01:31:43.780] Log Level: 2 [01:31:43.838] No hints found in the recent session. [01:33:28.968] SSH Resolver called for "ssh-remote+7b22686f73744e616d65223a223139322e3136382e312e3137222c2275736572223a226a75616e645f227d", attempt 2, (Reconnection) [01:33:28.988] askpass server listening on /var/folders/3z/kt7fvb3x5z11rkm9ymn1r4n00000gn/T/vscode-ssh-askpass-4ade019c7b5c067258ad1300a047c8c890426840.sock [01:33:29.079] WARN: $PLATFORM is undefined in installation script output. Errors may be dropped. |
I'm experiencing an issue with the VS Code Remote SSH extension when connecting to a differents UTM Virtual Machines (Windows 11, debian 12). The SSH connection times out in VS Code after a few seconds. This issue occurs only when I use VSCode on a local Wi-Fi network after changing countries, but:
The problem with the first solution is that I lose 90% of connection speed and with the second one I can't use vscode as an IDE.
Below is the log output from VS Code with UTM Windows VM:
23:28:02.138] askpass server listening on /var/folders/3z/kt7fvb3x5z11rkm9ymn1r4n00000gn/T/vscode-ssh-askpass-176ec28f7ca68cb77bb1e0277447b1a1f4f6a686.sock
[23:28:02.138] Spawning local server with {"serverId":1,"ipcHandlePath":"/var/folders/3z/kt7fvb3x5z11rkm9ymn1r4n00000gn/T/vscode-ssh-askpass-753327bd91ba2e36e4a2ee01b135874c27c77fb8.sock","sshCommand":"ssh","sshArgs":["-v","-T","-D","49963","-o","ConnectTimeout=15","juanw_@192.168.1.16"],"serverDataFolderName":".vscode-server","dataFilePath":"/Users/juan/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-e396b1f8-b1c0a14de1414fcdaa400695b4db1c0799bc3124-0.113.1-es/data.json"}
[23:28:02.139] Local server env: {"SSH_AUTH_SOCK":"/private/tmp/com.apple.launchd.qa7Nqrbtnp/Listeners","SHELL":"/bin/bash","DISPLAY":"1","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"/Users/juan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.113.1/out/local-server/askpass.sh","VSCODE_SSH_ASKPASS_NODE":"/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin)","VSCODE_SSH_ASKPASS_EXTRA_ARGS":"","VSCODE_SSH_ASKPASS_MAIN":"/Users/juan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.113.1/out/askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"/var/folders/3z/kt7fvb3x5z11rkm9ymn1r4n00000gn/T/vscode-ssh-askpass-176ec28f7ca68cb77bb1e0277447b1a1f4f6a686.sock"}
[23:28:02.139] Spawned 36775
[23:28:02.206] > local-server-1> Running ssh connection command: ssh -v -T -D 49963 -o ConnectTimeout=15 juanw_@192.168.1.16
[23:28:02.207] > local-server-1> Spawned ssh, pid=36783
[23:28:02.213] stderr> OpenSSH_9.8p1, LibreSSL 3.3.6
[23:28:02.214] stderr> ssh: connect to host 192.168.1.16 port 22: Host is down
[23:28:02.214] > local-server-1> ssh child died, shutting down
[23:28:02.217] Local server exit: 0
[23:28:02.217] Received install output: local-server-1> Running ssh connection command: ssh -v -T -D 49963 -o ConnectTimeout=15 juanw_@192.168.1.16
local-server-1> Spawned ssh, pid=36783
OpenSSH_9.8p1, LibreSSL 3.3.6
ssh: connect to host 192.168.1.16 port 22: Host is down
local-server-1> ssh child died, shutting down
[23:28:02.217] Failed to parse remote port from server output
[23:28:02.218] Resolver error: Error:
at m.Create (/Users/juan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.113.1/out/extension.js:2:501230)
at t.handleInstallOutput (/Users/juan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.113.1/out/extension.js:2:498552)
at e (/Users/juan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.113.1/out/extension.js:2:560378)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async /Users/juan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.113.1/out/extension.js:2:582435
at async t.withShowDetailsEvent (/Users/juan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.113.1/out/extension.js:2:586054)
at async /Users/juan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.113.1/out/extension.js:2:557083
at async T (/Users/juan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.113.1/out/extension.js:2:555134)
at async t.resolveWithLocalServer (/Users/juan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.113.1/out/extension.js:2:556623)
at async k (/Users/juan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.113.1/out/extension.js:2:579574)
at async t.resolve (/Users/juan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.113.1/out/extension.js:2:583465)
at async /Users/juan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.113.1/out/extension.js:2:851126
[23:28:02.220] ------
And below is the log output from VS Code with UTM Debian VM:
[00:19:37.238] Log Level: 2
[00:19:37.240] VS Code version: 1.92.0
[00:19:37.240] Remote-SSH version: remote-ssh@0.113.1
[00:19:37.240] darwin arm64
[00:19:37.247] SSH Resolver called for "ssh-remote+7b22686f73744e616d65223a223139322e3136382e312e3137222c2275736572223a226a75616e645f227d", attempt 1
[00:19:37.247] "remote.SSH.useLocalServer": true
[00:19:37.247] "remote.SSH.useExecServer": true
[00:19:37.247] "remote.SSH.path": undefined
[00:19:37.247] "remote.SSH.configFile": undefined
[00:19:37.247] "remote.SSH.useFlock": true
[00:19:37.248] "remote.SSH.lockfilesInTmp": false
[00:19:37.248] "remote.SSH.localServerDownload": auto
[00:19:37.248] "remote.SSH.remoteServerListenOnSocket": false
[00:19:37.248] "remote.SSH.showLoginTerminal": false
[00:19:37.248] "remote.SSH.defaultExtensions": []
[00:19:37.248] "remote.SSH.loglevel": 2
[00:19:37.248] "remote.SSH.enableDynamicForwarding": true
[00:19:37.248] "remote.SSH.enableRemoteCommand": false
[00:19:37.248] "remote.SSH.serverPickPortsFromRange": {}
[00:19:37.248] "remote.SSH.serverInstallPath": {}
[00:19:37.248] "remote.SSH.permitPtyAllocation": false
[00:19:37.248] "remote.SSH.preferredLocalPortRange: undefined
[00:19:37.248] "remote.SSH.useCurlAndWgetConfigurationFiles: false
[00:19:37.252] SSH Resolver called for host: juand_@192.168.1.17
[00:19:37.252] Setting up SSH remote "192.168.1.17"
[00:19:37.253] Acquiring local install lock: /var/folders/3z/kt7fvb3x5z11rkm9ymn1r4n00000gn/T/vscode-remote-ssh-c11ea22e-install.lock
[00:19:37.254] Looking for existing server data file at /Users/juan/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-c11ea22e-b1c0a14de1414fcdaa400695b4db1c0799bc3124-0.113.1-es/data.json
[00:19:37.254] Found local server running: {"remoteListeningOn":{"port":38065},"osReleaseId":"debian","arch":"aarch64","sshAuthSock":"","display":"","tmpDir":"/run/user/1000","platform":"linux","execServerToken":"10370d5d-dcc9-43f9-896e-3bfe3e09140d","pid":82463,"ipcHandlePath":"/var/folders/3z/kt7fvb3x5z11rkm9ymn1r4n00000gn/T/vscode-ssh-askpass-0e5c7f3a7ceb329338deac055af2424c7c7a6f81.sock","socksPort":53964,"startupTime":1734585550545}
[00:19:37.261] Found running server - short-circuiting install
[00:19:37.264] Starting forwarding server. local port 53975 -> socksPort 53964 -> remotePort 38065
[00:19:37.264] Forwarding server listening on port 53975
[00:19:37.264] Waiting for ssh tunnel to be ready
[00:19:37.265] Tunneled port 38065 to local port 53975
[00:19:37.265] Resolved "ssh-remote+7b22686f73744e616d65223a223139322e3136382e312e3137222c2275736572223a226a75616e645f227d" to "port 53975"
[00:19:37.270] Initizing new exec server for ssh-remote+7b22686f73744e616d65223a223139322e3136382e312e3137222c2275736572223a226a75616e645f227d
[00:19:37.270] Resolving exec server at port 53975
[00:19:37.282] [Forwarding server port 53975] Got connection 0
[00:19:37.283] [Forwarding server port 53975] Got connection 1
[00:19:37.325] Exec server for ssh-remote+7b22686f73744e616d65223a223139322e3136382e312e3137222c2275736572223a226a75616e645f227d created and cached
[00:19:37.327] ------
[00:19:37.369] [server] Checking /home/juand_/.vscode-server/cli/servers/Stable-b1c0a14de1414fcdaa400695b4db1c0799bc3124/log.txt and /home/juand_/.vscode-server/cli/servers/Stable-b1c0a14de1414fcdaa400695b4db1c0799bc3124/pid.txt for a running server...
[00:19:37.415] [server] Found running server (pid=6632)
[00:19:38.355] Opening exec server for ssh-remote+7b22686f73744e616d65223a223139322e3136382e312e3137222c2275736572223a226a75616e645f227d
[00:19:38.361] Opening exec server for ssh-remote+7b22686f73744e616d65223a223139322e3136382e312e3137222c2275736572223a226a75616e645f227d
[00:19:38.373] Verified and reusing cached exec server for ssh-remote+7b22686f73744e616d65223a223139322e3136382e312e3137222c2275736572223a226a75616e645f227d
[00:19:38.373] Verified and reusing cached exec server for ssh-remote+7b22686f73744e616d65223a223139322e3136382e312e3137222c2275736572223a226a75616e645f227d
[00:19:38.382] Opening exec server for ssh-remote+7b22686f73744e616d65223a223139322e3136382e312e3137222c2275736572223a226a75616e645f227d
[00:19:38.387] Verified and reusing cached exec server for ssh-remote+7b22686f73744e616d65223a223139322e3136382e312e3137222c2275736572223a226a75616e645f227d
[00:20:02.435] Exec server for ssh-remote+7b22686f73744e616d65223a223139322e3136382e312e3137222c2275736572223a226a75616e645f227d closed (gracefully)
[00:20:02.442] ------
[00:20:02.442] SSH Resolver called for "ssh-remote+7b22686f73744e616d65223a223139322e3136382e312e3137222c2275736572223a226a75616e645f227d", attempt 2, (Reconnection)
[00:20:02.445] SSH Resolver called for host: juand_@192.168.1.17
[00:20:02.445] Setting up SSH remote "192.168.1.17"
[00:20:02.447] Acquiring local install lock: /var/folders/3z/kt7fvb3x5z11rkm9ymn1r4n00000gn/T/vscode-remote-ssh-c11ea22e-install.lock
[00:20:02.447] Looking for existing server data file at /Users/juan/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-c11ea22e-b1c0a14de1414fcdaa400695b4db1c0799bc3124-0.113.1-es/data.json
[00:20:02.448] Using commit id "b1c0a14de1414fcdaa400695b4db1c0799bc3124" and quality "stable" for server
[00:20:02.455] Install and start server if needed
[00:20:02.458] PATH: /Users/juan/.pyenv/shims:/Applications/ArmGNUToolchain/12.3.rel1/arm-none-eabi/bin:/Users/juan/.nvm/versions/node/v18.16.0/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Library/TeX/texbin
[00:20:02.458] Checking ssh with "ssh -V"
[00:20:02.467] > OpenSSH_9.8p1, LibreSSL 3.3.6
[00:20:02.469] askpass server listening on /var/folders/3z/kt7fvb3x5z11rkm9ymn1r4n00000gn/T/vscode-ssh-askpass-8c53bba9c64111648373eed5af902319e5a70067.sock
[00:20:02.469] Spawning local server with {"serverId":1,"ipcHandlePath":"/var/folders/3z/kt7fvb3x5z11rkm9ymn1r4n00000gn/T/vscode-ssh-askpass-465bfafe6e72549604e7a99d78b8edc55cf28848.sock","sshCommand":"ssh","sshArgs":["-v","-T","-D","53980","-o","ConnectTimeout=15","juand_@192.168.1.17"],"serverDataFolderName":".vscode-server","dataFilePath":"/Users/juan/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-c11ea22e-b1c0a14de1414fcdaa400695b4db1c0799bc3124-0.113.1-es/data.json"}
[00:20:02.469] Local server env: {"SSH_AUTH_SOCK":"/private/tmp/com.apple.launchd.qa7Nqrbtnp/Listeners","SHELL":"/bin/bash","DISPLAY":"1","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"/Users/juan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.113.1/out/local-server/askpass.sh","VSCODE_SSH_ASKPASS_NODE":"/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin)","VSCODE_SSH_ASKPASS_EXTRA_ARGS":"","VSCODE_SSH_ASKPASS_MAIN":"/Users/juan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.113.1/out/askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"/var/folders/3z/kt7fvb3x5z11rkm9ymn1r4n00000gn/T/vscode-ssh-askpass-8c53bba9c64111648373eed5af902319e5a70067.sock"}
[00:20:02.470] Spawned 83261
[00:20:02.545] > local-server-1> Running ssh connection command: ssh -v -T -D 53980 -o ConnectTimeout=15 juand_@192.168.1.17
[00:20:02.546] > local-server-1> Spawned ssh, pid=83269
[00:20:02.551] stderr> OpenSSH_9.8p1, LibreSSL 3.3.6
[00:20:02.552] stderr> ssh: connect to host 192.168.1.17 port 22: Host is down
[00:20:02.553] > local-server-1> ssh child died, shutting down
[00:20:02.555] Local server exit: 0
[00:20:02.555] Received install output: local-server-1> Running ssh connection command: ssh -v -T -D 53980 -o ConnectTimeout=15 juand_@192.168.1.17
local-server-1> Spawned ssh, pid=83269
OpenSSH_9.8p1, LibreSSL 3.3.6
ssh: connect to host 192.168.1.17 port 22: Host is down
local-server-1> ssh child died, shutting down
[00:20:02.555] Failed to parse remote port from server output
[00:20:02.555] Resolver error: Error:
at m.Create (/Users/juan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.113.1/out/extension.js:2:501230)
at t.handleInstallOutput (/Users/juan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.113.1/out/extension.js:2:498552)
at e (/Users/juan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.113.1/out/extension.js:2:560378)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async /Users/juan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.113.1/out/extension.js:2:582435
at async t.withShowDetailsEvent (/Users/juan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.113.1/out/extension.js:2:586054)
at async /Users/juan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.113.1/out/extension.js:2:557083
at async T (/Users/juan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.113.1/out/extension.js:2:555134)
at async t.resolveWithLocalServer (/Users/juan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.113.1/out/extension.js:2:556623)
at async k (/Users/juan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.113.1/out/extension.js:2:579574)
at async t.resolve (/Users/juan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.113.1/out/extension.js:2:583465)
at async /Users/juan/.vscode/extensions/ms-vscode-remote.remote-ssh-0.113.1/out/extension.js:2:851126
[00:20:02.557] ------
The text was updated successfully, but these errors were encountered: