A Nix Flake to build and run NixOS on multiple Type-2 hypervisors, providing isolated virtual machines as Nix packages or systemd services.
MicroVM.nix is a Nix Flake that builds NixOS and runs it on multiple Type-2 hypervisors like QEMU, Firecracker, and cloud-hypervisor. It provides isolated virtual machines as an alternative to nixos-container, allowing users to manage MicroVMs declaratively through Nix configurations or as systemd services. The project supports both Linux and macOS hosts, offering optimized storage, networking, and memory management for lightweight virtualization.
NixOS and Linux system administrators, DevOps engineers, and developers who need isolated, reproducible virtual machines for testing, development, or production workloads. It's particularly useful for those already using Nix for declarative system management.
Developers choose MicroVM.nix for its deep integration with Nix, enabling declarative configuration and reproducibility, along with support for multiple high-performance hypervisors. It offers better isolation than containers while maintaining the flexibility and ease of use of Nix packages and systemd services.
NixOS MicroVMs
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports eight hypervisors including QEMU, Firecracker, and cloud-hypervisor, allowing users to choose based on performance, features, or platform compatibility, as detailed in the hypervisor table.
Enables MicroVMs to be defined as NixOS configurations in a flake, leveraging Nix's reproducibility for consistent deployments, and can be run imperatively with the `microvm` command.
Uses read-only root disks with squashfs for smaller size or erofs for faster performance, and offers stateful storage via image volumes or shared directories through 9p/virtiofs.
Allows attachment of TAP interfaces or user networking, with vhost-net acceleration for high throughput (~10 Gbps with QEMU), supporting various network setups for isolation or performance.
Different hypervisors have varying limitations; for example, Firecracker and stratovirt lack 9p/virtiofs shares, and vfkit on macOS has no tap networking, complicating cross-platform deployments.
Graphics are marked as experimental, working only with specific setups like cloud-hypervisor on Linux or vfkit on macOS, making it unreliable for GUI applications without additional customization.
Heavily relies on Nix and NixOS, which can be a barrier for teams not already using these tools, as setup requires Nix flake knowledge and limits host OS compatibility.