microsoft / vscode-remote-release

Visual Studio Code Remote Development: Open any folder in WSL, in a Docker container, or on a remote machine using SSH and take advantage of VS Code's full feature set.
https://aka.ms/vscode-remote
Other
3.62k stars 277 forks source link

Cannot start remote on WSL when using fish shell #3966

Closed ElijahSink closed 3 years ago

ElijahSink commented 3 years ago

Steps to Reproduce:

  1. Use chsh to set your WSL user's shell to fish
  2. Try starting a remote session in WSL

Changing the shell back to bash resolves the issue. Log:

[2020-11-07 00:14:31.278] Resolving wsl+arch2, resolveAttempt: 1
[2020-11-07 00:14:31.391] Starting VS Code Server inside WSL (Arch2)
[2020-11-07 00:14:31.391] Extension version: 0.51.1, Windows build: 19042. Multi distro support: available. WSL path support: enabled
[2020-11-07 00:14:31.392] No shell environment set or found for current distro.
[2020-11-07 00:14:31.760] Probing if server is already installed: C:\WINDOWS\System32\wsl.exe -d Arch2 -e sh -c "[ -d ~/.vscode-server-insiders/bin/24b28f57be22fe3029cb17a1dd72d8d9c2d6468b ] && printf found || ([ -f /etc/alpine-release ] && printf alpine-; uname -m)"
[2020-11-07 00:14:32.259] Probing result: x86_64
[2020-11-07 00:14:32.259] No server install found in WSL, needs x64
[2020-11-07 00:14:32.260] Downloading server on client side to C:\Users\themi\AppData\Local\Temp\vscode-remote-wsl\24b28f57be22fe3029cb17a1dd72d8d9c2d6468b\vscode-server-linux-x64.tar.gz.
[2020-11-07 00:14:32.260] https://update.code.visualstudio.com/commit:24b28f57be22fe3029cb17a1dd72d8d9c2d6468b/server-linux-x64/insider
[2020-11-07 00:14:32.855] Download checksum: b1f7676eb7fdaf2c262c7c964d2096ea1fba293164948ffbea060f1d538b5571
[2020-11-07 00:14:38.501] Download checksum verified
[2020-11-07 00:14:38.507] Launching C:\WINDOWS\System32\wsl.exe -d Arch2 sh -c '"$VSCODE_WSL_EXT_LOCATION/scripts/wslServer.sh" 24b28f57be22fe3029cb17a1dd72d8d9c2d6468b insider .vscode-server-insiders 0  ' in c:\Users\themi\.vscode-insiders\extensions\ms-vscode-remote.remote-wsl-0.51.1}
[2020-11-07 00:16:11.583] VS Code Server for WSL failed to start. No messages received for 90s
[2020-11-07 00:16:11.584] For help with startup problems, go to
[2020-11-07 00:16:11.584] https://code.visualstudio.com/docs/remote/troubleshooting#_wsl-tips
[2020-11-07 00:16:11.599] WSL Daemon exited with code 0

I'm noticing that in the probe command, the -e flag is used, which the docs describe as "Execute the specified command without using the default Linux shell." However in the launch command, that flag is not used.

