Page 1 of 1

ubuntu host, fedora (partition) guest

Posted: 10. Aug 2010, 19:08
by Carrot Cruncher
hi. i'm having problems booting my fedora partition from my ubuntu host.

ubuntu (10.04) is installed into /dev/sda2 and fedora (13) is installed into /dev/sda5. mbr contains grub installed from ubuntu.

booting natively into fedora i have installed grub into the boot sector of /dev/sda5 with the following config :
default=0
timeout=0
splashimage=(hd0,4)/grub/splash.xpm.gz
hiddenmenu
title Fedora (2.6.33.6-147.2.4.fc13.i686.PAE)
root (hd0,4)
kernel /vmlinuz-2.6.33.6-147.2.4.fc13.i686.PAE ro root=/dev/sda5 LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=uk
initrd /initramfs-2.6.33.6-147.2.4.fc13.i686.PAE.img

from the ubuntu host i have created a mbr using :
dd if=/dev/sda5 of=~/.VirtualBox/HardDisks/Fedora.mbr bs=512 count=1

i'm not sure why this step is actually required as i'd have thought the vm would just boot grub from the partition boot sector but this doesn't seem to work.

then created a vmdk image using :
VBoxManage internalcommands createrawvmdk -filename ~/.VirtualBox/HardDisks/Fedora.vmdk -rawdisk /dev/sda -partitions 5 -mbr ~/.VirtualBox/HardDisks/Fedora.mbr -relative

booting the vm gives :
failed to read image

Error 1: File not found

Press any key to continue...

which just throws me back to the grub menu. have i done something obviously wrong ?

another question is ... if i boot the same vm up to a fedora livecd and run :
fdisk -l

it shows me all the partitions on the host hard drive. i thought the :
-partitions 5

part of the createrawvmdk command meant the vm would only be able to see partition 5. have i misunderstood ?

any advice/help much appreciated.

Re: ubuntu host, fedora (partition) guest

Posted: 11. Aug 2010, 19:23
by Carrot Cruncher
solution was really obvious in the end. i'd copied the grub config from another server that had a /boot partition so all the paths were relative to it. this server doesn't have a /boot partition so i had to prefix all the paths with /boot.

still not exactly sure what the -partitions parameter does but i now have the fedora partition successfully booted under the ubuntu host.

Re: ubuntu host, fedora (partition) guest

Posted: 11. Aug 2010, 21:59
by Sasquatch
The -partition option is to make only that partition accessible for the VM. If you would try to read or otherwise access the other partitions, you would get a denied, does not exist or other error. Since using RAW disk access is a dangerous feature, especially if you would mount the drive or partition in both the Host and the Guest, it would get really messy if you couldn't separate it, leaving the partition unmounted on the Host so that the Guest can access it safely.