From a38acd39468715bb5902162daaad3535da354a65 Mon Sep 17 00:00:00 2001 From: Mathieu Moran Date: Wed, 21 Oct 2026 19:00:46 -0400 Subject: [PATCH] Fix MAC generator (5 octets) and silence the discoverability flyout QEMU rejects a five-byte ethernet address, so every VM would have failed to start with 'invalid ethernet address'. Caught by booting the installer against a scratch disk with user-mode networking: the unattended file was picked up, image index 2 copied, and once=d handed off to the disk. --- backends/qemu.sh | 5 +++-- seed/payload/bootstrap.ps1 | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/backends/qemu.sh b/backends/qemu.sh index 4c82d3d..f2be223 100644 --- a/backends/qemu.sh +++ b/backends/qemu.sh @@ -45,13 +45,14 @@ qemu_pidfile(){ printf '%s/run/%s.pid' "$LAB_ROOT" "$1"; } qemu_log() { printf '%s/run/%s.log' "$LAB_ROOT" "$1"; } qemu_monitor(){ printf '%s/run/%s.monitor' "$LAB_ROOT" "$1"; } -# Deterministic MAC from the last two octets: 10.10.10.31 -> 52:54:00:0a:1f +# Deterministic MAC from the last two octets: 10.10.10.31 -> 52:54:00:0a:1f:00 +# (six octets — a five-byte value is rejected as "invalid ethernet address") qemu_mac_for() { local ip=$1 local b3=${ip##*.} local rest=${ip%.*} local b2=${rest##*.} - printf '52:54:00:%02x:%02x' "$b2" "$b3" + printf '52:54:00:%02x:%02x:00' "$b2" "$b3" } backend_running() { diff --git a/seed/payload/bootstrap.ps1 b/seed/payload/bootstrap.ps1 index 46397fd..500013f 100644 --- a/seed/payload/bootstrap.ps1 +++ b/seed/payload/bootstrap.ps1 @@ -31,6 +31,11 @@ if (-not $nic) { Set-DnsClientServerAddress -InterfaceIndex $nic.ifIndex -ServerAddresses $Config.DNS Set-NetConnectionProfile -InterfaceIndex $nic.ifIndex -NetworkCategory Private -ErrorAction SilentlyContinue + # The IP change re-triggers the "make this PC discoverable" flyout. + New-Item -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Network' -Force | Out-Null + Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Network' ` + -Name NewNetworkWindowOff -Value 1 -Type DWord + Write-Host "bootstrap: $($nic.Name) -> $($Config.IP)/$($Config.Prefix)" }