---
# System prepended metadata

title: Set Up Visual Studio Code on the Workstation

---

# Set Up Visual Studio Code on the Workstation
=== A reference for [Lai Research Group Computing Infrastructure](https://hackmd.io/4tb1XuqMShK_6HLSySbk4g) ===

This guide teaches how to use Visual Studio Code to develop code on our workstation.

:::success

[Our training session  recording](https://princeton.zoom.us/rec/share/B37MWuRTVkHTkpo_2X9njmZugexJtN7SuIjLr4lty8DyFCDQPB-vjkQjzsV1dDWB.7AYAUTr9W4GvHxrH) might help
:::

### 1. Install

Install [Visual Studio Code](https://code.visualstudio.com/). It should be easy. Download, then click the installer.

### 2. Remote Devlopement
* a. Set up the key-based authentication between your local PC/laptop and the server. You can follow the "How can I avoid typing password each time" in [this guide](https://hackmd.io/9iVBJfITQwy8tIz9ubgorw?view#Q-How-can-I-avoid-typing-password-each-time). Especially make sure the public key is added to `~/.ssh/authorized_keys` on the workstation.

* b. Click the Extensions on the left panel, install the Remote-SSH extension. The extension allows us to access the workstation within VSCode via SSH.
![](https://i.imgur.com/gIZdLe3.png)


* c. Press `Ctrl + Shift + P` to trigger Command Palette (or similarly, click View->Command Palette). Select `Remote-SSH: Connect to Host...` , select `Configure SSH Hosts` and open a configuration file. 
![](https://i.imgur.com/x2H9tHU.png)


* d. Type the following into the configuration file, but remember to **change the User to your username on workstation**, and **IdentityFile with the private key file (id_rsa) created in step a**.
```
Host YaoGroup
    HostName sdss-yaolai.stanford.edu
    User nbcoffey
    IdentityFile /users/nbcoffey/.ssh/id_ed25519
```

It looks like this:
![Screenshot 2024-02-05 at 3.23.12 PM](https://hackmd.io/_uploads/H1elAJkiT.png)

* e. Now click `Remote-SSH: Connect to Host...` again. This time an option `YaoGroup` will appear, and you be able to connect it without typing any password, and a new window will appear (password is asked, when SSH identity goes wrong, please check to step a, b & d)

* f. Verify you are using the workstation by open a folder.
![](https://i.imgur.com/0r6YrPK.png)
