nvx README

The project's README from github.com/microsoft/nvx. As one markdown file: README.md.

NVX: An Ultra-Light Micro-VM Sandbox

NVX is an ultra-light micro-VM sandbox for running untrusted workloads with hardware-enforced isolation. It is built on top of OpenVMM and runs Linux as a guest.

NVX was jointly developed by the MSR Systems Research Group and Azure Research - Systems, building on research results from the Nanvix system.

This repository includes version pins for Linux, OpenVMM, and the Rust guest toolchain, along with the patches, guest source files, build tools, and benchmarks needed to use NVX. Alpine, Ubuntu, and Azure Linux ship the ten static guest binaries from nvx at their common /sbin/nvx-* paths.

Quick Start

Git and Rust are required; install Rust with rustup, which also installs Cargo. The commands below clone NVX, build nvx, the NVX command-line interface, and run a microVM. The first run downloads the prebuilt NVX package of the host's platform, from the release that CI built from the cloned revision when available, or from its nearest released first-parent ancestor otherwise, so the guest and OpenVMM need no build. The download uses the curl and tar of the host, which Windows 10 and later include. After you pull newer commits, nvx download installs their release; run downloads only into a checkout that holds no artifacts.

A successful boot prints NVX-GUEST-BOOT-OK: alpine and opens a root shell. The package also includes the Ubuntu and Azure Linux userlands: boot either with the same NVX kernel by adding --guest ubuntu or --guest azurelinux to nvx run. Exit cleanly from the guest with /sbin/nvx-exit 0. See the setup and run guides for detailed prerequisites and runtime options. To run without Rust, extract the package of a development release and run its bin/nvx. To build NVX from source instead, first initialize the openvmm submodule, which the clone below omits.

ℹ️ To run microVMs from a program of your own through the nvx library, see the library guide; for direct OpenVMM integration without nvx, see Run OpenVMM directly.

Linux / KVM

Requires KVM configured with read/write access to /dev/kvm.

git clone https://github.com/microsoft/nvx.git && cd nvx
cargo build --release --locked --features cli \
  --manifest-path nvx/Cargo.toml --target-dir nvx/target
nvx/target/release/nvx run

Linux / MSHV

Requires MSHV configured with read/write access to /dev/mshv.

git clone https://github.com/microsoft/nvx.git && cd nvx
cargo build --release --locked --features cli \
  --manifest-path nvx/Cargo.toml --target-dir nvx/target
nvx/target/release/nvx run --hypervisor mshv

Windows / WHP

Requires Windows Hypervisor Platform enabled.

git clone https://github.com/microsoft/nvx.git; Set-Location nvx
cargo build --release --locked --features cli `
    --manifest-path nvx/Cargo.toml --target-dir nvx/target
nvx\target\release\nvx.exe run

Documentation

Usage

Development

nvx (microsoft/nvx)

Searching Database…

850 ·GitHub
What is this?NVX is an ultra-light micro-VM sandbox for running untrusted workloads with hardware-enforced isolation, built on OpenVMM and running Linux as the guest OS.
Is this a library I import, or a standalone tool?It is a command-line runtime harness (scripts/nvx.py) that boots and manages micro-VMs, not a library you import into your own code; there is also a path to drive OpenVMM directly without the harness.
How do I get a sandbox running?Install Python 3.10 or newer, then run the quick-start commands for your platform; they download the latest NVX release so no local build is needed, and a successful boot prints the boot-OK message and opens a root shell.
What hypervisor do I need already set up on my machine?You need a hypervisor enabled on your OS: KVM with read/write access to /dev/kvm on Linux, MSHV on Linux, or Windows Hypervisor Platform (WHP) enabled on Windows.
What's the main pitfall when getting NVX to boot?Each backend has its own prerequisite that must already be in place — e.g. the right read/write permissions on /dev/mshv for MSHV, or WHP switched on in Windows — otherwise the micro-VM won't start.
Who is this built for?It targets engineers and researchers who need hardware-isolated sandboxes for running untrusted or agent-generated code, such as agentic coding workloads.
Can I choose a different guest OS than the default?Yes, NVX boots an Alpine Linux guest by default, and you can switch to an Ubuntu userland with the same NVX kernel by passing --guest ubuntu.
What is OpenVMM and why does NVX depend on it?OpenVMM is the hypervisor runtime NVX is built on top of; the repo pins specific Linux and OpenVMM versions and adds the patches, guest sources, build tools, and benchmarks needed to run them together as NVX.
Does the project test its own sandbox isolation?Yes, it documents 'Copilot-driven adversarial testing' — bounded adaptive stress and containment campaigns used to probe the robustness of the sandbox's isolation.
Creator
microsoft
Size
116.8 MB
Stars
850
Updated
CommitNov 18
Age
3mo
Commits · 90 Days