Skip to content
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

[Remote-SSH Bug]: "Failed to set up socket for dynamic port forward" on VSCode v1.76 #8132

Closed
3 tasks done
Keyslam opened this issue Mar 3, 2023 · 17 comments
Closed
3 tasks done
Assignees
Labels
ssh Issue in vscode-remote SSH

Comments

@Keyslam
Copy link

Keyslam commented Mar 3, 2023

Is there an existing issue for this bug?

  • I have searched the existing issues

Required Troubleshooting Steps

  • I have followed these troubleshooting steps
  • I have tried both values of the remote.SSH.useLocalServer setting

Connect Locally

It connects successfully

->

No response

Expected Behavior

When trying to connect to my remote Linux server with my local Windows desktop machine, I get stuck in a loop having to enter my passphrase. It worked fine the day before. As far as I am aware, no settings have been changed.
I can connect to the remote server fine with: My Windows laptop (on the same network), a friend's Windows desktop (on another network), and on a Linux install (On the same desktop machine).

Steps I have tried:

  • Disabling Remote.SSH: Use Local Server
  • Setting AllowTcpForwarding yes in /etc/ssh/sshd_config on the remote server
  • Removing .vscode_server/bin from remote server
  • Removing .vscode_server from remote server
  • Reinstalling Remote SSH extension
  • Installing the preview version of Remote SSH extension
  • Installing an older version of Remote SSH extension
  • Reinstalling SSH on the remote server
  • Reinstalling Windows on the desktop machine

Steps To Reproduce

No response

Remote-SSH Log

Remote-SSH Log

[10:09:48.031] Log Level: 2
[10:09:48.040] SSH Resolver called for "ssh-remote+keyslam.com", attempt 1
[10:09:48.041] "remote.SSH.useLocalServer": false
[10:09:48.041] "remote.SSH.showLoginTerminal": false
[10:09:48.041] "remote.SSH.remotePlatform": {"keyslam.com":"linux"}
[10:09:48.041] "remote.SSH.path": undefined
[10:09:48.041] "remote.SSH.configFile": undefined
[10:09:48.042] "remote.SSH.useFlock": true
[10:09:48.042] "remote.SSH.lockfilesInTmp": false
[10:09:48.042] "remote.SSH.localServerDownload": auto
[10:09:48.042] "remote.SSH.remoteServerListenOnSocket": false
[10:09:48.042] "remote.SSH.showLoginTerminal": false
[10:09:48.042] "remote.SSH.defaultExtensions": []
[10:09:48.042] "remote.SSH.loglevel": 2
[10:09:48.042] "remote.SSH.enableDynamicForwarding": true
[10:09:48.042] "remote.SSH.enableRemoteCommand": false
[10:09:48.043] "remote.SSH.serverPickPortsFromRange": {}
[10:09:48.043] "remote.SSH.serverInstallPath": {}
[10:09:48.045] VS Code version: 1.76.0
[10:09:48.045] Remote-SSH version: remote-ssh@0.98.0
[10:09:48.045] win32 x64
[10:09:48.046] SSH Resolver called for host: keyslam.com
[10:09:48.046] Setting up SSH remote "keyslam.com"
[10:09:48.049] Using commit id "92da9481c0904c6adfe372c12da3b7748d74bdcb" and quality "stable" for server
[10:09:48.053] Install and start server if needed
[10:09:48.057] Checking ssh with "C:\Windows\system32\ssh.exe -V"
[10:09:48.060] Got error from ssh: spawn C:\Windows\system32\ssh.exe ENOENT
[10:09:48.060] Checking ssh with "C:\Windows\ssh.exe -V"
[10:09:48.061] Got error from ssh: spawn C:\Windows\ssh.exe ENOENT
[10:09:48.061] Checking ssh with "C:\Windows\System32\Wbem\ssh.exe -V"
[10:09:48.062] Got error from ssh: spawn C:\Windows\System32\Wbem\ssh.exe ENOENT
[10:09:48.062] Checking ssh with "C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe -V"
[10:09:48.062] Got error from ssh: spawn C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe ENOENT
[10:09:48.063] Checking ssh with "C:\Windows\System32\OpenSSH\ssh.exe -V"
[10:09:48.087] > OpenSSH_for_Windows_8.6p1, LibreSSL 3.4.3

[10:09:48.091] Running script with connection command: "C:\Windows\System32\OpenSSH\ssh.exe" -T -D 60053 "keyslam.com" bash
[10:09:48.093] Terminal shell path: C:\Windows\System32\cmd.exe
[10:09:48.652] > Enter passphrase for key 'C:\Users\Keyslam/.ssh/id_rsa':�]0;C:\Windows\System32\cmd.exe�
[10:09:48.652] Got some output, clearing connection timeout
[10:09:48.652] Detected passphrase message
[10:09:56.885] Got passphrase response
[10:09:56.886] "install" wrote data to terminal: "**************"
[10:09:56.915] > 
[10:09:57.291] > 2d4c914579ab: running
[10:09:57.322] > Acquiring lock on /root/.vscode-server/bin/92da9481c0904c6adfe372c12da3b7748d74bdcb/vscode-remote-lock.root.92da9481c0904c6adfe372c12da3b7748d74bdcb
> Found existing installation at /root/.vscode-server/bin/92da9481c0904c6adfe372c12da3b7748d74bdcb...
[10:09:57.338] > Checking /root/.vscode-server/.92da9481c0904c6adfe372c12da3b7748d74bdcb.log and /root/.vscode-server/.92da9481c0904c6adfe372c12da3b7748d74bdcb.pid for a running server
> Looking for server with pid: 31676
> Running ssh connection command... /root/.vscode-server/bin/92da9481c0904c6adfe372c12da3b7748d74bdcb/bin/code-server --start-server --host=127.0.0.1 --accept-server-license-terms --enable-remote-auto-shutdown --port=0 --telemetry-level all   &> "/root/.vscode-server/.92da9481c0904c6adfe372c12da3b7748d74bdcb.log" < /dev/null
> printenv:
>     SHELL=/bin/bash
>     LANGUAGE=en_US
>     PWD=/root
>     LOGNAME=root
>     XDG_SESSION_TYPE=tty
>     MOTD_SHOWN=pam
>     HOME=/root
>     LANG=en_US
>     VSCODE_AGENT_FOLDER=/root/.vscode-server
>     SSH_CONNECTION=62.195.4.231 60054 85.214.79.167 22
>     XDG_SESSION_CLASS=user
>     USER=root
>     SHLVL=0
>     XDG_SESSION_ID=29441671
>     XDG_RUNTIME_DIR=/run/user/0
>     SSH_CLIENT=62.195.4.231 60054 22
>     PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
> s:/usr/local/games:/snap/bin
>     DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/0/bus
>     _=/usr/bin/printenv
> Removing old logfile at /root/.vscode-server/.92da9481c0904c6adfe372c12da3b7748d
> d74bdcb.log
[10:09:57.344] > 
> Spawned remote server: 32921
> Waiting for server log...
[10:09:57.362] > 
[10:09:57.385] > Waiting for server log...
[10:09:57.404] > 
[10:09:57.423] >  
> *
> * Visual Studio Code Server
> *
> * By using the software, you agree to
> * the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-lice
> ense) and
> * the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacyst
> tatement).
> *
> 
[10:09:57.436] > 
> 2d4c914579ab: start
> SSH_AUTH_SOCK====
> DISPLAY====
> webUiAccessToken====
> listeningOn==34533==
> osReleaseId==ubuntu==
> arch==x86_64==
> tmpDir==/run/user/0==
> platform==linux==
> unpackResult====
> didLocalDownload==0==
> downloadTime====
> installTime====
> extInstallTime====
[10:09:57.442] > 
> serverStartTime==84==
> connectionToken==111111aa-11a1-11aa-a1a1-a1111a11aa1a==
> 2d4c914579ab: end
[10:09:57.442] Received install output: 
SSH_AUTH_SOCK====
DISPLAY====
webUiAccessToken====
listeningOn==34533==
osReleaseId==ubuntu==
arch==x86_64==
tmpDir==/run/user/0==
platform==linux==
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
extInstallTime====
serverStartTime==84==
connectionToken==111111aa-11a1-11aa-a1a1-a1111a11aa1a==

