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...
gid reffers to the information you get by typing:
[Your Name]@debianvirtualbox:~$ id -u [Your Name] 1000 [Your Name]@debianvirtualbox:~$ id -g [Your Name] 1000
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?
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