cannot boot grub multiboot image with kvm -kernel

Bug #598649 reported by Scott Moser
This bug affects 1 person
Affects Status Importance Assigned to Milestone
qemu-kvm (Ubuntu)
Fix Released
Won't Fix
Serge Hallyn

Bug Description

Binary package hint: qemu-kvm

I'm trying to boot a grub multiboot image with kvm -kernel and it is not functioning.

'-kernel' should be capable of booting a multiboot image, and I'm passing it one. I created the image by running the following inside a ubuntu 10.04 guest.

$ echo "set prefix=(hd0)/boot/grub" > mycfg.cfg
$ grub-mkimage --output=grub-loader.img --config=mycfg.cfg \
   --prefix=/boot/grub biosdisk ext2 part_msdos

Then, I tried booting a disk image passing that loader to '-kernel'. kvm hangs showing only:
  Starting SeaBIOS (version 0.5.1-20100120_010601-rothera)

I've built git from commit bc3a9ccc5ddea4c0c713ef6fb3c11d9a88cec169 at git:// , and it is functioning correctly.

ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: qemu-kvm 0.12.4+noroms-0ubuntu3
ProcVersionSignature: User Name 2.6.32-305.9-ec2
Uname: Linux 2.6.32-305-ec2 x86_64
Architecture: amd64
CurrentDmesg: [ 15.541040] eth0: no IPv6 routers present
Date: Fri Jun 25 20:25:58 2010
Ec2AMI: ami-8e05ede7
Ec2AMIManifest: ubuntu-images-testing-us/ubuntu-maverick-daily-amd64-server-20100625.manifest.xml
Ec2AvailabilityZone: us-east-1d
Ec2InstanceType: m1.large
Ec2Kernel: aki-0d816864
Ec2Ramdisk: unavailable
 ubuntu 1779 812 99 86610 47744 1 20:25 pts/1 00:00:18 kvm -m 128 -drive file=disk.img,index=0,if=virtio -net nic,model=virtio -net user -kernel grub-loader.img -curses

Lsusb: Error: command ['lsusb'] failed with exit code 1:
ProcCmdLine: root=/dev/sda1 ro 4
ProcModules: ipv6 293479 12 - Live 0xffffffffa0000000
SourcePackage: qemu-kvm

Related branches

Revision history for this message
Scott Moser (smoser) wrote :
Revision history for this message
Scott Moser (smoser) wrote :

This tarball contains a re-create scenario.

Download it, extract it, and the nrun:
  kvm -m 128 -drive file=disk.img,index=0,if=virtio \
    -net nic,model=virtio -net user \
    -kernel grub-loader.img

That works with kvm tip, but not maverick's version (or lucid's)

Revision history for this message
Scott Moser (smoser) wrote :

Looking into this further, I suspect that 'multiboot.bin' is involved.

Chuck Short (zulcss)
Changed in qemu-kvm (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

With the package compiled from
which includes a patch entitled "Fix multiboot compilation" I get the exact
same multiboot.bin as I get from kvm-git.

Indeed, after this kvm gets further. However, I'm currently stuck on a
different breakage:

 error: hd0 cannot get C/H/S values.
 grub rescue>

I'm looking through kvm.git log particularly for hw/pc.c for clues...

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

The maverick version of grub-mkimage (coming from grub-common) doesn't
seem to create working images per the kvm-grub-loader.tar.bz2/README directions,
but using

grub-mkimage -O i386-pc --output=grub-loader.img --config=mycfg.cfg --prefix=/boot/grub biosdisk ext2 part_msdos ls

I can get something which boots with upstream kvm.

WIth the package (from my bzr tree) it gets to the grub command line, but does
not continue to boot.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Using bios.bin from seabios compiled from git succeeds. So we need both:

1. the update package from my bzr tree, referenced above.

2. an update to the seabios package.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

I now have this working both on the ec2 instance and my maverick laptop using
my own kvm and seabios packages. The kvm package is still the one in the bzr
branch listed above, which needs sponsorship to get into maverick. The seabios
package is the one at

The source for the package is at

with the .orig.tgz file at

This takes exactly the release + patches which qemu-kvm uses, plus two more
patches which are also needed to make boot from virtio work.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package qemu-kvm - 0.12.4+noroms-0ubuntu4

qemu-kvm (0.12.4+noroms-0ubuntu4) maverick; urgency=low

  * merge patch from upstream to fix multiboot.bin (LP: #598649)
 -- Serge Hallyn <email address hidden> Mon, 28 Jun 2010 10:44:44 -0500

Changed in qemu-kvm (Ubuntu):
status: Triaged → Fix Released
Thierry Carrez (ttx)
Changed in qemu-kvm (Ubuntu Lucid):
assignee: nobody → Thierry Carrez (ttx)
assignee: Thierry Carrez (ttx) → Serge Hallyn (serge-hallyn)
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

The qemu patch might be back-portable, but the bios change which is also needed
is not nicely back-portable to lucid, so this will have to be a maverick-only fix.

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.