[10:09:57.443] Remote server is listening on 34533
[10:09:57.443] Parsed server configuration: {"serverConfiguration":{"remoteListeningOn":{"port":34533},"osReleaseId":"ubuntu","arch":"x86_64","webUiAccessToken":"","sshAuthSock":"","display":"","tmpDir":"/run/user/0","platform":"linux","connectionToken":"111111aa-11a1-11aa-a1a1-a1111a11aa1a"},"serverStartTime":84,"installUnpackCode":""}
[10:09:57.446] Starting forwarding server. localPort 60062 -> socksPort 60053 -> remotePort 34533
[10:09:57.447] Forwarding server listening on 60062
[10:09:57.447] Waiting for ssh tunnel to be ready
[10:09:57.448] [Forwarding server 60062] Got connection 0
[10:09:57.449] Tunneled 34533 to local port 60062
[10:09:57.449] Resolved "ssh-remote+keyslam.com" to "127.0.0.1:60062"
[10:09:57.450] > 
[10:09:57.459] ------




[10:09:57.478] [Forwarding server 60062] Got connection 1
[10:09:57.605] ------




[10:09:57.605] SSH Resolver called for "ssh-remote+keyslam.com", attempt 2, (Reconnection)
[10:09:57.607] SSH Resolver called for host: keyslam.com
[10:09:57.607] Setting up SSH remote "keyslam.com"
[10:09:57.608] Using commit id "92da9481c0904c6adfe372c12da3b7748d74bdcb" and quality "stable" for server
[10:09:57.611] Install and start server if needed
[10:09:57.614] Running script with connection command: "C:\Windows\System32\OpenSSH\ssh.exe" -T -D 60067 "keyslam.com" bash
[10:09:57.615] Terminal shell path: C:\Windows\System32\cmd.exe
[10:09:57.616] [Forwarding server 60062] Got connection 2
[10:09:57.646] Failed to set up socket for dynamic port forward to remote port 34533: Socket closed. Is the remote port correct?
[10:09:57.653] > channel 3: open failed: connect failed: Connection refused
[10:09:57.666] > 
[10:09:58.164] > Enter passphrase for key 'C:\Users\Keyslam/.ssh/id_rsa':�]0;C:\Windows\System32\cmd.exe�
[10:09:58.164] Got some output, clearing connection timeout
[10:09:58.164] Detected passphrase message
[10:10:05.886] Got passphrase response
[10:10:05.886] "install" wrote data to terminal: "**************"
[10:10:05.914] > 
[10:10:06.288] > 20fbc3518430: running
[10:10:06.307] > Acquiring lock on /root/.vscode-server/bin/92da9481c0904c6adfe372c12da3b7748d74bdcb/vscode-remote-lock.root.92da9481c0904c6adfe372c12da3b7748d74bdcb
[10:10:06.319] > Found existing installation at /root/.vscode-server/bin/92da9481c0904c6adfe372c12da3b7748d74bdcb...
> Checking /root/.vscode-server/.92da9481c0904c6adfe372c12da3b7748d74bdcb.log and /root/.vscode-server/.92da9481c0904c6adfe372c12da3b7748d74bdcb.pid for a running server
> Looking for server with pid: 32921
[10:10:06.332] > Running ssh connection command... /root/.vscode-server/bin/92da9481c0904c6adfe372c12da3b7748d74bdcb/bin/code-server --start-server --host=127.0.0.1 --accept-server-license-terms --enable-remote-auto-shutdown --port=0 --telemetry-level all   &> "/root/.vscode-server/.92da9481c0904c6adfe372c12da3b7748d74bdcb.log" < /dev/null
> printenv:
>     SHELL=/bin/bash
>     LANGUAGE=en_US
>     PWD=/root
>     LOGNAME=root
>     XDG_SESSION_TYPE=tty
>     MOTD_SHOWN=pam
>     HOME=/root
>     LANG=en_US
>     VSCODE_AGENT_FOLDER=/root/.vscode-server
>     SSH_CONNECTION=62.195.4.231 60070 85.214.79.167 22
>     XDG_SESSION_CLASS=user
>     USER=root
>     SHLVL=0
>     XDG_SESSION_ID=29441721
>     XDG_RUNTIME_DIR=/run/user/0
>     SSH_CLIENT=62.195.4.231 60070 22
>     PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
> s:/usr/local/games:/snap/bin
>     DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/0/bus
>     _=/usr/bin/printenv
[10:10:06.338] > Removing old logfile at /root/.vscode-server/.92da9481c0904c6adfe372c12da3b7748d
> d74bdcb.log
> Spawned remote server: 33023
> Waiting for server log...
[10:10:06.357] > 
[10:10:06.379] > Waiting for server log...
[10:10:06.398] > 
[10:10:06.416] >  
> *
> * Visual Studio Code Server
> *
> * By using the software, you agree to
> * the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-lice
> ense) and
> * the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacyst
> tatement).
> *
> 
[10:10:06.432] > 
> 20fbc3518430: start
> SSH_AUTH_SOCK====
> DISPLAY====
> webUiAccessToken====
> listeningOn==34972==
> osReleaseId==ubuntu==
> arch==x86_64==
> tmpDir==/run/user/0==
> platform==linux==
> unpackResult====
> didLocalDownload==0==
> downloadTime====
> installTime====
> extInstallTime====
> serverStartTime==81==
> connectionToken==111a11a1-11a1-111a-aa11-a111a1a1a11a==
> 20fbc3518430: end
[10:10:06.432] Received install output: 
SSH_AUTH_SOCK====
DISPLAY====
webUiAccessToken====
listeningOn==34972==
osReleaseId==ubuntu==
arch==x86_64==
tmpDir==/run/user/0==
platform==linux==
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
extInstallTime====
serverStartTime==81==
connectionToken==111a11a1-11a1-111a-aa11-a111a1a1a11a==

