Virtualbox Shared Folder Fstab Automount on boot Ubuntu

I’m trying to integrate the Documents folders on all my machines. (Or, at the very least, set up a shared folder to automount on startup.)

Step 1:
I used the Virtualbox interface to setup a shared folder, selecting the correct host path
Code:

C:/users/username/Documents

and checking “Make Permenant.”

Step 2:
On my UbuntuServer12.04 guest, I created a mountpoint directory,
Code:

/home/username/Documents

. On the other guest, there is already a Documents folder which I will use as the mountpoint.

Step 3:
I entered this into /etc/fstab on both guest systems:
Code:

Documents /home/username/Documents vboxsf uid=username,gid=groupname 0 0

Step 4:
I even tested /etc/rc.local (made sure it was executable) by adding one of these three lines (tested one line, rebooted, replaced it with the next line, rebooted, tested the third…):

Code:

mount /home/username/Documents

Code:

mount Documents

Code:

mount -t vboxsf Documents /home/username/Documents

Code:

mount -a

I’m pulling my hair out faster than it’s already thinning and I’m going to go balled in no-time if I don’t get some help (know what I mean?)

SOLUTIONS:

Shared folders are automatically mounted in /media/sf_sharename. There are 2 ways to make your shared folder appear where you actually want them to go.

Solution 1:
Bind them to another folder.

1: Check if you are in the vboxsf group with
Code:

groups username

2: If you don’t see vboxsf, join the group by doing this, otherwise skip to step 3:
Code:

sudo usermod -a -G vboxsf username

3: Bind the automatically generated shared folder to your mountpoint by putting this line into /etc/rc.local:
Code:

mount –bind /media/sf_sharename /path/to/mountpoint

Solution 2:
Just make a symbolic link:
Code:

ln -s /media/sf_sharename /wherever/you/want

 

http://ubuntuforums.org/showthread.php?t=2074022

Author: bm on January 10, 2014
Category: ubuntu

Your comment:

Your Name

Comment:




Last articles