I am writing to ask what the effect of the auto-mounting process is in VirtualBox, and where the folders can be accessed within a guest Linux system if auto-mount is used.

I have VirtualBox 4.0.4 installed on Mac OS 10.6.7, with Guest Additions apparently running correctly. The guest OS is Ubuntu 10.04, and I observe no apparent problems with it. I find that if the shared folders have "auto-mount" unchecked in the VirtualBox settings, they can then be mounted using the prescribed syntax

sudo mount -t vboxsf folder_name path_to_mount_point

and all works as it is supposed to.

But if the auto-mount option is checked, then I find that I can no longer mount the shared folders manually. I get the error

mounting failed with the error: Invalid argument

and the folders also do not appear to mount anywhere else accessible to me. Using the syntax

sudo mount -t vboxsf

without specifying a path installs them in /media, with their names prefixed with sf_, but they are not easily accessible there and I have not been able to change their owner using chown, either.

Thanks for your patient explanation.

link|improve this question
1  
I don't have a fix, either but I'm running into the same issue with an Ubuntu 11.04 server guest running on a Windows 7 ultimate host. My work-around was to uncheck the auto-mount option in VirtualBox, and instead add the shared folders to fstab and have Ubuntu mount them automatically at boot time. – quanticle Jul 23 '11 at 9:02
The thing I find interesting is that in an older installation of 10.04 (on an earlier version of VB) I did not have this problem and was able to mount shared folders easily. So I suspect it has something to do with VB rather than Ubuntu itself. – brannerchinese Aug 6 '11 at 22:23
feedback

migrated from stackoverflow.com Apr 7 '11 at 0:33

This question came from our site for professional and enthusiast programmers.

2 Answers

That is happening because you haven't indicated to your Guess OS that it has to mount that folder, you just told VirtualBox to share that folder. In order to auto mount a folder in Debian (it should be simillar for other Linux)

Edit as root the file /etc/fstab and at the bottom add the following line:

folder_name      path_to_mount_point        vboxsf  defaults        0       0

The path_to_mount must exist

then just run:

sudo mount -a

or reboot your VM

link|improve this answer
feedback

I had similar problems and found that my fstab wasn't auto mounting for some reason, whether I had the Auto mount checked or not. So I tried this approach instead and it worked fine:

  1. Create a directory to mount into (if you haven't already): mkdir -p /mnt/path_to_mount_point
  2. Edit your rc.local file: nano /etc/rc.local
  3. Append the following line and save: mount.vboxsf -w -o fmode=0777,dmode=0777 folder_name /mnt/path_to_mount_point

Reboot and it should mount with the correct permissions.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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