[10:10:06.433] Remote server is listening on 34972
[10:10:06.433] Parsed server configuration: {"serverConfiguration":{"remoteListeningOn":{"port":34972},"osReleaseId":"ubuntu","arch":"x86_64","webUiAccessToken":"","sshAuthSock":"","display":"","tmpDir":"/run/user/0","platform":"linux","connectionToken":"111a11a1-11a1-111a-aa11-a111a1a1a11a"},"serverStartTime":81,"installUnpackCode":""}
[10:10:06.434] Starting forwarding server. localPort 60077 -> socksPort 60067 -> remotePort 34972
[10:10:06.435] Forwarding server listening on 60077
[10:10:06.435] Waiting for ssh tunnel to be ready
[10:10:06.436] [Forwarding server 60077] Got connection 0
[10:10:06.436] Tunneled 34972 to local port 60077
[10:10:06.436] Resolved "ssh-remote+keyslam.com" to "127.0.0.1:60077"
[10:10:06.439] ------




[10:10:06.443] [Forwarding server 60077] Got connection 1
[10:10:06.447] > 
[10:10:06.613] ------




[10:10:06.613] SSH Resolver called for "ssh-remote+keyslam.com", attempt 3, (Reconnection)
[10:10:06.614] SSH Resolver called for host: keyslam.com
[10:10:06.614] Setting up SSH remote "keyslam.com"
[10:10:06.615] Using commit id "92da9481c0904c6adfe372c12da3b7748d74bdcb" and quality "stable" for server
[10:10:06.617] Install and start server if needed
[10:10:06.619] Running script with connection command: "C:\Windows\System32\OpenSSH\ssh.exe" -T -D 60082 "keyslam.com" bash
[10:10:06.620] Terminal shell path: C:\Windows\System32\cmd.exe
[10:10:07.239] > Enter passphrase for key 'C:\Users\Keyslam/.ssh/id_rsa':�]0;C:\Windows\System32\cmd.exe�
[10:10:07.239] Got some output, clearing connection timeout
[10:10:07.239] Detected passphrase message

Anything else?

No response

@Keyslam Keyslam added the ssh Issue in vscode-remote SSH label Mar 3, 2023
@Keyslam Keyslam changed the title [Remote-SSH Bug]: (Suddently) can't connect to remote server [Remote-SSH Bug]: (Suddenly) can't connect to remote server Mar 3, 2023
@mwinkler
Copy link

mwinkler commented Mar 4, 2023

I have the same issue.

@Keyslam
Copy link
Author

Keyslam commented Mar 5, 2023

Since I need this to work ASAP I have resorted to reinstalling Linux on the remote server with no luck.
To summarize, I am on a clean install of Windows and by extension VSCode, and on a clean install of Linux, with AllowTcpForwarding yes in /etc/ssh/sshd_config.

It (still) seems unable to forward the port, but I have no idea what could be causing that.

[10:34:47.909] Log Level: 2
[10:34:47.920] SSH Resolver called for "ssh-remote+keyslam.com", attempt 1
[10:34:47.920] "remote.SSH.useLocalServer": false
[10:34:47.920] "remote.SSH.showLoginTerminal": false
[10:34:47.921] "remote.SSH.remotePlatform": {"keyslam.com":"linux"}
[10:34:47.921] "remote.SSH.path": undefined
[10:34:47.921] "remote.SSH.configFile": undefined
[10:34:47.921] "remote.SSH.useFlock": true
[10:34:47.921] "remote.SSH.lockfilesInTmp": false
[10:34:47.921] "remote.SSH.localServerDownload": auto
[10:34:47.921] "remote.SSH.remoteServerListenOnSocket": false
[10:34:47.922] "remote.SSH.showLoginTerminal": false
[10:34:47.922] "remote.SSH.defaultExtensions": []
[10:34:47.922] "remote.SSH.loglevel": 2
[10:34:47.922] "remote.SSH.enableDynamicForwarding": true
[10:34:47.922] "remote.SSH.enableRemoteCommand": false
[10:34:47.922] "remote.SSH.serverPickPortsFromRange": {}
[10:34:47.922] "remote.SSH.serverInstallPath": {}
[10:34:47.927] VS Code version: 1.76.0
[10:34:47.927] Remote-SSH version: remote-ssh@0.98.0
[10:34:47.927] win32 x64
[10:34:47.929] SSH Resolver called for host: keyslam.com
[10:34:47.929] Setting up SSH remote "keyslam.com"
[10:34:47.934] Using commit id "92da9481c0904c6adfe372c12da3b7748d74bdcb" and quality "stable" for server
[10:34:47.939] Install and start server if needed
[10:34:47.942] Checking ssh with "C:\Python311\Scripts\ssh.exe -V"
[10:34:47.945] Got error from ssh: spawn C:\Python311\Scripts\ssh.exe ENOENT
[10:34:47.945] Checking ssh with "C:\Python311\ssh.exe -V"
[10:34:47.946] Got error from ssh: spawn C:\Python311\ssh.exe ENOENT
[10:34:47.947] Checking ssh with "C:\Windows\system32\ssh.exe -V"
[10:34:47.948] Got error from ssh: spawn C:\Windows\system32\ssh.exe ENOENT
[10:34:47.948] Checking ssh with "C:\Windows\ssh.exe -V"
[10:34:47.949] Got error from ssh: spawn C:\Windows\ssh.exe ENOENT
[10:34:47.949] Checking ssh with "C:\Windows\System32\Wbem\ssh.exe -V"
[10:34:47.951] Got error from ssh: spawn C:\Windows\System32\Wbem\ssh.exe ENOENT
[10:34:47.951] Checking ssh with "C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe -V"
[10:34:47.952] Got error from ssh: spawn C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe ENOENT
[10:34:47.952] Checking ssh with "C:\Windows\System32\OpenSSH\ssh.exe -V"
[10:34:47.978] > OpenSSH_for_Windows_8.6p1, LibreSSL 3.4.3

