Ha kvm install - Error starting domain: Path '/usr/share/OVMF/OVMF_CODE.fd' is not accessible: No such file or directory

I had a sudden shutdown yesterday and now does not start.
VM shows Error starting domain: Path ‘/usr/share/OVMF/OVMF_CODE.fd’ is not accessible: No such file or directory.

Any suggestions other than start again with fresh install?

  • running since 2021. (was haos-ova-v6.6.qcow2 when originally installed)
  • linux ubuntu (22.04). updated regularly. fully up to date last week.
  • home assistant KVM (.qcow2) install
  • home assistant updated regularly. Fully updated core and all to current versions last week.

steps so far:

  • vm’s firmware setting has not changed. still set to UEFI x86_64: /user/share/OVMF/OVMF_CODE.fd
  • verified that the qcow2 file is there and accessible to qemu/kvm.
  • all other vm’s continue working normally with no errors.
  • qcow2 info shows clean file system via qemu-img info haos-ova-v6.6.qcow2 shows corrupt: false.
  • mounted qcow2 as block device and can see 8 partitions (1 EFI and 7 linux filesystems). no errors.
  • normal shutdown and restart.
  • this qcow2 is in same disk and partition as all other vm’s. no file system corruption. fsck’d. checked logs. no smartmon issues. no disk issues logged. no controller issues logged.
  • startup error persists

details reported during the vm startup:
Error starting domain: Path ‘/usr/share/OVMF/OVMF_CODE.fd’ is not accessible: No such file or directory

Traceback (most recent call last):
File “/usr/share/virt-manager/virtManager/asyncjob.py”, line 72, in cb_wrapper
callback(asyncjob, *args, **kwargs)
File “/usr/share/virt-manager/virtManager/asyncjob.py”, line 108, in tmpcb
callback(*args, **kwargs)
File “/usr/share/virt-manager/virtManager/object/libvirtobject.py”, line 57, in newfn
ret = fn(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/share/virt-manager/virtManager/object/domain.py”, line 1402, in startup
self._backend.create()
File “/usr/lib/python3/dist-packages/libvirt.py”, line 1379, in create
raise libvirtError(‘virDomainCreate() failed’)
libvirt.libvirtError: Path ‘/usr/share/OVMF/OVMF_CODE.fd’ is not accessible: No such file or directory

Such crashes and errors afterward are most of the time not worth trying to fix.
If your backup is recent and or snapshot, i would just make a new HA install and restore the backup.

Most cases its going to be much faster.

If the file disappeared after an unexpected shutdown, then that may have been caused by a bigger problem (or problem to come) … but may have been as a result of an upgrade??

I myself just recently upgraded from Ubuntu 22.04 to 24.04 and during that upgrade, my OVMF_CODE.fd file disappeared as it is no longer in the /usr/share/OVMF/ directory. However in that directory are several alternatives, and the one I now use is OVMF_VARS_4M.fd.

As for virt-manager, in my case the OVMF_VARS_xxx file was configured when I build the VM for the first time and afterwards virt-manager no longer allows this to be “selectable”. So to change the OVMF_VARS_xxx, I instead had to hand edit it using virsh edit DOMAIN_NAME (if you use this method, then make sure you have a backup copy of the xml file before hand editing).

Thanks! that’s encouraging @wmaker! But, I’m not finding the OVMF directory. Can you help a little more. I think i’m ok once I find the OVMF file(s).

I thought I would find /user/share/OVMF in p8 but did not.

p1 and p6 do not mount. have not yet fsck’d or e2fsck’d p1 or p6.

the qcow2 has the following partitions. fsck -l
Device Start End Sectors Size Type
/dev/nbd0p1 2048 67583 65536 32M EFI System
/dev/nbd0p2 67584 116735 49152 24M Linux filesystem
/dev/nbd0p3 116736 641023 524288 256M Linux filesystem
/dev/nbd0p4 641024 690175 49152 24M Linux filesystem
/dev/nbd0p5 690176 1214463 524288 256M Linux filesystem
/dev/nbd0p6 1214464 1230847 16384 8M Linux filesystem
/dev/nbd0p7 1230848 1427455 196608 96M Linux filesystem
/dev/nbd0p8 1427456 67108830 65681375 31.3G Linux filesystem

tried to find *.fd files
tried to find OVFM directory

Umm… I think you are trying to look inside the HAOS VM Guest.
The OVMF files should be on your Host machine

1 Like

@wmaker Winner!
Solution for me is to add a symbolic link from the new OVMF_CODE_4M.fd to the OVMF_CODE.fd and I can boot HA again. I’ll clean up with a cloned and edited config soon and clean up the extra symbolic link.

Suspect recent upgrades/patches to Ubuntu is source of the change and I missed the HA fail after upgrade/patch.

But HA booted and running is a great result.
Thank you !