How microsoft/nvx works
NVX is a hardware-isolated Linux micro-VM sandbox built on OpenVMM. Its primary workflow is to invoke the Python runtime harness, provision and start a sandbox, execute a workload, collect its streams and outcome, then stop and remove it. The repository also exposes a Rust lifecycle API with a direct OpenVMM backend and an optional native-agent backend, alongside guest-side control and ABI code. The README documents benchmarking and adversarial campaigns as additional capabilities. Some Python and OpenVMM implementation links are inferred only from the source index or README; those limits are marked dashed or omitted.
Main entry points: nvx.py NVX CLI · mod.rs OpenVMM backend · client.rs Sandbox client · exec.rs Execution streams
Components 23
Runtime harness
- NVX CLI
scripts/nvx.py - Sandbox lifecycle
scripts/nvx_tools/sandbox_lifecycle.py - Control session
scripts/nvx_tools/control_session.py - Egress policy
scripts/nvx_tools/egress_policy.py
Rust sandbox API
- Lifecycle model
aci_edge_sandboxes/model/src/model.rs - Sandbox client
aci_edge_sandboxes/src/client.rs - Backend contract
aci_edge_sandboxes/src/backend.rs - Execution streams
aci_edge_sandboxes/src/exec.rs - Workload input
aci_edge_sandboxes/src/input.rs - Output queues
aci_edge_sandboxes/src/stream.rs
OpenVMM backend
- OpenVMM backend
aci_edge_sandboxes/src/openvmm/mod.rs - VMM configuration
aci_edge_sandboxes/src/openvmm/config.rs - VM artifacts
aci_edge_sandboxes/src/openvmm/artifacts.rs - Sandbox state
aci_edge_sandboxes/src/openvmm/state.rs - Guest session
aci_edge_sandboxes/src/openvmm/session.rs - Control protocol
aci_edge_sandboxes/src/openvmm/protocol.rs
Guest control
- Managed guest agent
guest/common/nvx-managed-agent.c - Guest device I/O
guest/common/nvx-device-io.c - Guest time ABI
guest/common/nvx-time.c
Benchmarking and testing
- MicroVM benchmarks
scripts/nvx_tools/microvm_tests.py - Adversarial campaigns
scripts/nvx_tools/adversarial.py
Other components
- Sandbox user
- OpenVMM process
Connections 22
- Sandbox user → NVX CLI: invokes
README.md - NVX CLI → Sandbox lifecycle: dispatches lifecycle
scripts/nvx.py - NVX CLI → Control session: uses control
scripts/nvx.py - NVX CLI → Egress policy: uses policy
scripts/nvx.py - Sandbox client → Backend contract: delegates operations
aci_edge_sandboxes/src/client.rs - Sandbox client → Lifecycle model: validates requests
aci_edge_sandboxes/src/client.rs - Sandbox client → OpenVMM backend: constructs backend
aci_edge_sandboxes/src/client.rs - OpenVMM backend → Backend contract: implements contract
aci_edge_sandboxes/src/openvmm/mod.rs - OpenVMM backend → VMM configuration: uses configuration
aci_edge_sandboxes/src/openvmm/mod.rs - VMM configuration → VM artifacts: resolves artifacts
aci_edge_sandboxes/src/openvmm/config.rs - VMM configuration → Sandbox state: uses state
aci_edge_sandboxes/src/openvmm/config.rs - OpenVMM backend → Guest session: opens guest session
aci_edge_sandboxes/src/openvmm/mod.rs - Guest session → Control protocol: encodes frames
aci_edge_sandboxes/src/openvmm/session.rs - Backend contract → Execution streams: returns execution control
aci_edge_sandboxes/src/backend.rs - Execution streams → Output queues: streams output
- Execution streams → Workload input: accepts input
- OpenVMM backend → OpenVMM process: launches VMM
- Guest session → Managed guest agent: exchanges control
- Managed guest agent → Guest device I/O: uses device I/O
- Managed guest agent → Guest time ABI: uses time ABI
- NVX CLI → MicroVM benchmarks: offers benchmarks
README.md - NVX CLI → Adversarial campaigns: offers campaigns
scripts/nvx.py