Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 665152 - sys-firmware/edk2-ovmf: Gentoo installation media fails to boot under KVM with TianoCore OVMF UEFI
Summary: sys-firmware/edk2-ovmf: Gentoo installation media fails to boot under KVM wit...
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Matthias Maier
Depends on:
Reported: 2018-09-03 11:05 UTC by Wolfram
Modified: 2019-07-28 23:17 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---

screenshot of grub behavior (Screenshot_20180903_115956.png,5.82 KB, image/png)
2018-09-03 17:01 UTC, Ben Kohler

Note You need to log in before you can comment on or make changes to this bug.
Description Wolfram 2018-09-03 11:05:12 UTC
The following command ends in minimal GRUB shell:

sudo qemu-system-x86_64 --enable-kvm -bios ~/edk2/Build/OvmfX64/DEBUG_GCC46/FV/OVMF.fd -m 1G -cdrom /srv/iso/install-amd64-minimal-20180830T214502Z.iso

Works fine with qemu bios. I've tried several OVMF versions, including latest one, all failed.

Related bug:
Comment 1 Ben Kohler gentoo-dev 2018-09-03 15:26:14 UTC
This seems to be a GRUB issue.  On our catalyst grub config we're using "search --no-floppy --set=root --file livecd" to locate the cdrom root and load a real config from there.  In my initial testing, grub's "search" command doesn't seem to work at all when booting QEMU/OVMF.

On real hardware (or other working VMs), I can drop to the grub> shell and "search --no-floppy --file /livecd" returns "cd0"

On QEMU/OVMF, it returns "error: no such device: /livecd."  But if I do "ls (cd0)/", the livecd file is found, so the device is there and visible.  I cannot get any "search --file=foo" command to work on QEMU/OVMF.
Comment 2 Ben Kohler gentoo-dev 2018-09-03 16:09:11 UTC
For some reason it seems that the --no-floppy option is causing this.  You can get this to boot if you manually enter:

grub> search --set=root --file /livecd
grub> configfile /grub/grub.cfg
Comment 3 Ben Kohler gentoo-dev 2018-09-03 17:01:50 UTC
Created attachment 545844 [details]
screenshot of grub behavior

Here's the gist of the problem in one screenshot
Comment 4 Sebastian Hamann 2019-03-28 17:57:14 UTC
I used OVMF_CODE.secboot.fd from Fedora's edk2-ovmf-20190308stable-1.fc31.noarch.rpm to boot install-amd64-minimal-20190313T214502Z.iso.
With this setup, Grub correctly loads it's configuration.

Using the same ISO and Gentoo's OVMF_CODE.fd from sys-firmware/edk2-ovmf-2017_p20180211 Grub fails as described above.
So, its probably the newer version of the OVMF firmware that fixes the issue.
Comment 5 Ben Kohler gentoo-dev 2019-03-28 20:12:27 UTC
Good find.  I can confirm that edk2-ovmf-9999 from upstream git works fine as well.
Comment 6 Matthias Maier gentoo-dev 2019-03-28 20:30:29 UTC
(Changing summary so that I didn't miss this bug report.)
Comment 7 Larry the Git Cow gentoo-dev 2019-07-28 23:17:47 UTC
The bug has been closed via the following commit(s):

commit 6137d4c59ea47d77517e925d8bfd46b8b3b1f669
Author:     Matthias Maier <>
AuthorDate: 2019-07-28 21:00:39 +0000
Commit:     Matthias Maier <>
CommitDate: 2019-07-28 23:17:16 +0000

    sys-firmware/edk2-ovmf: version bump to 201905
     * switch to new upstream version number
     * add secure boot support
     * versions contains security fixes for all vulnerabilities identified
       in #678906c1
    Package-Manager: Portage-2.3.69, Repoman-2.3.16
    Signed-off-by: Matthias Maier <>

 sys-firmware/edk2-ovmf/Manifest                |   5 +-
 sys-firmware/edk2-ovmf/edk2-ovmf-201905.ebuild | 153 +++++++++++++++++++++++++
 2 files changed, 156 insertions(+), 2 deletions(-)