From bcc370d70fac6817108f596dc807cc2e65b04007 Mon Sep 17 00:00:00 2001 From: Mathieu Moran Date: Mon, 26 Oct 2026 13:01:10 -0400 Subject: [PATCH] bootstrap: find the virtio CD by content, not by volume label Get-Volume only returns a label when the image carries one; when it did not, the whole block was skipped and neither vioser nor the agent was installed. Probe the drives for guest-agent/qemu-ga-x86_64.msi instead. --- session1/content/seed/payload/bootstrap.ps1 | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/session1/content/seed/payload/bootstrap.ps1 b/session1/content/seed/payload/bootstrap.ps1 index d1bb61a..5956df1 100644 --- a/session1/content/seed/payload/bootstrap.ps1 +++ b/session1/content/seed/payload/bootstrap.ps1 @@ -64,14 +64,21 @@ if (-not (Get-NetFirewallRule -DisplayName 'Norbourg ICMPv4' -ErrorAction Silent # virtio-win is attached as a CD on that platform; on qemu it is absent and # this block does nothing. try { - $virtio = Get-Volume -ErrorAction SilentlyContinue | - Where-Object { $_.FileSystemLabel -like 'virtio-win*' -and $_.DriveLetter } | - Select-Object -First 1 - if ($virtio) { + # Find the virtio CD by its content, not by volume label: the label is + # not reliable across images and an empty one silently skipped the whole + # block (no driver, no agent, no provisioning). + $virtioRoot = $null + foreach ($drv in (Get-PSDrive -PSProvider FileSystem -ErrorAction SilentlyContinue)) { + if (Test-Path "$($drv.Root)guest-agent\qemu-ga-x86_64.msi") { + $virtioRoot = $drv.Root + break + } + } + if ($virtioRoot) { # 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' ` + $vioser = Get-ChildItem "$($virtioRoot)vioserial" -Recurse -Filter 'vioser.inf' ` -ErrorAction SilentlyContinue | Where-Object { $_.FullName -match 'amd64' } | Select-Object -First 1 if ($vioser) { @@ -81,7 +88,7 @@ try { Write-Host 'bootstrap: vioser.inf not found on the virtio CD' } - $msi = "$($virtio.DriveLetter):\guest-agent\qemu-ga-x86_64.msi" + $msi = "$($virtioRoot)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