My virtualbox fstab will not auto-mount on reboot?

14

10

I am able to mount my drive manually like this (ubuntu):

sudo mount -t vboxsf C_DRIVE /mnt/saga_c

But when I try and add it to my fstab it does not mount when I restart the machine. Is there something wrong with my /etc/fstab line:

C_DRIVE         /mnt/saga_c     vboxsf   defaults         0   0

Do I need something in addition to the vboxsf? Or is there something else I am doing incorrectly?

stephenmm

Posted 2010-05-29T19:45:10.013

Reputation: 1 197

1I'd try adding an explicit auto to the mount options. It can't hurt and quoth mount(8): "Some of these options could be enabled or disabled by default in the system kernel." – msw – 2010-05-29T20:17:09.103

1

If you've got a systemd based system try looking at this answer: https://askubuntu.com/a/1097468/233795

– Pierz – 2018-11-30T16:59:07.553

Answers

12

Try removing the "defaults 0 0" part. Just a hunch.

Found this (put this instead of the defaults):
rw,uid=1000,gid=1000

Report back. :)

Apache

Posted 2010-05-29T19:45:10.013

Reputation: 14 755

Have to leave right now but I will try it tonight and get back. Thanks! – stephenmm – 2010-05-29T21:59:21.840

This is how my fstab looks now and it seems to be working. Thanks!

C_DRIVE /mnt/saga_c vboxsf auto,rw,uid=1000,gid=1000 0 0 – stephenmm – 2010-05-30T21:06:39.283

After a night of frustration, here I am with a satisfied smile on my face. Thank you! – janosrusiczki – 2013-05-05T00:41:22.590

8

Running debian jessie as host, i used the option comment=systemd.automount in my /etc/fstab to get it working (in addition to the suggestion of Azizur):

Share /var/sfshare vboxsf auto,rw,uid=33,gid=33,umask=0007,comment=systemd.automount 0 0

uid, gid and umask were set for compatibility with owncloud (v7.0.4) to use the mount point as data folder.

https://ask.fedoraproject.org/en/question/48578/fstab-mount-with-virtualbox-shared-folders/

setempler

Posted 2010-05-29T19:45:10.013

Reputation: 191

4I tried different solutions pointed out on superuser/stackoverflow/interwebs - but the important option is the comment=systemd.automount - with all other it would fail at my systemstart. – lorem monkey – 2015-06-03T09:04:29.653

2

This is what worked for me on Ubuntu 11.10 Server:

/etc/fstab line:

sites   /home/rob/sites vboxsf  auto,rw,uid=1000,gid=33 0 0

uid 1000 = my user, gid=33 www-data (apache group on ubuntu..)

/etc/rc.local

mount /home/rob/sites

robm

Posted 2010-05-29T19:45:10.013

Reputation: 121

1

After quite a bit of searching I found this VirtualBox/SharedFolders Troubleshooting.

try:

sudo chmod 777 /mnt/saga_c

This worked for me.

Azizur Rahman

Posted 2010-05-29T19:45:10.013

Reputation: 111

chmod 777: nonononono! Never ever run chmod 777. It is practically never required! Not even for "testing purposes". If the file is readable, then it's readable. If it's writable by the user or group that need to write to it, then it's writable. There is absolutely zero need to give everyone write permissions, and forgetting to chmod it back to something sane is exactly how multinationals get hacked. Just don't do it. Ever. I wrote an introduction of Unix permissions. Please read it! – Martin Tournoij – 2016-03-13T06:10:55.630