[10:34:47.983] Running script with connection command: "C:\Windows\System32\OpenSSH\ssh.exe" -T -D 61644 "keyslam.com" bash
[10:34:47.985] Terminal shell path: C:\Windows\System32\cmd.exe
[10:34:48.380] > The authenticity of host 'keyslam.com (85.214.79.167)' can't be established.
> ED25519 key fingerprint is SHA256:NeZqVgoKvwg7V64gLHjx3TK1EFOT5B5G7YXYqnEqDqE.
> This key is not known by any other names
> Are you sure you want to continue connecting (yes/no/[fingerprint])?�]0;C:\Windows\System32\cmd.exe�
[10:34:48.380] Got some output, clearing connection timeout
[10:34:48.381] Detected fingerprint confirmation message
[10:34:48.381] Showing fingerprint confirmation dialog
[10:34:49.994] Got fingerprint response: yes
[10:34:49.994] "install" wrote data to terminal: "yes"
[10:34:50.020] > yes
> Warning: Permanently added 'keyslam.com' (ED25519) to the list of known hosts.
[10:34:50.172] > root@keyslam.com's password: 
[10:34:50.173] Showing password prompt
[10:34:53.253] Got password response
[10:34:53.253] "install" wrote data to terminal: "**************"
[10:34:53.273] > 
[10:34:53.462] > b34887b8507e: running
[10:34:53.477] > Acquiring lock on /root/.vscode-server/bin/92da9481c0904c6adfe372c12da3b7748d74bdcb/vscode-remote-lock.root.92da9481c0904c6adfe372c12da3b7748d74bdcb
[10:34:53.494] > Installing to /root/.vscode-server/bin/92da9481c0904c6adfe372c12da3b7748d74bdcb...
> b34887b8507e%%1%%
[10:34:53.509] > Downloading with wget
[10:34:54.091] > Download complete
> b34887b8507e%%2%%
> tar --version:
> tar (GNU tar) 1.30
> Copyright (C) 2017 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.Written by John Gilmore and Jay Fenlason.
> 
[10:34:55.823] > Checking /root/.vscode-server/.92da9481c0904c6adfe372c12da3b7748d74bdcb.log and /root/.vscode-server/.92da9481c0904c6adfe372c12da3b7748d74bdcb.pid for a running server
> Looking for server with pid: 2566
> Running ssh connection command... /root/.vscode-server/bin/92da9481c0904c6adfe372c12da3b7748d74bdcb/bin/code-server --start-server --host=127.0.0.1 --accept-server-license-terms --enable-remote-auto-shutdown --port=0 --telemetry-level all  
>   &> "/root/.vscode-server/.92da9481c0904c6adfe372c12da3b7748d74bdcb.log" < /dev/
> /null
> printenv:
>     SHELL=/bin/bash
>     PWD=/root
>     LOGNAME=root
>     MOTD_SHOWN=pam
>     HOME=/root
>     LANG=nl_NL.UTF-8
>     VSCODE_AGENT_FOLDER=/root/.vscode-server
>     SSH_CONNECTION=62.195.4.231 61645 85.214.79.167 22
>     USER=root
>     SHLVL=0
>     SSH_CLIENT=62.195.4.231 61645 22
>     PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
> s:/usr/local/games:/snap/bin
>     OLDPWD=/root/.vscode-server/bin/92da9481c0904c6adfe372c12da3b7748d74bdcb    
>     _=/usr/bin/printenv
[10:34:55.830] > Removing old logfile at /root/.vscode-server/.92da9481c0904c6adfe372c12da3b7748d
> d74bdcb.log
> Spawned remote server: 436
[10:34:55.836] > 
> Waiting for server log...
[10:34:55.872] > Waiting for server log...
[10:34:55.888] > 
[10:34:55.911] >  
> *
> * Visual Studio Code Server
> *
> * By using the software, you agree to
> * the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-lice
> ense) and
> * the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacyst
> tatement).
> *
> 
[10:34:55.919] > 
[10:34:55.927] > b34887b8507e: start
> SSH_AUTH_SOCK====
> DISPLAY====
> webUiAccessToken====
> listeningOn==40002==
> osReleaseId==ubuntu==
> arch==x86_64==
> tmpDir==/tmp==
> platform==linux==
> unpackResult==success==
> didLocalDownload==0==
> downloadTime==581==
> installTime==1715==
> extInstallTime====
> serverStartTime==83==
> connectionToken==a1111a11-1a11-111a-1aa1-11aa1a11aaaa==
> b34887b8507e: end
[10:34:55.927] Received install output: 
SSH_AUTH_SOCK====
DISPLAY====
webUiAccessToken====
listeningOn==40002==
osReleaseId==ubuntu==
arch==x86_64==
tmpDir==/tmp==
platform==linux==
unpackResult==success==
didLocalDownload==0==
downloadTime==581==
installTime==1715==
extInstallTime====
serverStartTime==83==
connectionToken==a1111a11-1a11-111a-1aa1-11aa1a11aaaa==

[10:34:55.927] Remote server is listening on 40002
[10:34:55.928] Parsed server configuration: {"serverConfiguration":{"remoteListeningOn":{"port":40002},"osReleaseId":"ubuntu","arch":"x86_64","webUiAccessToken":"","sshAuthSock":"","display":"","tmpDir":"/tmp","platform":"linux","connectionToken":"a1111a11-1a11-111a-1aa1-11aa1a11aaaa"},"downloadTime":581,"installTime":1715,"serverStartTime":83,"installUnpackCode":"success"}
[10:34:55.930] Starting forwarding server. localPort 61650 -> socksPort 61644 -> remotePort 40002
[10:34:55.931] Forwarding server listening on 61650
[10:34:55.931] Waiting for ssh tunnel to be ready
[10:34:55.932] [Forwarding server 61650] Got connection 0
[10:34:55.933] Tunneled 40002 to local port 61650
[10:34:55.933] Resolved "ssh-remote+keyslam.com" to "127.0.0.1:61650"
[10:34:55.941] ------




[10:34:55.941] > 
[10:34:55.954] [Forwarding server 61650] Got connection 1
[10:34:56.087] ------




[10:34:56.087] SSH Resolver called for "ssh-remote+keyslam.com", attempt 2, (Reconnection)
[10:34:56.088] SSH Resolver called for host: keyslam.com
[10:34:56.088] Setting up SSH remote "keyslam.com"
[10:34:56.089] Using commit id "92da9481c0904c6adfe372c12da3b7748d74bdcb" and quality "stable" for server
[10:34:56.092] Install and start server if needed
[10:34:56.094] Running script with connection command: "C:\Windows\System32\OpenSSH\ssh.exe" -T -D 61655 "keyslam.com" bash
[10:34:56.095] Terminal shell path: C:\Windows\System32\cmd.exe
[10:34:56.097] [Forwarding server 61650] Got connection 2
[10:34:56.128] Failed to set up socket for dynamic port forward to remote port 40002: Socket closed. Is the remote port correct?
[10:34:56.134] > channel 3: open failed: connect failed: Connection refused
[10:34:56.153] > 
[10:34:56.659] > root@keyslam.com's password:�]0;C:\Windows\System32\cmd.exe�
[10:34:56.659] Got some output, clearing connection timeout
[10:34:56.659] Showing password prompt

