About VS Code

VSCode is one of the favourite editor for most of the IT guys. It is more popular because of its extendability. VSCode support a huge number of plugins, which helps the developer life easier. You can download the plugins from VSCode market place.

Today i will show you one if the best plugin we can use with VSCode. Normally most of the developers need to edit files on remote machine using SSH, so the optios at that time is limited with vim or nano and most of the people are not comfortable with these editors. Here you can use VSCode remote development extension pack from Microsoft.

VS Code Remote Development Extension

The remote Development extension pack allows you to open any folder in a container, or a remote server and take the advantage of VSCode full feature set.

Requirement

  1. Make sure to install VSCode in your system. Or you can download it from here

2. Install any of the ssh client in your Windows PC. I am using git bash for windows.

3. configure key based authentication on the host you plan to connect to by adding your local public SSH key to ~/.ssh/authorized_keys on the host. There is an option to prompt for password confirmation in the vs code configuration

Installation

Open VSCode and navigate to Extensions and search for remote development.

VSCode Extension Section

Select the first one from Microsoft and click install. Which will install the Plugin and dependencies.

You can notice a new tab appeared on Bottom and Left side bar.

Extension Status

Click on the Green connect icon on the bottom bar will open the command palette. Or you can open command palette from the view tab and search for on remote-SSH: Connect to Host, and enter your host IP address[username@hostname]

command palette

After a moment, VS Code will connect to the SSH server and set itself up. VS Code will keep you up to date using a progress notification.

After you are connected, you'll be in an empty window. You can then open a folder or workspace on the remote machine using File > Open... or File > Open Workspace.

Note:

You can create a quick connection in by adding servers in config file. the default file location is c:\users\<username>\.ssh\config. Sample format will be like this

Host 10.10.10.90
    HostName 10.10.10.90
    User jjames
Host 10.10.10.91
    HostName 10.10.10.91
    User jjames

You can find more details here