Environment
Sandboxes on CodeSandbox are backed by a Firecracker (opens in a new tab) microVM, within the VM we run a rootless Docker container based on a Dev Container (opens in a new tab) configuration (specified in the .devcontainer/devcontainer.json
file).
Booting a Sandbox
Whenever we boot a sandbox from scratch, we'll:
- Start the Firecracker VM
- Create a default user (called
pitcher-host
) - (optional) Build the Docker image specified in the
.devcontainer/devcontainer.json
file - Start the Docker container
- Mount the
/project/sandbox
directory as a volume inside the Docker container
We run an agent inside the VM that the SDK connects to. Via an RPC protocol you can then interact with the sandbox.