Check prerequisites
SmolVM uses hardware virtualization. The requirements depend on your platform:
- Linux (Firecracker)
- macOS (QEMU)
- KVM support — check with
ls /dev/kvm - Ubuntu, Debian, or Fedora recommended
- Root access for initial setup
/dev/kvm does not exist, enable virtualization in your BIOS/UEFI settings. For cloud VMs, enable nested virtualization in your hypervisor.Run one-time setup
This configures the virtualization backend for your machine:On Linux, this installs Firecracker, configures KVM permissions, and sets up networking tools. You may be prompted for
sudo.On macOS, this installs QEMU via Homebrew.Verify the runtime
Confirm everything is ready:You should see green checkmarks for your backend, KVM (Linux), and networking tools.
Run your first sandbox
Create a file called Run it:You should see:The
quickstart.py:quickstart.py
with block handles the full lifecycle — it creates the sandbox on entry and tears it down on exit.The first run takes longer (30–60 seconds) because SmolVM downloads and builds the Alpine Linux base image. Subsequent runs use the cached image and boot in under a second.
Try more commands
Inside the sandbox you can run as many commands as you need. The sandbox stays alive until thewith block exits:
Customize resources
Configure memory and disk size for heavier workloads:- Memory: 512 MiB
- Disk: 512 MiB
- Minimum disk size: 64 MiB
Next steps
AI agent integration
Plug SmolVM into PydanticAI, OpenAI Agents, LangChain, and more
Port forwarding
Expose services running inside a sandbox to your host machine
Custom images
Build specialized images with your own tools pre-installed
API reference
Explore the complete SmolVM API
Troubleshooting
KVM device not found (/dev/kvm)
KVM device not found (/dev/kvm)
Linux only — if you see “KVM device missing”:
-
Check virtualization support:
If nothing appears, enable virtualization in BIOS/UEFI.
-
Load KVM modules:
-
Add your user to the kvm group:
SSH connection timeout
SSH connection timeout
If the sandbox starts but SSH times out:
- Wait longer — the first boot downloads and builds the Alpine image (30–60 seconds).
- Increase timeout:
- Check networking:
macOS: QEMU not found
macOS: QEMU not found