By default, SmolVM boots a minimal Alpine Linux image with SSH. If you need specific packages, libraries, or a different base OS, you can build a custom image using theDocumentation Index
Fetch the complete documentation index at: https://docs.celesto.ai/llms.txt
Use this file to discover all available pages before exploring further.
ImageBuilder class. Custom images are built with Docker and cached locally so you only build once.
Quick start
ImageBuilder requires Docker to be installed and running. On macOS, use Docker Desktop. On Linux, install docker.io.Build methods
SmolVM provides three image build methods. Each creates a Linux filesystem with SSH pre-configured and returns a(kernel_path, rootfs_path) tuple.
Alpine with SSH password
The simplest option — builds a minimal Alpine Linux image with root password authentication:Alpine with SSH key (recommended)
More secure — uses public key authentication instead of a password:Debian with SSH key
For workloads that needapt, glibc, or broader package compatibility. Debian images are larger but more compatible:
Since v0.0.14,
debian is no longer accepted by smolvm create --os or by auto-config. The build_debian_ssh_key method below remains available when you call ImageBuilder directly. For new projects, prefer the Ubuntu auto-config path or build on the Alpine/Ubuntu base.Boot arguments
Use theSSH_BOOT_ARGS constant for any SSH-capable image:
Image caching
ImageBuilder caches built images to avoid rebuilding. The first build downloads base images and runs Docker. Subsequent calls with the same name return cached paths instantly:
Custom cache directory
The kernel SmolVM uses
Every image you build withImageBuilder boots SmolVM’s own Linux 6.12.85 kernel. SmolVM builds it in CI from upstream Linux source and tunes it for sandbox workloads — it is the same kernel used by the published images so behavior stays consistent across hosts.
You don’t need to pick a kernel or pass a URL. SmolVM downloads the universal kernel once and caches it under ~/.smolvm/images/<version>/.
How the init script works
All SSH-capable images include a custom/init script that runs as PID 1 inside the sandbox. This script:
- Mounts essential filesystems (
/proc,/sys,/dev,/tmp) - Configures networking from kernel boot arguments
- Sets up DNS resolution (8.8.8.8)
- Generates SSH host keys if missing
- Starts the SSH daemon
- Stays alive as PID 1 to keep the sandbox running
ImageBuilder method.
Real-world example: OpenClaw
This example fromexamples/openclaw.py builds a 4 GB Debian image for the OpenClaw application:
Troubleshooting
When an image build fails, SmolVM diagnoses the root cause and returns a specific error message. You do not need to debug Docker issues manually.Docker not installed
Docker not installed
SmolVM raises an
ImageError with install instructions:- macOS: Install Docker Desktop
- Linux:
sudo apt-get install docker.io(Debian/Ubuntu)
Docker daemon not running
Docker daemon not running
Start the Docker service:
- macOS
- Linux
Permission denied on Docker socket
Permission denied on Docker socket
Add your user to the
docker group:Build fails with disk space errors
Build fails with disk space errors
Image builds require sufficient disk space. Check available space and clean the Docker cache if needed:
Next steps
Environment variables
Inject configuration into custom images
AI agent integration
Build specialized images for AI agent sandboxes
VM lifecycle
Manage sandboxes built with custom images
