whoisraibolt
whoisraibolt

Reputation: 2708

VS Code Remote-SSH: The vscode server failed to start SSH

I'm trying to connect to a server via remote-ssh extension for Visual Studio Code, however, I'm getting the following error:

The vscode server failed to start SSH

Everything is fine on the server-side, and the connection to this host worked fine for a while.

Any suggestions to re-access the server via remote-ssh extension?

Upvotes: 49

Views: 96694

Answers (16)

PolarisKnight
PolarisKnight

Reputation: 1

I was banging my head against a wall with this as well but as it turns out, VS Code will fail to install on the remote machine if tar is not present on the remote machine. Make sure tar is installed and try again, because the installation script that it runs seems to take advantage of that program.

Upvotes: 0

Deema
Deema

Reputation: 11

try, rm -rf .vscode-server it is does not work check the storage as it sometimes due to the disk space, so freeing up some files in the .cache should fix it

Upvotes: 1

Hesam Korki
Hesam Korki

Reputation: 179

If killing "vscode-server" did not solve it for you, it might be that there's not enough space on the remote server hard drive so it fails to fully download the necessary files and unfortunately, this scenario gives no appropriate log

Upvotes: 0

xin king
xin king

Reputation: 31

I have tried all methods provided by former answers, but none of them worked. Finally, the problem solve by the update of Vscode severse.

Upvotes: 0

LiiOr
LiiOr

Reputation: 101

For people who are here after Feb 10th, 2024 :

Version 1.86.1 brings a temporary patch allowing VScode users to connect to unsupported OS version again (old Linux distributions). See the issue's conclusion : https://github.com/microsoft/vscode/issues/203375

Upvotes: 0

ahajianpour
ahajianpour

Reputation: 529

For people who are here after Feb 1st, 2024:

The release notes of the new VS-Code 1.86 (Jan 2024) reads:

From this release onwards, VS Code desktop is only compatible with Linux distributions based on glibc 2.28 or later, and glibcxx 3.4.25 or later, such as Debian 10, RHEL 8, or Ubuntu 20.04.

If you don't have the required version of the mentioned programs on the server side, you better revert to the previous version of VS-Code (v1.85). To do so, uninstall your current (v1.86) VS-Code, download v1.85 from the link below, and install it. https://code.visualstudio.com/updates/v1_85

Linux users can easily run the following command until the next release; run it after you uninstall the current (v1.86) VS-Code:

sudo apt install code-exploration

Upvotes: 40

Siva Prakash
Siva Prakash

Reputation: 4997

One other possible reason is your remote machine may not have enough space. So check that.

Upvotes: 8

bzd8tbq
bzd8tbq

Reputation: 1

If you also have dev containers running on the remote host. You may fail to kill the vscode-server (thus somehow fail to reconnect) since the vscode-server in containers are running as root on the remote host. You need to first kill the running containers (docker stop <container_name>) and try reconnecting again.

Upvotes: 0

pecneb
pecneb

Reputation: 71

Remove vscode server config from home dir

  • run rm -rf ~/.vscode-server
  • then try connecting again, it worked for me

Upvotes: 7

will.mendil
will.mendil

Reputation: 1035

For raspberry pi this helped me https://github.com/microsoft/vscode-remote-release/issues/8342#issuecomment-1501195063

Ok so it seems I was able to find a workaround provided here.

"I think you're having the same issue as me, but it's actually caused by an update to the pi. VScode is reading the uname -m value, the machine hardware name, which is returning aarch64, and so it is trying to run the 64 bit version of the remote server. In reality, your pi is likely using a armv7l (32 bit) user space. Remove the vscode remote server currently on the pi, then add arm_64bit=0 to /boot/config.txt and restart. If uname -m returns armv7l, then vscode should work again."

  • Remove vscode server from RPi: rm -rf ~/.vscode-server on the RPi.
  • Add the arm_64bit=0 to /boot/config.txt and restart as stated above on the RPi.
  • Start your vscode again from the host and start your remote connection. This will download the correct server.

Upvotes: 2

Carlos Silva
Carlos Silva

Reputation: 71

Remote-SSH: kill VS Code Server on Host...

Didn't work for me, so I tried the other option:

Remote-SSH: Uninstall VS Code Server from Host...

It took a bit more time but worked for me!

Upvotes: 6

Mirtuzza Mitthi
Mirtuzza Mitthi

Reputation: 1

Update the Remote ssh check file groups belongs to same group if you manually copied .vscode-server

Upvotes: 0

VonC
VonC

Reputation: 1328602

Everything is fine on the server-side, and the connection to this host worked fine for a while.

In case it is a simple intermittent network issue, VSCode 1.70 (July 2022) will retry the connection for you (up to 5 times)

See issue 127565 and PR 156444

Retry up to 5 times the initial authority resolving and also retry up to 5 times the initial connection

When connecting to a remote, if the initial connection fails, we will give up. The idea was that retrying would be useless, since the initial setup might have failed.

But it is possible that perhaps it was an intermittent network error.

This is available in VSCode insiders today.

Upvotes: 0

Xi Gou
Xi Gou

Reputation: 49

wrong proxy setting may cause problem. If Remote-SSH: kill VS Code Server on Host command not work for you, open settings and clear proxy setting and retry.

Upvotes: 0

Krishan
Krishan

Reputation: 337

In my case it was ssh plugin issue. I updated remote ssh plugin then it worked

Upvotes: 11

whoisraibolt
whoisraibolt

Reputation: 2708

After a while, I found a solution that can be useful to others.

In VS Code press:

CTRL + SHIFT + P

Type or select the option:

Remote-SSH: kill VS Code Server on Host...

enter image description here

Select the host name:

enter image description here

And after this procedure, try connecting again to the host.

That worked for me.

Upvotes: 108

Related Questions