# microvm-nix/microvm.nix

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/microvm-nix-microvm-nix).**

2,682 stars · 211 forks · Nix · MIT

## Links

- GitHub: https://github.com/microvm-nix/microvm.nix
- Homepage: https://microvm-nix.github.io/microvm.nix/
- awesome-repositories: https://awesome-repositories.com/repository/microvm-nix-microvm-nix.md

## Topics

`cloud-hypervisor` `crosvm` `firecracker` `flake` `flakes` `kvmtool` `microvm` `microvms` `nix` `nix-flake` `nixos` `qemu` `virtualization`

## Description

microvm.nix is a declarative virtual machine manager and orchestrator for defining, building, and managing isolated guest environments using Nix. It functions as a virtual machine image builder that transforms system specifications into bootable disk images and runner scripts.

The project provides a hypervisor abstraction layer, enabling the deployment of guest images across multiple virtualization backends through a unified configuration. It includes specialized tools for PCI hardware passthrough, granting virtual machines direct access to physical host USB and PCI devices.

The framework covers a broad range of virtualization capabilities, including virtual network orchestration with support for bridging and port forwarding, and guest storage management using writable store overlays and shared host directories. It also supports cross-architecture emulation and binary translation for executing foreign binaries on different CPU architectures.

Lifecycle management is integrated with systemd to automate virtual machine startup and updates, with support for remote configuration activation via SSH.

## Tags

### Development Tools & Productivity

