You are not logged in.

#1 2024-11-08 07:54:33

Per-Astra-Ad-Deum
Member
Registered: 2024-08-11
Posts: 35

Recent update broke virtualization: "Unable to find 'efi' firmware"

Hi there,

after yesterdays update I find myself unable to launch any virtual machine.

sudo virsh start [VM NAME]

yields the following error message:

error: Failed to start domain '[VM NAME]'
error: operation failed: Unable to find 'efi' firmware that is compatible with the current configuration

I have no idea what  this is about. I assume that the edk2 UEFI file I've been using (`/usr/share/edk2/OVMF_VARS.fd`) is no longer supported by libvirt?

I'd be happy for any advice.

Offline

#2 2024-11-08 08:24:23

Svenare
Member
Registered: 2024-11-08
Posts: 1

Re: Recent update broke virtualization: "Unable to find 'efi' firmware"

Same issue.  I downgraded edk2-ovmf back to 202311-1 and everything is working for me again.

Offline

#3 2024-11-08 08:29:49

Per-Astra-Ad-Deum
Member
Registered: 2024-08-11
Posts: 35

Re: Recent update broke virtualization: "Unable to find 'efi' firmware"

Svenare wrote:

Same issue.  I downgraded edk2-ovmf back to 202311-1 and everything is working for me again.

While downgrading libvirt didn't solve the issue, downgrading edk2-ovmf did. Thanks for the hint! And glad I'm not the only one experiencing this.

Offline

#4 2024-11-08 16:12:09

csmnn
Member
Registered: 2017-05-10
Posts: 16

Re: Recent update broke virtualization: "Unable to find 'efi' firmware"

The edk2-ovmf package shows a notice on upgrade:

>>> The CSM support has been removed upstream in version 202402.
    The 2MB firmware files have been removed in favor of the 4MB ones as the new default.
    Virtual machine setups may need to be adapted!

The old firmware-files I use are no longer part of the package. I could just switch to the 4MB versions without any problems.

You could try to edit the config-files for the VMs with virsh and change the paths.

For me it was just switching two paths around. Quite possible, that you need to look for some other files in /usr/share/edk2/...:

virsh -c qemu:///system edit $VMname

/usr/share/edk2/x64/OVMF_CODE.fd -> /usr/share/edk2/x64/OVMF_CODE.4m.fd
/usr/share/edk2/x64/OVMF_VARS.fd -> /usr/share/edk2/x64/OVMF_VARS.4m.fd

Afterwards my VM was booting regularly.

Offline

#5 2024-11-08 22:18:44

odror
Member
Registered: 2015-03-17
Posts: 128

Re: Recent update broke virtualization: "Unable to find 'efi' firmware"

That did not work for me.

I was not able to edit and change to the 4m file. The editor is refusing to save.
I get the following error:

error: operation failed: Unable to find 'efi' firmware that is compatible with the current configuration
Failed. Try again? [y,n,i,f,?]

Also copying the old 2m files to the edk2 directory does not solve the issue.

Any Ideas how to change the 2m efi to the 4m bios file. Editing does not work.

Last edited by odror (2024-11-08 22:32:50)

Offline

#6 2024-11-09 11:43:12

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 12,926

Re: Recent update broke virtualization: "Unable to find 'efi' firmware"

https://wiki.archlinux.org/title/Libvirt#UEFI_support doesn't mention 2m files , just 4m files .
That section hasn't changed since dec 2023 .

Why are people using .2m files ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#7 2024-11-09 12:21:39

Per-Astra-Ad-Deum
Member
Registered: 2024-08-11
Posts: 35

Re: Recent update broke virtualization: "Unable to find 'efi' firmware"

csmnn wrote:

The edk2-ovmf package shows a notice on upgrade:

>>> The CSM support has been removed upstream in version 202402.
    The 2MB firmware files have been removed in favor of the 4MB ones as the new default.
    Virtual machine setups may need to be adapted!

The old firmware-files I use are no longer part of the package. I could just switch to the 4MB versions without any problems.

You could try to edit the config-files for the VMs with virsh and change the paths.

For me it was just switching two paths around. Quite possible, that you need to look for some other files in /usr/share/edk2/...:

virsh -c qemu:///system edit $VMname

/usr/share/edk2/x64/OVMF_CODE.fd -> /usr/share/edk2/x64/OVMF_CODE.4m.fd
/usr/share/edk2/x64/OVMF_VARS.fd -> /usr/share/edk2/x64/OVMF_VARS.4m.fd

