Lightweight Sandbox Powered by a Purpose-Built VM and OS
See the codeNanvix is a sandboxing technology for running untrusted applications in a hardware-isolated environment with minimal overhead.
Note: This repository contains the implementation of the sandbox. If you are looking to use Nanvix, refer to nanvix-python, a Python distribution of Nanvix.
Nanvix features a unique co-designed architecture that combines two key innovations:
A purpose-built Micro-VM that provides hardware-enforced isolation with minimal overhead. This Micro-VM is designed to be as lightweight as possible, exposing only a virtual processor and memory to the guest and stripping away all device emulation and other features that add latency.
A multikernel OS that enables flexible system component placement and sharing. This design splits the OS across two kernels: a guest-side Microkernel that runs inside the Micro-VM and provides essential OS features; and a host-side Macro-Kernel that runs on the host platform and provides network and storage software switches. System components run as special processes on top of either kernel, depending on the deployment configuration.
Read more about this architecture in our paper: Nanvix: A Multikernel OS Design for High-Density Serverless Deployments.
┌─────────────────────────────────────┐
│ Micro-VM │ Microkernel on Micro-VM runs:
│ Microkernel │ • The untrusted application.
│ │ • Essential system services (scheduler, etc.).
│ ┌─────────────┐ ┌──────────────┐ │ • Optional in-guest components (e.g. filesystem).
│ │ Application │ │ Filesystem │ │
│ └─────────────┘ └──────────────┘ │
└──────────────────┬──────────────────┘
│ selected I/O
│ (e.g. network)
▼
┌─────────────────────────────────────┐
│ Macro-Kernel │ Macro-Kernel on host platform runs:
│ (host OS) │ • Network software switch.
│ │ • Storage software switch.
│ ┌──────────────┐ │ • Host-side system components (e.g. network stack).
│ │ Network │ │
│ └──────────────┘ │
└─────────────────────────────────────┘
| Feature | Nanvix | Unikraft | Firecracker | gVisor | Docker | WebAssembly |
|---|---|---|---|---|---|---|
| Flexible Component Placement | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
| Multiple Guest Processes | ✅ | ❌ | ✅ | ✅ | ✅ | ❌ |
| Hardware Isolation | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ |
| Startup Time | ~30ms | ~320ms | ~70ms | ~160ms | ~1s | ~1ms |
| Memory Footprint | ~10MB | ~10MB | 10–100MB | 10–50MB | ~100MB | ~1MB |
| Deployment Density | ~10k | ~1k | ~1k | ~1k | ~100 | ~10k |
| Full Linux Compatibility | ❌ | ❌ | ✅ | ✅ | ✅ | ❌ |
Startup time is the p50 latency to serve the first HTTP echo request; memory footprint is the per-instance contribution to host memory for the same workload, measured via
MemAvailablein/proc/meminfo. Nanvix and Firecracker use snapshot-restore (the production serverless configuration); Unikraft and gVisor use cold start (no production snapshot path available). Ranges span cold boot and snapshot-restore variants where applicable. Docker and WebAssembly are approximate community values. See arXiv:2604.11669 for more on the methodology.
Requires Ubuntu 24.04 with sudo privileges and KVM enabled.
# Run on Bash.
# Clone this source code.
git clone https://github.com/nanvix/nanvix.git && cd nanvix
# Setup the development environment.
./z setup
# Build Nanvix.
./z build -- all
# Run an example application.
./bin/nanvixd.elf -console-file /dev/stdout -- ./bin/hello-rust-nostd.elf
Requires Windows 11 with GNU Make on PATH, Windows Hypervisor Platform enabled, Developer Mode turned on, and a Rust toolchain installed via rustup.
# Run on PowerShell.
# Clone this source code (symlinks require Developer Mode).
git clone -c core.symlinks=true https://github.com/nanvix/nanvix.git; cd nanvix
# Setup the development environment.
.\z.ps1 setup
# Build Nanvix.
.\z.ps1 build -- all
# Run an example application.
.\bin\uservm.exe -kernel .\bin\kernel.elf -initrd .\bin\hello-rust-nostd.elf -standalone
For more details, see the full setup, build, and run guides.
This project is a prototype. As such, we provide no guarantees that it will work and you are assuming any risks with using the code. We welcome comments and feedback. Please send any questions or comments to any of the following maintainers of the project:
By sending feedback, you are consenting that it may be used in the further development of this project.
This project is distributed under the MIT License.
6,166 commits
4,084 commits
234 commits
154 commits
Rust
88.7%
C
6.6%
Python
2.0%
Makefile
1.6%
Lightweight Sandbox Powered by a Purpose-Built VM and OS
See the codeNanvix is a sandboxing technology for running untrusted applications in a hardware-isolated environment with minimal overhead.
Note: This repository contains the implementation of the sandbox. If you are looking to use Nanvix, refer to nanvix-python, a Python distribution of Nanvix.
Nanvix features a unique co-designed architecture that combines two key innovations:
A purpose-built Micro-VM that provides hardware-enforced isolation with minimal overhead. This Micro-VM is designed to be as lightweight as possible, exposing only a virtual processor and memory to the guest and stripping away all device emulation and other features that add latency.
A multikernel OS that enables flexible system component placement and sharing. This design splits the OS across two kernels: a guest-side Microkernel that runs inside the Micro-VM and provides essential OS features; and a host-side Macro-Kernel that runs on the host platform and provides network and storage software switches. System components run as special processes on top of either kernel, depending on the deployment configuration.
Read more about this architecture in our paper: Nanvix: A Multikernel OS Design for High-Density Serverless Deployments.
┌─────────────────────────────────────┐
│ Micro-VM │ Microkernel on Micro-VM runs:
│ Microkernel │ • The untrusted application.
│ │ • Essential system services (scheduler, etc.).
│ ┌─────────────┐ ┌──────────────┐ │ • Optional in-guest components (e.g. filesystem).
│ │ Application │ │ Filesystem │ │
│ └─────────────┘ └──────────────┘ │
└──────────────────┬──────────────────┘
│ selected I/O
│ (e.g. network)
▼
┌─────────────────────────────────────┐
│ Macro-Kernel │ Macro-Kernel on host platform runs:
│ (host OS) │ • Network software switch.
│ │ • Storage software switch.
│ ┌──────────────┐ │ • Host-side system components (e.g. network stack).
│ │ Network │ │
│ └──────────────┘ │
└─────────────────────────────────────┘
| Feature | Nanvix | Unikraft | Firecracker | gVisor | Docker | WebAssembly |
|---|---|---|---|---|---|---|
| Flexible Component Placement | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
| Multiple Guest Processes | ✅ | ❌ | ✅ | ✅ | ✅ | ❌ |
| Hardware Isolation | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ |
| Startup Time | ~30ms | ~320ms | ~70ms | ~160ms | ~1s | ~1ms |
| Memory Footprint | ~10MB | ~10MB | 10–100MB | 10–50MB | ~100MB | ~1MB |
| Deployment Density | ~10k | ~1k | ~1k | ~1k | ~100 | ~10k |
| Full Linux Compatibility | ❌ | ❌ | ✅ | ✅ | ✅ | ❌ |
Startup time is the p50 latency to serve the first HTTP echo request; memory footprint is the per-instance contribution to host memory for the same workload, measured via
MemAvailablein/proc/meminfo. Nanvix and Firecracker use snapshot-restore (the production serverless configuration); Unikraft and gVisor use cold start (no production snapshot path available). Ranges span cold boot and snapshot-restore variants where applicable. Docker and WebAssembly are approximate community values. See arXiv:2604.11669 for more on the methodology.
Requires Ubuntu 24.04 with sudo privileges and KVM enabled.
# Run on Bash.
# Clone this source code.
git clone https://github.com/nanvix/nanvix.git && cd nanvix
# Setup the development environment.
./z setup
# Build Nanvix.
./z build -- all
# Run an example application.
./bin/nanvixd.elf -console-file /dev/stdout -- ./bin/hello-rust-nostd.elf
Requires Windows 11 with GNU Make on PATH, Windows Hypervisor Platform enabled, Developer Mode turned on, and a Rust toolchain installed via rustup.
# Run on PowerShell.
# Clone this source code (symlinks require Developer Mode).
git clone -c core.symlinks=true https://github.com/nanvix/nanvix.git; cd nanvix
# Setup the development environment.
.\z.ps1 setup
# Build Nanvix.
.\z.ps1 build -- all
# Run an example application.
.\bin\uservm.exe -kernel .\bin\kernel.elf -initrd .\bin\hello-rust-nostd.elf -standalone
For more details, see the full setup, build, and run guides.
This project is a prototype. As such, we provide no guarantees that it will work and you are assuming any risks with using the code. We welcome comments and feedback. Please send any questions or comments to any of the following maintainers of the project:
By sending feedback, you are consenting that it may be used in the further development of this project.
This project is distributed under the MIT License.
6,166 commits
4,084 commits
234 commits
154 commits
Rust
88.7%
C
6.6%
Python
2.0%
Makefile
1.6%