unable to find any master var store for loader error

Greetings, I have the following machine: https://dpaste.com/5BPA3F77F which I'm trying to boot in uefi. /etc/libvirt/qemu.conf looks like this: https://dpaste.com/B3SFHUY6R and the ovmf files exists in the path, see: # ll /usr/share/edk2-ovmf/OVMF_CODE.fd /usr/share/edk2-ovmf/OVMF_VARS.fd /usr/share/edk2-ovmf/OVMF_CODE.secboot.fd /usr/share/edk2-ovmf/OVMF_VARS.secboot.fd -rw-r--r-- 1 root root 1966080 Aug 21 14:32 /usr/share/edk2-ovmf/OVMF_CODE.fd -rw-r--r-- 1 root root 1966080 Aug 21 14:32 /usr/share/edk2-ovmf/OVMF_CODE.secboot.fd -rw-r--r-- 1 root root 131072 Aug 21 14:32 /usr/share/edk2-ovmf/OVMF_VARS.fd -rw-r--r-- 1 root root 131072 Aug 21 14:32 /usr/share/edk2-ovmf/OVMF_VARS.secboot.fd when I try to start the machine, I get this error: error: Failed to start domain vm1 error: operation failed: unable to find any master var store for loader: /usr/share/edk2-ovmf/OVMF_CODE.fd libvirt version is 6.7.0 and qemu version is 5.1.0 any idea how to fix this issue? Thanks. Dagg.

On Mon, Oct 12, 2020 at 10:52:25PM +0200, daggs wrote:
Greetings,
I have the following machine: https://dpaste.com/5BPA3F77F which I'm trying to boot in uefi. /etc/libvirt/qemu.conf looks like this: https://dpaste.com/B3SFHUY6R and the ovmf files exists in the path, see: # ll /usr/share/edk2-ovmf/OVMF_CODE.fd /usr/share/edk2-ovmf/OVMF_VARS.fd /usr/share/edk2-ovmf/OVMF_CODE.secboot.fd /usr/share/edk2-ovmf/OVMF_VARS.secboot.fd -rw-r--r-- 1 root root 1966080 Aug 21 14:32 /usr/share/edk2-ovmf/OVMF_CODE.fd -rw-r--r-- 1 root root 1966080 Aug 21 14:32 /usr/share/edk2-ovmf/OVMF_CODE.secboot.fd -rw-r--r-- 1 root root 131072 Aug 21 14:32 /usr/share/edk2-ovmf/OVMF_VARS.fd -rw-r--r-- 1 root root 131072 Aug 21 14:32 /usr/share/edk2-ovmf/OVMF_VARS.secboot.fd
when I try to start the machine, I get this error: error: Failed to start domain vm1 error: operation failed: unable to find any master var store for loader: /usr/share/edk2-ovmf/OVMF_CODE.fd
libvirt version is 6.7.0 and qemu version is 5.1.0
any idea how to fix this issue?
What do you have in /usr/share/qemu/firmware/ ? There should be JSON files installed (by QEMU, I think) describing the possible firmware combinations.
Thanks.
Dagg.

Greetings Martin,
Sent: Tuesday, October 13, 2020 at 1:13 PM From: "Martin Kletzander" <mkletzan@redhat.com> To: "daggs" <daggs@gmx.com> Cc: libvirt-users@redhat.com Subject: Re: unable to find any master var store for loader error What do you have in /usr/share/qemu/firmware/ ? There should be JSON files installed (by QEMU, I think) describing the possible firmware combinations.
here: # ll /usr/share/qemu/firmware/ total 24 -rw-r--r-- 1 root root 716 Oct 7 19:25 50-edk2-i386-secure.json -rw-r--r-- 1 root root 741 Oct 7 19:25 50-edk2-x86_64-secure.json -rw-r--r-- 1 root root 622 Oct 7 19:25 60-edk2-aarch64.json -rw-r--r-- 1 root root 610 Oct 7 19:25 60-edk2-arm.json -rw-r--r-- 1 root root 667 Oct 7 19:25 60-edk2-i386.json -rw-r--r-- 1 root root 692 Oct 7 19:25 60-edk2-x86_64.json the content of 60-edk2-x86_64.json is: { "description": "UEFI firmware for x86_64", "interface-types": [ "uefi" ], "mapping": { "device": "flash", "executable": { "filename": "/usr/share/qemu/edk2-x86_64-code.fd", "format": "raw" }, "nvram-template": { "filename": "/usr/share/qemu/edk2-i386-vars.fd", "format": "raw" } }, "targets": [ { "architecture": "x86_64", "machines": [ "pc-i440fx-*", "pc-q35-*" ] } ], "features": [ "acpi-s3", "amd-sev", "verbose-dynamic" ], "tags": [ ] } both /usr/share/qemu/edk2-x86_64-code.fd and /usr/share/qemu/edk2-i386-vars.fd exists.

