Guest VM UEFI NVRAM not saved / not persistent
-
@olivierlambert I enabled UEFI boot for an existing Debian Linux VM but XCP does not save the UEFI boot variable NVRAM in the XAPI database. The next time the VM cold boots (or is migrated and reboots) it forgets what to do an just drops to the UEFI shell because the UEFI NVRAM is blank (hardware emulated).
XO should automatically enable NVRAM saving to the XAPI database when UEFI is enabled. It would be good to have a clear NVRAM button too (or just turn off UEFI and back on).
How do I manually enable persistent NVRAM saving in XCP for existing VMs?
I find that UEFI VMs can boot a lot faster than BIOS VMs.... when they boot.
-
-
@olivierlambert Banging my head against the screen late at night provided the following results:
- There is still a UEFI/NVRAM save issue (XCP/OVMF).
- There is a Tianocore UEFI boot issue not looking for the vendor boot files correctly.
- There is a Debian assumption that your UEFI firmware is not broken and supports up-to-date processes.
To workaround the GRUB UEFI boot issue with Debian, simply run the command
dpkg-reconfigure grub-efi-amd64
and enable Force installation to the removable media path, this will update the Debian config. For a quick fix, run:grub-install --force-extra-removable
. It will install a good old normal standard default UEFI boot config that works with XCP/Tianocore/UEFI boot (and other VM hosts having the same issue). Ubuntu already does this. FreeBSD already does this. This may cause problems with multi-OS boot on a single disk (like a desktop), but since this is a VM I don't care. One VM, One OS. Just boot it.- Some official Debian Docs about the issue.
- A user report about the Debian issue on another platform
- And another one
-
I never met this issue but we'll try to reproduce. We met a similar issue which may have the same root cause, though: if you clear the EFI variable store from a debian VM (at least the version we had tested at the time, 10 or 11, maybe both), then it becomes unbootable, where most other OSes can boot and populate it back.
-
Is this on XCP-ng 8.2 or 8.3?
-
@stormi I'm using 8.2.1 (updated July 2024).
If you read Debian's docs about UEFI boot it explains why they do something different than everyone else and how to fix it so it works. I use UEFI boot for Debian and use the removable media path install it boots every time on XCP.
I think there are several issues, each can cause the same failure to boot the VM.
If you upgrade XOA to UEFI with Debian then you need to install the extra boot files so it always boots on XCP.
-
@Andrew do you still have the exact steps to reproduce? Must you start with a Debian VM booting in BIOS mode and then switch to UEFI?
-
@stormi I'll build a new VM and test it.