From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40862) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGTj0-0002Ra-EV for qemu-devel@nongnu.org; Mon, 02 Sep 2013 08:59:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VGTiv-0002Bx-3x for qemu-devel@nongnu.org; Mon, 02 Sep 2013 08:59:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:13894) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGTiu-0002Br-SZ for qemu-devel@nongnu.org; Mon, 02 Sep 2013 08:59:17 -0400 Date: Mon, 2 Sep 2013 13:59:07 +0100 From: "Richard W.M. Jones" Message-ID: <20130902125907.GB18409@redhat.com> References: <52203B8D.5030507@kamp.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52203B8D.5030507@kamp.de> Subject: Re: [Qemu-devel] Qemu Booting a PC without an MBR? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 > upload /usr/share/syslinux/mbr.bin /dev/sda > mount /dev/sda1 / > extlinux / > 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