On 10/12/20 10:52 PM, daggs wrote:
Greetings,
I have the following machine: https://dpaste.com/5BPA3F77F which I'm trying to boot in uefi. /etc/libvirt/qemu.conf looks like this: https://dpaste.com/B3SFHUY6R and the ovmf files exists in the path, see: # ll /usr/share/edk2-ovmf/OVMF_CODE.fd /usr/share/edk2-ovmf/OVMF_VARS.fd /usr/share/edk2-ovmf/OVMF_CODE.secboot.fd /usr/share/edk2-ovmf/OVMF_VARS.secboot.fd -rw-r--r-- 1 root root 1966080 Aug 21 14:32 /usr/share/edk2-ovmf/OVMF_CODE.fd -rw-r--r-- 1 root root 1966080 Aug 21 14:32 /usr/share/edk2-ovmf/OVMF_CODE.secboot.fd -rw-r--r-- 1 root root 131072 Aug 21 14:32 /usr/share/edk2-ovmf/OVMF_VARS.fd -rw-r--r-- 1 root root 131072 Aug 21 14:32 /usr/share/edk2-ovmf/OVMF_VARS.secboot.fd
when I try to start the machine, I get this error: error: Failed to start domain vm1 error: operation failed: unable to find any master var store for loader: /usr/share/edk2-ovmf/OVMF_CODE.fd
libvirt version is 6.7.0 and qemu version is 5.1.0
any idea how to fix this issue?
Hey, I'll paste the interesting part of domain XML here so that it doesn't get lost: <os> <type arch='x86_64' machine='pc-q35-5.0'>hvm</type> <loader readonly='yes' type='pflash'>/usr/share/edk2-ovmf/OVMF_CODE.fd</loader> <nvram>/var/lib/libvirt/qemu/nvram/vm1_VARS.fd</nvram> <boot dev='hd'/> </os> And then in qemu.conf you define the pair: nvram = [ "/usr/share/edk2-ovmf/OVMF_CODE.fd:/usr/share/edk2-ovmf/OVMF_VARS.fd", "/usr/share/edk2-ovmf/OVMF_CODE.secboot.fd:/usr/share/edk2-ovmf/OVMF_VARS.secboot.fd" ] But as the comment in qemu.conf (just above your line) says, this is ignored if FW metadata files exist which is exactly your case and this bug: https://bugzilla.redhat.com/show_bug.cgi?id=1763477 For your convenience you can switch to <os firmware='efi'/> (the <loader/> element will be removed automatically) or if you insist on using the old style then provide @template attribute to <nvram/>: <nvram template="/usr/share/edk2-ovmf/OVMF_CODE.fd">/var/lib/libvirt/qemu/nvram/vm1_VARS.fd</nvram> There is an internal list that is still consulted when finding matching _VARS fails, but your path is not on it: https://gitlab.com/libvirt/libvirt/-/blob/master/src/qemu/qemu_conf.c#L98 But it exists mostly to give distros enough time to switch to FW descriptors. Michal

Greetings Michal,
Sent: Tuesday, October 13, 2020 at 2:51 PM From: "Michal Privoznik" <mprivozn@redhat.com> To: "daggs" <daggs@gmx.com>, libvirt-users@redhat.com Subject: Re: unable to find any master var store for loader error
Hey,
I'll paste the interesting part of domain XML here so that it doesn't get lost:
<os> <type arch='x86_64' machine='pc-q35-5.0'>hvm</type> <loader readonly='yes' type='pflash'>/usr/share/edk2-ovmf/OVMF_CODE.fd</loader> <nvram>/var/lib/libvirt/qemu/nvram/vm1_VARS.fd</nvram> <boot dev='hd'/> </os>
And then in qemu.conf you define the pair:
nvram = [ "/usr/share/edk2-ovmf/OVMF_CODE.fd:/usr/share/edk2-ovmf/OVMF_VARS.fd", "/usr/share/edk2-ovmf/OVMF_CODE.secboot.fd:/usr/share/edk2-ovmf/OVMF_VARS.secboot.fd" ]
But as the comment in qemu.conf (just above your line) says, this is ignored if FW metadata files exist which is exactly your case and this bug:
https://bugzilla.redhat.com/show_bug.cgi?id=1763477
For your convenience you can switch to <os firmware='efi'/> (the <loader/> element will be removed automatically) or if you insist on using the old style then provide @template attribute to <nvram/>:
<nvram template="/usr/share/edk2-ovmf/OVMF_CODE.fd">/var/lib/libvirt/qemu/nvram/vm1_VARS.fd</nvram>
There is an internal list that is still consulted when finding matching _VARS fails, but your path is not on it:
https://gitlab.com/libvirt/libvirt/-/blob/master/src/qemu/qemu_conf.c#L98
But it exists mostly to give distros enough time to switch to FW descriptors.
Michal
thanks for the detailed explanation, I wanted to be sure I understand. the following is needed to be done: 1. replace this: <os> <type arch='x86_64' machine='pc-q35-5.0'>hvm</type> <loader readonly='yes' type='pflash'>/usr/share/edk2-ovmf/OVMF_CODE.fd</loader> <nvram>/var/lib/libvirt/qemu/nvram/vm1_VARS.fd</nvram> <boot dev='hd'/> </os> to this: <os firmware='efi'/> <type arch='x86_64' machine='pc-q35-5.0'>hvm</type> <boot dev='hd'/> </os> 2. patch qemu_conf.c to include the custom paths of my fd files? Thanks, Dagg.

