Steps to Reproduce:
my SSH config:
Host myhost
Hostname myhost.domain
User me
Output from "Remote - SSH"
[email protected]
Confirming that myhost is a valid reachable host
Running ssh -o ConnectTimeout=15 "myhost" bash << 'EOSSH'
uname -sm
EOSSH to confirm the host platform
> execvp(3) failed.: No such file or directory
"uname" terminal command done
myhost: unreachable or not Linux x86_64. (execvp(3) failed.: No such file or directory)
When I paste the exact command above into the vscode terminial, specifically
ssh -o ConnectTimeout=15 "myhost" bash << 'EOSSH'
uname -sm
EOSSH
I get back Linux x86_64
[email protected]
SSH Resolver called for "ssh-remote+china.example.cn"
SSH Resolver called for host: china.example.cn
Setting up SSH remote "china.example.cn"
Using commit id "553cfb2c2205db5f15f3ee8395bbd5cf066d357d" and quality "stable" for server
Install and start server if needed
> execvp(3) failed.: No such file or directory
"install" terminal command done
Received install output: execvp(3) failed.: No such file or directory
Failed to parse remote port from server output: execvp(3) failed.: No such file or directory
And remote is Linux x86_64.
ssh -o ConnectTimeout=15 "[email protected]" bash << 'EOSSH'
uname -sm
EOSSH
Output is: Linux x86_64.
But remote host default shell is zsh.
How can resolve this?
I don't know what the problem is but it sounds like zsh might be involved. Could you try this with the "nightly" version of the extension (uninstall the stable version first)?
vscode insider version is ok. :smile: @roblourens
Great, thanks.
I'm not sure I've got the most current version. It's not working, but appears to be a newer version.
Through the extension manager, it shows I have:
Name: Remote - SSH
Id: ms-vscode-remote.remote-ssh
Description: Open any folder on a remote machine using SSH and take advantage of VS Code's full feature set.
Version: 0.42.1
Publisher: Microsoft
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh
Where do I get a nightly version of the extension?
Or, do you mean install the vscode insider edition?
https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh-nightly - uninstall the stable version of the ssh extension first
I'm having the exact same issue, and I thought zsh might be involved too, but I changed back to bash with chsh on both remote and local, and restarted my computer, and I still see the same errors. I just tried the nightly version, and that at least got to the point of opening a new VSCode window before throwing an error. The output message in the new VSCode window looked like this:
[email protected]
SSH Resolver called for "ssh-remote+rrlogin"
SSH Resolver called for host: rrlogin
Setting up SSH remote "rrlogin"
Using commit id "c7d83e57cd18f18026a8162d042843bda1bcf21f" and quality "stable" for server
Testing ssh with ssh -V
ssh exited with code: 0
Got stderr from ssh: OpenSSH_7.4p1, LibreSSL 2.5.0
Install and start server if needed
> execvp(3) failed.: No such file or directory
"install" terminal command done
Received install output: execvp(3) failed.: No such file or directory
Failed to parse remote port from server output: execvp(3) failed.: No such file or directory
At the same time, a message window showed up at the top of the VSCode window saying
Could not establish connection to "rrlogin".
and an error message popped up on the bottom right saying
The terminal process command 'sh -c '"ssh" -o ConnectTimeout=15 "rrlogin" bash << 'EOSSH' COMMIT_ID="c7d83e57cd18f18026a8162d042843bda1bcf21f" EXTENSIONS="" TELEMETRY="" export VSCODE_AGENT_FOLDER=$HOME/.vscode-server #setup VSCH_DIR="$VSCODE_AGENT_FOLDER/bin/$COMMIT_ID" VSCH_LOGFILE="$VSCODE_AGENT_FOLDER/.$COMMIT_ID.log" if [ ! -d "$VSCH_DIR" ]; then mkdir -p $VSCH_DIR fi ARCH=$(uname -sm | sed 's/^linux //gi') case $ARCH in x86_64) VSCODE_ARCH="x64";; armv7l) VSCODE_ARCH="armhf";; *) echo "Unsupported architecture: $ARCH" echo "25efaf74-a396-47d9-a3f4-3edd50a9e997##27##" exit 0 ;; esac ## Copyright (C) 2009 Przemyslaw Pawelczyk <[email protected]> ## This script is licensed under the terms of the MIT license. ## https://opensource.org/licenses/MIT LOCKFILE="$VSCH_DIR/vscode-remote-lock.c7d83e57cd18f18026a8162d042843bda1bcf21f" LOCKFD=99 # PRIVATE _lock() { flock -$1 $LOCKFD; } _no_more_locking() { _lock u; _lock xn && rm -f $LOCKFILE; } _...
For the record, here's my other info:
Thoughts on where to go from here?
Yes. Agree to @benlindsay, change the default shell to /bin/bash still have the same issue in the stable version. The error log is still like this:
Setting up SSH remote "china.example.cn"
Using commit id "c7d83e57cd18f18026a8162d042843bda1bcf21f" and quality "stable" for server
Install and start server if needed
> execvp(3) failed.: No such file or directory
"install" terminal command done
Received install output: execvp(3) failed.: No such file or directory
Failed to parse remote port from server output: execvp(3) failed.: No such file or directory
And the insider version still ok.
As some seem to indicate that a default shell of zsh might cause a problem - I've got my default shell on my laptop (macOS) and Linux host both set to bash:
# local host
$ dscl . -read ~/ UserShell
UserShell: /bin/bash
# remote host
$ grep "^$USER" /etc/passwd
me:x:1000:1000:My Name,,,:/home/me:/bin/bash
@roblourens - I installed the nightly version of the extension as you specified, and while it works differently, it still fails. Here's the new error output - from the popup message:
The terminal process command 'sh -c '"ssh" -o ConnectTimeout=15 "myhost" bash << 'EOSSH' COMMIT_ID="c7d83e57cd18f18026a8162d042843bda1bcf21f" EXTENSIONS="" TELEMETRY="--disable-telemetry" export VSCODE_AGENT_FOLDER=$HOME/.vscode-server #setup VSCH_DIR="$VSCODE_AGENT_FOLDER/bin/$COMMIT_ID" VSCH_LOGFILE="$VSCODE_AGENT_FOLDER/.$COMMIT_ID.log" if [ ! -d "$VSCH_DIR" ]; then mkdir -p $VSCH_DIR fi ARCH=$(uname -sm | sed 's/^linux //gi') case $ARCH in x86_64) VSCODE_ARCH="x64";; armv7l) VSCODE_ARCH="armhf";; *) echo "Unsupported architecture: $ARCH" echo "0a07a4a1-822b-4184-8c2a-e9faee033f40##27##" exit 0 ;; esac ## Copyright (C) 2009 Przemyslaw Pawelczyk <[email protected]> ## This script is licensed under the terms of the MIT license. ## https://opensource.org/licenses/MIT LOCKFILE="$VSCH_DIR/vscode-remote-lock.c7d83e57cd18f18026a8162d042843bda1bcf21f" LOCKFD=99 # PRIVATE _lock() { flock -$1 $LOCKFD; } _no_more_locking() { _lock u; _lock xn && rm...
And in my output window I get:
[email protected]
SSH Resolver called for "ssh-remote+myhost"
SSH Resolver called for host: myhost
Setting up SSH remote "myhost"
Using commit id "c7d83e57cd18f18026a8162d042843bda1bcf21f" and quality "stable" for server
Testing ssh with ssh -V
ssh exited with code: 0
Got stderr from ssh: OpenSSH_7.9p1, LibreSSL 2.7.3
Install and start server if needed
> execvp(3) failed.: No such file or directory
"install" terminal command done
Received install output: execvp(3) failed.: No such file or directory
Failed to parse remote port from server output: execvp(3) failed.: No such file or directory
Seeing the above error mentioned a problem parsing remote port, I did put in a Port 22 line in my ~/.ssh/config file, but that didn't change the error message.
As suggested by @tosone, I tried installing Visual Studio Code - Insiders with the non-nightly version of the Remote - SSH extension (v. 0.42.2) and now the remote ssh feature works.
So, it seems the fix for this is to just switch from the stable version of vscode to the insider's edition.
I have no idea why this would work in Insiders but not stable vscode. Maybe the stable remote dir got into a bad state, you could try running "Uninstall vs code server" from stable vscode to start fresh and see if that helps.
I tried switching to insider's edition like @magic-lantern mentioned, but it didn't work for me. This time, in the new VSCode window that pops up, I see this output:
[email protected]
SSH Resolver called for "ssh-remote+rrlogin"
SSH Resolver called for host: rrlogin
Setting up SSH remote "rrlogin"
Using commit id "d04b5d2eb16c156e24dbf44010c315d968694bd6" and quality "insider" for server
Install and start server if needed
> Installing to /home/lindsb/.vscode-server-insiders/bin/d04b5d2eb16c156e24dbf44010c315d968694bd6...
> Downloading with wget
> Printing the current remote environment...
...
< a bunch of lines with all my remote environment variables >
...
> _=/usr/bin/printenv
> OLDPWD=/home/lindsb/.vscode-server-insiders/bin/d04b5d2eb16c156e24dbf44010c315d968694bd6
> Starting server...
> Waiting for server log...
> Waiting for server log...
> Waiting for server log...
> Waiting for server log...
> Waiting for server log...
> Waiting for server log...
> Waiting for server log...
>
> *
> * Reminder: You may only use this software with Visual Studio family products,
> * as described in the license (https://go.microsoft.com/fwlink/?linkid=2077057)
> *
>
> Server did not start successfully. Full server log:
>
> <--- Last few GCs --->
>
> [14202:0x2c0eb40] 208 ms: Scavenge 6.1 (8.3) -> 5.8 (11.3) MB, 1.6 / 0.0 ms allocation failure
> [14202:0x2c0eb40] 267 ms: Scavenge 8.3 (12.8) -> 7.2 (12.8) MB, 1.5 / 0.0 ms allocation failure
> [14202:0x2c0eb40] 379 ms: Scavenge 9.6 (13.8) -> 8.8 (14.8) MB, 1.6 / 0.0 ms allocation failure
> [14202:0x2c0eb40] 466 ms: Scavenge 10.5 (15.3) -> 9.6 (16.8) MB, 16.3 / 0.0 ms allocation failure
>
>
> <--- JS stacktrace --->
> Cannot get stack trace in GC.
> FATAL ERROR: NewSpace::Rebalance Allocation failed - process out of memory
> 1: node::Abort() [/home/lindsb/.vscode-server-insiders/bin/d04b5d2eb16c156e24dbf44010c315d968694bd6/node]
> 2: 0x88050c [/home/lindsb/.vscode-server-insiders/bin/d04b5d2eb16c156e24dbf44010c315d968694bd6/node]
> 3: v8::Utils::ReportOOMFailure(char const*, bool) [/home/lindsb/.vscode-server-insiders/bin/d04b5d2eb16c156e24dbf44010c315d968694bd6/node]
> 4: v8::internal::V8::FatalProcessOutO
> fMemory(char const*, bool) [/home/lindsb/.vscode-server-insiders/bin/d04b5d2eb16c156e24dbf44010c315d968694bd6/node]
> 5: 0xa5e43b [/home/lindsb/.vscode-server-insiders/bin/d04b5d2eb16c156e24dbf44010c315d968694bd6/node]
> 6: 0xe7e1d2 [/home/lindsb/.vscode-server-insiders/bin/d04b5d2eb16c156e24dbf44010c315d968694bd6/node]
> 7: v8::internal::MarkCompactCollector::CollectGarbage() [/home/lindsb/.vscode-server-insiders/bin/d04b5d2eb16c156e24dbf44010c315d968694bd6/node]
> 8: v8::internal::Heap::MarkCompact() [/home/lindsb/.vscode-server-insiders/bin/d04b5d2eb16c156e24dbf44010c315d968694bd6/node]
> 9: v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/home/lindsb/.vscode-server-insiders/bin/d04b5d2eb16c156e24dbf44010c315d968694bd6/node]
> 10: v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/home/lindsb/.vscode-server-insiders/bin/d04b5d2eb16c156e24dbf44010c315d968694bd6/node]
> 11: v8::intern
> al::Factory::NewInternalizedStringImpl(v8::internal::Handle<v8::internal::String>, int, unsigned int) [/home/lindsb/.vscode-server-insiders/bin/d04b5d2eb16c156e24dbf44010c315d968694bd6/node]
> 12: v8::internal::InternalizedStringKey::AsHandle(v8::internal::Isolate*) [/home/lindsb/.vscode-server-insiders/bin/d04b5d2eb16c156e24dbf44010c315d968694bd6/node]
> 13: v8::internal::StringTable::LookupKey(v8::internal::Isolate*, v8::internal::StringTableKey*) [/home/lindsb/.vscode-server-insiders/bin/d04b5d2eb16c156e24dbf44010c315d968694bd6/node]
> 14: v8::internal::StringTable::LookupString(v8::internal::Isolate*, v8::internal::Handle<v8::internal::String>) [/home/lindsb/.vscode-server-insiders/bin/d04b5d2eb16c156e24dbf44010c315d968694bd6/node]
> 15: 0x10e5e1b [/home/lindsb/.vscode-server-insiders/bin/d04b5d2eb16c156e24dbf44010c315d968694bd6/node]
> 16: v8::internal::Runtime_KeyedGetProperty(int, v8::internal::Object**, v8::internal::Isolate*) [/home/lindsb/.vscode-server-insiders/bin/d04b5d2eb16c156e24dbf44010c315d968694b
> d6/node]
> 17: 0x15e1fd00427d
> /home/lindsb/.vscode-server-insiders/bin/d04b5d2eb16c156e24dbf44010c315d968694bd6/server.sh: line 12: 14202 Aborted (core dumped) "$ROOT/node" ${INSPECT:-} "$ROOT/out/vs/server/main.js" "$@"
> 93e3cd29-03d4-4fae-9930-5bb221b61637====
"install" terminal command done
Received install output: 93e3cd29-03d4-4fae-9930-5bb221b61637====
Failed to parse remote port from server output: 93e3cd29-03d4-4fae-9930-5bb221b61637====
Looks like it runs into a memory issue? I know there's a RAM limit of about 1 GB per user on this machine. Any idea how much memory this requires?
@roblourens - In my case on the server/remote - I only have a ~/.vscode-server-insiders/ directory, there is no non-insiders dir. From the error I'm getting, the very first step attempted by the plugin is to determine if the remote host is Linux x86_64. The command as shown in my earlier post fails in regular VS code, but works from the command line. Additionally, it works correctly in the Insiders edition.
If there is some additional debugging I can do to help identify differences between the VSCode versions, please let me know. I'm happy to help, but have done all I know how to do.
I know there's a RAM limit of about 1 GB per user on this machine. Any idea how much memory this requires?
That could probably be an issue. We don't have a specific requirement but I think it will eventually need more than that, given that your user is probably doing other things too.
@magic-lantern it gets past that point, and there must be some line in the install script causing the failure. I guess I still have no idea unfortunately.
I'm having this same problem. I used to be able to use remote ssh on insiders version. I tried today with latest version of both stable (1.35.1) and insiders (1.36.0) and I get these errors.
On stable or insiders with 0.42.2, output shows this.
[email protected]
Confirming that host_name is a valid reachable host
Running ssh -o ConnectTimeout=15 "host_name" bash << 'EOSSH'
uname -sm
EOSSH to confirm the host platform
> execvp(3) failed.: No such file or directory
"uname" terminal command done
host_name: unreachable or not Linux x86_64. (execvp(3) failed.: No such file or directory)
On insiders with nightly remote ssh extension, it opens a new window and output shows this.
[email protected]
SSH Resolver called for "ssh-remote+host_name"
SSH Resolver called for host: host_name
Setting up SSH remote "host_name"
Using commit id "15b7c86d86319b187a5ef255c170184a8519c5af" and quality "insider" for server
Testing ssh with ssh -V
ssh exited with code: 0
Got stderr from ssh: OpenSSH_7.9p1, LibreSSL 2.7.3
Install and start server if needed
> execvp(3) failed.: No such file or directory
"install" terminal command done
Received install output: execvp(3) failed.: No such file or directory
Failed to parse remote port from server output: execvp(3) failed.: No such file or directory
EDIT: I tested the command referenced in the output in a normal terminal and this works fine and outputs Linux x86_64.
ssh -o ConnectTimeout=15 "host_name" bash << 'EOSSH'
uname -sm
EOSSH
Have any of you set the setting terminal.integrated.shell.osx?
I have the following in my settings.json file:
"terminal.integrated.env.osx": {
"PATH": ""
}
The reason for this was https://github.com/microsoft/vscode-python/issues/4434 but it seems things have changed as I removed it and I am still able to use Conda Python environments.
Removing that block from my settings file does fix this bug for me.
Have any of you set the setting
terminal.integrated.shell.osx?
Yep! I had the exact same thing as @magic-lantern for the exact same reason. Removing that fixes the problem for a different machine where I don't have a memory limitation. Thanks @roblourens!
This makes sense because we try to open the terminal for 'sh' but with no path, we can't find it. I can reproduce it.
@roblourens - is this problem something that the Remote-SSH plugin can either detect or work around?
Sort of. I will use /bin/sh if it exists, instead of assuming that a PATH exists. With https://github.com/microsoft/vscode/issues/70248, this could still happen in some cases outside of that setting that overrides PATH. Anyone currently having this issue should be able to set PATH to "/bin" or something.
Most helpful comment
I have the following in my settings.json file:
The reason for this was https://github.com/microsoft/vscode-python/issues/4434 but it seems things have changed as I removed it and I am still able to use Conda Python environments.
Removing that block from my settings file does fix this bug for me.