Shared Folders in Sun VirtualBox is a good option to share data between virtual machine (guest) and physical machine (Host). This post explains how you can setup shared folders in VirtualBox with read and write access on physical partition in host.
In my earlier post, I explained about accessing physical disk and partition as raw disk in virtual machine. Its a raw disk access and not having real time read or write access on disk. But it worked as one of drive in host. Shared folders in VirtualBox work as network share between host and guest with real time read and write access. In this example, my host is windows 7 and guest is windows XP. I’m going to access Windows 7 host partition in Windows XP guest VirtualBox virtual machine.
Requirement for Shared Folders in VirtualBox
1) VirtualBox Guest Additions should be installed on guest
Not a Requirement for Shared Folders in VirtualBox
1) Networking between host and guest.
Even though shared folders work like network share, it’s not necessary to setup any kind of network between host and guest. No network communication required. In this example, I did not setup network between Windows XP and Windows 7.
How to Setup Shared Folders in Sun VirtualBox
1) Go to settings of virtual machine without switching on. Click on Shared Folders option.
2) Click on add sign as mentioned above.
3) Click drop down arrow in Folder Path option, select other.
4) Browse for the partition or folder you want to share to guest through shared folders in VirtualBox. I select partition D here.
5) You can give a name for shared partition and select ‘Read-only’ if required.
This share doesn’t mean that partition is shared on network and others can view it. This sharing only between host and guest through VirtualBox console. Windows sharing is nothing to do with it.
Click OK, once successfully added.
6) Successful share shown as below.
7) Start the virtual machine and go to ‘Entire network’ under ‘Other Places’ in ‘My Network Places’.
if Virtualbox guest additions not installed on guest machine, you can’t see ‘VirtualBox Shared Folders’ icon.
8) Open ‘VirtualBox Shared Folders’ as shown above
9) At the end, I can access physical partition D on Windows XP guest machine from VirtualBox. You would have noted I didn’t talk or configure any network between host and guest.
10) For testing purpose I created a text file called ‘test_from_vbox.txt’ on shared partition from Windows XP, which is replicated immediately on my Windows 7 host drive.
It means, read and write access on host partition works fine in shared folders method. Still, if you like to use like a drive then simply map as network drive.
After mapping as network drive, I can access host windows 7 physical partition D as one of partition in Windows XP guest virtual machine in VirtualBox.
I’m sure this method would be helpful to share large data between host and guest in Sun VirtualBox desktop virtualization software. You do not need to create raw disks to share physical drivers or partitions to access data from host in this case. You can use same method to access multiple partitions and folders from host. This works without any network setup.
Let me know if you face any problems with shared folders in Sun VirtualBox and your valuable comments on this.