On 10/13/20 2:25 PM, daggs wrote:
Greetings Michal,
Sent: Tuesday, October 13, 2020 at 2:51 PM From: "Michal Privoznik" <mprivozn@redhat.com> To: "daggs" <daggs@gmx.com>, libvirt-users@redhat.com Subject: Re: unable to find any master var store for loader error
Hey,
I'll paste the interesting part of domain XML here so that it doesn't get lost:
<os> <type arch='x86_64' machine='pc-q35-5.0'>hvm</type> <loader readonly='yes' type='pflash'>/usr/share/edk2-ovmf/OVMF_CODE.fd</loader> <nvram>/var/lib/libvirt/qemu/nvram/vm1_VARS.fd</nvram> <boot dev='hd'/> </os>
And then in qemu.conf you define the pair:
nvram = [ "/usr/share/edk2-ovmf/OVMF_CODE.fd:/usr/share/edk2-ovmf/OVMF_VARS.fd", "/usr/share/edk2-ovmf/OVMF_CODE.secboot.fd:/usr/share/edk2-ovmf/OVMF_VARS.secboot.fd" ]
But as the comment in qemu.conf (just above your line) says, this is ignored if FW metadata files exist which is exactly your case and this bug:
https://bugzilla.redhat.com/show_bug.cgi?id=1763477
For your convenience you can switch to <os firmware='efi'/> (the <loader/> element will be removed automatically) or if you insist on using the old style then provide @template attribute to <nvram/>:
<nvram template="/usr/share/edk2-ovmf/OVMF_CODE.fd">/var/lib/libvirt/qemu/nvram/vm1_VARS.fd</nvram>
There is an internal list that is still consulted when finding matching _VARS fails, but your path is not on it:
https://gitlab.com/libvirt/libvirt/-/blob/master/src/qemu/qemu_conf.c#L98
But it exists mostly to give distros enough time to switch to FW descriptors.
Michal
thanks for the detailed explanation, I wanted to be sure I understand. the following is needed to be done: 1. replace this: <os> <type arch='x86_64' machine='pc-q35-5.0'>hvm</type> <loader readonly='yes' type='pflash'>/usr/share/edk2-ovmf/OVMF_CODE.fd</loader> <nvram>/var/lib/libvirt/qemu/nvram/vm1_VARS.fd</nvram> <boot dev='hd'/> </os> to this: <os firmware='efi'/> <type arch='x86_64' machine='pc-q35-5.0'>hvm</type> <boot dev='hd'/> </os>
Here, nvram will be generated, but if you want some other path than libvirt would generate you can provide it under <nvram/>. Yes. But you're using the default path anyway.
2. patch qemu_conf.c to include the custom paths of my fd files?
There is a third option. Save the following under /etc/qemu/firmware/50-my-ovmf.json: { "description": "UEFI firmware for x86_64", "interface-types": [ "uefi" ], "mapping": { "device": "flash", "executable": { "filename": "/usr/share/edk2-ovmf/OVMF_CODE.fd", "format": "raw" }, "nvram-template": { "filename": "/usr/share/edk2-ovmf/OVMF_VARS.fd", "format": "raw" } }, "targets": [ { "architecture": "x86_64", "machines": [ "pc-i440fx-*", "pc-q35-*" ] } ], "features": [ "acpi-s3", "amd-sev", "verbose-dynamic" ], "tags": [ ] } Michal

Greetings Michal,
Sent: Tuesday, October 13, 2020 at 4:04 PM From: "Michal Privoznik" <mprivozn@redhat.com> To: "daggs" <daggs@gmx.com> Cc: libvirt-users@redhat.com Subject: Re: unable to find any master var store for loader error ... Here, nvram will be generated, but if you want some other path than libvirt would generate you can provide it under <nvram/>. Yes. But you're using the default path anyway.
...
There is a third option. Save the following under /etc/qemu/firmware/50-my-ovmf.json:
{ "description": "UEFI firmware for x86_64", "interface-types": [ "uefi" ], "mapping": { "device": "flash", "executable": { "filename": "/usr/share/edk2-ovmf/OVMF_CODE.fd", "format": "raw" }, "nvram-template": { "filename": "/usr/share/edk2-ovmf/OVMF_VARS.fd", "format": "raw" } }, "targets": [ { "architecture": "x86_64", "machines": [ "pc-i440fx-*", "pc-q35-*" ] } ], "features": [ "acpi-s3", "amd-sev", "verbose-dynamic" ], "tags": [
] }
Michal
Thank you, that indeed rendered the vm working. Dagg.
participants (3)
-
daggs
-
Martin Kletzander
-
Michal Privoznik