Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • What version of grub? Commented Oct 23, 2014 at 13:47
  • @eyoung100 grub2. Are there large differences between different versions within grub2? Commented Oct 23, 2014 at 14:00
  • No, but a Major Difference exists Between Grub-1 and Grub-2. Drive Numbering in Grub is zero based. Since A VM only has one disk by default hd0 is correct. I believe your issue her is that you have not embedded the boot sector code in the boot block. See this Gentoo Wiki Entry. Follow the Configuration Section for BIOS/MBR /dev/loop0 is a CDROM type device. See WikiPedia, and you can't install a bootloader on a Read-only device. Commented Oct 23, 2014 at 14:37
  • @eyoung100 But QEMU seems to boot into grub, and looking at the file in a hexeditor, I can see traces of grub. Commented Oct 23, 2014 at 15:05
  • grub-install --no-floppy /dev/loop0 indicates that you attemped to install the bootsector code as an appendage to the image file. QEMU does not see the image file because it is treating the image as the hard disk hd0 as noted by your rescue prompt. You need to mount the image in a working system on the loop device like an ISO without the RO flag, create a boot directory in the image, run grub-install, pointed at the mount point of the image, unmount and reboot QEMU. This is one of the reasons I use VirtualBox. Commented Oct 23, 2014 at 15:23