Skip to main content

Crate mimobox_vm

Crate mimobox_vm 

Source
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§

GuestCommandResult
Result of a guest command execution.
GuestExecOptions
Per-command execution options passed to the guest command protocol.
HttpRequest
Validated and normalized HTTP proxy request.
HttpResponse
HTTP response returned by the host-controlled proxy.
KvmBackendkvm
Linux KVM backend implementation for mimobox microVMs.
MicrovmConfig
Configuration for a single microVM instance.
MicrovmSandbox
Public microVM sandbox implementation.
MicrovmSnapshot
Self-describing microVM snapshot.
PooledRestoreVmkvm
Restored microVM handle borrowed from a RestorePool.
RestorePoolkvm
Pool of empty VM shells optimized for snapshot restoration.
RestorePoolConfigkvm
Configuration for the snapshot restore pool.

Enums§

GuestFileErrorKind
Guest-side file operation error categories.
HttpProxyError
Error returned by the host-controlled HTTP proxy.
KvmExitReasonkvm
Coarse exit reason returned after a KVM_RUN loop step is handled.
KvmLifecyclekvm
Lifecycle state of a KvmBackend.
KvmTransportkvm
Guest command transport selected by the KVM backend.
LifecycleError
Structured lifecycle error for microVM and pooled VM handles.
MicrovmError
Top-level error type returned by the microVM crate.
MicrovmState
Lifecycle state of a MicrovmSandbox.
RestorePoolErrorkvm
Error returned by RestorePool operations.
StreamEvent
Event emitted by streaming guest command execution.

Functions§

microvm_config_from_assets_dir
Builds a MicrovmConfig from an assets directory.
microvm_config_from_vm_assets
Builds a MicrovmConfig from 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.