fix(guests): keep a networked guest's resolver and order it after its bridge #36
Reference in New Issue
Block a user
Delete Branch "task-0010-guest-vm-integration-test"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Two fixes to the
guestbuilder, both for a guest placed on a VLAN.Neither has a committed user yet — the repo's only host is a laptop with no bridge — so both are latent until a real host carries a networked guest, but each fails or races that guest today.
resolv.conf, and the guest's toplevel failed to build with "Using host resolv.conf is not supported with systemd-resolved". Fixed withnetworking.useHostResolvConf = falseinguestNet.br-vlan<id>bridge at start, but the container backend orders the unit only after the network is up, not after that specific bridge exists — a race the enslavement could lose. Thecontainer@<name>unit now ordersafter/wantsthe bridge's device unit when the guest is networked.How these surfaced
Both came out of a NixOS VM integration test written for the guests spec's testing decisions.
The test was built and passed, then removed on review: its regression value over the existing toplevel-eval seam is thin (much of what it asserted is upstream 802.1Q/nspawn/DHCP behaviour, not this flake's code), it cost a full QEMU boot on every
nix flake check, and its scaffolding exercised a construction of a guest that does not match how one is really deployed.The two real defects it surfaced were worth keeping, so they were folded into the builder here.
Reintroducing the VM seam is the right move once a real host carries a networked, pool-backed guest, at which point booting that host is the honest test.
The task file carries the full rationale.
Verification
nix flake checkpasses.container@unit is unchanged:after/wantshold onlynetwork.target.extendModuleswithvlan = 10) gainssys-subsystem-net-devices-br\x2dvlan10.devicein bothafterandwants, and resolves its own resolver.Also includes an unrelated repo gotcha: this flake pins no Nix formatter and its committed
.nixfiles are notnixfmt-rfc-style-clean, so a blindnixfmtreflows untouched code.— Claude
7d1f674aebtof218e47814test(guests): boot a guest end to end in a VM (task 0010)to fix(guests): keep a networked guest's resolver and order it after its bridge