Manage to connect through the terminal, but not through the remote explorer

Viewed 1164

I am coming from notepad, and am learning how to work with VS Code.

I am now trying to access my online repertory on the webserver. I followed up the guide here: https://code.visualstudio.com/docs/remote/ssh

I did manage to access my server through the terminal window. (ssh user@domain + password). When connecting, this shows in the log:

"Linux infong-eu27 4.4.246-icpu-061 #2 SMP Thu Nov 26 10:58:41 UTC 2020 x86_64"

This tells me that it is working on Linux.

If I type "Ls", I can see my folders and navigate among them. So far, so good!

Second phase: Connecting through the remote explorer.

Step 1: I configured the ssh with the same credentials I used with the terminal.

Step 2: I am opening the remote explorer, I can see my server's name. I right click on it and select "connect".

Step 3: I am then asking to choose the system. I am picking Linux as shown earlier when connecting through the terminal.

Step 4: I am entering the same password I used before to connect in the terminal.

Step 5: Infinite loading, or a very long one till I get 2 notifications / errors:

  • Could not fetch remote environment
  • Failed to connect to the remote extension host (error time limit..)

That being said, it also says in the bottom left corner, in the "remote window", that I am connected. This does not seems right.

connection messages

Any chance someone could help? I am frustrated because it connects in 1s using the terminal, but not in the remote explorer.

UPDATE:
I found this article on medium that paraphrases the official documentation. https://medium.com/@sujaypillai/connect-to-your-remote-servers-from-visual-studio-code-eb5a5875e348
I managed, through Git bash, to create a ssh pair key, and managed to copy one on my server. I then followed the instructions on how to set it up on VS Code successfully! Now, when I try to connect, I am asked for my key pass:

asking for key pass

But, when I do: super long loading, and the same error message. When I looked on my server with a sftp software, I see that VS did manage to connect as files were installed in a VS folder it created:

installed files

1 Answers

This is reported in issue 4415 (no answer) and issue 4204

The last one includes:

This might be caused by our new automatic port forwarding feature which scans the remote OS for available ports in order to forward them locally (microsoft/vscode#112843)

This is fixed by PR 113342, for the next 1.54 Feb. 2021 release. That bug is about setting remote.autoForwardPorts to false and... still seeing VSCode auto-forward ports!

Check on your server (while VSCode attempts to connect) if:

  • the CPU is high
  • if there are any services running on public port on said server
Related