Looking at htop in another terminal, I see:

    PID USER      PRI  NI  VIRT   RES   SHR S CPU% MEM%   TIME+  Command
 309907 root       20   0  9140  3996  3464 S  0.0  0.1  0:00.01 /sbin/runuser -u ejsink -- /usr/bin/fish -c sh -c '"$VSCODE_WSL_EXT_LOCATION/scripts/wslServer.sh" 74ef0a92fe8be7034d7d5f513e31262ab77d3bf1 insider .vscode-server-insiders 0  '
 309915 ejsink     20   0  164M  6800  5680 R 138.  0.2 20:36.75 └─ /usr/bin/fish -c sh -c '"$VSCODE_WSL_EXT_LOCATION/scripts/wslServer.sh" 74ef0a92fe8be7034d7d5f513e31262ab77d3bf1 insider .vscode-server-insiders 0  '
 313169 ejsink     20   0  164M  6800  5680 R 42.1  0.2  0:00.63    └─ /usr/bin/fish -c sh -c '"$VSCODE_WSL_EXT_LOCATION/scripts/wslServer.sh" 74ef0a92fe8be7034d7d5f513e31262ab77d3bf1 insider .vscode-server-insiders 0  '
 311379 root       20   0  9140  4012  3480 S  0.0  0.1  0:00.01 /sbin/runuser -u ejsink -- /usr/bin/fish -c sh -c '"$VSCODE_WSL_EXT_LOCATION/scripts/wslServer.sh" 24b28f57be22fe3029cb17a1dd72d8d9c2d6468b insider .vscode-server-insiders 0  '
 311388 ejsink     20   0  164M  6824  5700 R 137.  0.2  6:50.93 └─ /usr/bin/fish -c sh -c '"$VSCODE_WSL_EXT_LOCATION/scripts/wslServer.sh" 24b28f57be22fe3029cb17a1dd72d8d9c2d6468b insider .vscode-server-insiders 0  '
 313163 ejsink     20   0  164M  6824  5700 S 48.1  0.2  0:00.94    └─ /usr/bin/fish -c sh -c '"$VSCODE_WSL_EXT_LOCATION/scripts/wslServer.sh" 24b28f57be22fe3029cb17a1dd72d8d9c2d6468b insider .vscode-server-insiders 0  '
 311771 root       20   0  9140  3976  3448 S  0.0  0.1  0:00.04 /sbin/runuser -u ejsink -- /usr/bin/fish -c sh -c '"$VSCODE_WSL_EXT_LOCATION/scripts/wslServer.sh" 24b28f57be22fe3029cb17a1dd72d8d9c2d6468b insider .vscode-server-insiders 0  '
 311783 ejsink     20   0  164M  6932  5796 S 138.  0.2  5:10.98 └─ /usr/bin/fish -c sh -c '"$VSCODE_WSL_EXT_LOCATION/scripts/wslServer.sh" 24b28f57be22fe3029cb17a1dd72d8d9c2d6468b insider .vscode-server-insiders 0  '
 313181 ejsink     20   0  164M  6932  5796 S  0.0  0.2  0:00.00    └─ /usr/bin/fish -c sh -c '"$VSCODE_WSL_EXT_LOCATION/scripts/wslServer.sh" 24b28f57be22fe3029cb17a1dd72d8d9c2d6468b insider .vscode-server-insiders 0  '

Note the orphaned server processes and the high CPU usage.

Does this issue occur when you try this locally?: No Does this issue occur when you try this locally and all extensions are disabled?: No

aeschli commented 3 years ago

Can you add "remote.WSL.debug": true to the settings for more logging?

ElijahSink commented 3 years ago

Yep! This log is from a different machine which demonstrates the same behavior:

