SDK
Environment

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:

  1. Start the Firecracker VM
  2. Create a default user (called pitcher-host)
  3. (optional) Build the Docker image specified in the .devcontainer/devcontainer.json file
  4. Start the Docker container
  5. 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.