bux-krun
Raw FFI bindings to libkrun — a lightweight VM engine for sandboxed code execution.
Note: This crate provides unsafe, low-level bindings. Prefer the safe
buxcrate for application code.
How it works
Pre-generated bindgen bindings are committed in src/bindings.rs so end
users do not need libclang installed. At build time the build script:
- Downloads the pre-built dynamic library from GitHub Releases (or uses
BUX_DEPS_DIR). - Configures the linker for dynamic linking and exports
DEP_KRUN_LIB_DIR.
Regenerating bindings
To update bindings from the pinned qntx/libkrun fork header (requires libclang, Linux/macOS only):
# or manually:
BUX_UPDATE_BINDINGS=1
Environment variables
| Variable | Description |
|---|---|
BUX_DEPS_DIR |
Path to a local directory containing pre-built libraries. Skips downloading. |
BUX_DEPS_VERSION |
Override the deps release version (default: crate version). |
BUX_UPDATE_BINDINGS |
Copy generated bindings back to src/bindings.rs (with regenerate feature). |
Supported platforms
| Target | Backend |
|---|---|
aarch64-apple-darwin |
Hypervisor.framework |
x86_64-unknown-linux-gnu |
KVM |
aarch64-unknown-linux-gnu |
KVM |
License
Licensed under either of Apache License, Version 2.0 or MIT License at your option.