qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Qemu Booting a PC without an MBR?
@ 2013-08-30  6:28 Peter Lieven
  2013-08-30  6:37 ` Paolo Bonzini
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Peter Lieven @ 2013-08-30  6:28 UTC (permalink / raw)
  To: qemu-devel@nongnu.org

Hi all,

today I had the second incidence of a migrated system (copied with DD) to qemu which won't
boot. (stuck after booting from harddisk message).

Looking at sector 0 I found out that it does not have an MBR. It seems that real hardware and
I was told also vmware can cope with this.

Is there a way we can improve this? (maybe be using an open source mbr in case the mbr
section is zeroed out?)

Thanks,
Peter

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] Qemu Booting a PC without an MBR?
  2013-08-30  6:28 [Qemu-devel] Qemu Booting a PC without an MBR? Peter Lieven
@ 2013-08-30  6:37 ` Paolo Bonzini
  2013-08-30  6:43   ` Peter Lieven
  2013-09-02 12:59 ` Richard W.M. Jones
  2013-09-02 13:00 ` Richard W.M. Jones
  2 siblings, 1 reply; 6+ messages in thread
From: Paolo Bonzini @ 2013-08-30  6:37 UTC (permalink / raw)
  To: Peter Lieven; +Cc: qemu-devel@nongnu.org

Il 30/08/2013 08:28, Peter Lieven ha scritto:
> Hi all,
> 
> today I had the second incidence of a migrated system (copied with DD)
> to qemu which won't boot. (stuck after booting from harddisk message).
> 
> Looking at sector 0 I found out that it does not have an MBR. It seems
> that real hardware and I was told also vmware can cope with this.

Maybe because it's got a UEFI bootloader?  In this case, you could try
using OVMF as the firmware with the -bios command-line option.

Paolo

> Is there a way we can improve this? (maybe be using an open source mbr
> in case the mbr section is zeroed out?)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] Qemu Booting a PC without an MBR?
  2013-08-30  6:37 ` Paolo Bonzini
@ 2013-08-30  6:43   ` Peter Lieven
  2013-08-30 11:01     ` Fam Zheng
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Lieven @ 2013-08-30  6:43 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel@nongnu.org

On 30.08.2013 08:37, Paolo Bonzini wrote:
> Il 30/08/2013 08:28, Peter Lieven ha scritto:
>> Hi all,
>>
>> today I had the second incidence of a migrated system (copied with DD)
>> to qemu which won't boot. (stuck after booting from harddisk message).
>>
>> Looking at sector 0 I found out that it does not have an MBR. It seems
>> that real hardware and I was told also vmware can cope with this.
> Maybe because it's got a UEFI bootloader?  In this case, you could try
> using OVMF as the firmware with the -bios command-line option.
I will try, thanks for the pointer.

It seems that the partition marked as boot has a boot loader though.

Peter

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] Qemu Booting a PC without an MBR?
  2013-08-30  6:43   ` Peter Lieven
@ 2013-08-30 11:01     ` Fam Zheng
  0 siblings, 0 replies; 6+ messages in thread
From: Fam Zheng @ 2013-08-30 11:01 UTC (permalink / raw)
  To: Peter Lieven; +Cc: Paolo Bonzini, qemu-devel@nongnu.org

On Fri, 08/30 08:43, Peter Lieven wrote:
> On 30.08.2013 08:37, Paolo Bonzini wrote:
> >Il 30/08/2013 08:28, Peter Lieven ha scritto:
> >>Hi all,
> >>
> >>today I had the second incidence of a migrated system (copied with DD)
> >>to qemu which won't boot. (stuck after booting from harddisk message).
> >>
> >>Looking at sector 0 I found out that it does not have an MBR. It seems
> >>that real hardware and I was told also vmware can cope with this.
> >Maybe because it's got a UEFI bootloader?  In this case, you could try
> >using OVMF as the firmware with the -bios command-line option.
> I will try, thanks for the pointer.
> 
> It seems that the partition marked as boot has a boot loader though.
> 
As a simple workaround you could boot with a GRUB iso and chainload the
partition, when you are in the guest OS, fix the MBR.

Fam

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] Qemu Booting a PC without an MBR?
  2013-08-30  6:28 [Qemu-devel] Qemu Booting a PC without an MBR? Peter Lieven
  2013-08-30  6:37 ` Paolo Bonzini
@ 2013-09-02 12:59 ` Richard W.M. Jones
  2013-09-02 13:00 ` Richard W.M. Jones
  2 siblings, 0 replies; 6+ messages in thread
From: Richard W.M. Jones @ 2013-09-02 12:59 UTC (permalink / raw)
  To: Peter Lieven; +Cc: qemu-devel@nongnu.org


On Fri, Aug 30, 2013 at 08:28:29AM +0200, Peter Lieven wrote:
> Hi all,
>
> today I had the second incidence of a migrated system (copied with
> DD) to qemu which won't boot. (stuck after booting from harddisk
> message).

You should probably have looked at virt-v2v, but you are where you are
now, so ...

> Looking at sector 0 I found out that it does not have an MBR. It seems that real hardware and
> I was told also vmware can cope with this.
> 
> Is there a way we can improve this? (maybe be using an open source mbr in case the mbr
> section is zeroed out?)

(1) Use virt-rescue to open the disk image and then run whatever
program is needed inside the guest (eg. grub-install).

Or:

(2) Use guestfish and add a syslinux boot loader.  I don't have a
direct example you can copy, but you could greatly simplify this:

https://rwmj.wordpress.com/2013/05/09/tip-convert-a-windows-dvd-iso-to-a-bootable-usb-key-using-guestfish/

It'll probably be something like:

Write a /tmp/syslinux cfg file (see EXTLINUX docs).

guestfish -a disk.img
><fs> upload /usr/share/syslinux/mbr.bin /dev/sda
><fs> mount /dev/sda1 /
><fs> extlinux /
><fs> upload /tmp/syslinux.cfg /syslinux.cfg

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] Qemu Booting a PC without an MBR?
  2013-08-30  6:28 [Qemu-devel] Qemu Booting a PC without an MBR? Peter Lieven
  2013-08-30  6:37 ` Paolo Bonzini
  2013-09-02 12:59 ` Richard W.M. Jones
@ 2013-09-02 13:00 ` Richard W.M. Jones
  2 siblings, 0 replies; 6+ messages in thread
From: Richard W.M. Jones @ 2013-09-02 13:00 UTC (permalink / raw)
  To: Peter Lieven; +Cc: qemu-devel@nongnu.org

Actually assuming it's a Linux guest, a third option would be:

(3) Use an external kernel + initrd:

guestfish -a disk.img -i
><fs> download /boot/vmlinuz-... /tmp/kernel
><fs> download /boot/initrd-... /tmp/initrd

qemu -kernel /tmp/kernel -initrd /tmp/initrd -hda disk.img ...

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-09-02 13:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-30  6:28 [Qemu-devel] Qemu Booting a PC without an MBR? Peter Lieven
2013-08-30  6:37 ` Paolo Bonzini
2013-08-30  6:43   ` Peter Lieven
2013-08-30 11:01     ` Fam Zheng
2013-09-02 12:59 ` Richard W.M. Jones
2013-09-02 13:00 ` Richard W.M. Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).