@alxliv
Copy link

alxliv commented Mar 5, 2023

I have exact same issue with VSCode v1.76. Downgraded to v1.74.3 and it connects just fine. Something broke in VSCode 1.76 version regarding Remote SSH

@Keyslam
Copy link
Author

Keyslam commented Mar 5, 2023

I have exact same issue with VSCode v1.76. Downgraded to v1.74.3 and it connects just fine. Something broke in VSCode 1.76 version regarding Remote SSH

This solved it. Thanks so much Alxliv!
Seeing as this is a workaround, I'll update this issue's title and keep it open.

@Keyslam Keyslam changed the title [Remote-SSH Bug]: (Suddenly) can't connect to remote server [Remote-SSH Bug]: "Failed to set up socket for dynamic port forward" on VSCode v1.76 Mar 5, 2023
@kushal9291
Copy link

@alxliv This solved the issue. Thank you so much!

@eleanorjboyd
Copy link
Member

Hello! Sorry for the delay! I am looking into this now. Can someone try downgrading to the remote-ssh extension version 9.6 (the newest version is going to be 0.98 for stable). Does downgrading this fix the issue or is it only on downgrading all of vscode? Secondly what is the type of everyone's local and remote machines?

Screenshot 2023-03-14 at 9 14 34 AM

@eleanorjboyd
Copy link
Member

I have exact same issue with VSCode v1.76. Downgraded to v1.74.3 and it connects just fine. Something broke in VSCode 1.76 version regarding Remote SSH

Could you send your logs from 1.76 @alxliv ? Thanks!

@alxliv
Copy link

alxliv commented Mar 14, 2023

@eleanorjboyd , Hi, I wanted to reproduce this issue on VSCode v1.76.0 but could not find download v1.76.0. So I installed the latest version - v1.76.1 and could not reproduce the issue. Remote-SSH works now just fine. I guess this issue somehow got fixed (at least for me) from 1.76.0 to 1.76.1

@eleanorjboyd
Copy link
Member

eleanorjboyd commented Mar 14, 2023

Great news @alxliv! Does it work on 1.78 or is it broken there?

@alxliv
Copy link

alxliv commented Mar 14, 2023

@eleanorjboyd , 1.78? The latest version of VSCode I can see is 1.76.1 https://code.visualstudio.com/updates/v1_76
How can I download v 1.78?

@eleanorjboyd
Copy link
Member

oops you're right I got my versions mixed up between the vscode version and the remote-ssh extension! It must have been the point fix that was the solution but let me know if it resurfaces.

@aiktb
Copy link

aiktb commented Apr 20, 2023

I have temporarily solved this problem for now, but I don't know the reason.
In the /etc/ssh/sshd_config file will

AllowAgentForwarding no
AllowTcpForwarding no

changed to

AllowAgentForwarding yes
AllowTcpForwarding yes

Note that these two lines appear twice in the file, once at the beginning of the # comment, I uncommented these two lines, and another time at the end of the file, I changed yes to no.
Then restart the ssh service and delete the .vscode-server folder.

systemctl restart sshd
rm -rf ~/.vscode-server/

I now understand that someone appended "no" to the end of the default configuration file and did not delete the comment item, which caused me to see the comment item and mistakenly think it is now in the default state of "yes".

@eleanorjboyd
Copy link
Member

closing as it seems resolved but please comment again if this is not the case or if confusion persists.

@victbr victbr mentioned this issue Apr 30, 2023
3 tasks
@kuang-da
Copy link

After updating to 1.78.2, the problem seems to show again. Sometimes it works, but sometimes it does not. Connecting to the same remote server from multiple windows takes a while to wait, if not impossible.

[23:25:11.872] Log Level: 2
[23:25:11.878] SSH Resolver called for "ssh-remote+thelio-kim", attempt 1
[23:25:11.879] "remote.SSH.useLocalServer": true
[23:25:11.879] "remote.SSH.path": undefined
[23:25:11.879] "remote.SSH.configFile": undefined
[23:25:11.879] "remote.SSH.useFlock": true
[23:25:11.879] "remote.SSH.lockfilesInTmp": false
[23:25:11.879] "remote.SSH.localServerDownload": auto
[23:25:11.879] "remote.SSH.remoteServerListenOnSocket": false
[23:25:11.879] "remote.SSH.showLoginTerminal": false
[23:25:11.879] "remote.SSH.defaultExtensions": []
[23:25:11.879] "remote.SSH.loglevel": 2
[23:25:11.879] "remote.SSH.enableDynamicForwarding": true
[23:25:11.879] "remote.SSH.enableRemoteCommand": false
[23:25:11.879] "remote.SSH.serverPickPortsFromRange": {}
[23:25:11.879] "remote.SSH.serverInstallPath": {}
[23:25:11.881] VS Code version: 1.78.2
[23:25:11.881] Remote-SSH version: remote-ssh@0.102.0
[23:25:11.881] darwin arm64
[23:25:11.882] SSH Resolver called for host: thelio-kim
[23:25:11.882] Setting up SSH remote "thelio-kim"
[23:25:11.884] Acquiring local install lock: /var/folders/5l/ldh0bl0d2jjcl4lmw_r6stv40000gn/T/vscode-remote-ssh-92930c6a-install.lock
[23:25:11.884] Looking for existing server data file at /Users/kuangda/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-92930c6a-b3e4e68a0bc097f0ae7907b217c1119af9e03435-0.102.0/data.json
[23:25:11.884] Using commit id "b3e4e68a0bc097f0ae7907b217c1119af9e03435" and quality "stable" for server
[23:25:11.887] Install and start server if needed
[23:25:11.888] PATH: /Users/kuangda/miniconda3/bin:/Users/kuangda/miniconda3/condabin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/Library/TeX/texbin:/Library/Apple/usr/bin:/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:/Users/kuangda/Library/Application Support/JetBrains/Toolbox/scripts
[23:25:11.888] Checking ssh with "ssh -V"
[23:25:11.893] > OpenSSH_9.0p1, LibreSSL 3.3.6