[2020-11-12 08:53:02.691] Resolving wsl+Arch, resolveAttempt: 1
[2020-11-12 08:53:02.724] Starting VS Code Server inside WSL (Arch)
[2020-11-12 08:53:02.724] Extension version: 0.51.3, Windows build: 19042. Multi distro support: available. WSL path support: enabled
[2020-11-12 08:53:02.725] No shell environment set or found for current distro.
[2020-11-12 08:53:02.812] Probing if server is already installed: C:\Windows\System32\wsl.exe -d Arch -e sh -c "[ -d ~/.vscode-server/bin/fcac248b077b55bae4ba5bab613fd6e9156c2f0c ] && printf found || ([ -f /etc/alpine-release ] && printf alpine-; uname -m)"
[2020-11-12 08:53:02.896] Probing result: found
[2020-11-12 08:53:02.896] Server install found in WSL
[2020-11-12 08:53:02.896] Launching C:\Windows\System32\wsl.exe -d Arch sh -c 'env && VSCODE_WSL_DEBUG_INFO=true "$VSCODE_WSL_EXT_LOCATION/scripts/wslServer.sh" fcac248b077b55bae4ba5bab613fd6e9156c2f0c stable .vscode-server 0  ' in c:\Users\ejsink\.vscode\extensions\ms-vscode-remote.remote-wsl-0.51.3, env: {
[2020-11-12 08:53:02.896]   "ALLUSERSPROFILE": "C:\\ProgramData",
[2020-11-12 08:53:02.896]   "AMDRMPATH": "C:\\Program Files\\AMD\\RyzenMaster\\",
[2020-11-12 08:53:02.896]   "AMD_ENTRYPOINT": "vs/workbench/services/extensions/node/extensionHostProcess",
[2020-11-12 08:53:02.896]   "APPDATA": "C:\\Users\\ejsink\\AppData\\Roaming",
[2020-11-12 08:53:02.896]   "APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL": "true",
[2020-11-12 08:53:02.896]   "CHROME_CRASHPAD_PIPE_NAME": "\\\\.\\pipe\\crashpad_19368_LKTOGHUCDDAKHJAC",
[2020-11-12 08:53:02.896]   "CommonProgramFiles": "C:\\Program Files\\Common Files",
[2020-11-12 08:53:02.896]   "CommonProgramFiles(x86)": "C:\\Program Files (x86)\\Common Files",
[2020-11-12 08:53:02.896]   "CommonProgramW6432": "C:\\Program Files\\Common Files",
[2020-11-12 08:53:02.896]   "COMPUTERNAME": "GALILEO",
[2020-11-12 08:53:02.896]   "ComSpec": "C:\\Windows\\system32\\cmd.exe",
[2020-11-12 08:53:02.896]   "DriverData": "C:\\Windows\\System32\\Drivers\\DriverData",
[2020-11-12 08:53:02.896]   "ELECTRON_RUN_AS_NODE": "1",
[2020-11-12 08:53:02.896]   "HOMEDRIVE": "C:",
[2020-11-12 08:53:02.896]   "HOMEPATH": "\\Users\\ejsink",
[2020-11-12 08:53:02.896]   "LOCALAPPDATA": "C:\\Users\\ejsink\\AppData\\Local",
[2020-11-12 08:53:02.896]   "LOGONSERVER": "\\\\GALILEO",
[2020-11-12 08:53:02.896]   "NUMBER_OF_PROCESSORS": "12",
[2020-11-12 08:53:02.896]   "OneDrive": "C:\\Users\\ejsink\\OneDrive",
[2020-11-12 08:53:02.896]   "OneDriveConsumer": "C:\\Users\\ejsink\\OneDrive",
[2020-11-12 08:53:02.896]   "ORIGINAL_XDG_CURRENT_DESKTOP": "undefined",
[2020-11-12 08:53:02.896]   "OS": "Windows_NT",
[2020-11-12 08:53:02.896]   "Path": "C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\;C:\\Program Files\\NVIDIA Corporation\\NVIDIA NvDLISR;C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\Program Files\\Git\\cmd;C:\\Users\\ejsink\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\ejsink\\AppData\\Local\\Programs\\Microsoft VS Code\\bin",
[2020-11-12 08:53:02.896]   "PATHEXT": ".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC",
[2020-11-12 08:53:02.896]   "PIPE_LOGGING": "true",
[2020-11-12 08:53:02.896]   "PROCESSOR_ARCHITECTURE": "AMD64",
[2020-11-12 08:53:02.896]   "PROCESSOR_IDENTIFIER": "AMD64 Family 23 Model 113 Stepping 0, AuthenticAMD",
[2020-11-12 08:53:02.896]   "PROCESSOR_LEVEL": "23",
[2020-11-12 08:53:02.896]   "PROCESSOR_REVISION": "7100",
[2020-11-12 08:53:02.896]   "ProgramData": "C:\\ProgramData",
[2020-11-12 08:53:02.896]   "ProgramFiles": "C:\\Program Files",
[2020-11-12 08:53:02.896]   "ProgramFiles(x86)": "C:\\Program Files (x86)",
[2020-11-12 08:53:02.896]   "ProgramW6432": "C:\\Program Files",
[2020-11-12 08:53:02.896]   "PSModulePath": "C:\\Program Files\\WindowsPowerShell\\Modules;C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\Modules",
[2020-11-12 08:53:02.896]   "PUBLIC": "C:\\Users\\Public",
[2020-11-12 08:53:02.896]   "SystemDrive": "C:",
[2020-11-12 08:53:02.896]   "SystemRoot": "C:\\Windows",
[2020-11-12 08:53:02.896]   "TEMP": "C:\\Users\\ejsink\\AppData\\Local\\Temp",
[2020-11-12 08:53:02.896]   "TMP": "C:\\Users\\ejsink\\AppData\\Local\\Temp",
[2020-11-12 08:53:02.896]   "USERDOMAIN": "GALILEO",
[2020-11-12 08:53:02.896]   "USERDOMAIN_ROAMINGPROFILE": "GALILEO",
[2020-11-12 08:53:02.896]   "USERNAME": "Elijah Sink",
[2020-11-12 08:53:02.896]   "USERPROFILE": "C:\\Users\\ejsink",
[2020-11-12 08:53:02.896]   "VERBOSE_LOGGING": "true",
[2020-11-12 08:53:02.896]   "VSCODE_CWD": "C:\\Windows\\system32",
[2020-11-12 08:53:02.896]   "VSCODE_FILE_WATCHER_POLLING": "0",
[2020-11-12 08:53:02.896]   "VSCODE_HANDLES_UNCAUGHT_ERRORS": "true",
[2020-11-12 08:53:02.896]   "VSCODE_IPC_HOOK": "\\\\.\\pipe\\4a0aff238063a409bbc05b76283c1a00-1.51.0-main-sock",
[2020-11-12 08:53:02.896]   "VSCODE_IPC_HOOK_EXTHOST": "\\\\.\\pipe\\vscode-ipc-b5c921a9-d2ae-4790-8c4e-5691bdd40430-sock",
[2020-11-12 08:53:02.896]   "VSCODE_LOGS": "C:\\Users\\ejsink\\AppData\\Roaming\\Code\\logs\\20201112T001047",
[2020-11-12 08:53:02.896]   "VSCODE_LOG_STACK": "false",
[2020-11-12 08:53:02.896]   "VSCODE_NLS_CONFIG": "{\"locale\":\"en-us\",\"availableLanguages\":{},\"_languagePackSupport\":true}",
[2020-11-12 08:53:02.896]   "VSCODE_NODE_CACHED_DATA_DIR": "C:\\Users\\ejsink\\AppData\\Roaming\\Code\\CachedData\\fcac248b077b55bae4ba5bab613fd6e9156c2f0c",
[2020-11-12 08:53:02.896]   "VSCODE_PID": "19368",
[2020-11-12 08:53:02.896]   "VSCODE_WSL_AGENT_DEBUG_PORT": "",
[2020-11-12 08:53:02.896]   "VSCODE_WSL_APP_ROOT": "c:\\Users\\ejsink\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app",
[2020-11-12 08:53:02.896]   "VSCODE_WSL_DEBUG_INFO": "true",
[2020-11-12 08:53:02.896]   "VSCODE_WSL_DEFAULT_DISTRO": "Arch",
[2020-11-12 08:53:02.896]   "VSCODE_WSL_DISTRO": "Arch",
[2020-11-12 08:53:02.896]   "VSCODE_WSL_ENABLE_TELEMETRY": "true",
[2020-11-12 08:53:02.896]   "VSCODE_WSL_EXT_HOST_PID": "35616",
[2020-11-12 08:53:02.896]   "VSCODE_WSL_EXT_LOCATION": "c:\\Users\\ejsink\\.vscode\\extensions\\ms-vscode-remote.remote-wsl-0.51.3",
[2020-11-12 08:53:02.896]   "VSCODE_WSL_PIPE_NAME": "\\\\.\\pipe\\vscode-wsl-4e4ca89af820b22fd5ee64fa98a408caee272f4a-sock",
[2020-11-12 08:53:02.896]   "windir": "C:\\Windows",
[2020-11-12 08:53:02.896]   "WSLENV": "VSCODE_WSL_EXT_LOCATION/up"
[2020-11-12 08:53:02.896] }}
[2020-11-12 08:54:35.933] VS Code Server for WSL failed to start. No messages received for 90s
[2020-11-12 08:54:35.933] For help with startup problems, go to
[2020-11-12 08:54:35.933] https://code.visualstudio.com/docs/remote/troubleshooting#_wsl-tips
[2020-11-12 08:54:35.941] WSL Daemon exited with code 0
kherdier commented 3 years ago