Afterwards my VM was booting regularly.

Can confirm. Adding "4m." to the lines via

sudo virsh edit [VM NAME]

did solve the issue for me.

Offline

#8 2024-11-09 19:00:27

odror
Member
Registered: 2015-03-17
Posts: 128

Re: Recent update broke virtualization: "Unable to find 'efi' firmware"

Can confirm. Adding "4m." to the lines via

sudo virsh edit [VM NAME]

did solve the issue for me.

That did not work for me. The editor is refusing to save and exit. Any ideas why? is there additional setup issue that I need. My guest is W11. Can that be the issue?

Offline

#9 2024-11-09 19:02:13

Per-Astra-Ad-Deum
Member
Registered: 2024-08-11
Posts: 35

Re: Recent update broke virtualization: "Unable to find 'efi' firmware"

odror wrote:

Can confirm. Adding "4m." to the lines via

sudo virsh edit [VM NAME]

did solve the issue for me.

That did not work for me. The editor is refusing to save and exit. Any ideas why? is there additional setup issue that I need. My guest is W11. Can that be the issue?

Did you reverse your downgrade beforehand?

Offline

#10 2024-11-09 19:07:31

odror
Member
Registered: 2015-03-17
Posts: 128

Re: Recent update broke virtualization: "Unable to find 'efi' firmware"

Did you reverse your downgrade beforehand?

Let understand it. Do you mean that I need to reverse the update first. Then edit the VM and finally do the upgrade. So editing the machine xml needs to be done BEFORE the upgrade.

Offline

#11 2024-11-09 19:14:58

odror
Member
Registered: 2015-03-17
Posts: 128

Re: Recent update broke virtualization: "Unable to find 'efi' firmware"

odror wrote:

Did you reverse your downgrade beforehand?

Let understand it. Do you mean that I need to reverse the update first. Then edit the VM and finally do the upgrade. So editing the machine xml needs to be done BEFORE the upgrade.

I did that. I am still getting an error:

error: operation failed: Unable to find 'efi' firmware that is compatible with the current configuration
Failed. Try again? [y,n,i,f,?]: 

Do I need to reverse libvirt as well before editing? Anything else I need to reverse?

Offline

#12 2024-11-09 19:29:36

Per-Astra-Ad-Deum
Member
Registered: 2024-08-11
Posts: 35

Re: Recent update broke virtualization: "Unable to find 'efi' firmware"

odror wrote:

Did you reverse your downgrade beforehand?

Let understand it. Do you mean that I need to reverse the update first. Then edit the VM and finally do the upgrade. So editing the machine xml needs to be done BEFORE the upgrade.

No, from what I understood you downgraded the OVMF package initially? Revert that downgrade, so all your packages are up-to-date. Then change the lines in the VM's config!

Offline

#13 2024-11-10 08:36:03

Lockheed
Member
Registered: 2010-03-16
Posts: 1,527

Re: Recent update broke virtualization: "Unable to find 'efi' firmware"

Same problem here. Can't use virsh because

virsh -c qemu:///system edit HomeAssistant
error: failed to get domain 'HomeAssistant'

and editing the XML in VirtManager cannot Apply, because trying to add ".4m" to this section

  <os firmware="efi">
    <type arch="x86_64" machine="pc-q35-9.0">hvm</type>
    <firmware>
      <feature enabled="no" name="enrolled-keys"/>
      <feature enabled="no" name="secure-boot"/>
    </firmware>
    <loader readonly="yes" type="pflash">/usr/share/edk2/x64/OVMF_CODE.fd</loader>
    <nvram template="/usr/share/edk2/x64/OVMF_VARS.fd">/var/lib/libvirt/qemu/nvram/HomaAssistant_VARS.fd</nvram>
    <bootmenu enable="no"/>
  </os>

fails like so

Error changing VM configuration: operation failed: Unable to find 'efi' firmware that is compatible with the current configuration

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/addhardware.py", line 345, in change_config_helper
    define_func(**define_args)
  File "/usr/share/virt-manager/virtManager/details/details.py", line 1353, in change_cb
    return self.vm.define_xml(newxml)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/virt-manager/virtManager/object/libvirtobject.py", line 347, in define_xml
    self._redefine_xml_internal(origxml, newxml)
  File "/usr/share/virt-manager/virtManager/object/libvirtobject.py", line 374, in _redefine_xml_internal
    self._define(newxml)
  File "/usr/share/virt-manager/virtManager/object/domain.py", line 1137, in _define
    self.conn.define_domain(xml)
  File "/usr/share/virt-manager/virtManager/connection.py", line 554, in define_domain
    return self._backend.defineXML(xml)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/libvirt.py", line 4559, in defineXML
    raise libvirtError('virDomainDefineXML() failed')
