proxmox: reboot once after the install so the guest agent can connect

The agent MSI was installed at first logon, before the virtio-serial port
existed. The service started without a channel and Proxmox kept reporting
"guest agent is not running", which blocked provisioning at backend_ready.

- backend_finalize now waits for the first-logon bootstrap to finish
  (stamp.txt over SMB, which does not need the agent), detaches the
  installer ISO, reboots the VM once and waits for the agent to answer.
- bootstrap logs the pnputil and msiexec exit codes, so bootstrap.log says
  exactly what happened if it still fails.
- check requires smbclient (site sync + finalize) and python3.
- instructor guide: snapshot doubles disk usage, plan ~60 GB.
This commit is contained in:
2026-10-26 17:23:05 -04:00
parent bcc370d70f
commit 06a9034214
3 changed files with 42 additions and 3 deletions
+3 -2
View File
@@ -83,14 +83,15 @@ try {
Where-Object { $_.FullName -match 'amd64' } | Select-Object -First 1
if ($vioser) {
$null = pnputil.exe /add-driver $vioser.FullName /install
Write-Host "bootstrap: vioser driver installed from $($vioser.FullName)"
Write-Host "bootstrap: vioser add-driver exit=$LASTEXITCODE ($($vioser.FullName))"
} else {
Write-Host 'bootstrap: vioser.inf not found on the virtio CD'
}
$msi = "$($virtioRoot)guest-agent\qemu-ga-x86_64.msi"
if (Test-Path $msi) {
Start-Process msiexec.exe -ArgumentList "/i `"$msi`" /qn /norestart" -Wait
$proc = Start-Process msiexec.exe -ArgumentList "/i `"$msi`" /qn /norestart" -Wait -PassThru
Write-Host "bootstrap: qemu-ga msi exit=$($proc.ExitCode)"
Set-Service -Name QEMU-GA -StartupType Automatic -ErrorAction SilentlyContinue
Start-Service -Name QEMU-GA -ErrorAction SilentlyContinue
Write-Host 'bootstrap: qemu guest agent installed'