Share feedback
Answers are generated based on the documentation.

Connect VS Code to a sandbox

Availability: GA
Requires: Docker Sandboxes 0.37.0 or later

Use the Remote - SSH extension to open a VS Code window that runs inside a sandbox. Your editor stays on your host while files, terminals, and extensions run in the isolated sandbox.

Prerequisites

Connect

Confirm that you can connect to the sandbox from a terminal:

$ ssh demo.sbx

In VS Code, open the Command Palette and run Remote-SSH: Connect to Host.... Enter the sandbox hostname, such as demo.sbx, manually. After VS Code connects, use the remote folder picker to select the mounted workspace.

For more connection options, see the VS Code instructions to connect to a remote host.

Notes

  • The first connection installs the VS Code server inside the sandbox, so it can take a moment. Later connections are faster.

Reconnect loop on macOS

Affected versions of VS Code can enter an infinite reconnect loop on macOS. If this happens, set remote.SSH.useLocalServer to false in your VS Code user settings:

{
  "remote.SSH.useLocalServer": false
}

For details, see microsoft/vscode-remote-release#11672.