This could help as a temporary workaround, the main issue being I can't switch to bash when I need to.

ElijahSink commented 3 years ago

@kherdier I'm trying something similar, seems like it's functionally the same:

# Execute `fish` in interactive mode
if [ -z "$PS1" ]; then
        echo 'This shell is not interactive. Will keep using bash to make VS Code Remote work.'
else
        echo 'This shell is interactive. Will switch to fish.'
        exec fish
fi

this seems to be working acceptably, although like you said, now I can't use bash.

ElijahSink commented 3 years ago

@aeschli Any update on this? Is there any other information that I can provide?

aeschli commented 3 years ago

The recommended way to change the default shell is by using chsh. See https://blog.evalcode.com/zsh-default-wsl-windows-10/

We need to run the server without -e otherwise we don't know what the default shell is...

ElijahSink commented 3 years ago

I agree that chsh is the right way to do it, but unfortunately it causes this issue.

Why do we need to know what the default shell is?

aeschli commented 3 years ago

The server later starts the extension host process, built-in terminal, debuggers, etc, all relying on a properly initialized environment, including the SHELL env variable.

I just tried the set fish as the default shell and start VSCode and didn't get any errors:

Please make sure there's noting in your startup scripts that prevent server startup.

ElijahSink commented 3 years ago

Is there some sort of logging on the server side that I could view or enable? I use fish as my daily driver and have no issues with its startup. Maybe there's something in the ENV which is conflicting?

