> For the complete documentation index, see [llms.txt](https://learn.canceridc.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.canceridc.dev/cookbook/virtual-machines/using-vs-code-with-gcp-vms.md).

# Using VS Code with GCP VMs

[Visual Studio Code](https://code.visualstudio.com/) 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.

## Prerequisites

* \`\`[`gcloud` SDK](https://cloud.google.com/sdk/docs/install) installed on your computer
* [Visual Studio Code](https://code.visualstudio.com/) installed on your computer
* A GCP VM you want to use for code development is up and running

## **Step 1: Install "Remote - SSH" extension**

![](/files/-MTlJdbOKuFBlkWzDGH2)

## **Step 2: Populate SSH config files**

Run the following command to populate SSH config files with host entries for each VM instance you have running

```bash
$ gcloud compute config-ssh
```

## Step 3: Connect to host

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.

![](/files/-MTlLoiD6dpJ_azKj-q1)

{% hint style="warning" %}
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).
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://learn.canceridc.dev/cookbook/virtual-machines/using-vs-code-with-gcp-vms.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
