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)" }