qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Booting a guest with OVMF


From: Kashyap Chamarthy
Subject: Re: [Qemu-devel] Booting a guest with OVMF
Date: Wed, 11 Jun 2014 23:41:35 +0530
User-agent: Mutt/1.5.23 (2014-03-12)

On Wed, Jun 11, 2014 at 06:35:43PM +0200, Laszlo Ersek wrote:
> Alright, so we've already dealt with case #3 (--> the disk image was not
> appropriate for a UEFI VM); let's see cases #1 and #2 (I downloaded and
> tested the gummiboot rawhide image that you gave me).
> 
> What I did as preparation was:
> - I converted the raw image to qcow2:
> 
>   qemu-img convert -p -f raw -O qcow2 \
>       fedora-rawhide.iso fedora-rawhide.qcow2
> 
> - then I created an overlay so that the original never be modified:
> 
>   qemu-img create -f qcow2 -o backing_file=fedora-rawhide.qcow2 \
>       overlay.qcow2
> 
> And I tested with "overlay.qcow2" (rather than /dev/sdb), always
> recreating it from scratch before a test.
> 
> On 06/10/14 15:04, Kashyap Chamarthy wrote:
> > Heya,
> > 
> > Laszlo pointed out OVMF packages for Fedora from here[1]. I tried a
> > simple test using this[2] by installing Fedora onto a USB stick.
> > 
> > Once Fedora is installed on the USB stick (/dev/sdb), and I attempt to
> > boot into the USB device as below, I get the Fedora serial console login
> > prompt just fine through a QEMU vnc display:
> > 
> >     $ sudo qemu-system-x86_64 -machine accel=kvm -m 256 -bios \
> >       /usr/share/OVMF/OVMFX64.fd  /dev/sdb)
> 
> So, this "just works (TM)" for me too, same as for you.
> 
> > However, when I try with the below QEMU invocation, I get "Boot Failed.
> > EFI Floppy":
> > 
> >     $ sudo qemu-system-x86_64 -machine accel=kvm -m 512 -nographic \
> >       -nodefconfig -nodefaults  -serial stdio \
> >       -bios /usr/share/OVMF/OVMFX64.fd /dev/sdb
> >     Boot Failed. EFI Floppy
> >     Boot Failed. EFI Floppy 1
> 
> This happens because the image is incorrectly built. One "trick" that
> you should always use is the following two options:
> 
>   -debugcon file:debug.log \
>   -global isa-debugcon.iobase=0x402
> 
> (This is documented in the OVMF README.)
> 
> This will place the debug console at guest ioport 0x402, and redirect it
> to the debug.log host-side file. OVMF writes a pretty verbose log to
> that port.
> 
> Looking at that log, it's clear that gummiboot is actually started:
> 
> [...]
> Booting EFI Floppy
> PlatformBdsBootFail
> [...]
> Booting EFI Floppy 1
> PlatformBdsBootFail
> [...]
> Booting EFI Hard Drive
> [...]
> 
> The first two floppy boot failures are also displayed on serial (that's
> what you quoted).
> 
> No hard disk boot failure is logged to serial because that boot actually
> succeeds.
> 
> So, the question is, why don't you see anything on serial then? Well
> because in the image file neither gummiboot nor the kernel are
> configured to care about serial at all. 

Ah, right, I should have noticed that. I usually have the serial console
attribute (console=tty0 console=ttyS0,115200) by default in all my
Kickstart-based installs, so I missed it in this setup. Thanks.

> And, in case #2, you have no VGA
> etc; only a serial line.

> 
> Try this:
> - boot the image like in case #1 (== normal VGA),
> - log in, and navigate to /boot/loader/entries/
> - edit the gummiboot conf file you find there,
> - append "console=tty console=ttyS0" to the "options" line
> - shut down the guest cleanly (shutdown -h now)
> - start the guest again, like in case #2 (== headless).
> - You should get a login prompt on serial. (I do.)

This, of course, works.

Thanks Laszlo.

-- 
/kashyap



reply via email to

[Prev in Thread] Current Thread [Next in Thread]