I have configured a shared folder between the Windows host and Ubuntu guest. The folder mounts at start up but its empty(It also has a padlock sign.). I have to run the command below to access its content(the padlock sign disappears).

  sudo mount.vboxsf media ~/media

How can i configure it to be run automatically at start up. I've tried adding to the start up programs but nothing happens. Am new to Linux so try to put your answer in a layman's language. Thanks.

The mounted share folder belongs to the vboxsf user. You, as a user, were not added to the vboxsf group. To allow access to the shared folders permanently, copy and paste this command in a Terminal window:

sudo usermod -G vboxsf -a $USER

$USER will be replaced with your username. This command appends the user <username> to the vboxsf group, which is the owner of the shared folders (found in /media/... on the Ubuntu box).

You won't need to run a script at startup once you own the mounted shared folder.

  • For a few other tips about Ubuntu on a VirtualBox (Mac) see: [blog entry] (aboutfoto.wordpress.com/2013/04/03/of-ggobi-macports-and-r). – Cosmin Saveanu Jul 23 '13 at 13:05
  • It doesn't work. I had tried a similar thing earlier with this code: I don't know if its the same thing. sudo adduser <username> vboxsf – Njihia Jul 23 '13 at 16:15
  • Strange... On the box I'm using the shared folder appears as /media/sf_shared, and if I look at its permissions with ls -l I get: drwxrwx--- 2 root vboxsf 4096 Apr 3 18:47 sf_shared. Please check with the users-admin program if your user name is indeed in the vboxsf group (there is a button called Manage Groups and look at Properties of the vboxsf group). – Cosmin Saveanu Jul 23 '13 at 17:40
  • Am so sorry. The shared folder with the contents does appear in the media folder. What i wanted was for it to appear in my home folder with the contents. Sorry for the mistake. – Njihia Jul 25 '13 at 13:15
  • No problem. If you have writing access on the shared folder, that's fine. You can create a symbolic link in your home or Documents folder for easy access. In Terminal (assuming that you are in the directory where you want the link to appear) do: ln -s /media/sf_shared/ name_of_link. Replace sf_shared with the actual name of the shared directory and name_of_link with whatever you want. Alternatively, you can just drag the folder in Nautilus to the right navigation area and it will create an easy to access link. – Cosmin Saveanu Jul 26 '13 at 13:59

So here is how to access your shared folders on Ubuntu VM(Oracle Virtualbox). Am assuming you have already enabled auto-mount while you were adding the folder. Open the terminal and type.

sudo usermod -G vboxsf -a username 

Replace username with your own username.This command appends the user “username” to the vboxsf group, which is the owner of the shared folders (found in /media/ on the Ubuntu box). Confirm from your media folder if the shared folders are present. They're usually named "sf_name-of-shared-folder". For quick access, you may want to create a link to the shared folders in the home folder. In Terminal (assuming that you are in the directory where you want the link to appear and that you've enabled the Nautilus plugin that gives you the context menu option ) do:

ln -s /media/sf_shared/ name_of_link.

Replace sf_shared with the actual name of the shared directory and name_of_link with whatever you want. However the name-of-link shouldn't exist in the directory where you want to create the link(That is there should be no folder or file with that name). Alternatively, you can just drag the folder in Nautilus to the right navigation area and it will create an easy to access link.

  • 3
    Possibly one needs to log off/log on again before being able to access the shared folder. – Thomas W. Jan 5 '16 at 7:36

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.