Archive for June 14th, 2011

VirtualBox Shared Folders with Windows XP host and Ubuntu as guest OS

The VirtualBox shared folder is a way to share a common folder between your host and guest operating system.Although VirtualBox provides an option of shared folder, it is not straightforward to use this shared folder. It took me some searches on VirtualBox forum to find it how Ubuntu guest OS can access the shared Folder on WindowsXP host OS.

Before booting the guest OS create a shared folder in XP.I created a folder called vbox_xp in C drive and added it to VirtualBox shared folders as given in picture and click OK.Then it will get listed in the shared folders list.

When done with your shared folder(s) specification boot the guest OS.Here it is Ubuntu 11.04.

You have to install guest additions to proceed.How to install guest additions in Ubuntu 11.04 is described in my other blog.

You may now go ahead and actually mount these folders from Ubuntu. First you have to create a mountpoint, that is, a directory in your Ubuntu which will reflect the shared folder from Windows.

Type the following commands in terminal.

sudo mkdir /media/windows_share

Of course you may choose an alternative path for your mountpoint. With your mountpoint created you can now mount the shared folder, like this:

sudo mount -t vboxsf folder-name /media/windows_share

Where folder-name will be the name you assigned for this folder when you were adding it in the shared folders list.Therefore here it is like:

sudo mount -t vboxsf vbox_xp /media/windows_share

You could use the /etc/init.d/rc.local script to execute these commands on startup to have the shared folders automatically mounted every time you start your Ubuntu VirtualBox.To mount the shared folder at boot time, add the following commands in a terminal.

sudo su
gedit /etc/init.d/rc.local

And add the following line at the end of rc.local file

mount -t vboxsf vbox_xp /media/windows_share

Where “vbox_xp” is the folder created in Windows host OS and “windows_share” is the folder created on Ubuntu guest OS.