iblazhko commented 3 years ago

Edit: comment below was moved to a separate issue #4146


I have a very similar problem with VSCode Remote, but on SSH.

Version: 1.53.0-exploration Local OS Version: macOS BigSur 11.0.1 (Apple M1) Remote OS Version: Debian (MX Linux 19.3 x86_64) Remote Extension/Connection Type: SSH

At first, connection is established successfully:

[07:00:16.341] > Linux dev-box 5.8.0-3-amd64 #1 SMP Debian 5.8.14-1~mx19+2 (2020-10-25) x86_64
> No mail.

(2nd line is a Fish prompt)

But after a few seconds there is an error

[07:00:32.554] Terminating local server
[07:00:32.566] Resolver error: Error: Connecting with SSH timed out
[07:00:32.568] Local server exit: 15

Full client log:

[07:00:15.368] Log Level: 1
[07:00:15.369] remote-ssh@0.58.0
[07:00:15.369] darwin arm64
[07:00:15.370] SSH Resolver called for "ssh-remote+dev-box", attempt 1
[07:00:15.370] "remote.SSH.useLocalServer": true
[07:00:15.370] "remote.SSH.sshPath": undefined
[07:00:15.370] "remote.SSH.sshConfigurationFile": undefined
[07:00:15.370] "remote.SSH.useFlock": true
[07:00:15.370] "remote.SSH.lockfilesInTmp": false
[07:00:15.370] "remote.SSH.localServerDownload": auto
[07:00:15.370] "remote.SSH.remoteServerListenOnSocket": false
[07:00:15.370] "remote.SSH.showLoginTerminal": false
[07:00:15.370] "remote.SSH.maxReconnectionAttempts": 9007199254740991
[07:00:15.371] SSH Resolver called for host: dev-box
[07:00:15.371] Setting up SSH remote "dev-box"
[07:00:15.372] Acquiring local install lock: /var/folders/xw/3d8ppqw12wd559tmlt21zddc0000gn/T/vscode-remote-ssh-dev-box-install.lock
[07:00:15.427] Looking for existing server data file at /Users/dev-user/Library/Application Support/Code - Exploration/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-dev-box-32570a22cce64af05302826be2175050663a1c93-0.58.0/data.json
[07:00:15.427] Using commit id "32570a22cce64af05302826be2175050663a1c93" and quality "exploration" for server
[07:00:15.428] Install and start server if needed
[07:00:15.430] Checking ssh with "ssh -V"
[07:00:15.487] > OpenSSH_8.1p1, LibreSSL 2.7.3

