Can't connect VS Code to Linux machine for remote development

Jonatan Aponte picture Jonatan Aponte · Apr 1, 2020 · Viewed 10.9k times · Source

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] ------

Answer

grit picture grit · Apr 28, 2020

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: