diff --git a/session1/content/seed/payload/bootstrap.ps1 b/session1/content/seed/payload/bootstrap.ps1 index 505394f..d1bb61a 100644 --- a/session1/content/seed/payload/bootstrap.ps1 +++ b/session1/content/seed/payload/bootstrap.ps1 @@ -68,9 +68,24 @@ try { Where-Object { $_.FileSystemLabel -like 'virtio-win*' -and $_.DriveLetter } | Select-Object -First 1 if ($virtio) { + # The agent MSI does not install the VirtIO serial driver. Without it + # the service starts but never connects to the channel, and Proxmox + # shows "guest agent is not running", which blocks provisioning. + $vioser = Get-ChildItem "$($virtio.DriveLetter):\vioserial" -Recurse -Filter 'vioser.inf' ` + -ErrorAction SilentlyContinue | + 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)" + } else { + Write-Host 'bootstrap: vioser.inf not found on the virtio CD' + } + $msi = "$($virtio.DriveLetter):\guest-agent\qemu-ga-x86_64.msi" if (Test-Path $msi) { Start-Process msiexec.exe -ArgumentList "/i `"$msi`" /qn /norestart" -Wait + Set-Service -Name QEMU-GA -StartupType Automatic -ErrorAction SilentlyContinue + Start-Service -Name QEMU-GA -ErrorAction SilentlyContinue Write-Host 'bootstrap: qemu guest agent installed' } else { Write-Host 'bootstrap: virtio-win mounted but qemu-ga msi not found'