21
votes

I am getting this error on VS Code and have no clue why it fails

[15:14:59.543] Log Level: 2
[15:14:59.555] [email protected]
[15:14:59.555] win32 x64
[15:14:59.560] SSH Resolver called for "ssh-remote+xx.xx.xx.xx", attempt 1
[15:14:59.561] SSH Resolver called for host: xx.xx.xx.xx
[15:14:59.561] Setting up SSH remote "xx.xx.xx.xx"
[15:14:59.621] Using commit id "0ba0ca52957102ca3527cf479571617f0de6ed50" and quality "stable" for server
[15:14:59.624] Install and start server if needed
[15:15:01.964] getPlatformForHost was canceled
[15:15:01.965] Resolver error: Connecting was canceled
[15:15:01.973] ------
3

3 Answers

21
votes

Add one key in your settings.json as below. Please remember to replace the $remote_server_name to yours.

    "remote.SSH.remotePlatform": {
        "$remote_server_name": "linux"
    }

Menu: File->Preference->Settings

Or click the icon to open settings.json:

8
votes

In dialog box where you have typed user@host type/select Linux/Windows/etc. depends what you are using, then type/select Continue, then type password for remote session.

2
votes

For those getting this error on Windows: Check if you have multiple ssh clients installed.

How I solved it was by adding my ssh-configuration to ALL ssh-config files. In my case I had one in

  • C:\Users\USER_NAME.ssh\config (this is the one that the remote extension used to give me connection options)
  • and another in C:\Program Data\ssh\ssh-config

After adding my ssh-config setting to both I got the prompt to select virtual hosts' OS. Tried editing the settings.json file directly, but I think it gets confused because of the multiple ssh-configurations.

P.S.

Tested it for both private key and password enabled connections and it work with either.