Expand description
microVM sandbox backend for mimobox.
This crate provides the microVM isolation layer used by the higher-level mimobox sandbox APIs. It exposes configuration, lifecycle management, guest command execution, file transfer, controlled HTTP proxying, snapshot serialization, and optional pooling helpers.
The main entry point is MicrovmSandbox, which implements
mimobox_core::Sandbox. Linux builds with the kvm feature use KvmBackend
for the underlying VM lifecycle. Other platforms keep the public API available
but return MicrovmError::UnsupportedPlatform for KVM-only operations.
Snapshot support is split into MicrovmSnapshot for self-describing in-memory
snapshots and file-backed mimobox_core::SandboxSnapshot values for fast
restore paths. VmPool prewarms fully booted VMs, while RestorePool keeps
empty VM shells ready for snapshot restoration on supported KVM builds.
HTTP access from guests is intentionally host-mediated. HttpRequest values
are validated against SandboxConfig::allowed_http_domains and
executed by the host-side proxy rather than by giving the guest direct network
access.
Re-exports§
pub use pool::PoolError;pub use pool::PooledVm;pub use pool::VmPool;pub use pool::VmPoolConfig;pub use pool::VmPoolStats;
Modules§
- pool
- Thread-safe microVM prewarm pool types. microVM prewarm pool.
Structs§
- Guest
Command Result - Result of a guest command execution.
- Guest
Exec Options - Per-command execution options passed to the guest command protocol.
- Http
Request - Validated and normalized HTTP proxy request.
- Http
Response - HTTP response returned by the host-controlled proxy.
- KvmBackend
kvm - Linux KVM backend implementation for mimobox microVMs.
- Microvm
Config - Configuration for a single microVM instance.
- Microvm
Sandbox - Public microVM sandbox implementation.
- Microvm
Snapshot - Self-describing microVM snapshot.
- Pooled
Restore Vm kvm - Restored microVM handle borrowed from a
RestorePool. - Restore
Pool kvm - Pool of empty VM shells optimized for snapshot restoration.
- Restore
Pool Config kvm - Configuration for the snapshot restore pool.
Enums§
- Guest
File Error Kind - Guest-side file operation error categories.
- Http
Proxy Error - Error returned by the host-controlled HTTP proxy.
- KvmExit
Reason kvm - Coarse exit reason returned after a
KVM_RUNloop step is handled. - KvmLifecycle
kvm - Lifecycle state of a
KvmBackend. - KvmTransport
kvm - Guest command transport selected by the KVM backend.
- Lifecycle
Error - Structured lifecycle error for microVM and pooled VM handles.
- Microvm
Error - Top-level error type returned by the microVM crate.
- Microvm
State - Lifecycle state of a
MicrovmSandbox. - Restore
Pool Error kvm - Error returned by
RestorePooloperations. - Stream
Event - Event emitted by streaming guest command execution.
Functions§
- microvm_
config_ from_ assets_ dir - Builds a
MicrovmConfigfrom an assets directory. - microvm_
config_ from_ vm_ assets - Builds a
MicrovmConfigfrom the default assets directory. - resolve_
vm_ assets_ dir - Resolves the microVM assets directory.
- vm_
assets_ dir - Resolves the default microVM assets directory from process environment variables.