# Qemu/Libvirt/Virt-Manager VM uefi-boot error and how to fix

## alamahant

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 

```

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:

```

{

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

```
 

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

```

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.

 :Very Happy:   :Very Happy:   :Very Happy: 

----------

