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.
This commit is contained in:
+3
-2
@@ -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() {
|
||||
|
||||
@@ -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)"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user