Skip to main content

Crate mvm_apple_container

Crate mvm_apple_container 

Source
Expand description

Apple Virtualization.framework backend for mvm.

On macOS (Apple Silicon), this crate uses objc2-virtualization to call Virtualization.framework directly from Rust. VMs boot with VZLinuxBootLoader using our Nix-built kernel + ext4 rootfs — same as Firecracker, sub-second startup, no OCI, no XPC daemon, no Swift.

On other platforms, all functions return “not available” errors.

Constants§

GUEST_AGENT_PORT
Guest agent vsock port.

Functions§

discover_guest_ip
Discover the guest’s IP address via ARP scanning.
ensure_signed
Install a launchd agent to run the VM in the background. Uses resolved kernel/rootfs paths directly (build already done). Ensure the binary has the virtualization entitlement, signing if needed. On non-macOS this is a no-op.
install_launchd_direct
is_available
Check if Apple Virtualization is available on this platform.
list_ids
List running VM IDs.
start
Start a VM from a local kernel + ext4 rootfs using Virtualization.framework.
start_port_proxy
Start a port proxy from localhost:host_port to guest tcp/guest_port via vsock.
stop
Stop a running VM.
vsock_connect
Connect to the guest vsock on the given port, returning a Unix stream.