grub2 in lucid doesn't work in qemu with '-vga std'

Bug #717445 reported by Serge Hallyn on 2011-02-11
138
This bug affects 5 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Medium
Unassigned
Karmic
Medium
Colin Watson
Lucid
Medium
Unassigned
Maverick
Medium
Unassigned
Natty
Medium
Unassigned

Bug Description

Binary package hint: grub2

If you install a lucid VM in qemu (definately upstream version 0.14.0, I think also in natty's version), and run it with

kvm -hda VM.img -vga std

the VM refuses to boot, showing an error about 'out of range pointer 0x80220000'. Installing a 2.6.38 kernel does not help. Installing grub DOES prevent this bug.

A natty VM boots just fine. RHEL, fedora, and SLES images boot fine.

Serge Hallyn (serge-hallyn) wrote :

This presumably is the cause of bug 513273.

Dustin Kirkland  (kirkland) wrote :

Adding tasks for Karmic -> Natty, so that we can track each individually.

Removing 'insmod gfxterm' and 'insmod vbe' let's the guest boot up.

The full output of the error message is:

  error: no suitable mode found.
  error: unknown command `terminal'.
  out of range pointer 0x80220000
  Aborted: Press any key to exit.

The first error is from video/video.c:grub_video_set_mode(). This function is presumably triggered from `insmod gfxmenu'. For whatever reason, grub is unable to find a working mode when using the standard VGA driver in QEMU.

I tried changing the default 640x480 mode to 800x600 but that didn't help.

Changed in grub2 (Ubuntu Karmic):
importance: Undecided → High
Changed in grub2 (Ubuntu Lucid):
importance: Undecided → Medium
Changed in grub2 (Ubuntu Karmic):
importance: High → Medium
Changed in grub2 (Ubuntu Maverick):
importance: Undecided → Medium
Changed in grub2 (Ubuntu Natty):
importance: Undecided → Medium
Changed in grub2 (Ubuntu Karmic):
status: New → Confirmed
Changed in grub2 (Ubuntu Lucid):
status: New → Confirmed

Quoting Dustin Kirkland (<email address hidden>):
> ** Changed in: grub2 (Ubuntu Karmic)
> Status: New => Confirmed
>
> ** Changed in: grub2 (Ubuntu Lucid)
> Status: New => Confirmed

Have you been able to reproduce this with a natty guest? I'm
pretty sure this bug is Invalid for natty. But waiting for
someone else to verify that in case something went wrong in my
testing.

Leonardo E. Reiter (lreiter) wrote :

natty does not appear to have this problem.

I just verified the i386 version

Changed in grub2 (Ubuntu Natty):
status: New → Fix Released
Dustin Kirkland  (kirkland) wrote :

As mentioned in IRC, it would be col if we could bisect the fix by installing grub2 repeatedly onto a Lucid system, until we find the version that works... Serge mentioned that this is harder than it sounds, as newer grubs are not building on older lucids...

Serge Hallyn (serge-hallyn) wrote :

The upstream package from bzr works fine, just the package wouldn't build. So I'm slowly, in the background, doing a bisect. (NOt really a bisect, I don't yet have a known bad commit id to start with, and bzr doesn't afaict do bisect :)

Roland Dreier (roland.dreier) wrote :

Just confirmed that grub2 on Maverick (10.10) cannot boot in natty's kvm 0.14-rc1 with -vga vmware, but does work with -vga cirrus

Changed in grub2 (Ubuntu Maverick):
status: New → Confirmed
Serge Hallyn (serge-hallyn) wrote :

bisection in progress. So far, I've got:

bad: revision 2348
good: revision 2865

Serge Hallyn (serge-hallyn) wrote :

So far,

2467 bad
2470 good

Will continue tomorrow.

Serge Hallyn (serge-hallyn) wrote :

2470 is the commit which fixed it.

Unfortunately that commit is 2646 lines. diffstat:

 ChangeLog | 88 ++++++++
 conf/i386.rmk | 10
 include/grub/vga.h | 161 ++++++++++++++
 include/grub/video.h | 2
 include/grub/video_fb.h | 23 +-
 term/i386/pc/vga_text.c | 23 --
 video/bochs.c | 423 +++++++++++++++++++++++++++++++++++++++
 video/cirrus.c | 520 ++++++++++++++++++++++++++++++++++++++++++++++++
 video/fb/video_fb.c | 510 +++++++++++++++++++++++++++++++++--------------
 video/i386/pc/vbe.c | 257 ++---------------------
 video/i386/pc/vga.c | 63 -----
 video/sm712.c | 3
 12 files changed, 1624 insertions(+), 459 deletions(-)

Dustin Kirkland  (kirkland) wrote :

The diffstat shows a lot of activity around the video stack. Perhaps
we can ask Colin if he can help us narrow the diff down...

Serge Hallyn (serge-hallyn) wrote :

At last, here is a sequence of commands which reproduce the issue with grub-mkrescue. I created the rescue image from lucid, and used it to try to boot from a lucid hd:

loadfont (hd0,1)/usr/share/grub/unicode.pf2
set gfxmode=640x480
insmod gfxterm
insmod vbe
insmod terminal
terminal_output gfxterm
   ^ Here I get the 'error: no suitable mode found' message
insmod gettext
linux (hd0,1)/vmlinuz root=/dev/sda1
  ^ here I get the 'unaligned pointer: 0x8ebf0002\nAborted. Press any key to continue." message

Changed in grub2 (Ubuntu Karmic):
assignee: nobody → Colin Watson (cjwatson)
Karl Hegbloom (karl.hegbloom) wrote :

I had a similar problem... Everything works when I set it to use the Cirrus driver, but I wanted to use standard VGA. Working from 'virt-manager', and then looking at the log file in /var/log/libvirt/qemu/vmname.log, I find this:

 kvm: pci_add_option_rom: failed to find romfile "vgabios-stdvga.bin"

I ran 'dpkg --listfiles vgabios', and learned where they are kept. There is a bunch of symlinks... but they are not really in the right place. They are installed in /usr/share/kvm, not /usr/share/qemu. And, if they got installed in /usr/share/qemu, the vgabios package would clash with the qemu-common package, which installs a symlink named 'vga-bios-cirrus.bin'... but not one named 'vgabios-stdvga.bin'. Creating that symlink with:

  cd /usr/share/qemu
  sudo ln -s ../vgabios/vgabios.stdvga.bin vgabios-stdvga.bin

... fixes the problem, and now the virtual machine starts up fine. It has a faster display and higher resolution.

Serge Hallyn (serge-hallyn) wrote :

@Karl: yours is a different bug, which should finally be resolved (or at least be prevented from happing to anyone new), caused when vgabios was installed before qemu-common.

@Everyone

At this point I've cherrypicked the whole commit, first in three separate pieces, finally all three together, into lucid's grub2 source, to the point that the diffs look (just about) identical. (I'll attach them to this bug just for posterity's sake) But the problem persists. So it seems a previous commit must interact with this one to provide the fix. I'm wondering whether it's the one which introduces the '.prio' method.

Unfortunately bisecting isn't getting me far, so it may be better to go the route of adding more debugging instead.

It definately seems to be in the VBE code, since cirrus works, but vga and vmware (which use VBE) don't.

Serge Hallyn (serge-hallyn) wrote :
Serge Hallyn (serge-hallyn) wrote :
Serge Hallyn (serge-hallyn) wrote :
Serge Hallyn (serge-hallyn) wrote :

To be clear, lucid's grub2 plus any and/or all of the above patches works fine when booting without '-vga std' in qemu. But fails in the same way with.

pdf (pdffs) wrote :

Lucid also fails with '-vga qxl' without the patches, and qxl is the default for newer spice-enabled kvm/virt-manager/etc stacks.

Moris (nerimoris) on 2014-09-30
Changed in grub2 (Ubuntu):
assignee: nobody → Moris (nerimoris)
Changed in grub2 (Ubuntu):
assignee: Moris (nerimoris) → nobody
Rolf Leggewie (r0lf) wrote :

karmic has seen the end of its life and is no longer receiving any updates. Marking the karmic task for this ticket as "Won't Fix".

Changed in grub2 (Ubuntu Karmic):
status: Confirmed → Won't Fix
Rolf Leggewie (r0lf) wrote :

maverick has seen the end of its life and is no longer receiving any updates. Marking the maverick task for this ticket as "Won't Fix".

Changed in grub2 (Ubuntu Maverick):
status: Confirmed → Won't Fix
Rolf Leggewie (r0lf) wrote :

lucid has seen the end of its life and is no longer receiving any updates. Marking the lucid task for this ticket as "Won't Fix".

Changed in grub2 (Ubuntu Lucid):
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers