Skip to Content

How to connect the Google Compute Engine via Visual Studio Code

1. Generate SSH config file using gcloud command line

gcloud compute config-ssh

You cant get ssh config for your Google Compute Engine project!

Notice: you need choose target GCP project before run below command.

gcloud config set project <your-project-id>

2. Install Remote SSH extention in Visual Studio Code.

3. Press ⇧⌘P & Select target connection in Visual Studio Code!

  • Finaly you can connect in Visual Studio Code. Welcome to VS code when you write the code in SSH connection.