Where can I get OVMF?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
nexos
Member
Member
Posts: 1078
Joined: Tue Feb 18, 2020 3:29 pm
Libera.chat IRC: nexos

Where can I get OVMF?

Post by nexos »

Hello,
I am trying to download the OVMF firmware for QEMU, but I can't find a download link for it. Anyone have a link for it?
Thanks,
nexos
"How did you do this?"
"It's very simple — you read the protocol and write the code." - Bill Joy
Projects: NexNix | libnex | nnpkg
PeterX
Member
Member
Posts: 590
Joined: Fri Nov 22, 2019 5:46 am

Re: Where can I get OVMF?

Post by PeterX »

Linux normally has it. So you can install it with the folllowing command:

For Manjaro/Arch:

Code: Select all

sudo pacman -S ovmf
For Debian/Ubuntu/Mint:

Code: Select all

sudo apt install ovmf
Otherwise you have to build it from source. In that case follow the instructions given on tianocore.org

No matter how you retrieved OVMF, you have to search the file hierarchy for "OVMF.fd".

EDIT: A tip I got from one of OVMF's developers: Run it in Qemu with the -pflash option, not the -bios option.
User avatar
BenLunt
Member
Member
Posts: 941
Joined: Sat Nov 22, 2014 6:33 pm
Location: USA
Contact:

Re: Where can I get OVMF?

Post by BenLunt »

I got it from https://www.kraxel.org/repos/jenkins/edk2/, I then used 7zFM (7-Zip) for Windows to extract the files needed.
PeterX wrote:EDIT: A tip I got from one of OVMF's developers: Run it in Qemu with the -pflash option, not the -bios option.
Good point.

Here is how I do it for 64-bit:

Code: Select all

-drive if=pflash,format=raw,unit=0,readonly,file=OVMF-pure-efi.fd
-drive if=pflash,format=raw,unit=1,file=OVMF_VARS-pure-efi.fd
It is the same for 32-bit except you use the 32-bit files instead.

Ben
austinejinks11
Posts: 1
Joined: Sat Jun 29, 2024 12:05 am

Re: Where can I get OVMF?

Post by austinejinks11 »

PeterX wrote: Fri Aug 14, 2020 4:45 pm Linux normally has it. So you can install it with the folllowing command:

For Manjaro/Arch:

Code: Select all

sudo pacman -S ovmf
For Debian/Ubuntu/Mint:

Code: Select all

sudo apt install ovmf
Otherwise you have to build it from source. In that case follow the instructions given on tianocore.org

No matter how you retrieved OVMF, you have to search the file hierarchy for "OVMF.fd".

EDIT: A tip I got from one of OVMF's developers: Run it in Qemu with the -pflash option, not the -bios option.
how do I use the ovmf package after installing it.
Octocontrabass
Member
Member
Posts: 5494
Joined: Mon Mar 25, 2013 7:01 pm

Re: Where can I get OVMF?

Post by Octocontrabass »

Tell QEMU to load OVMF as the firmware, like this. Make sure you use a copy of the VARS file, not the original! You can reuse that copy each time you boot QEMU with the same configuration.

The exact path to the OVMF files depends on the package you installed, but they're probably somewhere under /usr/share (for example, Ubuntu 24.04 has /usr/share/OVMF/OVMF_CODE_4M.fd and /usr/share/OVMF/OVMF_VARS_4M.fd).
Post Reply