Skip to main content

Crate unkernel_rs

Crate unkernel_rs 

Source
Expand description

Native Rust + wasmtime host library for pithings/unkernel — boot an unmodified Linux 7.x Wasm kernel and aarch64 Alpine/Debian rootfs with zero Node.js, zero V8, zero JSPI, and zero /dev/kvm.

Re-exports§

pub use cache::DEFAULT_ALPINE_SHA256;
pub use cache::DEFAULT_BUNDLE_SHA256;
pub use cache::DEFAULT_SMP_SHA256;
pub use cache::DEFAULT_UNKERNEL_VERSION;
pub use cache::default_cache_dir;
pub use disk::DiskSnapshot;
pub use fs9p::WorkspaceDiff;
pub use fs9p::WorkspaceSnapshot;
pub use host::BootTimings;
pub use host::MountSpec;
pub use host::Vm;
pub use host::VmConfig;
pub use host::VmSnapshot;
pub use jit::JitStats;
pub use kwtty::ExecOptions;
pub use kwtty::ExecResult;
pub use mcp::run_mcp_stdio;
pub use mcp::run_mcp_with_io;
pub use monitor::ApprovalCallback;
pub use monitor::ApprovalDecision;
pub use monitor::ApprovalKind;
pub use monitor::ApprovalRequest;
pub use monitor::AuditCallback;
pub use monitor::AuditEvent;
pub use monitor::Monitor;
pub use monitor::MonitorConfig;
pub use monitor::PauseController;
pub use monitor::is_sensitive_path;
pub use monitor::open_audit_file;
pub use monitor::terminal_approval_callback;
pub use net::NetConfig;
pub use net::NetDevice;
pub use net::PortForward;
pub use sandbox::SandboxPathGrant;
pub use sandbox::SandboxStatus;
pub use sandbox::peak_rss_mib;
pub use switch::MacTableEntry;
pub use switch::SwitchAttachment;
pub use switch::SwitchPort;
pub use switch::SwitchPortStats;
pub use switch::VirtualSwitch;
pub use tls_inspect::MitmCa;
pub use tls_inspect::VmiTlsContext;
pub use vmi::ProcInfo;
pub use vmi::TaskStructOffsets;
pub use vmi::VmiTracker;

Modules§

cache
Artifact resolution, pinned HTTPS download with SHA-256 verification, native kwpatch unpacking, and version-keyed .cwasm AOT precompilation cache.
disk
Block device abstraction (wda read-only distro image, wdb persistent writable ext4 overlay disk) and native KWSPARS1 (optional gzip) sparse disk template unpacker.
fs9p
Scoped host directory 9P2000.L server over virtio-vsock port 564.
host
Core wasmtime Linux VM host: SharedMemory, cooperative multi-Store task switching, WASI, block disk, atomic IRQ delivery, vsock, kwtty, 9p2000.L, Cranelift guest JIT, StoreLimits, epoch_interruption, and optional Landlock self-sandboxing.
jit
Cranelift-backed kw_host_jit_* implementation for unkernel’s kwemu aarch64 JIT.
kwpatch
Native Rust parser for unkernel.wasm bundle custom sections and KWP1 kernel patches (unkernel.kernel.smp.kwpatch), eliminating any Node.js build/unpack dependency.
kwtty
Structured exec and interactive PTY client speaking unkernel’s kwtty binary protocol over virtio-vsock port 1022.
mcp
Zero-dependency Model Context Protocol (MCP) server over stdio (JSON-RPC 2.0).
monitor
Untamperable host-side runtime monitoring, audit event streaming, interactive approval gates (network + 9P filesystem + sensitive credential reads), and whole-VM time-stop pause/resume.
net
Opt-in user-space L2/L3/L4 NAT network stack (wasm_driver_net_*) for unkernel.
sandbox
Defense-in-depth host sandboxing (Linux Landlock ABI v1-v4 + PR_SET_NO_NEW_PRIVS) and cross-platform host process telemetry (getrusage peak RSS, getrandom entropy).
switch
Pure-Rust virtual Layer-2 Ethernet switch (switch0) for multi-VM unkernel-rs labs.
tls_inspect
Host-side HTTPS forensic inspection for unkernel-rs.
vmi
Host-side Virtual Machine Introspection (VMI) for the guest Linux kernel inside wasmtime::SharedMemory.
vsock
Host virtio-vsock transport (wasm_driver_vsock_*) and blocking stream API for kwtty (exec/PTY) and 9P2000.L mounts.