Using VS Code with GCP VMs
Last updated
Last updated
Visual Studio Code has a useful feature of allowing you to develop code on a remote VM from the convenience of your desktop. You can follow the steps below to configure your development environment for this task.
``gcloud
SDK installed on your computer
Visual Studio Code installed on your computer
A GCP VM you want to use for code development is up and running
Run the following command to populate SSH config files with host entries for each VM instance you have running
If the previous step completed successfully, you should see the running VMs in the Remote Explorer of VS Code, as in the screenshot below, and should be able to open a new session to those remove VMs.
Note that the SSH configuration may/will change if you restart your VM. In this case you will need to re-configure (re-run step 2 above).