[23:25:11.894] askpass server listening on /var/folders/5l/ldh0bl0d2jjcl4lmw_r6stv40000gn/T/vscode-ssh-askpass-402dca26500266b112d3352530a5a1f8673c9b5e.sock
[23:25:11.895] Spawning local server with {"serverId":1,"ipcHandlePath":"/var/folders/5l/ldh0bl0d2jjcl4lmw_r6stv40000gn/T/vscode-ssh-askpass-80eedc71f35fb19c11ae09e4f180c8095ad204c0.sock","sshCommand":"ssh","sshArgs":["-v","-T","-D","50017","-o","ConnectTimeout=15","thelio-kim"],"serverDataFolderName":".vscode-server","dataFilePath":"/Users/kuangda/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-92930c6a-b3e4e68a0bc097f0ae7907b217c1119af9e03435-0.102.0/data.json"}
[23:25:11.895] Local server env: {"SSH_AUTH_SOCK":"/private/tmp/com.apple.launchd.ljolrQKZnF/Listeners","SHELL":"/bin/zsh","DISPLAY":"1","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"/Users/kuangda/.vscode/extensions/ms-vscode-remote.remote-ssh-0.102.0/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":"--ms-enable-electron-run-as-node","VSCODE_SSH_ASKPASS_MAIN":"/Users/kuangda/.vscode/extensions/ms-vscode-remote.remote-ssh-0.102.0/out/askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"/var/folders/5l/ldh0bl0d2jjcl4lmw_r6stv40000gn/T/vscode-ssh-askpass-402dca26500266b112d3352530a5a1f8673c9b5e.sock"}
[23:25:11.895] Spawned 10561
[23:25:11.963] > local-server-1> Running ssh connection command: "-v -T -D 50017 -o ConnectTimeout=15 thelio-kim"
[23:25:11.965] > local-server-1> Spawned ssh, pid=10568
[23:25:11.968] stderr> OpenSSH_9.0p1, LibreSSL 3.3.6
[23:25:11.976] stderr> OpenSSH_9.0p1, LibreSSL 3.3.6
[23:25:14.705] stderr> debug1: Server host key: ssh-ed25519 SHA256:cmAuOSrtLT7SIUoqKFYV4qoYd6i6JuzSLOWPHHdirq0
[23:25:17.344] stderr> Authenticated to kimtransfer.sas.upenn.edu ([198.18.0.46]:22) using "publickey".
[23:25:18.181] stderr> debug1: Server host key: ssh-ed25519 SHA256:Iox5nhZSBMHiaN3deN5cPADX2YwIr7o2J0pU5jezAFQ
[23:25:19.164] stderr> Authenticated to 192.168.1.179 (via proxy) using "publickey".
[23:25:19.723] > Welcome to Pop!_OS 22.04 LTS (GNU/Linux 6.2.6-76060206-generic x86_64)
> 
>  * Homepage: https://pop.system76.com
>  * Support:  https://support.system76.com
> 
> 
>  * Introducing Expanded Security Maintenance for Applications.
>    Receive updates to over 25,000 software packages with your
>    Ubuntu Pro subscription. Free for personal use.
> 
>      https://ubuntu.com/pro
[23:25:19.891] > ready: 5b917c1cc638
[23:25:20.129] > Linux 6.2.6-76060206-generic #202303130630~1679424972~22.04~4a8cde1 SMP PREEMPT_DYNAMIC Tue M
[23:25:20.130] Platform: linux
[23:25:20.367] > /usr/bin/zsh
[23:25:20.367] Shell: zsh
[23:25:20.367] Creating bash subshell inside "zsh"
[23:25:20.654] > bash version:  5.1.16(1)-release
[23:25:20.719] > bash version:  5.1.16(1)-release
[23:25:20.785] > bash version:  5.1.16(1)-release
[23:25:20.870] > bash version:  5.1.16(1)-release
[23:25:20.977] > bash version:  5.1.16(1)-release
[23:25:21.059] > 5b917c1cc638: running
[23:25:21.166] > Acquiring lock on /home/derek/.vscode-server/bin/b3e4e68a0bc097f0ae7907b217c1119af9e03435/vscode-remote-lock.derek.b3e4e68a0bc097f0ae7907b217c1119af9e03435
> Found old VS Code install 6a995c4f4cc2ced6e3237749973982e751cb0bf9, attempting to clean up
[23:25:21.230] > Install still has running processes, not deleting: 6a995c4f4cc2ced6e3237749973982e751cb0bf9
> Found existing installation at /home/derek/.vscode-server/bin/b3e4e68a0bc097f0ae7907b217c1119af9e03435...
> Checking /home/derek/.vscode-server/.b3e4e68a0bc097f0ae7907b217c1119af9e03435.log and /home/derek/.vscode-server/.b3e4e68a0bc097f0ae7907b217c1119af9e03435.pid for a running server
> Looking for server with pid: 2312395
[23:25:21.295] > Found running server...
>  
> *
> * Visual Studio Code Server
> *
> * By using the software, you agree to
> * the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and
> * the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).
> *
>  
> Checking server status on port 46415 with wget
> 5b917c1cc638: start
> SSH_AUTH_SOCK==/tmp/ssh-XXXXBxdPhj/agent.2633278==
> DISPLAY====
> webUiAccessToken====
> listeningOn==46415==
> osReleaseId==pop==
> arch==x86_64==
> vscodeArch==x64==
> bitness==64==
> tmpDir==/run/user/1000==
> platform==linux==
> unpackResult====
> didLocalDownload==0==
> downloadTime====
[23:25:21.828] > installTime====
> extInstallTime====
> serverStartTime====
> connectionToken==111a1a1a-1a11-1111-a111-a1111aa1111a==
> 5b917c1cc638: end
[23:25:21.829] Received install output: 
SSH_AUTH_SOCK==/tmp/ssh-XXXXBxdPhj/agent.2633278==
DISPLAY====
webUiAccessToken====
listeningOn==46415==
osReleaseId==pop==
arch==x86_64==
vscodeArch==x64==
bitness==64==
tmpDir==/run/user/1000==
platform==linux==
unpackResult====
didLocalDownload==0==
downloadTime====installTime====
extInstallTime====
serverStartTime====
connectionToken==111a1a1a-1a11-1111-a111-a1111aa1111a==

