These instructions are for Ubuntu 11.10 running under VirtualBox 4.1.8r75467 on Windows 7 with SP1. They should be the same for other version combinations, but no guarantee is made.
It shouldn’t matter on which host VirtualBox is running, but I don’t run it on anything other than Windows.
I have not tried shared folder with other Linux distros, so these instructions may or may not work with them.
Assumes you have installed VirtualBox Guest Additions on Ubuntu 11.10. Instructions to do so can be found here.
If you have already enabled folder sharing and want instructions on how to add a shared folder to Ubuntu, instructions can be found here.
Shared folders allow you to easily share large files or large amounts of data between the host OS and the guest OS. In my case, I share code so I can test my code on both Windows and Linux.
Enabling Shared Folders
1) Open a terminal (instructions can be found here).
2) Enter the following command:
sudo usermod -a -G vboxsf <<username>>, where username is your username (in my case, it is richard – your username will precede the @ symbol at the start of the command line). Enter your password when prompted. NOTE: for security reasons, Linux does not echo back your password – not even characters like # or * – so, as you type, it looks like nothing is happening. This is normal. Press Enter when you have finished entering your password:
sudo temporarily raises your privilege level to super-user status (if you enter the correct password)
usermod modifies the user account
-a instructs usermod to add the user to the specified group
-G tells usermod that a group or list of groups follows
<<username>> is the name of the user to add to the specified group
3) Restart the machine. The changes will not take effect until the machine is restarted.
Accessing Shared Folders
Assumes you are using the Unity interface.
Shared folders are found in the /media folder.
4) Click on the Folders icon:
5) Click on File System then double-click on the media folder:
The shared folders will be found inside. Shared folders are prefixed with
sf_. For example, if you shared a folder called
my_code, then it will appear as
sf_my_code in the media folder.
Whenever you share a new folder, you need to restart the machine for Ubuntu to pick it up.