libvirt.libvirtError: operation failed: Unable to find 'efi' firmware that is compatible with the current configuration

I did not downgrade the package at any point.

Offline

#14 2024-11-10 08:54:43

Per-Astra-Ad-Deum
Member
Registered: 2024-08-11
Posts: 35

Re: Recent update broke virtualization: "Unable to find 'efi' firmware"

Hmm. Did you change this line here:

/usr/share/edk2/x64/OVMF_CODE.fd

to

/usr/share/edk2/x64/OVMF_CODE.4m.fd

in both instances?

Notice that the "4m" addition must be written between "CODE" and the file ending "fd"

Honestly I can't help you any further. I did this with all four of my VMs and it worked with each one on first try :-/

Offline

#15 2024-11-10 11:07:54

Lockheed
Member
Registered: 2010-03-16
Posts: 1,527

Re: Recent update broke virtualization: "Unable to find 'efi' firmware"

Hah! I did not notice the second instance. Changed them both and now it's working. Thanks!

Offline

#16 2024-11-14 07:34:24

pwish
Member
Registered: 2024-06-24
Posts: 15

Re: Recent update broke virtualization: "Unable to find 'efi' firmware"

csmnn wrote:

The edk2-ovmf package shows a notice on upgrade:

>>> The CSM support has been removed upstream in version 202402.
    The 2MB firmware files have been removed in favor of the 4MB ones as the new default.
    Virtual machine setups may need to be adapted!

The old firmware-files I use are no longer part of the package. I could just switch to the 4MB versions without any problems.

You could try to edit the config-files for the VMs with virsh and change the paths.

For me it was just switching two paths around. Quite possible, that you need to look for some other files in /usr/share/edk2/...:

virsh -c qemu:///system edit $VMname

/usr/share/edk2/x64/OVMF_CODE.fd -> /usr/share/edk2/x64/OVMF_CODE.4m.fd
/usr/share/edk2/x64/OVMF_VARS.fd -> /usr/share/edk2/x64/OVMF_VARS.4m.fd

Afterwards my VM was booting regularly.

I can confirm, this solved the issue for me. Thanks for being kind and sharing the solution with us!

Last edited by pwish (2024-11-14 07:35:36)


ermmm actually. you didn't read the wiki probably....

Offline

#17 2024-11-17 07:30:50

archeiio
Member
Registered: 2024-11-17
Posts: 2

Re: Recent update broke virtualization: "Unable to find 'efi' firmware"

In my case, there is somthing to do after correcting the xml file:

1. cp /var/lib/libvirt/qemu/nvram/<VMNAME>_VARS.fd{,.bak}

2 download 2M_VARS-to-4M_VARS.sh and replace the variable NEW_VAR_TEMPLATE: /usr/share/OVMF/OVMF_VARS_4M.fd -> /usr/share/edk2/x64/OVMF_VARS.4m.fd

3 replace VARS: bash 2M_VARS-to-4M_VARS.sh -i /var/lib/libvirt/qemu/nvram/<VMNAME>_VARS.fd # (the script will overwrite <VMNAME>_VARS.fd)

4 cp /var/lib/libvirt/qemu/nvram/<VMNAME>_VARS.fd /var/lib/libvirt/qemu/nvram/<VMNAME>_VARS.4m.fd

Ref:
1. Finding EFI Firmware That Is Compatible
2. 2M_VARS-to-4M_VARS.sh: https://salsa.debian.org/qemu-team/edk2 … 4M_VARS.sh

Offline

#18 2024-11-18 21:13:12

rubenvb
Member
Registered: 2011-01-14
Posts: 101

Re: Recent update broke virtualization: "Unable to find 'efi' firmware"

archeiio wrote:

In my case, there is somthing to do after correcting the xml file:

You're a life saver. I had to install the virt-firmware for the script to work (for the virt-fw-vars command).
Thanks.

Some more context and information in the package notes would be useful though.
Libvirt is already above-average hard to set up in a good way, and stuff like this doesn't help.

Offline

Board footer

Powered by FluxBB