Page 1 of 1

How do you use the qemu with OVMF.fd?

Posted: Thu Oct 03, 2019 11:46 pm
by benji
As we all know, we can use the qemu to boot the os which supports UEFI. But, When I use the qemu to boot my os, It‘s always stuck in this interface.
ipv4.png
How can I jump this interface?

Re: How do you use the qemu with OVMF.fd?

Posted: Fri Oct 04, 2019 1:01 am
by linguofreak
We need more information. How are you starting QEMU, and with what options.

It looks like OVMF is attempting to boot from the network (PXE boot). Is this how you intend to boot your OS, or are you booting it from a disk image?

Re: How do you use the qemu with OVMF.fd?

Posted: Fri Oct 04, 2019 2:29 am
by benji
linguofreak wrote:We need more information. How are you starting QEMU, and with what options.

It looks like OVMF is attempting to boot from the network (PXE boot). Is this how you intend to boot your OS, or are you booting it from a disk image?
actually, I don't want qemu boot from network. I just want it skip this step.

Re: How do you use the qemu with OVMF.fd?

Posted: Fri Oct 04, 2019 5:44 am
by bzt
benji wrote:actually, I don't want qemu boot from network. I just want it skip this step.
Go into the UEFI setup screen (by pressing F12 or ESC if I recall correctly), select Boot Manager from the menu and change the boot sequence. If I were you, I'd add EFI Shell too to the list as the last option, that would save you lot of headaches later.

If you are interested, the boot manager in TianoCore is implemented here, and it looks like this:
Image

Cheers,
bzt

Re: How do you use the qemu with OVMF.fd?

Posted: Fri Oct 04, 2019 6:34 am
by benji
bzt wrote:
benji wrote:actually, I don't want qemu boot from network. I just want it skip this step.
Go into the UEFI setup screen (by pressing F12 or ESC if I recall correctly), select Boot Manager from the menu and change the boot sequence. If I were you, I'd add EFI Shell too to the list as the last option, that would save you lot of headaches later.

If you are interested, the boot manager in TianoCore is implemented here, and it looks like this:
Image

Cheers,
bzt
It's useless. Because it only skip this once. I don't want to edit the list each time.

Re: How do you use the qemu with OVMF.fd?

Posted: Fri Oct 04, 2019 7:50 am
by linguofreak
How are you starting QEMU? Are you starting it from the command line? If so, what is the exact command you're using to start it? Are you using a GUI wrapper like virt-manager to do your setup?

Re: How do you use the qemu with OVMF.fd?

Posted: Fri Oct 04, 2019 8:46 am
by zhiayang
linguofreak wrote:How are you starting QEMU? Are you starting it from the command line? If so, what is the exact command you're using to start it? Are you using a GUI wrapper like virt-manager to do your setup?
Indeed, assuming you downloaded the prebuilt OVMF images, you should run with something like this:

Code: Select all

qemu-system-i386 -bios OVMF-pure-efi.fd <other options>
As far as the changes not persisting, I haven't had that happen to me (even though I just run it like above), but you can look at viewtopic.php?f=1&t=33207 for the options to use.

Re: How do you use the qemu with OVMF.fd?

Posted: Sat Oct 05, 2019 6:01 am
by MichaelPetch
Are you building and running this on a Linux distro?

Re: How do you use the qemu with OVMF.fd?

Posted: Fri Oct 11, 2019 2:01 am
by benji
MichaelPetch wrote:Are you building and running this on a Linux distro?
yes, And I met a problem that is I have a disk with GTP partition. In this disk, I build a test.EFI with edk2 in uefi.hd. Now, I want to qemu run my test.EFI directly. I don't want to qemu drop into UEFI shell each time. How do I do? This is How I run qemu with ovmf.fd:

Code: Select all

qemu-system-x86_64 -bios OVMF.fd -hda uefi.hd -net none

Re: How do you use the qemu with OVMF.fd?

Posted: Fri Oct 11, 2019 8:24 am
by zhiayang
If you want your OS or UEFI program to run "automatically", then AFAIK it must be placed in /EFI/BOOT/BOOTX64.EFI (or maybe BOOTX86.EFI for 32-bit), and you must setup the boot order in the configuration appropriately.

Alternatively you can probably find a way to write to the NVRAM of the machine and modify the "default" path that it looks for the EFI (I think this is possible on real machines, [remembered rEFInd doing something like that?] but not sure about QEMU).