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
Pinned Firecracker version to install when auto-installing (e.g., “v1.14.1”).
Class Attributes
SmolVM home directory:
~/.smolvmBinary installation directory:
~/.smolvm/bin/Methods
detect_arch
Architecture string (e.g., “x86_64”, “aarch64”).
check_kvm
/dev/kvm exists and is accessible with read/write permissions.
True if KVM is available with R/W permissions, False otherwise.
check_dependencies
ip(iproute2)nft(nftables)ssh(openssh-client)
List of missing dependency names (empty if all present).
find_firecracker
- System PATH
~/.smolvm/bin/firecracker
Path to the binary, or None if not found.
install_firecracker
~/.smolvm/bin/.
Version to install (e.g., “v1.14.1”). Defaults to the pinned version from the constructor.
Path to the installed binary.
If architecture is unsupported, download fails, or extraction fails.
validate
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.