Mailing List Archive

Xen guest's bios=ovmf EFI vars are not persistent across guest reboot ?
I notice that when booting to a Xen UEFI Guest, where its config contains

bios='ovmf'

that the boot sequence queries for "Floppy" first. Clearly, there's no floppy involved here.


Checking efi vars after boot explains it

efibootmgr
BootCurrent: 0002
Timeout: 0 seconds
BootOrder: 0000,0001,0002,0003,0004,0005,0006,0007,0008,0009
? Boot0000* EFI Floppy
? Boot0001* EFI Floppy 1
Boot0002* EFI Hard Drive
Boot0003* EFI Hard Drive 1
Boot0004* EFI Hard Drive 2
Boot0005* EFI Misc Device
Boot0006* EFI Misc Device 1
Boot0007* EFI Misc Device 2
Boot0008* EFI Misc Device 3
Boot0009* EFI Internal Shell

I figured I could avoid it by changing the boot order so the "EFI Hard Drive" that the guest is currently booted from is simply sought out first

efibootmgr -o 2,9,0,1,3,4,5,6,7
BootCurrent: 0002
Timeout: 0 seconds
> BootOrder: 0002,0009,0000,0001,0003,0004,0005,0006,0007
Boot0000* EFI Floppy
Boot0001* EFI Floppy 1
> Boot0002* EFI Hard Drive
Boot0003* EFI Hard Drive 1
Boot0004* EFI Hard Drive 2
Boot0005* EFI Misc Device
Boot0006* EFI Misc Device 1
Boot0007* EFI Misc Device 2
Boot0008* EFI Misc Device 3
Boot0009* EFI Internal Shell
Boot000A* Linux Boot Manager

Notice that a new entry has appeared

Boot000A* Linux Boot Manager

and if I update

bootctl --path=/boot/efi update

then the new entry gets set as the 1st entry

efibootmgr
BootCurrent: 0002
Timeout: 0 seconds
> BootOrder: 000A,0002,0009,0000,0001,0003,0004,0005,0006,0007
Boot0000* EFI Floppy
Boot0001* EFI Floppy 1
Boot0002* EFI Hard Drive
Boot0003* EFI Hard Drive 1
Boot0004* EFI Hard Drive 2
Boot0005* EFI Misc Device
Boot0006* EFI Misc Device 1
Boot0007* EFI Misc Device 2
Boot0008* EFI Misc Device 3
Boot0009* EFI Internal Shell
> Boot000A* Linux Boot Manager

And if I now reboot,

(1) the floppy is again/still queried on boot, and fails
(2) the efi vars after reboot are reset to the original

efibootmgr
BootCurrent: 0002
Timeout: 0 seconds
BootOrder: 0000,0001,0002,0003,0004,0005,0006,0007,0008,0009
Boot0000* EFI Floppy
Boot0001* EFI Floppy 1
Boot0002* EFI Hard Drive
Boot0003* EFI Hard Drive 1
Boot0004* EFI Hard Drive 2
Boot0005* EFI Misc Device
Boot0006* EFI Misc Device 1
Boot0007* EFI Misc Device 2
Boot0008* EFI Misc Device 3
Boot0009* EFI Internal Shell

Iiuc, these efi vars, and their (non)persistence are the job of the bios, here 'ovmf'.

How do I set the Xen guest's ovmf-bios efi vars so

(a) the list is trimmed to only the needed/correct items,
(b) the right order is set,
(c) any changes I make are persistent across Guest reboots

?

_______________________________________________
Xen-users mailing list
Xen-users@lists.xen.org
http://lists.xen.org/xen-users
Re: Xen guest's bios=ovmf EFI vars are not persistent across guest reboot ? [ In reply to ]
Hi,

On Wed, Feb 24, 2016 at 05:40:32PM -0800, suse.dev@fea.st wrote:
> I notice that when booting to a Xen UEFI Guest, where its config contains
>
> bios='ovmf'
>
> that the boot sequence queries for "Floppy" first. Clearly, there's no floppy involved here.
>

EFI in xen uses a file on the ESP to store the EFI variables. Since it can't share access to the ESP when the
operating system is running changes made outside of the firmware shell are not persisted. If you start the EFI
shell from the boot menu and modify the boot order there it should persist the changes.

qemu has a pflash option which allows the location of an external backing file to be used but this is not wired
up in to Xen.

James