[07:00:15.496] askpass server listening on /var/folders/xw/3d8ppqw12wd559tmlt21zddc0000gn/T/vscode-ssh-askpass-51b5458f2a2aca043694d45152f82a9b55b5bbe1.sock
[07:00:15.496] Spawning local server with {"ipcHandlePath":"/var/folders/xw/3d8ppqw12wd559tmlt21zddc0000gn/T/vscode-ssh-askpass-9a4d07aef161469eb261d6b7ffd1462039ddbb7e.sock","sshCommand":"ssh","sshArgs":["-v","-T","-D","55280","-o","ConnectTimeout=15","dev-box"],"dataFilePath":"/Users/dev-user/Library/Application Support/Code - Exploration/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-dev-box-32570a22cce64af05302826be2175050663a1c93-0.58.0/data.json"}
[07:00:15.497] Local server env: {"DISPLAY":"1","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"/Users/dev-user/.vscode-exploration/extensions/ms-vscode-remote.remote-ssh-0.58.0/out/local-server/askpass.sh","VSCODE_SSH_ASKPASS_NODE":"/Applications/Visual Studio Code - Exploration.app/Contents/Frameworks/Code - Exploration Helper (Renderer).app/Contents/MacOS/Code - Exploration Helper (Renderer)","VSCODE_SSH_ASKPASS_MAIN":"/Users/dev-user/.vscode-exploration/extensions/ms-vscode-remote.remote-ssh-0.58.0/out/askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"/var/folders/xw/3d8ppqw12wd559tmlt21zddc0000gn/T/vscode-ssh-askpass-51b5458f2a2aca043694d45152f82a9b55b5bbe1.sock"}
[07:00:15.548] Spawned 3848
[07:00:15.640] > local-server> Spawned ssh: 3849
[07:00:15.642] stderr> OpenSSH_8.1p1, LibreSSL 2.7.3
[07:00:15.642] stderr> debug1: Reading configuration data /Users/dev-user/.ssh/config
[07:00:15.642] stderr> debug1: /Users/dev-user/.ssh/config line 1: Applying options for *
[07:00:15.642] stderr> debug1: /Users/dev-user/.ssh/config line 6: Applying options for dev-box
[07:00:15.642] stderr> debug1: Reading configuration data /etc/ssh/ssh_config
[07:00:15.642] stderr> debug1: /etc/ssh/ssh_config line 47: Applying options for *
[07:00:15.647] stderr> debug1: Connecting to dev-box [192.168.2.101] port 22.
[07:00:15.663] stderr> debug1: fd 5 clearing O_NONBLOCK
[07:00:15.663] stderr> debug1: Connection established.
[07:00:15.664] stderr> debug1: identity file /Users/dev-user/.ssh/IB-MacMini type 0
[07:00:15.664] stderr> debug1: identity file /Users/dev-user/.ssh/IB-MacMini-cert type -1
[07:00:15.664] stderr> debug1: Local version string SSH-2.0-OpenSSH_8.1
[07:00:15.664] stderr> debug1: Remote protocol version 2.0, remote software version OpenSSH_7.9p1 Debian-10+deb10u2
[07:00:15.664] stderr> debug1: match: OpenSSH_7.9p1 Debian-10+deb10u2 pat OpenSSH* compat 0x04000000
[07:00:15.664] stderr> debug1: Authenticating to dev-box:22 as 'dev-user'
[07:00:15.666] stderr> debug1: SSH2_MSG_KEXINIT sent
[07:00:15.666] stderr> debug1: SSH2_MSG_KEXINIT received
[07:00:15.666] stderr> debug1: kex: algorithm: curve25519-sha256
[07:00:15.666] stderr> debug1: kex: host key algorithm: ecdsa-sha2-nistp256
[07:00:15.666] stderr> debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
[07:00:15.667] stderr> debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
[07:00:15.667] stderr> debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
[07:00:15.677] stderr> debug1: Server host key: ecdsa-sha2-nistp256 SHA256:pPYvQ7vlVnqfnIksGs1t2V2oP6dqwr3hoDWC16vlmr0
[07:00:15.682] stderr> debug1: Host 'dev-box' is known and matches the ECDSA host key.
[07:00:15.682] stderr> debug1: Found key in /Users/dev-user/.ssh/known_hosts:6
[07:00:15.686] stderr> debug1: rekey out after 134217728 blocks
[07:00:15.687] stderr> debug1: SSH2_MSG_NEWKEYS sent
[07:00:15.687] stderr> debug1: expecting SSH2_MSG_NEWKEYS
[07:00:15.687] stderr> debug1: SSH2_MSG_NEWKEYS received
[07:00:15.687] stderr> debug1: rekey in after 134217728 blocks
[07:00:15.687] stderr> debug1: Will attempt key: /Users/dev-user/.ssh/IB-MacMini RSA SHA256:1EjzUxmkYl8xLa5zYPHaLdOeVBzA66FfB8h5tSVeV9M explicit agent
[07:00:15.687] stderr> debug1: SSH2_MSG_EXT_INFO received
[07:00:15.687] stderr> debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>
[07:00:15.688] stderr> debug1: SSH2_MSG_SERVICE_ACCEPT received
[07:00:15.697] stderr> debug1: Authentications that can continue: publickey,password
[07:00:15.697] stderr> debug1: Next authentication method: publickey
[07:00:15.697] stderr> debug1: Offering public key: /Users/dev-user/.ssh/IB-MacMini RSA SHA256:1EjzUxmkYl8xLa5zYPHaLdOeVBzA66FfB8h5tSVeV9M explicit agent
[07:00:15.698] stderr> debug1: Server accepts key: /Users/dev-user/.ssh/IB-MacMini RSA SHA256:1EjzUxmkYl8xLa5zYPHaLdOeVBzA66FfB8h5tSVeV9M explicit agent
[07:00:16.290] stderr> debug1: Authentication succeeded (publickey).
[07:00:16.290] stderr> Authenticated to dev-box ([192.168.2.101]:22).
[07:00:16.290] stderr> debug1: Local connections to LOCALHOST:55280 forwarded to remote address socks:0
[07:00:16.290] stderr> debug1: Local forwarding listening on ::1 port 55280.
[07:00:16.290] stderr> debug1: channel 0: new [port listener]
[07:00:16.290] stderr> debug1: Local forwarding listening on 127.0.0.1 port 55280.
[07:00:16.290] stderr> debug1: channel 1: new [port listener]
[07:00:16.290] stderr> debug1: channel 2: new [client-session]
[07:00:16.290] stderr> debug1: Requesting no-more-sessions@openssh.com
[07:00:16.290] stderr> debug1: Entering interactive session.
[07:00:16.290] stderr> debug1: pledge: network
[07:00:16.340] stderr> debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
[07:00:16.340] stderr> debug1: Remote: /home/dev-user/.ssh/authorized_keys:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
[07:00:16.340] stderr> debug1: Remote: /home/dev-user/.ssh/authorized_keys:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
[07:00:16.340] stderr> debug1: Sending environment.
[07:00:16.340] stderr> debug1: Sending env LC_CTYPE = en_US.UTF-8
[07:00:16.341] > Linux dev-box 5.8.0-3-amd64 #1 SMP Debian 5.8.14-1~mx19+2 (2020-10-25) x86_64
> No mail.
[07:00:32.554] Terminating local server
[07:00:32.566] Resolver error: Error: Connecting with SSH timed out
    at Function.Timeout (/Users/dev-user/.vscode-exploration/extensions/ms-vscode-remote.remote-ssh-0.58.0/out/extension.js:1:82387)
    at Timeout._onTimeout (/Users/dev-user/.vscode-exploration/extensions/ms-vscode-remote.remote-ssh-0.58.0/out/extension.js:1:276370)
    at listOnTimeout (internal/timers.js:549:17)
    at processTimers (internal/timers.js:492:7)
