Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

NixOS MicroVMs

License

NotificationsYou must be signed in to change notification settings

microvm-nix/microvm.nix

Repository files navigation

Handbook:HTMLMarkdownMatrix chatChangelog

Demo GIF

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.

Project Presentation (video)

At a glance

  • 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 usingmicrovm-balloon
  • MicroVMs have a read-only root disk with either a prepopulated/nix/store or 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'snixosConfigurationssection, reusing thenixosModules that 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.qemu andkvmtool also supportusernetworking which requires no additional setup on the host.

Hypervisors

HypervisorLanguageRestrictions
qemuC
cloud-hypervisorRustno 9p shares
firecrackerRustno 9p/virtiofs shares
crosvmRust9p shares broken
kvmtoolCno virtiofs shares, no control socket
stratovirtRustno 9p/virtiofs shares, no control socket
aliothRustno virtiofs shares, no control socket

Installation

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.)

Start writing your own NixOS MicroVM definitions

nix flake init -t microvm$EDITOR flake.nixnix run .#my-microvm

Examples

Run MicroVMs on your local machine

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

Run a MicroVM example with nested MicroVMs on 5 different Hypervisors

nix run microvm#vm

Checknetworkctl status virbr0 for the DHCP leases of the nestedMicroVMs. They listen for ssh with an empty root password.

Experimental: run graphical applications in cloud-hypervisor with Wayland forwarding

nix run microvm#graphics neverball

Commercial support

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


[8]ページ先頭

©2009-2025 Movatter.jp