microVM guests
A microVM guest is an ordinary DNF host (zone IP, services, monitoring) running in a lightweight virtual machine, on another host of the fleet: the hypervisor. DNF relies on microvm.nix 🡕 and cloud-hypervisor. Typical use: a closed AI workspace per person or per team.
Declare a guest
Section titled “Declare a guest”-
Declare the host
The
microvm-guestfeature names the hypervisor, from the same zone. The static IP is mandatory: the interface and MAC address are derived from it. Like any host, the guest is only monitored with themonitoring-nodefeature.etc/config.yaml hosts:- hostname: "espace1"zone: "maison:1.40"profile: "ai-space"features: ["microvm-guest:serveur", "monitoring-node"] -
Size it
Optional, 2 vCPU and 4096 Mio by default.
usr/machines/espace1/configuration.nix {darkone.system.microvm.guest = {vcpu = 4;mem = 6144; # Mio};} -
Pin the state version
A guest never goes through
just install: create the file by hand, with the NixOS version of the first deployment.usr/machines/espace1/install/state.nix { system.stateVersion = "26.05"; } -
Initialize its secrets
The guest only reads its own secrets: see isolated hosts.
Fenêtre de terminal just space-init espace1 -
Deploy the hypervisor
Fenêtre de terminal just generatejust apply serveur
Deploy and update
Section titled “Deploy and update”A guest is not a deployment target: just apply <hypervisor> builds the guests, starts the new ones and restarts those that changed. Guests start with the hypervisor.
| Item | Location |
|---|---|
| Persistent data | /var/lib/microvms/<guest>/ on the hypervisor, closed to its accounts except root (0770) and mounted nosuid,nodev: a setuid file or a device created by the guest stays inert there |
/persist, /var/lib, /home | virtiofs shares of this folder |
Root / | In memory, wiped at each boot |
| Nix store | The hypervisor’s one in read-only, plus an in-memory layer for what the guest installs (nix shell, Home Manager), wiped at each boot |
Network isolation
Section titled “Network isolation”Each guest has its own interface vm-X-Y, routed as a /32 by the
hypervisor, which answers for it on the LAN (ARP proxy), without a bridge.
The hypervisor runs systemd-networkd, with DNS set to the zone gateway :
it cannot be that gateway, nor a host running NetworkManager.
| Flow | Allowed |
|---|---|
| Guest → Internet | Yes |
| Guest → Gateway DNS | Yes |
| Guest → LAN, tailnet, other guests | No |
| Guest → hypervisor | Transcription only, if requested |
| Gateway → guest | Yes (proxy, supervision) |
| Other host → guest | Ping and SSH only |
How to connect to a guest?
Section titled “How to connect to a guest?”Like any host, from an administration workstation: just enter <guest>. Its
name is published by the gateways’ DNS, which must therefore be redeployed
after adding the guest.
Optimize the hypervisor’s store?
Section titled “Optimize the hypervisor’s store?”No: the guest reads this store through an overlay layer, which returns Stale
file handle when a file read becomes a hard link. DNF therefore does not run
nix-store --optimise (the GC stays active); done manually, restart the guests.
Transcribe voice for guests?
Section titled “Transcribe voice for guests?”The hypervisor hosts a whisper.cpp 🡕 server,
started and opened only for the guests that request it (voice notes from an
AI space). Nothing to
declare ; darkone.system.microvm.whisper.model (default
large-v3-turbo) and .threads (default 8) configure it.
How to wipe a guest?
Section titled “How to wipe a guest?”Remove it from etc/config.yaml, deploy the hypervisor, then delete
/var/lib/microvms/<guest>/ on the hypervisor.