[libvirt-users] Trouble moving OVMF guest to new host

Hello, I recently had to reinstall my operating system on my computer. I made a backup of the entire partition beforehand onto an external drive. Now I am trying to import a VM from that backup onto the newly installed system. What I've done so far: - copied over the qcow2 disk image - copied over the XML config file - copied over the OVMF files under /usr/share/edk2.git/ovmf-x64/ I am getting this error whenever I try to boot the VM: Error starting domain: operation failed: unable to find any master var store for loader: /usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd The file /usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd does exist. Where would the "master var store" be located? Thank you, Joe -- Joseph Bashe Technical Director Bashe Development +1 (323) 999-1731

I'm running libvirt in user session and libvirt creates VARS part of OVMF in ~/.config/libvirt/qemu/nvram/ Check your xml, there should be lines like this: <os> <type arch='x86_64' machine='pc-q35-2.7'>hvm</type> <loader readonly='yes' type='pflash'>/UEFI_OVMF/OVMF_CODE.fd</loader> <nvram>/home/username/.config/libvirt/qemu/nvram/vm_VARS.fd</nvram> /--Regards, Aleksei/ ------------------------------------------------------------------------ *From:* Bashe, Joe *Sent:* Wednesday, February 08, 2017 7:53PM *To:* Libvirt-users *Subject:* [libvirt-users] Trouble moving OVMF guest to new host
Hello,
I recently had to reinstall my operating system on my computer. I made a backup of the entire partition beforehand onto an external drive. Now I am trying to import a VM from that backup onto the newly installed system.
What I've done so far:
* copied over the qcow2 disk image * copied over the XML config file * copied over the OVMF files under /usr/share/edk2.git/ovmf-x64/
I am getting this error whenever I try to boot the VM:
Error starting domain: operation failed: unable to find any master var store for loader: /usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd
The file /usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd does exist.
Where would the "master var store" be located?
Thank you,
Joe -- Joseph Bashe Technical Director Bashe Development +1 (323) 999-1731
_______________________________________________ libvirt-users mailing list libvirt-users@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-users

On Wed, 2017-02-08 at 20:13 +0300, Aleksei wrote:
I'm running libvirt in user session and libvirt creates VARS part of OVMF in ~/.config/libvirt/qemu/nvram/ Check your xml, there should be lines like this: <os> <type arch='x86_64' machine='pc-q35-2.7'>hvm</type> <loader readonly='yes' type='pflash'>/UEFI_OVMF/OVMF_CODE.fd</loader> <nvram>/home/username/.config/libvirt/qemu/nvram/vm_VARS.fd</nvram>
... or in /var/lib/libvirt/qemu/nvram, if you're using the system-wide libvirtd instance. Anyway, Aleksei is right that you should copy over the variable store (vm_VARS.fd) along with the disk image and the XML configuration: some guest operating systems are able to cope with its absence and recreate the correct EFI variables automatically, but that's not always the case. Moreover, you should make sure your /etc/libvirt/qemu.conf file contains something along the lines of nvram = [ "/usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd:/usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd/OVMF_VARS-pure-efi.fd" ] so that, in case the variable store for the guest is missing or your simply creating a new guest, libvirt will be able to create a new one by copying over the template (the "master var store" the error was referring to). By the way, edk2-ovmf is included in Fedora proper these days, you don't need to use edk2.git-ovmf-x64 any longer ;) -- Andrea Bolognani / Red Hat / Virtualization

Awesome, that worked perfectly. I just had to copy the variable store (it was in /var/lib/libvirt/qemu/nvram), and the VM booted right up! Thank you for the help! Best regards, Joe -- Joseph Bashe Technical Director Bashe Development +1 (323) 999-1731 On Wed, Feb 8, 2017 at 4:12 PM, Andrea Bolognani <abologna@redhat.com> wrote:
On Wed, 2017-02-08 at 20:13 +0300, Aleksei wrote:
I'm running libvirt in user session and libvirt creates VARS part of OVMF in ~/.config/libvirt/qemu/nvram/ Check your xml, there should be lines like this: <os> <type arch='x86_64' machine='pc-q35-2.7'>hvm</type> <loader readonly='yes' type='pflash'>/UEFI_OVMF/OVMF_ CODE.fd</loader> <nvram>/home/username/.config/libvirt/qemu/nvram/vm_VARS.fd</nvram>
... or in /var/lib/libvirt/qemu/nvram, if you're using the system-wide libvirtd instance.
Anyway, Aleksei is right that you should copy over the variable store (vm_VARS.fd) along with the disk image and the XML configuration: some guest operating systems are able to cope with its absence and recreate the correct EFI variables automatically, but that's not always the case.
Moreover, you should make sure your /etc/libvirt/qemu.conf file contains something along the lines of
nvram = [ "/usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd:/ usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd/OVMF_VARS-pure-efi.fd" ]
so that, in case the variable store for the guest is missing or your simply creating a new guest, libvirt will be able to create a new one by copying over the template (the "master var store" the error was referring to).
By the way, edk2-ovmf is included in Fedora proper these days, you don't need to use edk2.git-ovmf-x64 any longer ;)
-- Andrea Bolognani / Red Hat / Virtualization

Hello, I suppose OVMF_CODE-pure-efi.fd is likely your firmware (CODE in name). There should also be firmware's variable template file (used for the 1st startup, usually there is VARS in file name) and firmware variable file, where firmware's actual settings are stored. Those 3 files can be designated in domain's XML or qemu.conf, so try looking there for paths. On my system, it is /var/lib/libvirt/qemu/nvram/ On 2017.02.08 18:53, Bashe, Joe wrote:
Hello,
I recently had to reinstall my operating system on my computer. I made a backup of the entire partition beforehand onto an external drive. Now I am trying to import a VM from that backup onto the newly installed system.
What I've done so far:
* copied over the qcow2 disk image * copied over the XML config file * copied over the OVMF files under /usr/share/edk2.git/ovmf-x64/
I am getting this error whenever I try to boot the VM:
Error starting domain: operation failed: unable to find any master var store for loader: /usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd
The file /usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd does exist.
Where would the "master var store" be located?
Thank you,
Joe -- Joseph Bashe Technical Director Bashe Development +1 (323) 999-1731
_______________________________________________ libvirt-users mailing list libvirt-users@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-users
participants (4)
-
Aleksei
-
Andrea Bolognani
-
Bashe, Joe
-
Žilvinas Žaltiena