I have a VirtualBox Debianx64 system installed and I was trying to share a host folder to it. Following a tutorial, I came to a mount command:

sudo mount -t vboxsf -o rw,uid=1000,gid=1000 [Virtual Box share name here] [path where to mount]

That works perfectly. I can edit the files and stuff...

The uid and gid reffers to the information you get by typing:

[Your Name]@debianvirtualbox:~$ id -u [Your Name]
[Your Name]@debianvirtualbox:~$ id -g [Your Name]

Of course it really sucks to run this every time, so I wanted to automount it. According to some tips, this could be done by adding command to /etc/rc.local, like this:

#!/bin/sh -e
# rc.local
# By default this script does nothing.
mount -t vboxsf -o rw,uid=1000,gid=1000 share /home/[Your Name]/share
exit 0

Now when I restarted system, nothing was mounted. I found this answer that helped me to log the error output of my /etc/rc.local, which is:

+ mount -t vboxsf -o rw,uid=1000,gid=1000 share /home/[Your Name]/share
/sbin/mount.vboxsf: mounting failed with the error: No such device

I was thinking that maybe the mounting is happening too soon... Could I try to auto-mount it during login phase?

From comments:

I added lsmod|grep -i vbox >&2 before the mount command resulting in this output:

+ grep -i vbox
+ lsmod
vboxvideo              12437  0 
drm                   249955  2 vboxvideo
vboxguest             213028  0 
  • I don't have a configuration to test this, but could you add a line to your rc.local lsmod|grep -i vbox >&2 and tell us the output? Your rc.local may be running before the guest additions have loaded/probed the required kernel drivers. – Mark Plotnick Sep 24 '15 at 17:55
  • @MarkPlotnick Contrary to my expectations, it seems at least some of the virtual items are loaded already - see the updated question. – Tomáš Zato Sep 25 '15 at 7:27
  • Which version of debian are you running? – Mark Plotnick Oct 4 '15 at 20:44
  • @MarkPlotnick The new Jessie release, I think it's number 8. I'll add detailed info about version tomorrow when I'm at work. – Tomáš Zato Oct 4 '15 at 21:13

Running Debian 8.2 I had the same problem, fixed it by adding vboxsf to /etc/modules (from this askubuntu answer).


Try installing VBox Guest Additions and VirtualBox Oracle VM VirtualBox Extension Pack which will provide extra support for certain devices.


The problem is the OS running rc.local too fast, before the service is actually loaded. Add a sleep 10 in the script line.

sleep 10 && mount -t vboxsf -o rw,uid=33,gid=33 www /var/www/html/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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