Accessing dual boot partition from virtualization

2

My current system is dual-booting Fedora 14 and Windows 7. I just installed an Ubuntu partition via Virtualbox for virtualization. The idea is sometimes I need to do something in Windows but I want to keep Linux close at hand.

The virtualization works fine but I want to be able to access the files from my Fedora partition with the virtualized Ubuntu. The problem is that the option to share folders in Virtualbox takes you through a Windows folder selector, and the Fedora partition does not appear under my Computer since Windows cannot read it.

Is there any way I can access the files in Fedora from my Ubuntu virtualization?

I have seen this post. If I could boot the virtualization from the Fedora partition that would be even better.I am working on doing this while I wait for answers.

yarian

Posted 2011-06-29T01:26:51.520

Reputation: 141

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

Answers

0

You can mount the Fedora partitions and then share them as CIF/SMB shares, essentially turning Windows into a file server. This allows you to access them via your Ubuntu guest (or any other networked machine) without creating virtual folders.

The difficulty that you'll have here is that you'll need the appropriate drivers for Windows to recognize and mount the Linux filesystems. I tested an open-source driver called Ext2Fsd under Windows XP/32bit, and it worked, with the following limitation...

Ext2Fsd has a know limitation of RO access to EXT4, and doesn't support LVM. The default Fedora install creates an Ext3 boot partition, and an LVM volume group with Ext4 partitons. On my test machine, Ext2Fsd successfully mounted the Ext3 boot partition, but wasn't able to access the LVM. So if your conguration is the Fedora default, you may have limited success in trying this. If you're not using LVM, you should be able to RO Ext4 partitions, or EW Ext2/3 partitons.

If you try this and get the filesystems mounted, you can then share them via the Windows interface. Then from Ubuntu, you can browse the share in your filemanager. I typically use Gnome, and Nautilus has issues connecting to SMB shares, so I connect with an ip address instead of a server name - smb://192.168.1.150/sharename instead of smb://windowshostname/sharename. Howver, either may work for you. You may also need to configure your firewalls to allow SMB traffic.

Joe Internet

Posted 2011-06-29T01:26:51.520

Reputation: 5 145

0

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

Patches

Posted 2011-06-29T01:26:51.520

Reputation: 14 078