Skip to content

Testing an Installation in a QEMU VM

The script dnf/scripts/vm-start.sh starts a QEMU virtual machine on the DNF installation image. The VM is bridged to the LAN: it receives its address from the zone gateway, just like a physical machine.

The network bridge and qemu-bridge-helper come from the darkone.graphic.qemu module, to enable on the workstation that runs the VMs :

usr/machines/poste/configuration.nix
darkone.graphic.qemu = {
enable = true;
bridge.interface = "enp2s0";
bridge.macAddress = "aa:bb:cc:dd:ee:ff";
};

The deployment loads the bridge without activating it. Reboot the workstation (or run nmcli connection up br0) to move its IP address onto the bridge.

  1. Generate the image

    Fenêtre de terminal
    just build-iso
  2. Start the VM, from the project root

    Fenêtre de terminal
    # dnf/scripts/vm-start.sh <host>
    dnf/scripts/vm-start.sh poste

    On first run, the script creates the disk var/vm/poste.qcow2 (40 GB), ignored by git. An empty disk boots from the image.

  3. Install

    The VM screen displays its IP address and MAC. Then start the standard installation:

    Fenêtre de terminal
    just full-install poste nixos 10.0.0.50

    After reboot, the VM boots from its disk.

Script environment variables:

VariableDefaultRole
DISK_BUSsatasata → /dev/sda, nvme → /dev/nvme0n1, depending on the host’s disko
DISK_SIZE40GDisk size, at creation
MEMORY4096Memory (MiB)
CPUS2Number of processors
BRIDGEbr0Network bridge

Arguments placed after the host name are passed to QEMU.