Docker Sandboxes already supports SSH: ssh my-sandbox.sbx opens a shell in a sandbox, which means any SSH-capable editor (VS Code Remote-SSH, Cursor, Zed) can work inside the microVM. v0.48.0 extends this to the desktop agent apps:
On macOS and Windows,
sbx setup ssh --auto-createregisters Docker Sandbox connections in Codex and Claude Desktop. Each connection creates a dedicated sandbox on first use and reuses it on subsequent connections.
How SSH to a sandbox works
From sbx setup ssh --help:
Write a generated SSH config + known_hosts and include it from ~/.ssh/config so
"ssh <name>.sbx" connects with no prompts. Named app instances use
"ssh <name>.sbx-<app>" instead. Re-run any time; it's idempotent.
No SSH client key is needed; authentication is handled by the daemon's local
socket or named pipe (OS user boundary) combined with an active Docker login.
Sign in first (sbx login). On macOS and Windows, use --auto-create to install
the fixed codex.sbx and claude.sbx desktop profiles.
So you don’t manage any keys. Authentication is your OS user (who can reach the daemon socket) plus your Docker login.
Step 1: Sign in
sbx login
Desktop SSH setup now warns about missing authentication and gives local sign-in guidance for Codex and Claude.
Step 2: Generate the SSH config with desktop profiles
sbx setup ssh --auto-create
[OUTPUT TO CAPTURE]
This does three things:
- Writes a generated SSH config and
known_hosts, and adds anIncludefor it to~/.ssh/config(Host pattern*.sbxby default; change it with--alias). - Registers a
codex.sbxprofile in Codex. - Registers a
claude.sbxprofile in Claude Desktop.
Running it again is safe, and it recognises existing registrations even while the apps are running.
Step 3: Connect from Claude Desktop / Codex
[SCREENSHOT: Claude Desktop → SSH connection → claude.sbx]
[SCREENSHOT: Codex → remote → codex.sbx]
On the first connection, sbx creates a dedicated sandbox for that app. Later connections reuse it.
sbx ls
[OUTPUT TO CAPTURE: the auto-created sandboxes]
Step 4: Get your code in (no host workspace)
These auto-created sandboxes have no host workspace mounted. That’s deliberate: the desktop app gets a clean, isolated machine, not your home directory. Bring code in explicitly:
# from inside the session
git clone https://github.com/you/your-repo && cd your-repo
# or from the host
sbx cp ./my-project <sandbox-name>:/home/agent/my-project
Step 5: Plain SSH still works
ssh my-sandbox.sbx -- echo hello
[OUTPUT TO CAPTURE]
Other SSH fixes in 0.48.0
- Closing a Cursor or VS Code window connected over SSH no longer stops the daemon and every other running sandbox.
- SSH no longer fails on a cold start, where the CLI’s initial feature lookup used to time out before the daemon was up.
- SSH agent forwarding works with Windows OpenSSH and 1Password agents when
SSH_AUTH_SOCKisn’t set. - An unresponsive guest gives stop-and-start guidance over SSH instead of hanging (Part 6).
Undo
sbx setup ssh remove # removes the SSH config and desktop targets, keeps the sandboxes
Series wrap-up
That’s every new feature in Docker Sandboxes v0.48.0:
- A consistent CLI with
--format json|yamland strict non-TTY behaviour - Kits v3: capability groups,
kit.env, bundled skills,ssh-agent@1,git-identity@1 sbx kit addwith startup commands, plusSBX_AGENT- Live
sbx mcp unload - Sandbox-scoped secret overrides
- Registry-free local snapshots and lifecycle fixes
- Security hardening
- Managed Codex and Claude Desktop SSH targets
References: v0.48.0 release notes · Docker Sandboxes docs