Connect VS Code to a sandbox
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
- SSH access set up. See Editor and app integrations.
- The Remote - SSH
extension (
ms-vscode-remote.remote-ssh) installed in VS Code.
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.
Related
- Editor and app integrations — how SSH access works and how to set it up