·4 min read

Spunto Sandbox: the engine behind Spunto Cloud, now open source

The code that starts, pauses and forks Spunto Cloud's sandboxes is public under Apache-2.0. A daemon, a CLI and a TypeScript SDK let you run Firecracker microVMs on your own Linux machine — here is what a box is, what it costs in seconds, and why it is built on Firecracker.

Spunto Team

Spunto Team

spunto.net

Every sandbox on Spunto Cloud is a microVM, and the code that starts, pauses and copies them was written for Spunto, inside Spunto. As of this week it has its own home: Spunto Sandbox, open source under the Apache-2.0 license, at github.com/spuntodotnet/sandbox.

It is the same engine, with what it needs around it to run on your own machine without the rest of Spunto: a daemon (spunto-sandboxd), a CLI (sbx) and a TypeScript SDK (@spunto/sandbox on npm).

curl -fsSL https://sandbox.spunto.net/install.sh | sudo sh
 
sbx run ubuntu:24.04 --name hello        # a microVM, from any Docker image
sbx exec hello -- uname -a
sbx pause hello                          # RAM written, nothing runs, nothing is lost
sbx resume hello                         # same processes, back where they were
sbx fork hello --name hello-2            # a second VM, same memory, same processes

A coding agent spends a lot of its time waiting: for a test suite, for a review, for a person to answer a question. The engine was built around that. What we needed was a box per sandbox that starts fast, and above all a pause that keeps the memory: a task waiting an hour for a human should hold no RAM and no CPU, then carry on — dev server, REPL, half-done build — when the human answers.

That need picked the hypervisor. On the same bare-metal server, QEMU (through Incus) booted in 9 to 11 s and resumed a saved state in 7.8 s, no faster than a boot. Firecracker booted to a login prompt in 2.3 s and loaded a snapshot and resumed in 27 ms. The design notes tell the rest, choice by choice.

  • A microVM, not a container. Its own kernel (built reproducibly, with what Docker needs inside), its own disks, its own network namespace. Each Firecracker process runs under the jailer: a chroot, a user of its own, no capability.
  • Made from any OCI image. The image is unpacked inside a throwaway microVM, so the host never untars an archive from the internet.
  • Two disks on ZFS. / is a copy-on-write clone of the image and /workspace survives rebuilds: a new box costs nothing until it writes.
  • Out to the internet only. A box can't reach the host, another box, a private network or a cloud's metadata server. Nothing comes in; you reach a port with sbx port-forward or box.connect(port).
  • Bounded. CPU, network and memory per box — and a box only starts if the machine has room for it.

From code, the same in a few lines:

import { Sandbox } from "@spunto/sandbox"
 
const box = await Sandbox.create({ image: "node:24" })
const { stdout } = await box.exec("node -v")
await box.pause()             // RAM kept, nothing running
await box.resume()            // same processes, back in a fraction of a second
const copy = await box.fork() // a second box, same memory

Measured by sbx on November 25 with version 0.1.0, on a GCP n2-standard-8 with nested virtualization — so slower than bare metal — with small boxes (1 vCPU, 2 GB):

sbx run ubuntu:24.04, first box of the image (pull, unpack, boot)7.6 s
sbx run ubuntu:24.04, image already there2.5 s
sbx pause / sbx resume (until the agent in the box answers)0.8 s / 0.27 – 0.34 s
sbx fork of a running box: source paused / copy running39 – 77 ms / 0.9 – 1.2 s
A box from a memory snapshot (daemon side)0.36 s

Every figure, and how it was measured, is on the benchmarks page.

Linux on x86_64 with KVM (bare metal, or a cloud VM with nested virtualization), systemd with cgroup v2, and ZFS — a pool of yours, or --create-pool 100G for one in a file, to try it. The installer checks each of these and says what is missing. Not macOS, not ARM: not yet.

New to kernels, virtual machines and Firecracker? From zero explains them in five short videos, from what a kernel is to what can still go wrong.

Use Spunto Sandbox when you want your sandboxes on your hardware. Use Spunto Cloud when you would rather not have hardware: the same microVMs, the same pause and the same forks, with what a platform adds — an API and an MCP server for agents, a dashboard, projects, tasks delegated to coding agents, teams.

Issues and pull requests are welcome on GitHub.

Spunto Team

Spunto Team

spunto.net

Building Spunto — self-hosted dev environments for engineers who want their compute to work for them, not against them.

Spunto Sandbox: the engine behind Spunto Cloud, now open source — Spunto