How to run OVMF
|Line 1:||Line 1:|
<big>How to run OVMF with QEMU</big>
<big>How to run OVMF with QEMU </big>
Revision as of 23:55, 23 February 2011
How to run OVMF with QEMU or KVM
In order to run OVMF with QEMU, you must have QEMU version 0.9.1 or newer installed on your system.
Get a build of OVMF.Fv (older releases used OVMF.fd)
Choose the correct processor architecture
Be sure to align the processor architecture for OVMF with the proper processor archtecture of QEMU.
For the IA32 build of OVMF, there is a little more choice, since the X64 processor is also compatible with IA32. Therefore, with the IA32 build of OVMF, you can use the following commands: qemu, qemu-system-i386 or qemu-system-x86_64.
For the X64 build of OVMF, however, you can only use the qemu-system-x86_64 command.
Setup a BIOS directory for OVMF QEMU
To use OVMF with QEMU, we utilize the -L QEMU command line parameter. This paramter takes a directory path, and QEMU will load the bios.bin from this directory.
Create a directory, and cd to the directory
bash$ mkdir ~/run-ovmf bash$ cd ~/run-ovmf
Next, copy the OVMF.Fv file into this directory, but rename OVMF.Fv to bios.bin:
bash$ cp /path/to/ovmf/OVMF.Fv bios.bin
Now copy the CirrusLogic5446.rom file into this directory, but rename it to vgabios-cirrus.bin:
bash$ cp /path/to/ovmf/CirrusLogic5446.rom vgabios-cirrus.bin
Next, create a directory to use as a hard disk image for QEMU
(QEMU can turn the contents of a directory into a disk image 'on-the-fly'):
bash$ mkdir hda-contents
Run OVMF with QEMU
Run QEMU using OVMF
Here is a sample command:
bash$ qemu-system-x86_64 -L . -hda fat:hda-contents
If everything goes well, you should see a graphic logo, and then the UEFI shell should start.
OVMF on Linux is not yet fully comptible with KVM. Recent version of QEMU on linux will attempt to enable kvm, and this may cause OVMF to fail to start. If QEMU with OVMF fails to boot, try adding the -no-kvm command line option.