Munix

A microVM runner for NixOS systems with desktop integration, powered by muvm/libkrun.

Quick Start

  1. Build a test VM:
nix build '.#nixosConfigurations.testvm-x86_64.config.system.build.toplevel' -o testvm
  1. Run the VM:
nix run '.#munix' -- testvm

This will start an interactive bash session inside the microVM.

Run a specific command:

nix run '.#munix' -- testvm fastfetch

Create a custom VM: Use the template to bootstrap a new munix project:

mkdir my-vm && cd my-vm
nix flake init -t 'git+https://git.clan.lol/clan/munix#musictest'
git init && git add flake.nix
nix run

This creates a flake.nix with a music player demo (MPD + Euphonica). Edit the module to customize your VM.

munix Options

OptionDescription
--uid UIDSet microVM UID (default: 1337)
-u UIDSet microVM UID (default: 1337)
--gid GIDSet microVM GID (default: 1337)
-g GIDSet microVM GID (default: 1337)
--no-gpuDisable GPU acceleration
--no-waylandDisable Wayland support
--no-pipewireDisable PipeWire audio
--x11Enable X11 support
--bind SRC DSTBind mount SRC to DST in the VM
--ro-bind SRC DSTRead‑only bind mount
--expose PATHExpose PATH in the VM at the same location
--ro-expose PATHExpose PATH read‑only

Example with options:

nix run '.#munix' -- --no-gpu --ro-expose /home/user/data testvm htop