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.
Prepare the administration workstation
Section titled “Prepare the administration workstation”The network bridge and qemu-bridge-helper come from the
darkone.graphic.qemu module, to enable on the workstation that runs the VMs :
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.
Starting a VM
Section titled “Starting a VM”-
Generate the image
Fenêtre de terminal just build-iso -
Start the VM, from the project root
Fenêtre de terminal # dnf/scripts/vm-start.sh <host>dnf/scripts/vm-start.sh posteOn first run, the script creates the disk
var/vm/poste.qcow2(40 GB), ignored by git. An empty disk boots from the image. -
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.50After reboot, the VM boots from its disk.
Settings
Section titled “Settings”Script environment variables:
| Variable | Default | Role |
|---|---|---|
DISK_BUS | sata | sata → /dev/sda, nvme → /dev/nvme0n1, depending on the host’s disko |
DISK_SIZE | 40G | Disk size, at creation |
MEMORY | 4096 | Memory (MiB) |
CPUS | 2 | Number of processors |
BRIDGE | br0 | Network bridge |
Arguments placed after the host name are passed to QEMU.