Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Qemu/Libvirt/Virt-Manager VM uefi-boot error and how to fix
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
alamahant
Guru
Guru


Joined: 23 Mar 2019
Posts: 557

PostPosted: Tue Jan 07, 2020 3:16 am    Post subject: Qemu/Libvirt/Virt-Manager VM uefi-boot error and how to fix Reply with quote

Hi Guys,
As of late an update of libvirt(app-emulation/libvirt-5.10.0 or even earlier) has caused all new uefi booting VMs to be unable to boot.
It used to be the case before that in
/etc/libvirt/qemu.conf
one would have an entry like
Code:

nvram = [
   "/usr/share/edk2-ovmf/OVMF_CODE.fd:/usr/share/edk2-ovmf/OVMF_VARS.fd"
]

However this way of handling the nvram location has become 'obsolete' and it will totally be ignored by the libvirtd daemon.
As a result you will get errors when trying to start uefi VMs.
Either the UEFI boot button will be greyed out in Virtual Manager or even if not the VM will NOT boot.
A dirty work around:
Create a file:
/etc/qemu/firmware/ovmf.json
with the following content:
Code:

{
    "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": [

    ]
}


Then try to boot an uefi VM.
If still unable then BEFORE CREATING the uefi VM <vm-name> also run:
Code:
 
cp /usr/share/edk2-ovmf/OVMF_VARS.fd /var/lib/libvirt/qemu/nvram/<vm-name>_VARS.fd

Now try again to boot --successfully this time your VM.
You might also wish to create another .json file for secure boot VMs.
If you also get an error about "Unable to get boot time from host" then in
/etc/libvirt/qemu.conf
append
Code:

remember_owner = 0

Thats it!!!
AH by the way the libvirt team SHOULD DO their homework before pushing detrimental changes to the users and thus creating confusion and frustration.

:D :D :D
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum