Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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] ------ 
like image 328
Jonatan Aponte Avatar asked Apr 01 '20 15:04

Jonatan Aponte


People also ask

How do I connect to a remote machine using VS Code?

In VS Code, select Remote-SSH: Connect to Host... from the Command Palette (F1, Ctrl+Shift+P) and use the same user@hostname as in step 1. If VS Code cannot automatically detect the type of server you are connecting to, you will be asked to select the type manually.

Can you use VS Code over SSH?

You can connect over SSH into another machine from Visual Studio Code and interact with files and folders anywhere on that remote filesystem. If you have an app located on a different computer, you could use SSH to connect to it and access your app, view its files, and even modify, run, and debug it.

Is VS Code compatible with Linux?

VS Code is supported on the following platforms: OS X El Capitan (10.11+) Windows 8.0, 8.1 and 10, 11 (32-bit and 64-bit) Linux (Debian): Ubuntu Desktop 16.04, Debian 9.


2 Answers

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:

like image 147
grit Avatar answered Sep 17 '22 03:09

grit


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.

like image 20
imperato Avatar answered Sep 20 '22 03:09

imperato