VirtualBox: Sharing folders between host and guest

Recently, having finally refused to surrender to windows, I installed Ubuntu virtualised as a guest on Windows as a host using Oracle’s recently released VirtualBox. Here’s a tip on how to share folders between guest and host in the official way.

On the guest VM virtualbox menu open ‘Shared folders’.

Open Shared Folders
Open Shared Folders

On the top right of the dialogue box that comes up click the ‘+’ icon. Fill in the dialogue by adding a name and location.

Add share
Add share

After that you should have a shares dialogue as below.

Shares Dialogue
Shares Dialogue

Next, as root, mount manually.

mkdir /mnt/share
mount -t vboxsf virtual-box-ubuntu-share /mnt/share/

And, finally, add the following entry into /etc/fstab for future boots.

virtual-box-ubuntu-share /mnt/share vboxsf defaults 0 0

Done. Ubuntu on VirtualBox running as guest on a Windows host is by far the best and most compelling complement to your development environment if you are forced into using Windows as a host. VirtualBox even supports seamless mode which means that you can have Linux and Windows windows intermingled on the windows desktop. Superb. And best of all – both VirtualBox and Ubuntu being completely free.

Update: Great news. VirtualBox 4.0 is out. Here’s what’s new.

3 thoughts on “VirtualBox: Sharing folders between host and guest”

  1. Be careful depending upon VirtualBox – recent versions have been rather buggy. It seems that since Oracle took over the QA process has gone downhill: for example FreeBSD can’t even finish installing without triggering an ATA timeout and resulting panic, and people have also had problems with other OS’s:
    This is actually one area where it may be worth spending money: many people agree that VMware Workstation is worth paying for: Workstation has consistently been stable and though VBox now supports it too, the tree-of-snapshots feature was invaluable 5 years ago when I was testing software. I’ve kept paying for upgrades because I know it’ll cope with whatever I throw at it.

  2. Thanks for your input Bruce. I see what you are saying. Personally speaking, this is the first time I’ve used VirtualBox and it’s gone fine. I’ve only tried installing a guest of Ubuntu on a host of Windows 7. It’s fairly responsive and behaves like a native install in most ways. To be quite frank, although I don’t doubt that VMWare is a far superior product, I simply can’t afford it. It’s way beyond what they charge for Fusion on the mac and more than what Parallels charge both of which I’d consider buying. In fact I own a copy of Parallels. I wish such competitive prices were available for Windows virtualisation.

    1. For those who don’t care about the developer features (Visual Studio & Eclipse integration, playback, snapshots etc.) in Workstation there are the free Server and Player (and even ESXi) products from VMware which I suspect they made free in order to compete with VirtualBox, VirtualPC and Xen.

Leave a Reply