This guide walks you from a bare Linux host to a running cohort of KVM-isolated microVM sandboxes. The one-command path (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/deeplethe/forkd/llms.txt
Use this file to discover all available pages before exploring further.
forkd quickstart) handles every step automatically; the manual path below gives you control over each verb when you need it.
Prerequisites
forkd requires a bare-metal or nested-virt x86_64 Linux host with KVM enabled.Verify your host is ready before installing:
- Architecture: x86_64
- OS: Ubuntu 22.04 or newer (other distros work; Ubuntu is tested)
- Kernel: Linux 5.7 minimum; 5.20+ recommended for automatic RNG re-seeding via
vmgenid - KVM:
/dev/kvmmust be present and readable by your user - cgroup v2: unified hierarchy must be mounted (
mount -t cgroup2)
Managed Kubernetes (GKE, EKS, AKS) typically requires a bare-metal node SKU or explicit nested-virt enablement to expose
/dev/kvm. See Host Setup for cloud-specific instructions and the full list of kernel modules and tuning parameters.Install forkd
Download and install the pre-built tarball — no Rust toolchain required:This installs two binaries:Optionally install the language SDKs for programmatic use:
forkd— the CLI for snapshots, forking, packing, and the bench tool.forkd-controller— the daemon that owns the registry, REST API, auth, and metrics.
One-command quickstart
Run the automated quickstart. This is the fastest way to get a working sandbox:
forkd quickstart does the following in order (nothing happens without your consent, or pass --yes to accept all prompts):- Preflights the host — runs the same 16 checks as
forkd doctor(KVM, hardware virt, cgroup v2, IP forwarding, tap device, netns provisioning, Firecracker binary + version, Docker daemon, snapshot directory + disk space, kernel image, controller reachability, anduffd_wp+memfd_createfor the v0.4 live-fork path). - Downloads a guest kernel if one is not already present.
- Provisions a tap device (
forkd-tap0) and network namespaces for per-child isolation. - Bakes a Python snapshot from
python:3.12-slimwith numpy pre-imported using your local Docker daemon — or pulls a prebaked pack from the Snapshot Hub if Docker is absent. - Forks 10 microVM children from the snapshot and prints per-child timings.
Verify latency with the bench tool
After quickstart completes, probe your install’s actual fork latency:Example output:Run this against any snapshot to measure how forkd performs on your hardware. The output is screenshot-friendly and covers single-spawn, exec round-trip, BRANCH, and fan-out timings in one pass.
Using the Python SDK
The Python SDK is E2B wire-compatible at theSandbox class level — swap from e2b import Sandbox for from forkd import Sandbox and existing agent code continues to work.
In-guest agent (exec and eval inside a running sandbox):
sb.eval(...) costs ~1 ms because it reuses the already-running Python interpreter in the sandbox’s PID 1. sb.commands.run("python3 -c '...'") spawns a cold subprocess that re-imports numpy (~96 ms). Prefer eval for tight loops.Using the TypeScript SDK
For Node.js 18+ agents (LangChain.js, AutoGen, OpenAI Swarm, or anything JS-side):Next steps
Building Snapshots
Build custom parent snapshots from Docker images or pre-built recipes (Jupyter, browser, Postgres).
Forking Sandboxes
Fork N children from a snapshot, set memory limits, and communicate via exec and eval.
Python SDK Reference
Full API reference for the Sandbox and Controller classes.
BRANCH: Fork a Live VM
Pause a running sandbox mid-thought, snapshot its state, and fan out to N children in ~56 ms.