> ## Documentation Index
> Fetch the complete documentation index at: https://ona.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# VS Code Desktop

With VS Code Desktop Support, you keep your local editor configurations<sup>1</sup> and benefit from Gitpod's high-spec servers & automated prebuilds. As usual, your code executes in an ephemeral Gitpod workspace, keeping each of your projects isolated from one another.

<iframe width="560" height="315" src="https://www.youtube.com/embed/kI6firDA0Bw" title="VS Code Desktop" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen className="rounded-xl" />

## Prerequisites

To open a Workspace directly from VS Code desktop, you'll need to install and sign into the [Gitpod Classic extension](https://marketplace.visualstudio.com/items?itemName=gitpod.gitpod-desktop), which you can find by searching for `Gitpod Classic` inside of VS Code's Extensions tab.

1. In VS Code, from the Activity Bar, click the Gitpod icon and then choose `Sign in`. Alternatively, open the Command Palette (`Ctrl/Cmd + Shift + P`) and type **gitpod classic**. Then select `Gitpod Classic: Sign In`

<Frame caption="Sign in VS Code from Gitpod view">
  <img src="https://mintcdn.com/gitpod-13c83c2b/TkdH1nTP1u2uhW_w/images/editors/vscode-desktop-view-signin.png?fit=max&auto=format&n=TkdH1nTP1u2uhW_w&q=85&s=c59b0801a7e43be0f8992c6ec53f4a4e" width="646" height="678" data-path="images/editors/vscode-desktop-view-signin.png" />
</Frame>

*Sign in to VS Code Desktop from the Gitpod view*

<Frame caption="Sign in VS Code from Command Palette">
  <img src="https://mintcdn.com/gitpod-13c83c2b/TkdH1nTP1u2uhW_w/images/editors/vscode-desktop-command-signin.png?fit=max&auto=format&n=TkdH1nTP1u2uhW_w&q=85&s=3bd13feaf3d64d85430ec1cf11c9d68d" width="1214" height="270" data-path="images/editors/vscode-desktop-command-signin.png" />
</Frame>

*Sign in to VS Code Desktop from the Command Palette*

2. A dialog will appear asking permission to open your browser for authenticating VS Code with Gitpod. Click `Open` to proceed.

<Frame caption="Open external website">
  <img src="https://mintcdn.com/gitpod-13c83c2b/TkdH1nTP1u2uhW_w/images/editors/vscode-desktop-open-external.png?fit=max&auto=format&n=TkdH1nTP1u2uhW_w&q=85&s=5a3e47c2e4f2f0fff591ef44bcf9f0df" width="1070" height="628" data-path="images/editors/vscode-desktop-open-external.png" />
</Frame>

3. Check your browser, you should see a Gitpod tab asking to authorize the VS Code Gitpod extension, click `Authorize`.

<Frame caption="Authorize VSCode Gitpod extension">
  <img src="https://mintcdn.com/gitpod-13c83c2b/TkdH1nTP1u2uhW_w/images/editors/vscode-desktop-authorize.png?fit=max&auto=format&n=TkdH1nTP1u2uhW_w&q=85&s=4e1238b2e8de82977c9a025daba22b33" width="1218" height="700" data-path="images/editors/vscode-desktop-authorize.png" />
</Frame>

4. You will be redirected to VS Code and authentication should be completed. In the Activity Bar, click the Accounts icon and you should see your Gitpod account listed.

<Frame caption="Authenticated VS Code Gitpod extension">
  <img src="https://mintcdn.com/gitpod-13c83c2b/TkdH1nTP1u2uhW_w/images/editors/vscode-desktop-authenticated.png?fit=max&auto=format&n=TkdH1nTP1u2uhW_w&q=85&s=0d126dbff2830a205b8afacdfbf8d52d" width="762" height="264" data-path="images/editors/vscode-desktop-authenticated.png" />
</Frame>

## Open a workspace in VS Code Desktop

