You can use the VBoxManage
tool to create vmdk
files that point to real partitions on your hard disk. You can use this to mount Fedora partitions in your Ubuntu virtual machine, or alternatively boot Fedora in VirtualBox.
WARNING: If you try and boot your currently running Windows installation in a virtual machine using the above technique, you could damage your Windows installation beyond repair. For that reason, you might want to use the second technique to mount Fedora against Ubuntu, or install GRUB into Fedora's partition.
To do so, open a Command Prompt as administrator by pressing Start, typing in cmd
, and pressing Ctrl+Shift+Enter. Once inside, cd
to the VirtualBox install directory where the VBoxManage
utility is located (C:\Program Files\Oracle\VirtualBox
by default), unless it happens to be in your PATH
.
The command to create a vmdk
representing your first hard disk in C:\Users\YGomez\mydisk.vmdk
is this:
VBoxManage internalcommands createrawvmdk -filename C:\Users\YGomez\mydisk.vmdk -rawdisk \\.\PhysicalDrive0
If Fedora is installed on a different hard drive, replace the 0
in PhysicalDrive0
with the hard drive's number. To figure out the drive numbers, run diskpart at the command line and then run list disk on the DiskPart command line.
You can also create a vmdk
representing Fedora's partition only. You might want to do this if you just plan to mount Fedora's partition in Ubuntu, or you wish to install GRUB directly in Fedora's partition and boot from there (see the warning above for why you might want to do this). To do so, add a -partitions
switch to the VBoxManage
command above with the partition numbers, separated by a comma. To figure out the partition numbers in DiskPart, run select disk n
where n
is the disk number, and then run list partition
.
For instance, if you had seperate root, /boot
, and /home
partitions in Fedora on partitions 2, 3, and 4 respectively, you'd run:
VBoxManage internalcommands createrawvmdk -filename C:\Users\YGomez\fedoraparts.vmdk -rawdisk \\.\PhysicalDrive0 -partitions 2,3,4
To install GRUB into Fedora's partition, boot into Fedora and run blkid
as root to figure out Fedora's /boot
partition device, or its root one if you didn't configure one. Then, run grub-install
on it. For instance, if Fedora's boot partition were on /dev/sda2
, you'd run the following as superuser:
grub-install /dev/sda2
Which version of Windows 7 are you using? – Joe Internet – 2011-06-29T02:14:42.817
@Joe Internet: Professional 64 bit. – yarian – 2011-06-29T02:28:33.323