Thank you for providing exact steps.
I tried this on a couple of VM-s and it worked fine (some already had the updated keys, some didn't, and this command worked for them).
This is an example of a Windows 11 VM:
Code:
efidisk0: enrolling Microsoft UEFI CA 2023
INFO: reading raw edk2 varstore from /var/run/qemu-server/qsd-vm-132-efi-enroll-efidisk0-enroll.fuse
INFO: var store range: 0x64 -> 0x40000
INFO: add db cert /usr/lib/python3/dist-packages/virt/firmware/certs/MicrosoftCorporationUEFICA2011.pem
INFO: certificate already present, skipping
INFO: add db cert /usr/lib/python3/dist-packages/virt/firmware/certs/MicrosoftUEFICA2023.pem
INFO: writing raw edk2 varstore to /var/run/qemu-server/qsd-vm-132-efi-enroll-efidisk0-enroll.fuse
successfully updated efidisk
However, inside the guests I'm still getting the Event:
Code:
Secure Boot CA/keys need to be updated. This device signature information is included here.
DeviceAttributes: BaseBoardManufacturer:;FirmwareManufacturer:Proxmox distribution of EDK II;FirmwareVersion:4.2025.05-2;OEMModelNumber:Standard PC (Q35 + ICH9, 2009);OEMModelBaseBoard:;OEMModelSystemFamily:;OEMManufacturerName:QEMU;OEMModelSKU:;OSArchitecture:amd64;
BucketId: e4d984ebd26ba50cc7642eeceba9258336bd302c7c0a4db90e1796d59b242c28
BucketConfidenceLevel:
UpdateType: 0
HResult: The operation completed successfully.
I guess there's something to be done in the OS as well. There's a task inside Windows that needs to be completed, but I tried running that task (Task Scheduler -> Microsoft -> Windows -> PI, then there is a task named "Secure-Boot-Update". But running it fails, with a status code 3221225477, meaning STATUS_ACCESS_VIOLATION, meaning the task crashed.
When looking at the result of
[System.Text.Encoding]::ASCII.GetString((Get-SecureBootUEFI -Name db).Bytes) -match 'Windows UEFI CA 2023'
in an elevated powershell, I get TRUE. Meaning the OS sees the new certificates in the firmware.
That's on Windows 11. Not working in my case.
On a Windows Server 2002 VM, that same powershell command is returning FALSE, meaning the OS doesn't even see the new certificates in firmware.
Now for that particular VM, the EFI vars were updated automatically, yesterday, when I installed the previews PVE updates, that contained the automatic deployment of new certs. For a Windows 11 VM I did the update manually with "qm enroll-efi-keys".
Question: was the update in PVE 9.0.17 / qemu-server 9.0.29 different from this freshly released one ?
EDIT/UPDATE:
- Windows 2022 VM actually sees the new certificate after a reboot. So it's just this Windows task where I'm stuck.
- I forgot to mention, this needs to be done inside the OS before trying to run the task:
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Secureboot" /v AvailableUpdates /t REG_DWORD /d 0x5944 /f
ANOTHER EDIT/UPDATE:
- after the update the Windows Server 2002 VM got this in the event viewer: Event ID 1044: Secure Boot DB update to install Microsoft Option ROM UEFI CA 2023 certificate applied successfully
So I guess it works, for WIndows Server at least. But not for my Windows 11 VMs for some reason.