Discover Docker Sandboxes Now on Windows
Docker Sandboxes (sbx) now runs on Windows 11. Every sandbox is a Linux microVM with its own kernel, its own Docker Engine and a deny-by-default network. On Windows it runs on the Windows Hypervisor Platform. There is no WSL2 in the loop.
What you get inside a sandbox
| Resource | What the sandbox gets |
|---|---|
| Kernel | Its own guest kernel, isolated from the host |
| Docker Engine | A private Docker daemon inside the VM |
| Filesystem | Its own root filesystem plus any mounted workspace |
| Network | Private stack, deny-by-default egress through a host-side proxy |
Prerequisites
| Requirement | Detail |
|---|---|
| OS | Windows 11 |
| CPU | 64-bit Intel or AMD (Windows on ARM is not supported for local sandboxes) |
| Runtime | Windows Hypervisor Platform optional feature enabled |
| Firmware | VT-x / AMD-V enabled in BIOS/UEFI |
Does it need admin?
| Step | Admin? |
|---|---|
winget install -h Docker.sbx (per-user) | No |
| Enable Windows Hypervisor Platform | Yes, one time, plus a reboot |
Daily sbx run | No |
Step 1: Enable the Windows Hypervisor Platform (one time)
Open PowerShell as Administrator:
Enable-WindowsOptionalFeature -Online -FeatureName HypervisorPlatform -All
Reboot when asked. Note: this is not the Hyper-V role and not WSL2.
Rolling out with Intune / MDM? Let your tooling schedule the reboot:
# One-time, elevated, per machine
Enable-WindowsOptionalFeature -Online -FeatureName HypervisorPlatform -All -NoRestart
# Then, as the developer (no admin):
winget install -h Docker.sbx
Step 2: Install sbx (no admin)
winget install -h Docker.sbx
This installs to %LOCALAPPDATA%. No elevation needed.
Step 3: Sign in and store your model key
sbx login
sbx secret set anthropic
sbx secret set prompts for the key. Other providers work the same way:
sbx secret set openai
sbx secret set openrouter
sbx secret set google
sbx secret set xai
The key never enters the VM. The host proxy adds it to outbound HTTP headers.
Step 4: Pick a network policy
On first run, choose Balanced (deny by default, common developer sites allowed).
sbx policy
sbx policy ls
Need to reach a database on your LAN?
sbx policy allow network 10.0.0.5:5432
Step 5: Run your first sandbox
sbx run claude-code ~/my-project
Pick the template that matches your agent:
| Template | Agent inside |
|---|---|
| claude-code | Claude Code |
| claude-code-minimal | Claude Code (no Node, Python, Go, Java) |
| codex | OpenAI Codex |
| copilot | GitHub Copilot CLI |
| cursor-agent | Cursor |
| devin | Devin CLI |
| docker-agent | Docker Agent |
| droid | Droid |
| gemini | Gemini CLI |
| kiro | Kiro |
| opencode | OpenCode |
| shell | No agent, manual setup |
Templates are Ubuntu-based and run as user agent (UID 1000, home /home/agent) with sudo.
Daily commands cheat sheet
# Lifecycle
sbx run opencode ~/my-project
sbx run --name feature opencode ~/proj
sbx run --name feature
sbx create --name scratch opencode
sbx ls
sbx stop my-sandbox
sbx rm my-sandbox
# Shell inside a sandbox
sbx exec -it my-sandbox bash
# Ports
sbx ports my-sandbox --publish 8080:3000
sbx ports my-sandbox
# Files
sbx cp ./config.json my-sandbox:/home/agent/workspace/
sbx cp my-sandbox:/home/agent/workspace/out.log ./
# Templates
sbx template save my-sandbox my-template:v1
sbx run -t my-template:v1 opencode
# Settings
sbx settings list
sbx settings set sandbox.disk.dockerVolume 30g
sbx daemon restart
Drive a project with sbxenv.yaml
Keep this file beside the project, not inside the mounted workspace:
schemaVersion: "1"
name: my-app
agent: opencode
workspace: ./app
env:
NODE_ENV: development
DATABASE_URL: postgres://alice:alice-strong-password@10.0.0.5:5432/alice_app
sandboxOptions:
cpus: 4
memory: 8g
skills: readonly
ports:
- sandbox: 3000
host: 3000
sbx env plan # preview what will be created
sbx env run # create the sandbox and attach
sbx env rm # destroy the environment
Isolation layers
- Hypervisor: guest kernel separated from the host
- Network: outbound TCP proxied and deny-by-default, UDP off, ICMP blocked, DNS through policy
- Docker Engine: host daemon is unreachable
- Workspace: mountless, clone or direct mount
- Credentials: injected by the host proxy, never stored in the VM
Always blocked (not configurable): host files outside your workspace, the host Docker daemon, sandbox-to-sandbox traffic, and external ping.
What survives a restart?
| Action | Effect |
|---|---|
sbx run | Boots the microVM and attaches you |
| Stop / start | Everything inside the VM persists |
sbx rm | Deletes the sandbox and its contents |
A directly mounted workspace lives on the host, so sbx rm does not delete your source code.
Sandboxes vs other options
| Approach | Isolation | Docker daemon | Best for |
|---|---|---|---|
| Sandboxes (microVMs) | Full hypervisor | Isolated, in-VM | Autonomous agents |
| Container + socket mount | Partial (namespaces) | Shared host daemon | Trusted tools |
| Docker-in-Docker | Partial (privileged) | Nested | CI/CD |
| Host execution | None | Host daemon | Manual dev |
Clean up
sbx stop my-sandbox
sbx rm my-sandbox
sbx prune --dry-run # see what would be removed
sbx prune
sbx template ls
No admin at all? Use the cloud
sbx --cloud
No local hypervisor needed. No host workspace mount, and compute is pay-as-you-go. The sbx CLI and local sandbox compute are free, including for commercial use.
Wrapping up
Enable one Windows feature once, install with winget, and every developer gets a private Linux microVM for their agents. Try the full hands-on lab at dockerworkshop.vercel.app.
Tip: sbx moves fast. Run sbx <cmd> --help to confirm flags on your installed version.