Software | Version |
---|---|
Client Machine OS | Windows 10 x64 |
Target Machine OS | Ubuntu 20.04.4 LTS (GNU/Linux 5.4.0-100-generic x86_64) |
VS Code | 1.65.0 |
VS Code Remote - SSH (Stable) | 0.76.1 |
I'm trying to use the Remote SSH extension in VS Code to edit files on a remote server. In C:\Users\me\.ssh\config
I have the following host configured:
Host druid
HostName mydomain.com
Port 22
User myuser
IdentityFile "K:\PathToKey\id_ed25519"
When trying to connect to this target host, I'm prompted for its OS type, then sometimes the key's password, then it fails. I get the following output:
[21:35:06.080] Log Level: 2
[21:35:06.082] remote-ssh@0.76.1
[21:35:06.082] win32 x64
[21:35:06.091] SSH Resolver called for "ssh-remote+druid", attempt 1
[21:35:06.092] "remote.SSH.useLocalServer": false
[21:35:06.092] "remote.SSH.showLoginTerminal": false
[21:35:06.092] "remote.SSH.remotePlatform": {}
[21:35:06.095] "remote.SSH.path": undefined
[21:35:06.095] "remote.SSH.configFile": undefined
[21:35:06.095] "remote.SSH.useFlock": true
[21:35:06.095] "remote.SSH.lockfilesInTmp": false
[21:35:06.096] "remote.SSH.localServerDownload": auto
[21:35:06.096] "remote.SSH.remoteServerListenOnSocket": false
[21:35:06.096] "remote.SSH.showLoginTerminal": false
[21:35:06.096] "remote.SSH.defaultExtensions": []
[21:35:06.096] "remote.SSH.loglevel": 2
[21:35:06.096] "remote.SSH.enableDynamicForwarding": true
[21:35:06.097] "remote.SSH.enableRemoteCommand": false
[21:35:06.097] "remote.SSH.serverPickPortsFromRange": {}
[21:35:06.097] "remote.SSH.serverInstallPath": {}
[21:35:06.138] SSH Resolver called for host: druid
[21:35:06.138] Setting up SSH remote "druid"
[21:35:06.151] Using commit id "b52...d43" and quality "stable" for server
[21:35:06.155] Install and start server if needed
[21:35:07.663] Checking ssh with "ssh -V"
[21:35:07.709] > OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2
[21:35:07.714] Running script with connection command: ssh -T -D 65124 druid bash
[21:35:07.718] Terminal shell path: C:\Windows\System32\cmd.exe
[21:35:07.955] > ]0;C:\Windows\System32\cmd.exe
[21:35:07.956] Got some output, clearing connection timeout
[21:35:09.262] > /bin/bash: No such file or directory
[21:35:10.541] "install" terminal command done
[21:35:10.542] Install terminal quit with output: ]0;C:\Windows\System32\cmd.exe/bin/bash: No such file or directory
[21:35:10.542] Received install output: ]0;C:\Windows\System32\cmd.exe/bin/bash: No such file or directory
[21:35:10.543] Failed to parse remote port from server output
[21:35:10.544] Resolver error: Error:
at Function.Create (c:\Users\me\.vscode\extensions\ms-vscode-remote.remote-ssh-0.76.1\out\extension.js:1:586041)
at Object.t.handleInstallOutput (c:\Users\me\.vscode\extensions\ms-vscode-remote.remote-ssh-0.76.1\out\extension.js:1:584693)
at Object.t.tryInstall (c:\Users\me\.vscode\extensions\ms-vscode-remote.remote-ssh-0.76.1\out\extension.js:1:681846)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async c:\Users\me\.vscode\extensions\ms-vscode-remote.remote-ssh-0.76.1\out\extension.js:1:644486
at async Object.t.withShowDetailsEvent (c:\Users\me\.vscode\extensions\ms-vscode-remote.remote-ssh-0.76.1\out\extension.js:1:647831)
at async Object.t.resolve (c:\Users\me\.vscode\extensions\ms-vscode-remote.remote-ssh-0.76.1\out\extension.js:1:645565)
at async c:\Users\me\.vscode\extensions\ms-vscode-remote.remote-ssh-0.76.1\out\extension.js:1:722872
[21:35:10.550] ------
I believe these lines in particular point to the root of the problem:
[21:35:07.714] Running script with connection command: ssh -T -D 65124 druid bash
[21:35:07.718] Terminal shell path: C:\Windows\System32\cmd.exe
[21:35:07.955] > ]0;C:\Windows\System32\cmd.exe
[21:35:07.956] Got some output, clearing connection timeout
[21:35:09.262] > /bin/bash: No such file or directory
[21:35:10.541] "install" terminal command done
[21:35:10.542] Install terminal quit with output: ]0;C:\Windows\System32\cmd.exe/bin/bash: No such file or directory
[21:35:10.542] Received install output: ]0;C:\Windows\System32\cmd.exe/bin/bash: No such file or directory
It looks like the code or script of the plugin is trying to run /bin/bash (on the client machine?), but it's using cmd.exe to do so unsuccessfully. I've tried every workaround I could find, but none have worked so far. For reference, I've tried:
- Switching
remote.SSH.useLocalServer
betweentrue
andfalse
in
C:\Users\me\AppData\Roaming\Code\User\settings.json
- Pointing a
"PATH"
value toC:\Program Files\Git\usr\bin
,C:\Program Files\Git\bin
, or nothing at all (""
) in theterminal.integrated.shell.windows
andterminal.integrated.shell.linux
settings in my VS Codesettings.json
, hoping it would pick upbash.exe
, or at least override something incorrectly set elsewhere - Setting the default terminal profile to either Git Bash or Ubuntu (WSL)
- Specifying an absolute path to both the ssh executable and the config file in Remote.SSH settings
- Running
ssh -T -D 65124 druid bash
in a PowerShell terminal to compare with Remote SSH output (gives one line:/bin/bash: No such file or directory
) - Running
ldd /bin/bash
on both the target machine and in an Ubuntu WSL terminal to compare output (identical) - Checking home directories for a
.vscode-server
directory to delete and regenerate, as suggested here - Running
Remote-SSH: Kill VS Code Server on Host...
in the VS Code Command Palette on client machine, which may or may not do the same thing as the solution above - Uninstalling and reinstalling the Remote SSH VS Code extension
I was hoping that I'd figure it out in the process of writing this all down and retracing my steps, but I'm still at a loss. Any advice would be much appreciated!