- [Virtual Machine Provisioning](https://awesome-repositories.com/f/development-tools-productivity/development-environment-management/environment-provisioning-configuration/virtual-machine-provisioning.md) — Allows for the reproducible and automated provisioning of virtual machines using declarative Nix configurations.

### DevOps & Infrastructure

- [Virtual Machine Managers](https://awesome-repositories.com/f/devops-infrastructure/virtual-machine-managers.md) — Provides a declarative framework for creating, configuring, and managing the lifecycle of virtual machine instances via Nix. ([source](https://microvm-nix.github.io/microvm.nix/declarative.html))
- [VM Lifecycle Orchestration](https://awesome-repositories.com/f/devops-infrastructure/declarative-node-orchestration/vm-lifecycle-orchestration.md) — Provides a system for managing the lifecycle, networking, and storage of virtual machines via reproducible configuration files.
- [Virtual Machine Builders](https://awesome-repositories.com/f/devops-infrastructure/infrastructure/infrastructure-as-code/configuration-management/runner-image-specifications/virtual-machine-builders.md) — Transforms declarative system specifications into bootable disk images and runner scripts.
- [Virtual Machine Deployment](https://awesome-repositories.com/f/devops-infrastructure/virtual-machine-deployment.md) — Configures virtual machines to launch automatically during the host system boot process. ([source](https://microvm-nix.github.io/microvm.nix/host-options.html))
- [Virtual Machine Lifecycle Management](https://awesome-repositories.com/f/devops-infrastructure/virtual-machine-lifecycle-management.md) — Integrates with systemd to automate the creation and execution of virtual machines as system services. ([source](https://microvm-nix.github.io/microvm.nix/conventions.html))
- [Host-Guest Mounts](https://awesome-repositories.com/f/devops-infrastructure/volume-mounts/host-guest-mounts.md) — Maps host directories into virtual machine filesystems for seamless and persistent file access. ([source](https://microvm-nix.github.io/microvm.nix/shares.html))
- [Application Configuration Activation](https://awesome-repositories.com/f/devops-infrastructure/application-configuration-activation.md) — Updates running virtual machines by verifying hostnames and executing configuration switches over SSH. ([source](https://microvm-nix.github.io/microvm.nix/ssh-deploy.html))
- [Automated Update Management](https://awesome-repositories.com/f/devops-infrastructure/automated-update-management.md) — Automates the fetching and application of latest system builds from remote caches to update running VMs. ([source](https://microvm-nix.github.io/microvm.nix/faq.html))
- [Configuration Activation](https://awesome-repositories.com/f/devops-infrastructure/execution-environments/remote-workspace-command-execution/ssh-based-remote-execution/configuration-activation.md) — Updates running virtual machines by transferring system derivations and executing configuration switches over SSH.
- [Remote VM Rebuilding](https://awesome-repositories.com/f/devops-infrastructure/remote-vm-rebuilding.md) — Provides a unified workflow to build and activate updated system configurations on remote virtual machine hosts via SSH. ([source](https://microvm-nix.github.io/microvm.nix/ssh-deploy.html))
- [SSH Deployment Tools](https://awesome-repositories.com/f/devops-infrastructure/ssh-deployment-tools.md) — Transfers system derivations to a remote host for building and activates configurations via SSH. ([source](https://microvm-nix.github.io/microvm.nix/ssh-deploy.html))

### Software Engineering & Architecture

- [VM Construction](https://awesome-repositories.com/f/software-engineering-architecture/declarative-configuration-systems/vm-construction.md) — Creates isolated guest environments using a declarative configuration system and high-performance hypervisors. ([source](https://cdn.jsdelivr.net/gh/microvm-nix/microvm.nix@main/README.md))
- [Instance Rebuild from Image](https://awesome-repositories.com/f/software-engineering-architecture/instance-management/cloud-instance-lifecycle/local-instance-lifecycles/instance-rebuild-from-image.md) — Rebuilds virtual machine instances from updated source references and restarts them to apply configuration changes. ([source](https://microvm-nix.github.io/microvm.nix/microvm-command.html))
- [Hypervisor Abstractions](https://awesome-repositories.com/f/software-engineering-architecture/provider-abstractions/hypervisor-abstractions.md) — Provides a hypervisor abstraction layer to execute machine images across different virtualization backends.

### Artificial Intelligence & ML

- [Machine Specifications](https://awesome-repositories.com/f/artificial-intelligence-ml/training-configurations/declarative-pipeline-specifications/machine-specifications.md) — Enables defining guest hardware and system configurations as code for automated deployment.

### Data & Databases

- [Virtual Storage Managers](https://awesome-repositories.com/f/data-databases/fault-tolerant-storage/virtual-storage-managers.md) — Manages the allocation of virtual disk volumes, shared directories, and storage pools for guest machines. ([source](https://microvm-nix.github.io/microvm.nix/options.html))
- [Guest Disk Configuration](https://awesome-repositories.com/f/data-databases/fault-tolerant-storage/virtual-storage-managers/guest-disk-configuration.md) — Provides declarative configuration for guest root disks and stateful block storage devices. ([source](https://cdn.jsdelivr.net/gh/microvm-nix/microvm.nix@main/README.md))

### Operating Systems & Systems Programming

- [Bootable Image Building](https://awesome-repositories.com/f/operating-systems-systems-programming/bootable-image-building.md) — Creates bootable disk images and runner scripts from declarative configurations for use on various hypervisors. ([source](https://microvm-nix.github.io/microvm.nix/declaring.html))
- [Guest Host Filesystem Sharing](https://awesome-repositories.com/f/operating-systems-systems-programming/guest-host-filesystem-sharing.md) — Implements mechanisms for sharing directory trees between the host operating system and guest virtual machines. ([source](https://microvm-nix.github.io/microvm.nix/faq.html))
- [Store Sharing](https://awesome-repositories.com/f/operating-systems-systems-programming/nix-based-provisioning/store-sharing.md) — Mounts a host directory into the environment to decrease image size and eliminate redundant build steps. ([source](https://microvm-nix.github.io/microvm.nix/shares.html))
- [Operating System Virtualization](https://awesome-repositories.com/f/operating-systems-systems-programming/operating-system-virtualization.md) — Executes isolated guest operating systems by defining runner packages and hypervisor configurations. ([source](https://microvm-nix.github.io/microvm.nix/conventions.html))
- [Virtualization Networking](https://awesome-repositories.com/f/operating-systems-systems-programming/virtualization-emulation/virtualization-platforms/virtualization-networking.md) — Manages communication between hosts and isolated virtual machines using bridges, port forwarding, and routed networking.
- [Hypervisor Backend Integrations](https://awesome-repositories.com/f/operating-systems-systems-programming/virtualization-emulation/virtualization-platforms/virtualization-technologies/virtual-machines/hypervisor-backend-integrations.md) — Allows users to select the underlying virtualization engine used to run the guest machine. ([source](https://microvm-nix.github.io/microvm.nix/microvm-options.html))
- [Virtual Machine Image Construction](https://awesome-repositories.com/f/operating-systems-systems-programming/virtualization-emulation/virtualization-platforms/virtualization-technologies/virtual-machines/virtual-machine-image-construction.md) — Builds lightweight virtual machines from specified sources and stores references for automated updates. ([source](https://microvm-nix.github.io/microvm.nix/microvm-command.html))
- [VM Host Environment Configuration](https://awesome-repositories.com/f/operating-systems-systems-programming/vm-host-environment-configuration.md) — Configures the necessary host-side state directories, network interfaces, and filesystems to support virtual machine execution. ([source](https://microvm-nix.github.io/microvm.nix/host.html))
- [Binary Translation Layers](https://awesome-repositories.com/f/operating-systems-systems-programming/binary-translation-layers.md) — Executes foreign binaries within a virtual machine by utilizing binary translation layers and emulation shares. ([source](https://microvm-nix.github.io/microvm.nix/vfkit-rosetta.html))
- [Writable Store Overlays](https://awesome-repositories.com/f/operating-systems-systems-programming/guest-host-filesystem-sharing/writable-store-overlays.md) — Implements read-only system images with writable overlays and shared host directories for persistent guest storage.
- [USB and PCI Passthroughs](https://awesome-repositories.com/f/operating-systems-systems-programming/hardware-interfacing-drivers/peripheral-passthrough/usb-and-pci-passthroughs.md) — Connects both PCI and USB devices from the host system directly to the virtual machine for hardware access. ([source](https://microvm-nix.github.io/microvm.nix/devices.html))
- [Hardware Resource Allocation](https://awesome-repositories.com/f/operating-systems-systems-programming/kernel-core-internals/system-resource-management/hardware-resource-allocation.md) — Allocates CPU cores, RAM, and network interfaces to define the hardware specifications of a virtual machine. ([source](https://microvm-nix.github.io/microvm.nix/options.html))
- [Layered Package Overlays](https://awesome-repositories.com/f/operating-systems-systems-programming/layered-package-overlays.md) — Supports mounting writable overlays on read-only system stores to allow package modifications in guests.
- [Multi-Architecture Emulators](https://awesome-repositories.com/f/operating-systems-systems-programming/multi-architecture-support/multi-architecture-emulators.md) — Runs guest operating systems on CPU architectures different from the host using compatible hypervisor emulation. ([source](https://microvm-nix.github.io/microvm.nix/microvm-options.html))
- [VirtioFS Shared Directories](https://awesome-repositories.com/f/operating-systems-systems-programming/system-administration-maintenance/file-system-management/file-system-integration/host-to-guest-file-sharing/virtiofs-shared-directories.md) — Utilizes VirtioFS to map host directories to the guest for efficient and high-performance data exchange. ([source](https://microvm-nix.github.io/microvm.nix/conventions.html))
- [Disk Layout Specifications](https://awesome-repositories.com/f/operating-systems-systems-programming/virtual-disk-image-booting/disk-layout-specifications.md) — Defines the boot disk filesystem type and attaches additional virtual disk images to the machine. ([source](https://microvm-nix.github.io/microvm.nix/microvm-options.html))
- [Network Bridges](https://awesome-repositories.com/f/operating-systems-systems-programming/virtualization-emulation/virtualization-platforms/virtualization-architectures/network-bridges.md) — Provides virtual network bridges to connect guest interfaces to physical host networks.
- [Hardware Passthrough](https://awesome-repositories.com/f/operating-systems-systems-programming/virtualization-emulation/virtualization-platforms/virtualization-infrastructure/hardware-passthrough.md) — Maps physical PCI and USB devices directly into guest environments for high-performance hardware access.
- [Adapter Configurations](https://awesome-repositories.com/f/operating-systems-systems-programming/virtualization-emulation/virtualization-platforms/virtualization-networking/virtual-network-management/adapter-configurations.md) — Defines virtual network adapters to control how a virtual machine connects to the host or external networks. ([source](https://microvm-nix.github.io/microvm.nix/host-systemd.html))
- [Cross-Architecture Virtualization](https://awesome-repositories.com/f/operating-systems-systems-programming/virtualization-emulation/virtualization-platforms/virtualization-platforms/cross-architecture-virtualization.md) — Enables running guest systems and binaries on different CPU architectures than the host through hypervisor emulation.
- [PCI Device Passthroughs](https://awesome-repositories.com/f/operating-systems-systems-programming/virtualization-emulation/virtualization-platforms/virtualization-technologies/device-passthrough-drivers/pci-device-passthroughs.md) — Binds physical PCI devices to host drivers to grant direct hardware access from within a virtual machine. ([source](https://microvm-nix.github.io/microvm.nix/conventions.html))
- [Writable Store Overlays](https://awesome-repositories.com/f/operating-systems-systems-programming/writable-store-overlays.md) — Mounts a writable overlay on the read-only Nix store to allow building derivations inside the guest. ([source](https://microvm-nix.github.io/microvm.nix/microvm-options.html))

### Networking & Communication

- [Network Port Forwarding](https://awesome-repositories.com/f/networking-communication/network-port-forwarding.md) — Forwards traffic from the host to the guest using user-networking or host-level address translation. ([source](https://microvm-nix.github.io/microvm.nix/print.html))
- [Public Interface Forwarding](https://awesome-repositories.com/f/networking-communication/network-port-forwarding/local-port-forwarding/public-interface-forwarding.md) — Redirects traffic from the host public interface to private IP addresses of internal virtual machines. ([source](https://microvm-nix.github.io/microvm.nix/advanced-network.html))
- [Service Port Forwarding](https://awesome-repositories.com/f/networking-communication/service-port-forwarding.md) — Sets up port forwarding to expose services running inside the virtual machine to the host. ([source](https://microvm-nix.github.io/microvm.nix/options.html))
- [Virtual Network Bridging](https://awesome-repositories.com/f/networking-communication/virtual-network-bridging.md) — Links multiple virtual Ethernet interfaces to a central host bridge to enable communication between isolated network environments. ([source](https://microvm-nix.github.io/microvm.nix/advanced-network.html))

### Security & Cryptography

- [Network Address Translation](https://awesome-repositories.com/f/security-cryptography/firewalls/network-address-translation.md) — Maps internal virtual machine subnets to an external interface to provide internet access through a gateway. ([source](https://microvm-nix.github.io/microvm.nix/routed-network.html))
- [Writable Directory Centralizations](https://awesome-repositories.com/f/security-cryptography/writable-directory-centralizations.md) — Provides a writable layer over the system store to enable package modifications within a guest session. ([source](https://microvm-nix.github.io/microvm.nix/shares.html))

### System Administration & Monitoring

- [Virtual Machine Management Tools](https://awesome-repositories.com/f/system-administration-monitoring/virtual-machine-management-tools.md) — Provides a command-line tool for the imperative creation, update, and listing of virtual machines. ([source](https://microvm-nix.github.io/microvm.nix/print.html))

### Part of an Awesome List

- [Virtualization Tools](https://awesome-repositories.com/f/awesome-lists/devtools/virtualization-tools.md) — Framework for NixOS-based MicroVMs.