There are currently three supported ways to open a VS Code Desktop session connected to a Gitpod workspace, either by opening it from the [Gitpod dashboard](https://gitpod.io/workspaces), choosing VS Code Desktop as your default preference, or directly from within VS Code Browser itself.

### Open VS Code Desktop from the Gitpod Dashboard

You can start a workspace with VS Code Desktop directly from [Gitpod Dashboard](https://gitpod.io/workspaces). You can do that from by clicking on the `New Workspace` button. Then, you can select the [context url](/classic/user/introduction/gitpod-tutorial/1-start-your-workspace#open-your-repository), Editor and custom [workspace class](/classic/user/configure/workspaces/workspace-classes).

<video controls playsInline autoPlay loop muted className="shadow-medium w-full rounded-xl max-w-2xl mt-x-small" src="https://mintcdn.com/gitpod-13c83c2b/REvlzjVBFWxgsYWs/images/docs/new-workspace-start-with-options.webm?fit=max&auto=format&n=REvlzjVBFWxgsYWs&q=85&s=9c68a7ce57db29b638e22fad9f7d6f27" data-path="images/docs/new-workspace-start-with-options.webm" />

### Open VS Code Desktop from VS Code Browser

1. Start a new Gitpod workspace
2. Open the command palette (`F1` or `Ctrl/Cmd + Shift + P`)
3. Type "Open in VS Code" and hit `Enter`

You will now be redirected to VS Code Desktop.

<Frame caption="Open VS Code via the Command Palette">
  <img src="https://mintcdn.com/gitpod-13c83c2b/TkdH1nTP1u2uhW_w/images/editors/open-in-vscode-command-palette-light-theme.png?fit=max&auto=format&n=TkdH1nTP1u2uhW_w&q=85&s=cf08d65e2f1fb0e9426a3b364de67376" className="block dark:hidden" width="720" height="445" data-path="images/editors/open-in-vscode-command-palette-light-theme.png" />

  <img src="https://mintcdn.com/gitpod-13c83c2b/TkdH1nTP1u2uhW_w/images/editors/open-in-vscode-command-palette-dark-theme.png?fit=max&auto=format&n=TkdH1nTP1u2uhW_w&q=85&s=ebffd13b0be6b43aeed01004a3c93825" className="hidden dark:block" width="3358" height="1142" data-path="images/editors/open-in-vscode-command-palette-dark-theme.png" />
</Frame>

*Open VS Code via the Command Palette*

### Open VS Code Desktop using your preferences

1. Navigate to your [Gitpod preferences](https://gitpod.io/preferences)
2. Select "VS Code" (without the browser label)
3. Restart any running workspaces

When the workspace starts, you will be prompted to open VS Code Desktop. You can also access your workspace using VS Code Browser, or copy SSH credentials from this page.

<Frame caption="Open VS Code Desktop from the workspace start page">
  <img src="https://mintcdn.com/gitpod-13c83c2b/TkdH1nTP1u2uhW_w/images/editors/vscode-desktop-splash-light-theme.png?fit=max&auto=format&n=TkdH1nTP1u2uhW_w&q=85&s=191483d70fa42c83c2b672344cad1b5e" className="block dark:hidden" width="2050" height="1220" data-path="images/editors/vscode-desktop-splash-light-theme.png" />

  <img src="https://mintcdn.com/gitpod-13c83c2b/TkdH1nTP1u2uhW_w/images/editors/vscode-desktop-splash-dark-theme.png?fit=max&auto=format&n=TkdH1nTP1u2uhW_w&q=85&s=15482a862c520a07f50955cb71efadba" className="hidden dark:block" width="854" height="625" data-path="images/editors/vscode-desktop-splash-dark-theme.png" />
</Frame>

*Open VS Code Desktop from the workspace start page*

<Frame caption="Selecting VS Code Desktop as an editor preference">
  <img src="https://mintcdn.com/gitpod-13c83c2b/TkdH1nTP1u2uhW_w/images/editors/select-vscode-desktop-preference-light-theme.png?fit=max&auto=format&n=TkdH1nTP1u2uhW_w&q=85&s=e62b7a349b5431c3eeab92ae3b969937" className="block dark:hidden" width="2364" height="1300" data-path="images/editors/select-vscode-desktop-preference-light-theme.png" />

  <img src="https://mintcdn.com/gitpod-13c83c2b/TkdH1nTP1u2uhW_w/images/editors/select-vscode-desktop-preference-dark-theme.png?fit=max&auto=format&n=TkdH1nTP1u2uhW_w&q=85&s=0ce01ed9c003e5e7b6c2c6461bbcb486" className="hidden dark:block" width="872" height="623" data-path="images/editors/select-vscode-desktop-preference-dark-theme.png" />
</Frame>

*Selecting VS Code Desktop as an editor preference*

## Connecting to VS Code Desktop

Connection to VS Code Desktop works via a secure tunnel established on the users device. A minor update is required to the users SSH configuration. A directory is created `~/.ssh/code_gitpod.d`, and an `Include` statement is added to the main SSH configuration file (`~/.ssh/config`). No other SSH configuration files are read, or written to by Gitpod.

### SSH configuration modifications

The following shows examples of the changes Gitpod makes to a user's SSH configuration files to establish a connection to Gitpod.

```shell theme={null}
$ cat ~/.ssh/code_gitpod.d/config
### This file is managed by Gitpod. Any manual changes will be lost.

Host *.vss.gitpod.io
  ...
```

**Caption:** An example of the directory created `~/.ssh/code_gitpod.d` and included configuration in the auto-generated `~/.ssh/code_gitpod.d/config` file.

```shell theme={null}
$ cat ~/.ssh/config
## START GITPOD INTEGRATION
## This section is managed by Gitpod. Any manual changes will be lost.
Include "code_gitpod.d/config"
## END GITPOD INTEGRATION
```

**Caption:** Example of the update to the SSH config file in `~/.ssh/config`.

<Frame caption="How VS Code Desktop establishes connection to Gitpod">
  <img src="https://mintcdn.com/gitpod-13c83c2b/TkdH1nTP1u2uhW_w/images/editors/how-vscode-local-ssh-connect-dark-theme.png?fit=max&auto=format&n=TkdH1nTP1u2uhW_w&q=85&s=d1ed1be94d53f0b3dc074887b40f36d8" className="hidden dark:block" width="2280" height="1320" data-path="images/editors/how-vscode-local-ssh-connect-dark-theme.png" />

  <img src="https://mintcdn.com/gitpod-13c83c2b/TkdH1nTP1u2uhW_w/images/editors/how-vscode-local-ssh-connect-light-theme.png?fit=max&auto=format&n=TkdH1nTP1u2uhW_w&q=85&s=7663c8ecfc8a7c82e5c353a4c38610ae" className="block dark:hidden" width="2280" height="1320" data-path="images/editors/how-vscode-local-ssh-connect-light-theme.png" />
</Frame>

*How VS Code Desktop establishes connection to Gitpod*

### Legacy Connection Methods

For documentation on previous / deprecated methods of connecting to VS Code see [Legacy - VS Code Desktop Connection Methods](/classic/user/references/ides-and-editors/legacy-vscode-connections), this includes:

1. [SSH Gateway access using an uploaded public SSH key](/classic/user/references/ides-and-editors/legacy-vscode-connections#connect-to-vs-code-desktop-using-an-uploaded-public-ssh-key)
2. [SSH Gateway access using the owner token](/classic/user/references/ides-and-editors/legacy-vscode-connections#connect-to-vs-code-desktop-using-the-workspace-owner-token)
3. [Using Local Companion](/classic/user/references/ides-and-editors/legacy-vscode-connections#connect-to-vs-code-desktop-using-local-companion)

## Reconnect to VS Code Desktop

When VS Code Desktop disconnects from the workspace, either you are experiencing genuine connectivity issues, or it's possible that the workspace has timed out and stopped.

<Frame caption="VS Code Desktop attempting to reconnect">
  <img src="https://mintcdn.com/gitpod-13c83c2b/TkdH1nTP1u2uhW_w/images/editors/reconnect-window-light-theme.png?fit=max&auto=format&n=TkdH1nTP1u2uhW_w&q=85&s=ea2ddaca000cf55c5ea9bf70fdcffbc9" className="block dark:hidden" width="962" height="333" data-path="images/editors/reconnect-window-light-theme.png" />

  <img src="https://mintcdn.com/gitpod-13c83c2b/TkdH1nTP1u2uhW_w/images/editors/reconnect-window-dark-theme.png?fit=max&auto=format&n=TkdH1nTP1u2uhW_w&q=85&s=dd171bea2ebaa9b2952bb50d33ef48d4" className="hidden dark:block" width="1338" height="454" data-path="images/editors/reconnect-window-dark-theme.png" />
</Frame>

*VS Code Desktop attempting to reconnect*

To restart the workspace, click **Open Workspace** from the workspace start page or from the dashboard and VS Code Desktop should automatically reconnect.

**Please note:** There is currently no way to start a workspace directly from VS Code Desktop.

<Frame caption="Open workspace button shown on a stopped workspace page">
  <img src="https://mintcdn.com/gitpod-13c83c2b/TkdH1nTP1u2uhW_w/images/editors/workspace-stopped-dark-theme.png?fit=max&auto=format&n=TkdH1nTP1u2uhW_w&q=85&s=39fd0f272bd765f92552188b66520ff7" className="hidden dark:block" width="854" height="625" data-path="images/editors/workspace-stopped-dark-theme.png" />

  <img src="https://mintcdn.com/gitpod-13c83c2b/1T56zcBWQ3jfH-V2/images/editors/workspace-stopped-light-theme.png?fit=max&auto=format&n=1T56zcBWQ3jfH-V2&q=85&s=ba795d0e93fd5adb0868fbba7b352095" className="block dark:hidden" width="1398" height="874" data-path="images/editors/workspace-stopped-light-theme.png" />
</Frame>

*The open workspace button shown on a stopped workspace page*

## VS Code settings sync

For enabling Setting Sync in VS Code Desktop please refer to the [official VS Code Settings Sync documentation](https://code.visualstudio.com/editor/settings-sync)

> **Notice:** Syncing between VS Code Browser and VS Code Desktop is not supported.

## Managing VS Code extensions

VS Code runs extensions in one of two places: locally on the UI / client side, or remotely on your Gitpod workspace.

For further details, please refer to the official VS Code docs on how to [manage extensions](https://code.visualstudio.com/remote/ssh#_managing-extensions).

## Custom fonts in VS Code Desktop

The process of installing fonts matches how you typically install custom fonts locally:

1. Download the desired font to your local machine and install it locally on your operating system.
2. Open the editor's user settings (e.g. *File* > *Preferences* > *Settings* > *User*)
3. Configure your font with the `editor.fontFamily` setting:
   ```json theme={null}
   {
   	"editor.fontFamily": "Your custom font name"
   }
   ```

## Optimizing VS Code Desktop

If you're using VS Code Desktop for frequent work you'll want to optimize your setup. Below are some tips to get a workspace set up as efficient as possible.

### SSH fingerprint

<Frame caption="Accepting the SSH fingerprint in VS Code">
  <img src="https://mintcdn.com/gitpod-13c83c2b/TkdH1nTP1u2uhW_w/images/editors/vscode-ssh-fingerprint-light-theme.png?fit=max&auto=format&n=TkdH1nTP1u2uhW_w&q=85&s=ffebf19db589133cc7471f89a3a34860" className="block dark:hidden" width="821" height="225" data-path="images/editors/vscode-ssh-fingerprint-light-theme.png" />

  <img src="https://mintcdn.com/gitpod-13c83c2b/TkdH1nTP1u2uhW_w/images/editors/vscode-ssh-fingerprint-dark-theme.png?fit=max&auto=format&n=TkdH1nTP1u2uhW_w&q=85&s=d17af2e97b7f26f839fc1776806fc679" className="hidden dark:block" width="2688" height="1084" data-path="images/editors/vscode-ssh-fingerprint-dark-theme.png" />
</Frame>

*Accepting the SSH fingerprint in VS Code*

It is common convention to be asked for a fingerprint when accessing a new SSH server. When the fingerprint is accepted, a reference to the server is stored in your local `known_hosts` file, which suppresses subsequent SSH connection prompts for that server.

You should only be presented with a request to trust the Gitpod workspace when using the legacy Local Companion approach of connecting to VS Code Desktop.

By swapping to the SSH Gateway approach of accessing VS Code Desktop, your known hosts file will be updated automatically. See [connecting to VS Code Desktop](/classic/user/references/ides-and-editors/vscode#connecting-to-vs-code-desktop-ssh) for more.

### Workspace Trust

<Frame caption="The VS Code Workspace Trust popup">
  <img src="https://mintcdn.com/gitpod-13c83c2b/TkdH1nTP1u2uhW_w/images/editors/trust-authors-workspace-light-theme.png?fit=max&auto=format&n=TkdH1nTP1u2uhW_w&q=85&s=6a80d846c3ec826b8ad29c2cda5ad3a8" className="block dark:hidden" width="719" height="465" data-path="images/editors/trust-authors-workspace-light-theme.png" />

  <img src="https://mintcdn.com/gitpod-13c83c2b/TkdH1nTP1u2uhW_w/images/editors/trust-authors-workspace-dark-theme.png?fit=max&auto=format&n=TkdH1nTP1u2uhW_w&q=85&s=9a82a60087782dc85dcefb8c3e4ed40c" className="hidden dark:block" width="2506" height="1558" data-path="images/editors/trust-authors-workspace-dark-theme.png" />
</Frame>

*The VS Code Workspace Trust popup*

[Workspace Trust](https://code.visualstudio.com/editor/workspace-trust#_trusting-a-workspace) is a feature within VS Code implemented to help prevent automatic code execution by disabling or limiting the operation of several VS Code features: tasks, debugging, workspace settings, and extensions.

When opening a Gitpod workspace with VS Code Desktop for the first time you will be prompted by a trust modal (given that you have not disabled the workspace trust setting in VS Code).

Selecting "**Yes, I trust the authors**" will open the workspace and store a reference to the workspace host and directory. Opening the same workspace will not show the prompt again. However, due to a hostname change, new workspaces require trust to be accepted on first open.

Choosing "**No, I do not trust the authors**" will enter you into the VS Code Restricted Mode. You can edit code in your workspace, but some features will be restricted. You can disable the VS Code Restricted Mode after the initial prompt.

If required, you can disable the workspace trust feature, however this is not recommended. Select "**Manage Workspace Trust**" from the Manage gear menu to view and modify your VS Code Workspace Trust settings.

<Frame caption="Updating Workspace Trust settings">
  <img src="https://mintcdn.com/gitpod-13c83c2b/TkdH1nTP1u2uhW_w/images/editors/manage-workspace-trust-dark-theme.png?fit=max&auto=format&n=TkdH1nTP1u2uhW_w&q=85&s=553872d792e63b1b4769de1eebe51eca" className="hidden dark:block" width="814" height="435" data-path="images/editors/manage-workspace-trust-dark-theme.png" />

  <img src="https://mintcdn.com/gitpod-13c83c2b/TkdH1nTP1u2uhW_w/images/editors/manage-workspace-trust-light-theme.png?fit=max&auto=format&n=TkdH1nTP1u2uhW_w&q=85&s=462a13b6c675f05f6868ede914c2a3ba" className="block dark:hidden" width="727" height="380" data-path="images/editors/manage-workspace-trust-light-theme.png" />
</Frame>

*Updating Workspace Trust settings*

Although, the following settings are **not recommended**, but you can untick the following setting to Trust all workspaces. It will apply to all opened repositories, inside and outside Gitpod.

<Frame caption="Manage workspace settings">
  <img src="https://mintcdn.com/gitpod-13c83c2b/TkdH1nTP1u2uhW_w/images/editors/manage-trust-settings-configure.png?fit=max&auto=format&n=TkdH1nTP1u2uhW_w&q=85&s=a965ef49b00dd6b3f434a797115545b2" width="2166" height="584" data-path="images/editors/manage-trust-settings-configure.png" />
</Frame>

See [Workspace Trust](https://code.visualstudio.com/editor/workspace-trust) in the VS Code official documentation for more.

### How do I know how I'm connecting to VS Code Desktop?

If you're uncertain about your connection method to Gitpod via VS Code Desktop, you can check the connection host displayed at the bottom left of the VS Code window.

* **Recommended** - Appears as `SSH: <workspaceid>.vss.gitpod.io` or `SSH: <workspaceid>.vsi.gitpod.io`
* **[SSH Gateway](/classic/user/references/ides-and-editors/legacy-vscode-connections#connect-to-vs-code-desktop-using-an-uploaded-public-ssh-key)** (Legacy) - Shows as `SSH: <workspaceid>.ssh.*.gitpod.io`
* **[Local Companion](/classic/user/references/ides-and-editors/legacy-vscode-connections#connect-to-vs-code-desktop-using-local-companion)** (Retired) - Displays only the `<workspaceid>` without a domain

<Frame caption="The SSH host information shown in the bottom left of VS Code Desktop">
  <img src="https://mintcdn.com/gitpod-13c83c2b/TkdH1nTP1u2uhW_w/images/editors/show-ssh-connection-vscode-light-theme.png?fit=max&auto=format&n=TkdH1nTP1u2uhW_w&q=85&s=b315998075fb4729211eff29418ae21d" className="block dark:hidden" width="720" height="262" data-path="images/editors/show-ssh-connection-vscode-light-theme.png" />

  <img src="https://mintcdn.com/gitpod-13c83c2b/TkdH1nTP1u2uhW_w/images/editors/show-ssh-connection-vscode-dark-theme.png?fit=max&auto=format&n=TkdH1nTP1u2uhW_w&q=85&s=dd9b1ebf9f7892df4c0467f2c3db15b2" className="hidden dark:block" width="962" height="306" data-path="images/editors/show-ssh-connection-vscode-dark-theme.png" />
</Frame>

*The SSH host information shown in the bottom left of VS Code Desktop*

### I'm being asked to choose the `platform of the remote host`. What should I choose?

When connecting, sometimes VS Code Desktop fails to automatically detect the host OS of a Gitpod workspace, asking the following: `Select the platform of the remote host "{id}"`.

No matter what the OS is on your computer, you should always choose `Linux` as the remote host platform, since this is the operating system all Gitpod workspaces run on.

If you choose another option, you may encounter an error like this:

```text theme={null}
Resolver error: Error: Got bad result from install script
```

### How do I enable SSH agent forwarding for Desktop VS Code?

Gitpod extension delegates ssh connection to the [MS Remote - SSH](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh) extension so agent forwarding should just work if you configure it in your `~/.ssh/config` file:

```
Host *.gitpod.io
    ForwardAgent yes
```

## Upload Files

You can upload files to your workspace by dragging and dropping them into the editor. This method works with every IDE (e.g. Intellij, PyCharm, etc.)

<video controls playsInline autoPlay loop muted className="shadow-medium w-full rounded-xl max-w-3xl mt-x-small" src="https://mintcdn.com/gitpod-13c83c2b/YsfME4byfqHwngvI/images/editors/file-upload-drag-and-drop.webm?fit=max&auto=format&n=YsfME4byfqHwngvI&q=85&s=8cb4f0408fcf401342f09929aa35cbc5" data-path="images/editors/file-upload-drag-and-drop.webm" />

## Troubleshooting

If you are having issues connecting to VS Code Desktop from Gitpod, try to:

1. Ensure both your VS Code Desktop application and Gitpod VS Code Desktop extension are up-to-date.
2. Determine [your current connection method to Gitpod](/classic/user/references/ides-and-editors/vscode#how-do-i-know-how-im-connecting-to-vs-code-desktop).
3. If you're not using the **recommended** mode, [switch to it](/classic/user/references/ides-and-editors/vscode#connecting-to-vs-code-desktop). If you can't switch, consult the [legacy docs](/classic/user/references/ides-and-editors/legacy-vscode-connections#troubleshooting).
4. If you're already using the **recommended** mode, [export the logs](/classic/troubleshooting#gitpod-logs-in-vs-code-browser-and-desktop) from the failed to connect window and [email us](mailto:contact@gitpod.io).
