Share Folder from Windows 7 to Ubuntu 10.04 Guest with Virtual Box

This is how I shared a folder from a Windows 7 host to a Ubuntu 10.04 guest. This is great for my overall goal of running a Virtual Ubuntu Server on my Windows desktop for FTP, DLNA, HTTP, and whatever else I find handy.


1.) So first you need to choose a share using the virtual box prompt on the guest OS. This is called "Shared Folders" and can be navigated to from the main console, the "Devices" menu of a guest OS window, or the bottom right folder icon on the guest OS window. If you want to temporarily mount the share go to step 2, if you want to permanently mount it go to step 3. I recommend testing using the commands in step 2 first then permanently mount it using the Fstab.

2.) To mount this share you must use the following set of commands

a.) sudo mkdir /mnt/shares/videos
//These comments just explain what each of these commands do
// "sudo" - gives our local account root powers allowing you to create the directory.
// "mkdir" - creates the directory
// "/mnt/shares/videos" - the name and location of the directory to create

b.) sudo mount -t vboxsf videos /mnt/shares/videos
// "mount -t vboxsf" - command to mount the shares
// "videos" - name of the folder shared in the VirtualBox window
// "/mnt/shares/videos" - the the directory where I want to mount the folder

So this will mount the directory in a location so it's usable but we don't wanna do this every time so we will add this command to our Fstab file.

3.)To Permanently mount this share you must add the following to your Fstab file. ***For some reason this throws an error before i hit the boot screen but it still works all the same, not to sure why...


a.) in a terminal type gksudo gedit /etc/fstab
// "gksudo" - graphical sudo command used when loading an app with a gui
// "gedit" - loads the gedit text editor
// "/etc/ftsab" - the location and name of the file to open

b.) add the following to the bottom of the fstab...
#Automatically mount shares from Host OS
videos /mnt/shares/videos vboxsf

//  "#Autom...." This is a comment in the fstab as noted by the # sign preceding it.

// "videos" - name of the folder shared in the VirtualBox window
// "/mnt/shares/videos" - the the directory where I want to mount the folder
// "vboxsf" - the type of filesystem

The final fstab should look like the last two lines of my fstab...


0 comments:

Post a Comment