How to make UEFI boot options persist?

Booting a VM here, and going into the UEFI I’d like to change boot orders to remove PXE and set some different options among other things.

However, they only persist until I stop and restart the instance. Each time they roll back to the defaults.

Is there some setting somewhere that controls saving this UEFI state?

I found the volatile.apply_nvram option in the documentation, which seems relevant, but of course that option goes away the moment you start the instance again. Where am I missing something?

Hmm, we have the NVRAM as writable and we only ever reset it if you change the security.secureboot value on the VM.

I have a number of VM which are configured to always network boot and haven’t seen that setting change, though note that the OS may be messing with things too (efibootmgr can change the boot options).

Strange. Still trying to debug this here. Running 6.0.3 incus. Do you think updating may help anything?

In meantime, I’ve been able to confirm the OVMF_VARS_4M.ms.fd file is being written to disk when I save setting in UEFI menus. Stopping VM and that file on disk remains same checksum as when I edited setting.

Moment I start instance, the checksum changes (Perhaps some power-on timestamp being written?) but all the settings are reset back to the defaults.

Note, I’ve not installed any OS, just trying to rule out variables. No incus config changes between boots either.

Ok, follow up here. May not be incus at all. Confirmed other settings in the UEFI menus are persisting across restarts. Only the boot options are not for some reason. (PXE keeps getting re-injected even after I disable and tell it to save)

Looking into OVMF update now, running 2022.11 still here :slight_smile: