Skip to main content
Use ensure_base_kernel_for_backend(...) when you bring your own root filesystem but want SmolVM’s verified base kernel. The helper picks the right kernel artifact for the backend, downloads it on first use, verifies it, and returns the local path.

ensure_base_kernel_for_backend

from smolvm import ensure_base_kernel_for_backend

kernel = ensure_base_kernel_for_backend("qemu", arch="host")
print(kernel)
backend
str | None
default:"None"
Backend that will boot the kernel. Use "firecracker" or "qemu" for documented SmolVM backends. When omitted, SmolVM uses normal backend selection.
arch
Literal["host", "amd64", "arm64", "x86_64", "aarch64"] | str
default:"host"
Architecture for the kernel. Use "host" to match the current machine.
cache_dir
Path | None
default:"~/.smolvm/images/"
Cache directory for downloaded kernel files.
return
Path
Local path to the verified SmolVM base kernel.

What it selects

SmolVM publishes the same kernel build in different container formats:
BackendKernel artifact
FirecrackerELF kernel
QEMUImage/bzImage kernel
The source currently also accepts libkrun in this helper. The public docs focus on Firecracker and QEMU because those are the supported paths for most users.
Last modified on June 6, 2026