BootImage to tell SmolVM which disk image to boot and how to boot it. It is a description only: SmolVM creates the VM, networking, and per-VM disk later when you pass the image to SmolVM.from_image().
BootImage
Human-readable image name. Blank names are rejected.
Path to the root filesystem disk image. The file must exist.
Disk image format. Use
"raw-ext4" for raw ext4 filesystems and "qcow2" for QEMU qcow2 disks.Kernel image path for direct-kernel boot. Direct-kernel images may omit this;
SmolVM.from_image(...) resolves SmolVM’s cached base kernel for the selected backend.Optional initrd image path for direct-kernel boot.
Boot helper. Use
DirectKernelBoot for Linux images loaded with -kernel, or FirmwareBoot for QEMU images that boot through firmware.Explicit kernel command line for direct-kernel images. Mutually exclusive with
boot.Backend this image is built for. Public docs focus on Firecracker and QEMU;
libkrun is accepted by the source but is less documented.Guest CPU architecture. Leave unset when
SmolVM.from_image(...) should use the host architecture.Whether the image starts SSH and accepts the credentials you pass to SmolVM. Set this to
True only when command helpers such as vm.run(...) can connect.Validation rules
BootImage validates the boot contract before you launch:
- Artifact paths must exist and point to files.
- Direct-kernel images need either
bootorboot_args. bootandboot_argsare mutually exclusive.- Firmware images must use
backend="qemu"when a backend is set. - Firmware images must not set
kernel_path,initrd_path, orboot_args.
Properties and methods
VM boot mode inferred from the boot helper.
Returns the kernel command line for direct-kernel images. Firmware images return an empty string because their boot arguments live inside the disk image.
DirectKernelBoot
UseDirectKernelBoot when SmolVM should load a Linux kernel directly.
Root device passed to the kernel.
Init program path. Set
None when the image should use its default init.Mount the root filesystem read-write. When
False, renders ro.Serial console setting. QEMU on arm64 uses
ttyAMA0; other documented paths use ttyS0.Kernel panic reboot delay.
Kernel reboot mode.
Add SmolVM’s safe boot defaults such as
tsc=reliable and no_timer_check.Controls the
quiet boot flag. Leave unset for the default behavior, or set SMOLVM_VERBOSE_BOOT=1 to drop quiet while debugging.Extra kernel arguments. Each entry must be one token with no spaces.
FirmwareBoot
UseFirmwareBoot for QEMU images that already contain their own bootloader, such as cloud images or Windows qcow2 disks.
Firmware images boot through QEMU firmware. They do not use
kernel_path, initrd_path, or boot_args.