Overview
TheHostManager class validates the host environment and manages the Firecracker binary installation. It checks for required system capabilities like KVM access, network tools, and the Firecracker binary.
The default installation directory is ~/.smolvm/bin/.
Constructor
str
default:"v1.14.1"
Pinned Firecracker version to install when auto-installing (e.g., “v1.14.1”).
Class Attributes
Path
SmolVM home directory:
~/.smolvmPath
Binary installation directory:
~/.smolvm/bin/Methods
detect_arch
str
Architecture string (e.g., “x86_64”, “aarch64”).
check_kvm
/dev/kvm exists and is accessible with read/write permissions.
bool
True if KVM is available with R/W permissions, False otherwise.
check_dependencies
ip(iproute2)nft(nftables)ssh(openssh-client)
list[str]
List of missing dependency names (empty if all present).
find_firecracker
- System PATH
~/.smolvm/bin/firecracker
Path | None
Path to the binary, or None if not found.
install_firecracker
~/.smolvm/bin/.
str | None
default:"None"
Version to install (e.g., “v1.14.1”). Defaults to the pinned version from the constructor.
Path
Path to the installed binary.
HostError
If architecture is unsupported, download fails, or extraction fails.
validate
HostInfo
Summary of validation results with the following attributes:
arch(str): CPU architecture (e.g., “x86_64”)capabilities(dict[HostCapability, bool]): Map of capability to availabilitymissing_deps(list[str]): List of missing dependency namesfirecracker_path(Path | None): Path to the Firecracker binary, if found
Complete Example
Related Types
HostCapability
Enum of host capabilities that SmolVM depends on:HostCapability.KVM- KVM virtualization supportHostCapability.NET_TOOLS- Network configuration tools (ip, nft, ssh)HostCapability.FIRECRACKER- Firecracker binary availability
HostInfo
Pydantic model containing host validation results. See thevalidate() method for details.