Virtualbox shared folder between guest (Ubuntu) and host OS

Ok, so this will be just a quick guide and I will just cover the case I had. I have a Windows 8 host operating system and Ubuntu 14.04 as the guest operating system. The guest operating system was already installed and set up before I wanted to share a folder with the host operating system. The shared folder will allow you to securely copy files from one system to another without resorting to any external media or to using internet. The folder sharing will work even if the guest has the virtual ethernet cable unplugged. So here is how I set it up.

Initially I followed the two manuals on installing Guest Additions and setting up Shared Folders.

On Ubuntu installing Guest Additions (which is needed for the shared folders setup) is really simple, you just use the Devices menu and choose Insert Guest Additions CD image. Ubuntu will ask you if you want to auto-run the CD and you should accept. Guest Additions drivers will install, but you will have to restart the virtual machine to make them work.

Insert Guest Additions CD

If you didn’t have the Guest Additions drivers installed previously you will notice some nice added features like dynamic screen size adaptation 🙂 Now you can set up your Shared Folder Settings.

Shared folder settings menuYou should set up a permanent (under Machine folders) shared folder and make it auto-mountable.

Shared folder settings

(Note that for auto-mount you will have to restart the virtual machine so transient folders seem to always need to be manually mounted.)

You will be able to find the mounted folders under /media/ in the guest system and the folder name will always start with sf_.

What I also noticed was that the folder was owned by root and vboxsf group, which will make them inaccessible to a normal user.

shared_folder_properties

To be able to access the folders and files freely you need to add your current user to the vboxsf group, which can be done by command

where Username should be changed to actual username of the user being added.

After setting up the groups correctly you will have free access to the shared folder.

shared_folder

There however are some issues with special characters in names or with names starting with ~ character, so you should probably not be using your shared folder as a work folder. The best way is to have a dedicated work folder on Linux and then synchronize it (manually or automatically) with the shared folder. If you will use it only for occasional manual file transfer then you should probably not be too concerned about this.

Tagged with: , , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

*