Skip to content

Instantly share code, notes, and snippets.

@ibogun
Created July 8, 2014 13:50
Show Gist options
  • Save ibogun/b8674f7339eef121ed24 to your computer and use it in GitHub Desktop.
Save ibogun/b8674f7339eef121ed24 to your computer and use it in GitHub Desktop.
Mount folder in Ubuntu guest VM
Step 7: Shared & Auto-Mounted Folder
Wouldn’t it be cool if you could access your Project folder of Mac OS X (or any other folder) inside of Ubuntu? We will do this now and I take as example a folder called “Projects”. Please replace this just with the one that you like.
Open the preferences of the Ubuntu VM (you need to shut it down before)
Go to “Shared Folder” and click on “+”
In the first line of the popup select the folder on your Mac which you want to see in Ubuntu
In the second line of the popup enter the name “Project” (or whatever your prefer)
Activate the second checkbox “automatic mounting” (or a similar wording)
Click “OK” and start your Ubuntu VM
In Ubuntu (maybe even connected via SSH?) type the following to add a mounting point for the shared folder:
sudo mkdir /mnt/Projects
sudo chmod 777 /mnt/Projects
sudo mount -t vboxsf -o uid=1000,gid=1000 Projects /mnt/Projects
Now enable auto-mounting. For this, we open the file which is always run at the start of Ubuntu:
sudo vim /etc/rc.local
Add the following line above(!!!) the line with “exit 0”:
sudo mount -t vboxsf -o uid=1000,gid=1000 Projects /mnt/Projects
save and close vim
from now on your Mac OS X folder is always in /mnt/Projects inside Ubuntu, even after a reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment