KVM Plugin cannot load UEFI firmware (OVMF_CODE_4M.fd)

  • After using omv-release-upgrade to upgrade from OMV 7.7.24 to OMV 8 my existing VM's that use UEFI didn't start anymore. I got an error saying that /usr/share/OVMF/OVMF_CODE.fd didn't exist.

    When creating a new UEFI VM in the KVM plugin of OMV-Extras 8.x, I got a slightly different error related to an issue loading /usr/share/OVMF/OVMF_CODE_4M.fd. This new firmware apparently can't be loaded with the "rom=" option, but should be loaded with "loader readonly='yes' type='pflash'" To temporary resolve both issues I renamed /usr/share/OVMF/OVMF_CODE_4M.fd to /usr/share/OVMF/OVMF_CODE_4M.fd.org and created 2 symbolic links /usr/share/OVMF/OVMF_CODE.fd and /usr/share/OVMF/OVMF_CODE_4M.fd both pointing to /usr/share/ovmf/OVMF.fd (note the lowercase ovfm directory name, that directory also still exists and has an older UEFI firmware file that can be loaded with the "rom=" option. Anyone else experiencing the same issue?

    • Official Post

    Anyone else experiencing the same issue?

    I was. That is why I made this change - https://github.com/OpenMediaVa…dfe7113107a12d36cd7b743a8 I will have to look into it more.

    omv 8.0.10-1 synchrony | 6.17 proxmox kernel

    plugins :: omvextrasorg 8.0.2 | kvm 8.0.4 | compose 8.1.2 | cterm 8.0 | borgbackup 8.1 | cputemp 8.0 | mergerfs 8.0 | scripts 8.0.1 | writecache 8.1


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

    • Official Post

    I think I have a fix for new VMs. People will have to edit existing VMs to fix the path on those if they are having issues. I had to edit one VM.

    omv 8.0.10-1 synchrony | 6.17 proxmox kernel

    plugins :: omvextrasorg 8.0.2 | kvm 8.0.4 | compose 8.1.2 | cterm 8.0 | borgbackup 8.1 | cputemp 8.0 | mergerfs 8.0 | scripts 8.0.1 | writecache 8.1


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • That's quick... will test it out, once the update is available and updating the xml of existing VM's so I can get rid of the symbolic links and use the newer firmware files is not an issue. Thanks again for looking at this!

    • Official Post

    I am pretty sure it is fixed from my testing but I am fixing some other small issues before I release an update.

    omv 8.0.10-1 synchrony | 6.17 proxmox kernel

    plugins :: omvextrasorg 8.0.2 | kvm 8.0.4 | compose 8.1.2 | cterm 8.0 | borgbackup 8.1 | cputemp 8.0 | mergerfs 8.0 | scripts 8.0.1 | writecache 8.1


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

    • Official Post

    If you want to test what I have so far, I would appreciate it.


    wget https://omv-extras.org/testing/openmediavault-kvm_8.0.2_all.deb -O openmediavault-kvm_8.0.2_all.deb

    sudo dpkg -i openmediavault-kvm_8.0.2_all.deb

    omv 8.0.10-1 synchrony | 6.17 proxmox kernel

    plugins :: omvextrasorg 8.0.2 | kvm 8.0.4 | compose 8.1.2 | cterm 8.0 | borgbackup 8.1 | cputemp 8.0 | mergerfs 8.0 | scripts 8.0.1 | writecache 8.1


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • I've removed the symbolic links from OVMF_CODE_4M.fd and OVMF_CODE.fd to /usr/share/ovmf/OVMF.fd and renamed OVMF_CODE_4M.fd.org back to OVMF_CODE_4M.fd and installed your version of openmediavault-kvm (8.0.2) and tested a couple of settings.


    Just UEFI:


    <os firmware='efi'>

    <type arch='x86_64' machine='pc-q35-10.0'>hvm</type>

    <firmware>

    <feature enabled='no' name='enrolled-keys'/>

    <feature enabled='no' name='secure-boot'/>

    </firmware>

    <loader readonly='yes' type='pflash' format='raw'>/usr/share/OVMF/OVMF_CODE_4M.fd</loader>

    <nvram template='/usr/share/OVMF/OVMF_VARS_4M.fd' templateFormat='raw' format='raw'>/var/lib/libvirt/qemu/nvram/UEFI-Test_VARS.fd</nvram>


    Tested and works!


    UEFI and Secure Boot:

    <os firmware='efi'>

    <type arch='x86_64' machine='pc-q35-10.0'>hvm</type>

    <firmware>

    <feature enabled='yes' name='enrolled-keys'/>

    <feature enabled='yes' name='secure-boot'/>

    </firmware>

    <loader readonly='yes' secure='yes' type='pflash' format='raw'>/usr/share/OVMF/OVMF_CODE_4M.ms.fd</loader>

    <nvram template='/usr/share/OVMF/OVMF_VARS_4M.ms.fd' templateFormat='raw' format='raw'>/var/lib/libvirt/qemu/nvram/UEFI_SecureBoot_Test_VARS.fd</nvram>


    Tested and works!


    I've also tested a VM with UEFI, Secure Boot and a vTPM, although the vTPM option is probably unrelated, this also works fine :)

    Many thanks!

    • Official Post

    Thanks for testing! I will likely release the update later today.

    omv 8.0.10-1 synchrony | 6.17 proxmox kernel

    plugins :: omvextrasorg 8.0.2 | kvm 8.0.4 | compose 8.1.2 | cterm 8.0 | borgbackup 8.1 | cputemp 8.0 | mergerfs 8.0 | scripts 8.0.1 | writecache 8.1


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • mbgroen

    Added the Label resolved
  • Just today I have moved from OMV7 to OMV8.... one more time GREAT JOB.... everything go smooth as it can, except above KVM problem. I was hosting Home Assistant, but realized that VM is not working only when lights won't turn on ;P.

    QEMU can't find "/usr/share/OVMF/OVMF_CODE.fd"


    I can also confirm that updating very old loader configuration from:


    <loader type='rom' format='raw'>/usr/share/OVMF/OVMF_CODE.fd</loader>


    to new one with 'pflash', and readonlu option and OVMF_CODE_4M.fd file solve one problem


    <loader readonly='yes' type='pflash' format='raw'>/usr/share/OVMF/OVMF_CODE_4M.fd</loader>


    solve one problem, but in my config have to add nvram template (come how I didn't have it


    <nvram template='/usr/share/OVMF/OVMF_VARS_4M.fd' templateFormat='raw' format='raw'>/var/lib/libvirt/qemu/nvram/HAOS_VARS.fd</nvram>


    now VM starts with out issues and looks good.


    Thanks very much for the topic and solution... my family was about to banish me from home;P


    PS. it may be good to put some worming in KVM about problem that shell be solved manually... or some other noobs like me may go back the backup route reverting upgrade to OMV7.

    • Official Post

    it may be good to put some worming in KVM about problem that shell be solved manually... or some other noobs like me may go back the backup route reverting upgrade to OMV7.

    The change has nothing to do with the plugin though. This is a Debian/kvm change. Changes between Debian major versions is quite command and the error when starting the VM is clear in my opinion. Not sure why someone would revert to a backup instead of just researching the error. I don't mind putting solutions to common problems in the omv-extras wiki but I doubt anyone would read it.

    omv 8.0.10-1 synchrony | 6.17 proxmox kernel

    plugins :: omvextrasorg 8.0.2 | kvm 8.0.4 | compose 8.1.2 | cterm 8.0 | borgbackup 8.1 | cputemp 8.0 | mergerfs 8.0 | scripts 8.0.1 | writecache 8.1


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!