[23:25:21.830] Remote server is listening on 46415
[23:25:21.831] Parsed server configuration: {"serverConfiguration":{"remoteListeningOn":{"port":46415},"osReleaseId":"pop","arch":"x86_64","webUiAccessToken":"","sshAuthSock":"/tmp/ssh-XXXXBxdPhj/agent.2633278","display":"","tmpDir":"/run/user/1000","platform":"linux","connectionToken":"111a1a1a-1a11-1111-a111-a1111aa1111a"},"installUnpackCode":""}
[23:25:21.832] Persisting server connection details to /Users/kuangda/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-92930c6a-b3e4e68a0bc097f0ae7907b217c1119af9e03435-0.102.0/data.json
[23:25:21.834] Starting forwarding server. localPort 50032 -> socksPort 50017 -> remotePort 46415
[23:25:21.835] Forwarding server listening on 50032
[23:25:21.835] Waiting for ssh tunnel to be ready
[23:25:21.837] Tunneled 46415 to local port 50032
[23:25:21.837] Resolved "ssh-remote+thelio-kim" to "127.0.0.1:50032"
[23:25:21.837] Updating $SSH_AUTH_SOCK: ln -f -s "/tmp/ssh-XXXXBxdPhj/agent.2633278" "/run/user/1000/vscode-ssh-auth-sock-221275527"
[23:25:21.837] Using cwd: vscode-remote://ssh-remote%2Bthelio-kim/
[23:25:21.838] Remote extension host environment: {"SSH_AUTH_SOCK":"/run/user/1000/vscode-ssh-auth-sock-221275527"}
[23:25:21.838] [Forwarding server 50032] Got connection 0
[23:25:21.844] ------




[23:25:21.850] [Forwarding server 50032] Got connection 1
[23:25:22.382] [Forwarding server 50032] Got connection 2
[23:25:29.708] [Forwarding server 50032] Got connection 3
[23:25:49.848] [Forwarding server 50032] Got connection 4
[23:25:59.714] Failed to set up socket for dynamic port forward to remote port 46415: Proxy connection timed out. Is the remote port correct?
[23:26:19.853] Failed to set up socket for dynamic port forward to remote port 46415: Proxy connection timed out. Is the remote port correct?
[23:27:08.897] "Update SSH_AUTH_SOCK" terminal command done

@dufuhang
Copy link

dufuhang commented Jun 1, 2023

After updating to 1.78.2, the problem seems to show again. Sometimes it works, but sometimes it does not. Connecting to the same remote server from multiple windows takes a while to wait, if not impossible.

[23:25:11.872] Log Level: 2
[23:25:11.878] SSH Resolver called for "ssh-remote+thelio-kim", attempt 1
[23:25:11.879] "remote.SSH.useLocalServer": true
[23:25:11.879] "remote.SSH.path": undefined
[23:25:11.879] "remote.SSH.configFile": undefined
[23:25:11.879] "remote.SSH.useFlock": true
[23:25:11.879] "remote.SSH.lockfilesInTmp": false
[23:25:11.879] "remote.SSH.localServerDownload": auto
[23:25:11.879] "remote.SSH.remoteServerListenOnSocket": false
[23:25:11.879] "remote.SSH.showLoginTerminal": false
[23:25:11.879] "remote.SSH.defaultExtensions": []
[23:25:11.879] "remote.SSH.loglevel": 2
[23:25:11.879] "remote.SSH.enableDynamicForwarding": true
[23:25:11.879] "remote.SSH.enableRemoteCommand": false
[23:25:11.879] "remote.SSH.serverPickPortsFromRange": {}
[23:25:11.879] "remote.SSH.serverInstallPath": {}
[23:25:11.881] VS Code version: 1.78.2
[23:25:11.881] Remote-SSH version: remote-ssh@0.102.0
[23:25:11.881] darwin arm64
[23:25:11.882] SSH Resolver called for host: thelio-kim
[23:25:11.882] Setting up SSH remote "thelio-kim"
[23:25:11.884] Acquiring local install lock: /var/folders/5l/ldh0bl0d2jjcl4lmw_r6stv40000gn/T/vscode-remote-ssh-92930c6a-install.lock
[23:25:11.884] Looking for existing server data file at /Users/kuangda/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-92930c6a-b3e4e68a0bc097f0ae7907b217c1119af9e03435-0.102.0/data.json
[23:25:11.884] Using commit id "b3e4e68a0bc097f0ae7907b217c1119af9e03435" and quality "stable" for server
[23:25:11.887] Install and start server if needed
[23:25:11.888] PATH: /Users/kuangda/miniconda3/bin:/Users/kuangda/miniconda3/condabin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/Library/TeX/texbin:/Library/Apple/usr/bin:/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:/Users/kuangda/Library/Application Support/JetBrains/Toolbox/scripts
[23:25:11.888] Checking ssh with "ssh -V"
[23:25:11.893] > OpenSSH_9.0p1, LibreSSL 3.3.6