_______________________________________________
Xen-users mailing list
Xen-users@lists.xen.org
http://lists.xen.org/xen-users
Re: Xen guest's bios=ovmf EFI vars are not persistent across guest reboot ? [ In reply to ]
On Wed, Feb 24, 2016 at 05:40:32PM -0800, suse.dev@fea.st wrote:
[...]
> Iiuc, these efi vars, and their (non)persistence are the job of the bios, here 'ovmf'.
>
> How do I set the Xen guest's ovmf-bios efi vars so
>
> (a) the list is trimmed to only the needed/correct items,
> (b) the right order is set,
> (c) any changes I make are persistent across Guest reboots
>

Unfortunately Xen needs to be taught on how to persist those eif vars.
Nobody is working on that at the moment.

As said in other email, we play a trick in our test system to make ovmf
load grub automatically.

Wei.

> ?
>
> _______________________________________________
> Xen-users mailing list
> Xen-users@lists.xen.org
> http://lists.xen.org/xen-users

_______________________________________________
Xen-users mailing list
Xen-users@lists.xen.org
http://lists.xen.org/xen-users
Re: Xen guest's bios=ovmf EFI vars are not persistent across guest reboot ? [ In reply to ]
On Fri, Feb 26, 2016, at 07:33 AM, Wei Liu wrote:
> On Wed, Feb 24, 2016 at 05:40:32PM -0800, suse.dev@fea.st wrote:
> [...]
> > Iiuc, these efi vars, and their (non)persistence are the job of the bios, here 'ovmf'.
> >
> > How do I set the Xen guest's ovmf-bios efi vars so
> >
> > (a) the list is trimmed to only the needed/correct items,
> > (b) the right order is set,
> > (c) any changes I make are persistent across Guest reboots
> >
>
> Unfortunately Xen needs to be taught on how to persist those eif vars.
> Nobody is working on that at the moment.
>
> As said in other email, we play a trick in our test system to make ovmf
> load grub automatically.

Fwiw, I'm not using grub anymore in the Guest. I'm using systemd-boot as the UEFI loader instead. It's simpler and lighter.

I'll eventually switch to using it in Dom0 too. But for now the Dom0 OS (opensuse) has a systemd that's too old. So i'll have to wait, figure out how to upgrade just systemd, or switch to a different OS.

And IIUC I don't thing any of this effect matters to the EFI vars' persistence.


_______________________________________________
Xen-users mailing list
Xen-users@lists.xen.org
http://lists.xen.org/xen-users
Re: Xen guest's bios=ovmf EFI vars are not persistent across guest reboot ? [ In reply to ]
On Fri, Feb 26, 2016 at 07:57:22AM -0800, suse.dev@fea.st wrote:
> On Fri, Feb 26, 2016, at 07:33 AM, Wei Liu wrote:
> > On Wed, Feb 24, 2016 at 05:40:32PM -0800, suse.dev@fea.st wrote:
> > [...]
> > > Iiuc, these efi vars, and their (non)persistence are the job of the bios, here 'ovmf'.
> > >
> > > How do I set the Xen guest's ovmf-bios efi vars so
> > >
> > > (a) the list is trimmed to only the needed/correct items,
> > > (b) the right order is set,
> > > (c) any changes I make are persistent across Guest reboots
> > >
> >
> > Unfortunately Xen needs to be taught on how to persist those eif vars.
> > Nobody is working on that at the moment.
> >
> > As said in other email, we play a trick in our test system to make ovmf
> > load grub automatically.
>
> Fwiw, I'm not using grub anymore in the Guest. I'm using systemd-boot as the UEFI loader instead. It's simpler and lighter.


The trick is the same whatever bootloader you use.


_______________________________________________
Xen-users mailing list
Xen-users@lists.xen.org
http://lists.xen.org/xen-users
Re: Xen guest's bios=ovmf EFI vars are not persistent across guest reboot ? [ In reply to ]
On Fri, Feb 26, 2016, at 07:58 AM, Wei Liu wrote:
> The trick is the same whatever bootloader you use.

Ok.

I'm still fuzzy about which combinations of disk-names in multi-disk configs do & don't work, the Dom0's Xen instance packages don't yet officially support OVMF, and as you pointed out for this issue and before, OVMF still uses some 'tricks'.

I should probably wait for some things to all 'catch up'.

Anyway, I have it loading now which is big progress in my book.

Thanks alot!

_______________________________________________
Xen-users mailing list
Xen-users@lists.xen.org
http://lists.xen.org/xen-users