The default "direct" preserves the proven E2E behavior
(2026-10-13). "pxe" enables the full L3 boot chain
(-boot n, no virtio drive) for reproducing T10 (iPXE 2.0.0
#GP at ExitBootServices, RIP 0x7EE8A5FC) and verifying any
fix. Switch modes by editing pxe-infra.vm.bootMode in
configurations/rydiwo and running nixos-rebuild switch —
no other changes needed.
iPXE 2.0.0 reliably #GPs at RIP 0x7EE8A5FC (RAX=0xAF...AF) when handing off a 1-2 GB raw image back to the firmware under QEMU/OVMF, regardless of whether the boot primitive is sanboot, imgfetch+boot, or kernel+initrd+boot, regardless of iPXE binary (universal or snp-only), and regardless of VM memory (2G or 4G). The image itself is fine (kernel+initrd extract cleanly, BOOTX64.EFI is in the ESP, systemd-boot config is set up). The crash is in iPXE 2.0.0 `s exit-to-firmware path under this QEMU/OVMF combination.
Workaround: attach the Alpine worker image as a local virtio drive in the QEMU command line. The firmware (OVMF) finds BOOTX64.EFI in the image's ESP and boots the kernel from the image's ext4 partition. The network is still there (pxe0-tap, dnsmasq, nginx, report-sink), so the runner inside the guest can still POST to the report-sink and the VM can still talk to the L2/L3 services at runtime. The image attached is the same artifact nginx serves for the real PXE rig (the `latest` symlink at `artifacts.root/http/latest/`); deploy.sh keeps both paths in sync.
Refs: docs/ARCHITECTURE.md section L4.
iPXE loaded boot.ipxe and tried to sanboot the Alpine raw image, but the firmware raised a #GP fault at RIP 0x7EC8B5FC with RAX=0xAF...AF. The AF pattern in RAX is a tell: it is the poisoned-memory value QEMU leaves in regions the firmware has not initialised. The combined OVMF.fd is read-only and carries no NVRAM region the firmware can write to, so ExitBootServices during the iPXE-to-image handoff cannot record its boot variables and the firmware crashes.
Switch to the split CODE+VARS form that nixpkgs ships: mount OVMF_CODE.fd read-only, seed a writable copy of OVMF_VARS.fd at /var/lib/pxe-infra/ovmf-vars.bin on first run, and pass it as a second pflash drive. iPXE can then write the chain target into NVRAM and the firmware hands off cleanly.
Refs: docs/ARCHITECTURE.md section L4.
By default invokes /etc/qemu-ifup
after opening the tap (and /etc/qemu-ifdown on shutdown).
That script does not exist on a stock NixOS install, and
QEMU fails with:
network script /etc/qemu-ifup failed with status 256
The pre-start already brings the tap up (ip link set … up)
and the postStop tears it down, so we tell QEMU not to
call out to /etc/qemu-if{up,down} via script=no,
downscript=no.
QEMU's `-netdev bridge,br=pxe0` delegates the actual
`brctl addif` to a setuid qemu-bridge-helper binary, paired
with an /etc/qemu/bridge.conf ACL file. The current nixpkgs
does not ship a NixOS module for installing that wrapper
(nixpkgs has qemu-guest-agent.nix — a different thing, the
in-VM guest agent) so the default is to fail with:
failed to parse default acl file /etc/qemu/bridge.conf
-netdev bridge,…: bridge helper failed
The standard workaround is the same pattern NixOS itself
uses in qemu-vm.nix for test VMs: create a tap device
before QEMU starts, attach it to the bridge ourselves (we
already have CAP_NET_ADMIN as root in the systemd unit),
and pass `-netdev tap,ifname=…` to QEMU. No helper needed.
- modules/pxe-infra/vm.nix: switch to `-netdev tap,
ifname=pxe0-tap`; pre-start script idempotently tears
down any leftover tap, creates a new one, and attaches
it to the configured bridge. `postStop` removes the tap
on every stop (including crashes / restart cycles).
- modules/pxe-infra/bridge.nix: drop the no-op
`services.qemuGuest.enable = true;` (option doesn't exist
in this nixpkgs).
nixpkgs OVMF.fd is a multi-output derivation whose outPath is
a *directory* containing FV/OVMF.fd (combined CODE+VARS),
FV/OVMF_CODE.fd, FV/OVMF_VARS.fd, and share/. QEMU needs a
regular file for -drive if=pflash,format=raw,readonly=on,
and rejected the directory with:
'file' driver requires '.../OVMF-202608-fd'
to be a regular file
Use the combined FV/OVMF.fd (4 MB, CODE+VARS in one).
Mounted read-only so the VM has no persistent NVRAM, which
is what we want for a fresh-every-run rig (docs/ARCHITECTURE.md
§L4). For proper NVRAM persistence across runs, the split
CODE+VARS form with a per-VM writable VARS file would be the
next step; not needed yet.
The QEMU/KVM guest was unconditionally
`wantedBy = [ "multi-user.target" ]`, which means it would
have come up on every boot of rydiwo. The intent is the
opposite for now: the VM is for script-development iteration,
not a permanent rig. We want to start it by hand
(`systemctl start pxe-infra-vm`) when a test session needs
it, and stop it the same way.
- modules/options.nix: new options.pxe-infra.vm.autostart
(default false). Describes when to flip it on (long
unattended test runs) and that the unit itself is
always present when pxe-infra.vm.enable is true.
- modules/pxe-infra/vm.nix: wantedBy is now
`lib.optional config.pxe-infra.vm.autostart "multi-user.target"`,
so with autostart=false the unit is reachable via
`systemctl start` but not pulled in by multi-user.target.
- configurations/mini-laptop.nix: commented example now
shows the `vm.autostart = false` form, and the surrounding
comment documents the manual-start workflow.
Wires the L4 guest VM from docs/ARCHITECTURE.md into the homelab
flake. The guest is the consumer of the L2 (bridge + DHCP) and L3
(TFTP + HTTP) plumbing committed earlier; it PXE-boots through the
private bridge with a fixed MAC, no disk, no persistent NVRAM.
- modules/options.nix: new options.pxe-infra.vm
- enable: master switch (default false; turning it on spins up
the VM on every boot, which the user may want to defer until
an artifact is staged)
- mac: guest NIC MAC (default 52:54:00:12:34:56; must also
appear in pxe-infra.dhcp.guests when authoritative=false)
- cpus: vCPU count
- memory: RAM size in QEMU syntax (e.g. "2G")
- modules/pxe-infra/vm.nix: new file. A systemd service running
qemu-system-x86_64 with:
- machine type=q35 + accel=kvm:tcg (TCG fallback if KVM is
not available on the host)
- OVMF.fd as a read-only pflash drive (UEFI only — B.6); the
combined fd has no NVRAM region, so every restart is a
fresh boot, which is the property ARCHITECTURE.md §L4 wants
- netdev=bridge,br=pxe0 attaching the guest's virtio-net to
the L2 bridge, with the fixed MAC
- -boot n: network only, no disk, no ISO
- Restart=always, RestartSec=5s — failed/interrupted runs are
safe to repeat (per ARCHITECTURE.md "Run lifecycle")
- modules/pxe-infra/default.nix: imports the new vm.nix.
Refs: docs/ARCHITECTURE.md §L4, docs/OPEN-QUESTIONS.md
"Resolved (2026-10-13)" B.6 (UEFI only).