Comment on page
Using VS Code with GCP VMs
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.
Run the following command to populate SSH config files with host entries for each VM instance you have running
$ gcloud compute config-ssh
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).