About this project

smolvm lets you manage and run custom Linux virtual machines locally using hardware virtualization (Hypervisor.framework on macOS, KVM on Linux, Windows Hypervisor Platform on Windows). It is built on libkrun as the VMM and libkrunfw for the guest kernel, with each workload getting its own VM and guest kernel for strong isolation. Key capabilities include: - Fast, cross-platform microVMs with sub-200ms cold starts, elastic memory via virtio balloon, and idle vCPU threads that sleep in the hypervisor. - Smolfile: a TOML declaration file (similar to a Dockerfile but for a whole VM) specifying image, resources, network policy, mounts, ports, and setup commands. Unknown keys are rejected at create time. - VM branching: live copy-on-write forks of a running machine that resume with the source's processes, memory, and disk. Supports batch branching with fan-out, worker-ready signaling, and held pool slots. - Portable artifacts: pack a stopped VM into a single .smolmachine file that can be pushed to any OCI registry and rehydrated on any supported platform with zero dependencies. - Sandboxing: network is off by default; egress can be locked to specific allowed hosts. Host filesystem, network, and credentials are separated by a hypervisor boundary. - SSH agent forwarding: the guest can use host SSH keys for git and SSH without private key material being copied into the VM. - Local container images: boot from docker save / podman save archives, stdin pipes, or unpacked rootfs directories without a Docker daemon. - Persistent dev machines: create, stop, start, and exec into machines with installed packages surviving restarts. Host directory mounts propagate inotify events for hot reload. - Kubernetes integration: ships a containerd shim v2 so pods run as microVMs via a RuntimeClass. - GPU acceleration: exposes the host GPU via virtio-gpu / Venus (Vulkan-over-virtio) on macOS and Linux. CUDA API remoting (--cuda) forwards CUDA calls over vsock to the host NVIDIA driver without GPU passthrough. - Checkpointing: save VM state as a durable .smolcheckpoint artifact for later restoration. A Rust crate (smolvm-checkpoint) provides incremental storage and portable export without depending on the VM runtime. Default resources are 4 vCPUs and 8 GiB RAM, overridable via flags or Smolfile. The security model treats guest root as untrusted, with explicitly forwarded capabilities (mounts, network, ports, SSH agent) becoming part of the workload's authority. The project is Apache-2.0 licensed.