Skip to main content

Crate bux

Crate bux 

Source
Expand description

Safe, ergonomic API for libkrun micro-VM sandboxing.

bux wraps the raw FFI bindings from bux_sys into a type-safe, Rust-idiomatic interface for creating and running lightweight virtual machines powered by KVM (Linux) or Hypervisor.framework (macOS).

§Quick start

use bux::Vm;

let vm = Vm::builder()
    .vcpus(2)
    .ram_mib(512)
    .root("/path/to/rootfs")
    .exec("/bin/bash", &["--login"])
    .build()
    .expect("invalid VM config");

// Takes over the process — only returns on error.
vm.start().expect("failed to start VM");

Structs§

Vm
A configured micro-VM ready to start.
VmBuilder
Builder for configuring a micro-VM.

Enums§

DiskFormat
Disk image format for [add_disk2] and [add_disk3].
Error
Errors returned by bux VM operations.
Feature
Build-time feature flag for [has_feature].
KernelFormat
Kernel image format for [set_kernel].
LogLevel
Log verbosity level for libkrun.
LogStyle
Log output style (terminal escape sequences).
SyncMode
Block device sync mode for [add_disk3].

Type Aliases§

Result
Alias for Result<T, bux::Error>.