[07:00:32.568] Local server exit: 15
[07:00:32.570] TELEMETRY: {"eventName":"resolver","properties":{"outcome":"failure","reason":"Timeout","exitCodeLabel":"","osReleaseId":"","arch":"","askedPw":"0","askedPassphrase":"0","asked2fa":"0","askedHostKey":"0","remoteInConfigFile":"1","gotUnrecognizedPrompt":"0","dynamicForwarding":"1","localServer":"1"},"measures":{"resolveAttempts":1,"retries":1,"timing.totalResolveTime":17187,"timing.preSshTime":127}}
[07:00:32.571] ------

Server log (from /var/log/auth.log):

Dec  7 07:14:27 dev-box sudo: dev-user : TTY=pts/2 ; PWD=/home/dev-user ; USER=root ; COMMAND=/usr/bin/tail -1000 /var/log/auth.log
Dec  7 07:14:27 dev-box sudo: pam_unix(sudo:session): session opened for user root by dev-user(uid=0)
Dec  7 07:14:31 dev-box sudo: pam_unix(sudo:session): session closed for user root
Dec  7 07:15:11 dev-box sshd[7030]: Accepted publickey for dev-user from 192.168.2.129 port 55529 ssh2: RSA SHA256:1EjzUxmkYl8xLa5zYPHaLdOeVBzA66FfB8h5tSVeV9M
Dec  7 07:15:11 dev-box sshd[7030]: pam_unix(sshd:session): session opened for user dev-user by (uid=0)
Dec  7 07:15:14 dev-box sudo: dev-user : TTY=unknown ; PWD=/home/dev-user ; USER=root ; COMMAND=/usr/bin/lsof /var/lib/dpkg/lock /var/lib/dpkg/lock-frontend /var/lib/apt/lists/lock /var/cache/apt/archives/lock
Dec  7 07:15:14 dev-box sudo: pam_unix(sudo:session): session opened for user root by (uid=0)
Dec  7 07:15:14 dev-box sudo: pam_unix(sudo:session): session closed for user root
Dec  7 07:15:28 dev-box sshd[7044]: Received disconnect from 192.168.2.129 port 55529:11: disconnected by user
Dec  7 07:15:28 dev-box sshd[7044]: Disconnected from user dev-user 192.168.2.129 port 55529
Dec  7 07:15:28 dev-box sshd[7030]: pam_unix(sshd:session): session closed for user dev-user

