Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork155
microvm-nix/microvm.nix
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Handbook:HTMLMarkdown •Matrix chat •Changelog
A Nix Flake to build NixOS and run it on one of several Type-2Hypervisors on NixOS/Linux. The project is intended to provide a moreisolated alternative tonixos-container. You can either build andrun MicroVMs like Nix packages, or alternatively install them assystemd services declaratively in your host's Nix Flake orimperatively with the providedmicrovm command.
- MicroVMs are Virtual Machines but use special device interfaces(virtio) for high performance.
- This project runs them on NixOS hosts.
- You can choose one of five hypervisors for each MicroVM.
- MicroVMs have a fixed RAM allocation (default: 512 MB) but can beshrunk using
microvm-balloon - MicroVMs have a read-only root disk with either a prepopulated
/nix/storeor by mounting the host's along with an optionalwritable overlay. This filesystem can be built as eithersquashfs(smaller) orerofs (faster). - You define your MicroVMs in a Nix Flake's
nixosConfigurationssection, reusing thenixosModulesthat are exported by this Flake. - MicroVMs can access stateful filesystems either on a image volume asa block device, or alternatively as a shared directory hierarchythrough9p orvirtiofs.
- Zero, one, or more virtual tap ethernet network interfaces can beattached to a MicroVM.
qemuandkvmtoolalso supportusernetworking which requires no additional setup on the host.
| Hypervisor | Language | Restrictions |
|---|---|---|
| qemu | C | |
| cloud-hypervisor | Rust | no 9p shares |
| firecracker | Rust | no 9p/virtiofs shares |
| crosvm | Rust | 9p shares broken |
| kvmtool | C | no virtiofs shares, no control socket |
| stratovirt | Rust | no 9p/virtiofs shares, no control socket |
| alioth | Rust | no virtiofs shares, no control socket |
nix registry add microvm github:microvm-nix/microvm.nix
(If you do not want to inflict this change on your system, justreplacemicrovm withgithub:microvm-nix/microvm.nix in the followingexamples.)
nix flake init -t microvm$EDITOR flake.nixnix run .#my-microvm
nix run microvm#qemu-examplenix run microvm#firecracker-examplenix run microvm#cloud-hypervisor-examplenix run microvm#crosvm-examplenix run microvm#kvmtool-examplenix run microvm#stratovirt-example
nix run microvm#vm
Checknetworkctl status virbr0 for the DHCP leases of the nestedMicroVMs. They listen for ssh with an empty root password.
nix run microvm#graphics neverball
Accelerate your operations and secure your infrastructure with support from ateam of virtualization experts. Contact Cyberus Technology:https://www.cyberus-technology.de/contact
Looking for help or customization?
Get in touch with Numtide to get a quote. We make it easy for companies towork with Open Source projects:https://numtide.com/contact
About
NixOS MicroVMs
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