[23:25:11.894] askpass server listening on /var/folders/5l/ldh0bl0d2jjcl4lmw_r6stv40000gn/T/vscode-ssh-askpass-402dca26500266b112d3352530a5a1f8673c9b5e.sock
[23:25:11.895] Spawning local server with {"serverId":1,"ipcHandlePath":"/var/folders/5l/ldh0bl0d2jjcl4lmw_r6stv40000gn/T/vscode-ssh-askpass-80eedc71f35fb19c11ae09e4f180c8095ad204c0.sock","sshCommand":"ssh","sshArgs":["-v","-T","-D","50017","-o","ConnectTimeout=15","thelio-kim"],"serverDataFolderName":".vscode-server","dataFilePath":"/Users/kuangda/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-92930c6a-b3e4e68a0bc097f0ae7907b217c1119af9e03435-0.102.0/data.json"}
[23:25:11.895] Local server env: {"SSH_AUTH_SOCK":"/private/tmp/com.apple.launchd.ljolrQKZnF/Listeners","SHELL":"/bin/zsh","DISPLAY":"1","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"/Users/kuangda/.vscode/extensions/ms-vscode-remote.remote-ssh-0.102.0/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":"--ms-enable-electron-run-as-node","VSCODE_SSH_ASKPASS_MAIN":"/Users/kuangda/.vscode/extensions/ms-vscode-remote.remote-ssh-0.102.0/out/askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"/var/folders/5l/ldh0bl0d2jjcl4lmw_r6stv40000gn/T/vscode-ssh-askpass-402dca26500266b112d3352530a5a1f8673c9b5e.sock"}
[23:25:11.895] Spawned 10561
[23:25:11.963] > local-server-1> Running ssh connection command: "-v -T -D 50017 -o ConnectTimeout=15 thelio-kim"
[23:25:11.965] > local-server-1> Spawned ssh, pid=10568
[23:25:11.968] stderr> OpenSSH_9.0p1, LibreSSL 3.3.6
[23:25:11.976] stderr> OpenSSH_9.0p1, LibreSSL 3.3.6
[23:25:14.705] stderr> debug1: Server host key: ssh-ed25519 SHA256:cmAuOSrtLT7SIUoqKFYV4qoYd6i6JuzSLOWPHHdirq0
[23:25:17.344] stderr> Authenticated to kimtransfer.sas.upenn.edu ([198.18.0.46]:22) using "publickey".
[23:25:18.181] stderr> debug1: Server host key: ssh-ed25519 SHA256:Iox5nhZSBMHiaN3deN5cPADX2YwIr7o2J0pU5jezAFQ
[23:25:19.164] stderr> Authenticated to 192.168.1.179 (via proxy) using "publickey".
[23:25:19.723] > Welcome to Pop!_OS 22.04 LTS (GNU/Linux 6.2.6-76060206-generic x86_64)
> 
>  * Homepage: https://pop.system76.com
>  * Support:  https://support.system76.com
> 
> 
>  * Introducing Expanded Security Maintenance for Applications.
>    Receive updates to over 25,000 software packages with your
>    Ubuntu Pro subscription. Free for personal use.
> 
>      https://ubuntu.com/pro
[23:25:19.891] > ready: 5b917c1cc638
[23:25:20.129] > Linux 6.2.6-76060206-generic #202303130630~1679424972~22.04~4a8cde1 SMP PREEMPT_DYNAMIC Tue M
[23:25:20.130] Platform: linux
[23:25:20.367] > /usr/bin/zsh
[23:25:20.367] Shell: zsh
[23:25:20.367] Creating bash subshell inside "zsh"
[23:25:20.654] > bash version:  5.1.16(1)-release
[23:25:20.719] > bash version:  5.1.16(1)-release
[23:25:20.785] > bash version:  5.1.16(1)-release
[23:25:20.870] > bash version:  5.1.16(1)-release
[23:25:20.977] > bash version:  5.1.16(1)-release
[23:25:21.059] > 5b917c1cc638: running
[23:25:21.166] > Acquiring lock on /home/derek/.vscode-server/bin/b3e4e68a0bc097f0ae7907b217c1119af9e03435/vscode-remote-lock.derek.b3e4e68a0bc097f0ae7907b217c1119af9e03435
> Found old VS Code install 6a995c4f4cc2ced6e3237749973982e751cb0bf9, attempting to clean up
[23:25:21.230] > Install still has running processes, not deleting: 6a995c4f4cc2ced6e3237749973982e751cb0bf9
> Found existing installation at /home/derek/.vscode-server/bin/b3e4e68a0bc097f0ae7907b217c1119af9e03435...
> Checking /home/derek/.vscode-server/.b3e4e68a0bc097f0ae7907b217c1119af9e03435.log and /home/derek/.vscode-server/.b3e4e68a0bc097f0ae7907b217c1119af9e03435.pid for a running server
> Looking for server with pid: 2312395
[23:25:21.295] > Found running server...
>  
> *
> * Visual Studio Code Server
> *
> * By using the software, you agree to
> * the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and
> * the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).
> *
>  
> Checking server status on port 46415 with wget
> 5b917c1cc638: start
> SSH_AUTH_SOCK==/tmp/ssh-XXXXBxdPhj/agent.2633278==
> DISPLAY====
> webUiAccessToken====
> listeningOn==46415==
> osReleaseId==pop==
> arch==x86_64==
> vscodeArch==x64==
> bitness==64==
> tmpDir==/run/user/1000==
> platform==linux==
> unpackResult====
> didLocalDownload==0==
> downloadTime====
[23:25:21.828] > installTime====
> extInstallTime====
> serverStartTime====
> connectionToken==111a1a1a-1a11-1111-a111-a1111aa1111a==
> 5b917c1cc638: end
[23:25:21.829] Received install output: 
SSH_AUTH_SOCK==/tmp/ssh-XXXXBxdPhj/agent.2633278==
DISPLAY====
webUiAccessToken====
listeningOn==46415==
osReleaseId==pop==
arch==x86_64==
vscodeArch==x64==
bitness==64==
tmpDir==/run/user/1000==
platform==linux==
unpackResult====
didLocalDownload==0==
downloadTime====installTime====
extInstallTime====
serverStartTime====
connectionToken==111a1a1a-1a11-1111-a111-a1111aa1111a==

[23:25:21.830] Remote server is listening on 46415
[23:25:21.831] Parsed server configuration: {"serverConfiguration":{"remoteListeningOn":{"port":46415},"osReleaseId":"pop","arch":"x86_64","webUiAccessToken":"","sshAuthSock":"/tmp/ssh-XXXXBxdPhj/agent.2633278","display":"","tmpDir":"/run/user/1000","platform":"linux","connectionToken":"111a1a1a-1a11-1111-a111-a1111aa1111a"},"installUnpackCode":""}
[23:25:21.832] Persisting server connection details to /Users/kuangda/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-92930c6a-b3e4e68a0bc097f0ae7907b217c1119af9e03435-0.102.0/data.json
[23:25:21.834] Starting forwarding server. localPort 50032 -> socksPort 50017 -> remotePort 46415
[23:25:21.835] Forwarding server listening on 50032
[23:25:21.835] Waiting for ssh tunnel to be ready
[23:25:21.837] Tunneled 46415 to local port 50032
[23:25:21.837] Resolved "ssh-remote+thelio-kim" to "127.0.0.1:50032"
[23:25:21.837] Updating $SSH_AUTH_SOCK: ln -f -s "/tmp/ssh-XXXXBxdPhj/agent.2633278" "/run/user/1000/vscode-ssh-auth-sock-221275527"
[23:25:21.837] Using cwd: vscode-remote://ssh-remote%2Bthelio-kim/
[23:25:21.838] Remote extension host environment: {"SSH_AUTH_SOCK":"/run/user/1000/vscode-ssh-auth-sock-221275527"}
[23:25:21.838] [Forwarding server 50032] Got connection 0
[23:25:21.844] ------




[23:25:21.850] [Forwarding server 50032] Got connection 1
[23:25:22.382] [Forwarding server 50032] Got connection 2
[23:25:29.708] [Forwarding server 50032] Got connection 3
[23:25:49.848] [Forwarding server 50032] Got connection 4
[23:25:59.714] Failed to set up socket for dynamic port forward to remote port 46415: Proxy connection timed out. Is the remote port correct?
[23:26:19.853] Failed to set up socket for dynamic port forward to remote port 46415: Proxy connection timed out. Is the remote port correct?
[23:27:08.897] "Update SSH_AUTH_SOCK" terminal command done

@kuang-da This issue has a workaround:microsoft/vscode#132519 (comment)

@natsu90
Copy link

natsu90 commented Jun 7, 2023

I had similar problem one day when using 1.62 although it never happened before. I did Remote-SSH: Kill VS Code Server on Host then the error magically disappeared.

@RossLopez
Copy link

RossLopez commented Jun 8, 2023

For me the issue was Tailscale. I updated my .ssh/config by adding the local (non Tailscale) ip to the HostName field

@github-actions github-actions bot locked and limited conversation to collaborators Jun 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ssh Issue in vscode-remote SSH
Projects
None yet
Development

No branches or pull requests