I can ssh into that server just fine, here is the environment from ssh session if that helps:

> set

CMD_DURATION 2250
COLUMNS 175
EMC_CMD emc
EMC_EDITOR nano
FISH_VERSION 3.0.2
HOME /home/dev-user
IFS \n\ \t
LANG en_GB.UTF-8
LINES 50
LOGNAME dev-user
LS_COLORS 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=…
MAIL /var/mail/dev-user
PATH '/usr/local/bin'  '/usr/bin'  '/bin'  '/usr/games'
PWD /home/dev-user
SHELL /usr/bin/fish
SHLVL 1
SPACEFISH_PROMPT_ORDER 'time'  'user'  'dir'  'host'  'git'  'docker'  'rust'  'has…
SSH_CLIENT '192.168.2.129 55124 22'
SSH_CONNECTION '192.168.2.129 55124 192.168.2.101 22'
SSH_TTY /dev/pts/2
TERM xterm-256color
USER dev-user
VIRTUAL_ENV_DISABLE_PROMPT 1
XDG_RUNTIME_DIR /run/user/1000
XDG_SESSION_CLASS user
XDG_SESSION_ID 165
XDG_SESSION_TYPE tty
...

Same version of VSCode Remote SSH works fine with the same server if I change login shell from fish to bash or zsh.

aeschli commented 3 years ago

@iblazhko The way the VSCode server is started in Remote SSH and Remote WSL is quite different, please file a new issue so I can assign it to SSH.

aeschli commented 3 years ago

@ElijahSink You need to looks at your shell initialization scripts. You can try tp add a set -x to enable tracing.

github-actions[bot] commented 3 years ago

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!