The following video shows you how to setup a folder share with a linux guest OS using Sun xVM VirtualBox (the non open source version).
There are a number of reasons, you would want to integrate a windows folder with a linux OS such as if you are doing cross platform application development with such GUI frameworks as Qt.
Here are the steps:
1. Start VirtualBox and select the virtualbox with which you want to share a folder.
2. Click on the shared folders link on the bottom right (betwen remote display and USB).
3. Click on add folder on the right. Enter the path to a folder and give it a name in the name text field. This name should be unique and is important as you will need it to mount the folder from within the Guest Linux OS. We’ll call this name as SourceFolder for our reference.
4. Start the Guest OS. When its done, create the folder to which you want the shared folder to be mounted. We’ll call the full path to this directory as TargetFolderPath
5. Start a command line window and go to the root shell (using su)
6. Now, enter the following command:
mount -t vboxsf SourceFolder TargetFolderPath
Now the contents of the sourcefolder should be visible from within the linux targetfolder.
Sanity Saving Tip: If you are doing cross platform development using Qt or similar and use the make command. Please do not compile in the same folder from within Linux. This will generate a lot of object files and configuration files for both linux and windows. Copy the folder using
cp -r TargetFolderPath NewFolderName
and then do the ‘make’ing separately. I spend 2 hours wondering what went wrong when I compiled from within linux on the same folder where I am compiling in Windows. Neither Visual Studio’s nmake or Linux’s make command will work as it will detect multiple targets.