[Remote-SSH Bug]: code command not found on fresh install
Is there an existing issue for this bug?
- [X] I have searched the existing issues
Required Troubleshooting Steps
- [X] I have followed these troubleshooting steps
- [ ] I have tried both values of the
remote.SSH.useLocalServersetting
Connect Locally
It connects successfully
->
No response
Expected Behavior
vscode binaries to be added to the path allowing usage of code when in the integrated terminal.
Steps To Reproduce
I am setting up a raspberry pi with Raspberry Pi OS Lite (64 bit). All I have done is mount some drives and merge them with mergerfs. I updated and upgraded the pi, running Debian 12 (bookworm).
I then connect using the remote explorer tab in vscode, using my ssh config with the key already copied over. The vscode-server installs. I open the vscode integrated terminal and get command not found when using code.
Remote-SSH Log
Remote-SSH Log
[22:02:18.918] Log Level: 2
[22:02:18.934] VS Code version: 1.85.2
[22:02:18.934] Remote-SSH version: [email protected]
[22:02:18.934] win32 x64
[22:02:18.978] SSH Resolver called for "ssh-remote+m-pi", attempt 1
[22:02:18.979] "remote.SSH.useLocalServer": false
[22:02:18.979] "remote.SSH.useExecServer": false
[22:02:18.979] "remote.SSH.showLoginTerminal": false
[22:02:18.979] "remote.SSH.remotePlatform": {"gimli.chpc.utah.edu":"linux","gimli":"linux","m-pi":"linux","co2":"linux"}
[22:02:18.979] "remote.SSH.path": undefined
[22:02:18.979] "remote.SSH.configFile": undefined
[22:02:18.979] "remote.SSH.useFlock": true
[22:02:18.980] "remote.SSH.lockfilesInTmp": false
[22:02:18.980] "remote.SSH.localServerDownload": auto
[22:02:18.980] "remote.SSH.remoteServerListenOnSocket": false
[22:02:18.980] "remote.SSH.showLoginTerminal": false
[22:02:18.980] "remote.SSH.defaultExtensions": []
[22:02:18.980] "remote.SSH.loglevel": 2
[22:02:18.980] "remote.SSH.enableDynamicForwarding": true
[22:02:18.980] "remote.SSH.enableRemoteCommand": false
[22:02:18.980] "remote.SSH.serverPickPortsFromRange": {}
[22:02:18.980] "remote.SSH.serverInstallPath": {}
[22:02:18.984] SSH Resolver called for host: m-pi
[22:02:18.984] Setting up SSH remote "m-pi"
[22:02:18.987] Using commit id "8b3775030ed1a69b13e4f4c628c612102e30a681" and quality "stable" for server
[22:02:18.988] Install and start server if needed
[22:02:18.992] Checking ssh with "C:\Windows\system32\ssh.exe -V"
[22:02:18.995] Got error from ssh: spawn C:\Windows\system32\ssh.exe ENOENT
[22:02:18.996] Checking ssh with "C:\Windows\ssh.exe -V"
[22:02:18.996] Got error from ssh: spawn C:\Windows\ssh.exe ENOENT
[22:02:18.996] Checking ssh with "C:\Windows\System32\Wbem\ssh.exe -V"
[22:02:18.997] Got error from ssh: spawn C:\Windows\System32\Wbem\ssh.exe ENOENT
[22:02:18.997] Checking ssh with "C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe -V"
[22:02:18.998] Got error from ssh: spawn C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe ENOENT
[22:02:18.998] Checking ssh with "C:\Windows\System32\OpenSSH\ssh.exe -V"
[22:02:19.019] > OpenSSH_for_Windows_8.6p1, LibreSSL 3.4.3
[22:02:19.021] Running script with connection command: "C:\Windows\System32\OpenSSH\ssh.exe" -T -D 60368 "m-pi" bash
[22:02:19.023] Terminal shell path: C:\Windows\System32\cmd.exe
[22:02:19.450] > Enter passphrase for key 'C:\Users\james/.ssh/keys/m-pi':]0;C:\Windows\System32\cmd.exe
[22:02:19.451] Got some output, clearing connection timeout
[22:02:19.451] Detected passphrase message
[22:02:23.430] Got passphrase response
[22:02:23.430] "install" wrote data to terminal: "*************"
[22:02:23.480] >
[22:02:23.716] > ecac0c2e0d14: running
[22:02:23.767] > Acquiring lock on /home/james/.vscode-server/bin/8b3775030ed1a69b13e4f4c628c612102e30a681/vscode-remote-lock.james.8b3775030ed1a69b13e4f4c628c612102e30a681
> Installing to /home/james/.vscode-server/bin/8b3775030ed1a69b13e4f4c628c612102e30a681...
[22:02:23.783] > ecac0c2e0d14%%1%%
> Downloading with wget
[22:02:32.002] > Download complete
> ecac0c2e0d14%%2%%
> tar --version:
> tar (GNU tar) 1.34
> Copyright (C) 2021 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.
>
[22:02:34.539] > Checking /home/james/.vscode-server/.8b3775030ed1a69b13e4f4c628c612102e30a681.log and /home/james/.vscode-server/.8b3775030ed1a69b13e4f4c628c612102e30a681.pid for a running server
[22:02:34.571] > Running ssh connection command... /home/james/.vscode-server/bin/8b3775030ed1a69b13e4f4c628c612102e30a681/bin/code-server --start-server --host=127.0.0.1 --accept-server-license-terms --enable-remote-auto-shutdown --port=0 --telemetry-level all &> "/home/james/.vscode-server/.8b3775030ed1a69b13e4f4c628c612102e30a681.log" < /dev/null
> printenv:
> SHELL=/bin/bash
> PWD=/home/james
> LOGNAME=james
> XDG_SESSION_TYPE=tty
> MOTD_SHOWN=pam
> HOME=/home/james
> LANG=en_GB.UTF-8
> VSCODE_AGENT_FOLDER=/home/james/.vscode-server
> SSH_CONNECTION=192.168.1.163 60369 192.168.1.174 22
> XDG_SESSION_CLASS=user
> USER=james
> SHLVL=1
> XDG_SESSION_ID=24
> XDG_RUNTIME_DIR=/run/user/1000
> SSH_CLIENT=192.168.1.163 60369 22
> PATH=/usr/local/bin:/usr/bin:/bin:/usr/games
> DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
> _=/usr/bin/printenv
> OLDPWD=/home/james/.vscode-server/bin/8b3775030ed1a69b13e4f4c628c612102e30a6
> 681
> rm: cannot remove '/home/james/.vscode-server/.8b3775030ed1a69b13e4f4c628c612102
> 2e30a681.token': No such file or directory
> Spawned remote server: 6927
[22:02:34.587] > Waiting for server log...
[22:02:34.604] >
[22:02:34.629] > Waiting for server log...
[22:02:34.637] >
[22:02:34.659] > Waiting for server log...
[22:02:34.699] > Waiting for server log...
[22:02:34.718] >
[22:02:34.736] > Waiting for server log...
[22:02:34.765] >
[22:02:34.784] >
> *
> * 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).
> *
>
[22:02:34.803] >
> ecac0c2e0d14: start
> SSH_AUTH_SOCK====
> DISPLAY====
> webUiAccessToken====
> listeningOn==38507==
> osReleaseId==debian==
> arch==aarch64==
> vscodeArch==arm64==
> bitness==64==
> tmpDir==/run/user/1000==
> platform==linux==
> unpackResult==success==
> didLocalDownload==0==
> downloadTime==8235==
> installTime==2502==
> extInstallTime====
> serverStartTime==216==
> connectionToken==1aaa1a11-a1a1-1a11-aaa1-11a1aaa1111a==
> ecac0c2e0d14: end
[22:02:34.803] Received install output:
SSH_AUTH_SOCK====
DISPLAY====
webUiAccessToken====
listeningOn==38507==
osReleaseId==debian==
arch==aarch64==
vscodeArch==arm64==
bitness==64==
tmpDir==/run/user/1000==
platform==linux==
unpackResult==success==
didLocalDownload==0==
downloadTime==8235==
installTime==2502==
extInstallTime====
serverStartTime==216==
connectionToken==1aaa1a11-a1a1-1a11-aaa1-11a1aaa1111a==
[22:02:34.804] Remote server is listening on port 38507
[22:02:34.804] Parsed server configuration: {"serverConfiguration":{"remoteListeningOn":{"port":38507},"osReleaseId":"debian","arch":"aarch64","webUiAccessToken":"","sshAuthSock":"","display":"","tmpDir":"/run/user/1000","platform":"linux","connectionToken":"1aaa1a11-a1a1-1a11-aaa1-11a1aaa1111a"},"downloadTime":8235,"installTime":2502,"serverStartTime":216,"installUnpackCode":"success"}
[22:02:34.804] ** Note: Support for architecture "aarch64" is in preview **
[22:02:34.808] Starting forwarding server. local port 60374 -> socksPort 60368 -> remotePort 38507
[22:02:34.809] Forwarding server listening on port 60374
[22:02:34.809] Waiting for ssh tunnel to be ready
[22:02:34.810] [Forwarding server port 60374] Got connection 0
[22:02:34.811] Tunneled port 38507 to local port 60374
[22:02:34.811] Resolved "ssh-remote+m-pi" to "port 60374"
[22:02:34.820] ------
[22:02:34.832] [Forwarding server port 60374] Got connection 1
[22:02:35.366] [Forwarding server port 60374] Got connection 2
[22:02:44.682] Opening exec server for ssh-remote+m-pi
[22:02:44.698] Initizing new exec server for ssh-remote+m-pi
[22:02:44.703] Using commit id "8b3775030ed1a69b13e4f4c628c612102e30a681" and quality "stable" for server
[22:02:44.706] Install and start server if needed
[22:02:44.716] Running script with connection command: "C:\Windows\System32\OpenSSH\ssh.exe" -T -D 60389 "m-pi" bash
[22:02:44.719] Terminal shell path: C:\Windows\System32\cmd.exe
[22:02:45.115] > Enter passphrase for key 'C:\Users\james/.ssh/keys/m-pi':]0;C:\Windows\System32\cmd.exe
[22:02:45.115] Got some output, clearing connection timeout
[22:02:45.116] Detected passphrase message
[22:02:49.132] Got passphrase response
[22:02:49.132] "install" wrote data to terminal: "*************"
[22:02:49.188] >
[22:02:49.424] > 62cec72092e5: running
[22:02:49.444] > Installing to /home/james/.vscode-server...
> 62cec72092e5%%1%%
> Downloading with wget
[22:02:50.665] > Download complete
> 62cec72092e5%%2%%
> tar --version:
> tar (GNU tar) 1.34
> Copyright (C) 2021 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.
>
[22:02:51.006] > code 1.85.2 (commit 8b3775030ed1a69b13e4f4c628c612102e30a681)
> Running ssh connection command... /home/james/.vscode-server/code-8b3775030ed1a69b13e4f4c628c612102e30a681 command-shell --cli-data-dir /home/james/.vscode-server/cli --on-port --require-token f7cd80218a98 --parent-process-id 7081 &> "/home/james/.vscode-server/.cli.8b3775030ed1a69b13e4f4c628c612102e30a681.log" < /dev/null
> printenv:
> SHELL=/bin/bash
> PWD=/home/james
> LOGNAME=james
> XDG_SESSION_TYPE=tty
> MOTD_SHOWN=pam
> HOME=/home/james
> LANG=en_GB.UTF-8
> VSCODE_AGENT_FOLDER=/home/james/.vscode-server
> SSH_CONNECTION=192.168.1.163 60392 192.168.1.174 22
> XDG_SESSION_CLASS=user
> USER=james
> SHLVL=1
> XDG_SESSION_ID=25
> XDG_RUNTIME_DIR=/run/user/1000
> SSH_CLIENT=192.168.1.163 60392 22
> PATH=/usr/local/bin:/usr/bin:/bin:/usr/games
> DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
> OLDPWD=/home/james/.vscode-server
> _=/usr/bin/printenv
[22:02:51.023] >
> Spawned remote CLI: 7123
[22:02:51.031] >
> Waiting for server log...
[22:02:51.038] >
[22:02:51.069] > Waiting for server log...
[22:02:51.100] >
[22:02:51.125] > 62cec72092e5: start
> SSH_AUTH_SOCK====
> DISPLAY====
> listeningOn==127.0.0.1:38939==
> osReleaseId==debian==
> arch==aarch64==
> vscodeArch==arm64==
> bitness==64==
> tmpDir==/run/user/1000==
> platform==linux==
> unpackResult==success==
> didLocalDownload==0==
> downloadTime==1204==
> installTime==349==
> serverStartTime==106==
> execServerToken==f7cd80218a98==
> 62cec72092e5: end
[22:02:51.126] Received install output:
SSH_AUTH_SOCK====
DISPLAY====
listeningOn==127.0.0.1:38939==
osReleaseId==debian==
arch==aarch64==
vscodeArch==arm64==
bitness==64==
tmpDir==/run/user/1000==
platform==linux==
unpackResult==success==
didLocalDownload==0==
downloadTime==1204==
installTime==349==
serverStartTime==106==
execServerToken==f7cd80218a98==
[22:02:51.127] Remote server is listening on port 38939
[22:02:51.127] Parsed server configuration: {"serverConfiguration":{"remoteListeningOn":{"port":38939},"osReleaseId":"debian","arch":"aarch64","sshAuthSock":"","display":"","tmpDir":"/run/user/1000","platform":"linux","execServerToken":"f7cd80218a98"},"downloadTime":1204,"installTime":349,"serverStartTime":106,"installUnpackCode":"success"}
[22:02:51.127] ** Note: Support for architecture "aarch64" is in preview **
[22:02:51.132] Starting forwarding server. local port 60394 -> socksPort 60389 -> remotePort 38939
[22:02:51.133] Forwarding server listening on port 60394
[22:02:51.134] Waiting for ssh tunnel to be ready
[22:02:51.135] [Forwarding server port 60394] Got connection 0
[22:02:51.135] Tunneled port 38939 to local port 60394
[22:02:51.136] Resolved "ssh-remote+m-pi" to "port 60394"
[22:02:51.136] Resolving exec server at port 60394
[22:02:51.137] [Forwarding server port 60394] Got connection 1
[22:02:51.155] >
[22:02:51.274] Exec server for ssh-remote+m-pi created and cached
Anything else?
I checked the issues from #6339:
I have inheritEnv checked in my user settings.
I checked my .profile and .bashrc files. The only thing place where it looked like my $PATH was being edited was here:
# set PATH so it includes user's private bin if it exists #if [ -d "$HOME/bin" ] ; then # PATH="$HOME/bin:$PATH" #fi
# set PATH so it includes user's private bin if it exists #if [ -d "$HOME/.local/bin" ] ; then # PATH="$HOME/.local/bin:$PATH" #fi
I have commented these lines out even though these directories do not exist and they are prepending anyway. I have attached both files for your reference.
My path does not have vscode on it:
james@m-pi:/ $ echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
I think this is different from #4451 because this is windows connecting to linux without vscode-server already installed.
Any different if you configure "remote.SSH.useExecServer": true?
My user settings have "remote.SSH.useExecServer" enabled by default.
Sorry, I see now that the logs I uploaded previously state that "remote.SSH.useExecServer" is false despite it being enabled in the UI settings. I have forced it to be true in the json settings, but code is still not found.
Remote-SSH Log
[22:25:14.237] Log Level: 2
[22:25:14.243] VS Code version: 1.86.2
[22:25:14.243] Remote-SSH version: [email protected]
[22:25:14.243] win32 x64
[22:25:14.261] SSH Resolver called for "ssh-remote+m-pi", attempt 1
[22:25:14.262] "remote.SSH.useLocalServer": false
[22:25:14.262] "remote.SSH.useExecServer": true
[22:25:14.262] "remote.SSH.showLoginTerminal": false
[22:25:14.262] "remote.SSH.remotePlatform": {"gimli.chpc.utah.edu":"linux","gimli":"linux","m-pi":"linux","co2":"linux"}
[22:25:14.262] "remote.SSH.path": undefined
[22:25:14.262] "remote.SSH.configFile": undefined
[22:25:14.262] "remote.SSH.useFlock": true
[22:25:14.262] "remote.SSH.lockfilesInTmp": false
[22:25:14.262] "remote.SSH.localServerDownload": auto
[22:25:14.262] "remote.SSH.remoteServerListenOnSocket": false
[22:25:14.262] "remote.SSH.showLoginTerminal": false
[22:25:14.263] "remote.SSH.defaultExtensions": []
[22:25:14.263] "remote.SSH.loglevel": 2
[22:25:14.263] "remote.SSH.enableDynamicForwarding": true
[22:25:14.263] "remote.SSH.enableRemoteCommand": false
[22:25:14.263] "remote.SSH.serverPickPortsFromRange": {}
[22:25:14.263] "remote.SSH.serverInstallPath": {}
[22:25:14.267] SSH Resolver called for host: m-pi
[22:25:14.268] Setting up SSH remote "m-pi"
[22:25:14.272] Using commit id "903b1e9d8990623e3d7da1df3d33db3e42d80eda" and quality "stable" for server
[22:25:14.275] Install and start server if needed
[22:25:14.280] Checking ssh with "C:\Windows\system32\ssh.exe -V"
[22:25:14.281] Got error from ssh: spawn C:\Windows\system32\ssh.exe ENOENT
[22:25:14.281] Checking ssh with "C:\Windows\ssh.exe -V"
[22:25:14.282] Got error from ssh: spawn C:\Windows\ssh.exe ENOENT
[22:25:14.282] Checking ssh with "C:\Windows\System32\Wbem\ssh.exe -V"
[22:25:14.283] Got error from ssh: spawn C:\Windows\System32\Wbem\ssh.exe ENOENT
[22:25:14.283] Checking ssh with "C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe -V"
[22:25:14.284] Got error from ssh: spawn C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe ENOENT
[22:25:14.284] Checking ssh with "C:\Windows\System32\OpenSSH\ssh.exe -V"
[22:25:14.315] > OpenSSH_for_Windows_8.6p1, LibreSSL 3.4.3
[22:25:14.320] Running script with connection command: "C:\Windows\System32\OpenSSH\ssh.exe" -T -D 50518 "m-pi" bash
[22:25:14.321] Terminal shell path: C:\Windows\System32\cmd.exe
[22:25:14.790] > Enter passphrase for key 'C:\Users\james/.ssh/keys/m-pi':]0;C:\Windows\System32\cmd.exe
[22:25:14.790] Got some output, clearing connection timeout
[22:25:14.790] Detected passphrase message
[22:25:19.293] Got passphrase response
[22:25:19.294] "install" wrote data to terminal: "*************"
[22:25:19.335] >
[22:25:19.613] > a3539c979493: running
[22:25:19.641] > Found existing installation at /home/james/.vscode-server...
> Starting VS Code CLI... "/home/james/.vscode-server/code-903b1e9d8990623e3d7da1df3d33db3e42d80eda" command-shell --cli-data-dir "/home/james/.vscode-server/cli" --on-port --parent-process-id 1397 &> "/home/james/.vscode-server/.cli.903b1e9d8990623e3d7da1df3d33db3e42d80eda.log" < /dev/null
> printenv:
> SHELL=/bin/bash
> PWD=/home/james
> LOGNAME=james
> XDG_SESSION_TYPE=tty
> MOTD_SHOWN=pam
> HOME=/home/james
> LANG=en_GB.UTF-8
> VSCODE_AGENT_FOLDER=/home/james/.vscode-server
> SSH_CONNECTION=192.168.1.163 50519 192.168.1.174 22
> XDG_SESSION_CLASS=user
> USER=james
> SHLVL=1
> XDG_SESSION_ID=4
> XDG_RUNTIME_DIR=/run/user/1000
> SSH_CLIENT=192.168.1.163 50519 22
> PATH=/usr/local/bin:/usr/bin:/bin:/usr/games
> DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
> _=/usr/bin/printenv
[22:25:19.658] > Removing old logfile at /home/james/.vscode-server/.cli.903b1e9d8990623e3d7da1df3d33db3e42d80eda.log
> Spawned remote CLI: 1416
[22:25:19.720] > Waiting for server log...
[22:25:19.736] >
[22:25:19.830] > Waiting for server log...
[22:25:19.843] >
[22:25:19.873] > a3539c979493: start
> SSH_AUTH_SOCK====
> DISPLAY====
> listeningOn==127.0.0.1:39339==
> osReleaseId==debian==
> arch==aarch64==
> vscodeArch==arm64==
> bitness==64==
> tmpDir==/run/user/1000==
> platform==linux==
> unpackResult====
> didLocalDownload==0==
> downloadTime====
> installTime====
> serverStartTime==233==
> execServerToken==1a1111a1-aa11-1aa1-111a-11a1a1111111==
> a3539c979493: end
[22:25:19.874] Received install output:
SSH_AUTH_SOCK====
DISPLAY====
listeningOn==127.0.0.1:39339==
osReleaseId==debian==
arch==aarch64==
vscodeArch==arm64==
bitness==64==
tmpDir==/run/user/1000==
platform==linux==
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
serverStartTime==233==
execServerToken==1a1111a1-aa11-1aa1-111a-11a1a1111111==
[22:25:19.874] Remote server is listening on port 39339
[22:25:19.874] Parsed server configuration: {"serverConfiguration":{"remoteListeningOn":{"port":39339},"osReleaseId":"debian","arch":"aarch64","sshAuthSock":"","display":"","tmpDir":"/run/user/1000","platform":"linux","execServerToken":"1a1111a1-aa11-1aa1-111a-11a1a1111111"},"serverStartTime":233,"installUnpackCode":""}
[22:25:19.874] ** Note: Support for architecture "aarch64" is in preview **
[22:25:19.878] Starting forwarding server. local port 50521 -> socksPort 50518 -> remotePort 39339
[22:25:19.878] Forwarding server listening on port 50521
[22:25:19.878] Waiting for ssh tunnel to be ready
[22:25:19.879] [Forwarding server port 50521] Got connection 0
[22:25:19.880] Tunneled port 39339 to local port 50521
[22:25:19.880] Resolved "ssh-remote+m-pi" to "port 50521"
[22:25:19.888] Initizing new exec server for ssh-remote+m-pi
[22:25:19.888] Resolving exec server at port 50521
[22:25:19.920] >
[22:25:19.921] [Forwarding server port 50521] Got connection 1
[22:25:20.145] Exec server for ssh-remote+m-pi created and cached
[22:25:20.149] ------
[22:25:20.164] [server] Checking /home/james/.vscode-server/cli/servers/Stable-903b1e9d8990623e3d7da1df3d33db3e42d80eda/log.txt and /home/james/.vscode-server/cli/servers/Stable-903b1e9d8990623e3d7da1df3d33db3e42d80eda/pid.txt for a running server...
[22:25:20.208] [server] Found running server (pid=1015)
[22:25:29.157] Opening exec server for ssh-remote+m-pi
[22:25:29.157] Opening exec server for ssh-remote+m-pi
[22:25:29.166] Verified and reusing cached exec server for ssh-remote+m-pi
[22:25:29.174] Verified and reusing cached exec server for ssh-remote+m-pi
https://github.com/microsoft/vscode-remote-release/issues/4451