You are not logged in.

#1 2014-12-16 05:30:45

spondbob
Member
Registered: 2014-01-30
Posts: 8
Website

[SOLVED] automount virtualbox shared folder (guest arch)

Hi all,

I have gone through the old resolved threads, but it stills not answering mine. The problem is that I'd like to automount shared folder, both approaches using automounting and fstab didn't work.

automounting
Here the shared folder is successfully mounting, but the problem is my user doesn't have read or write access, even already in vboxsf group. Here is the case:

# spondbob at bikinibottom-vb in ~ [12:42:18]
$ ls /media/sf_share_folder
ls: cannot access /media/sf_share_folder: Permission denied

# spondbob at bikinibottom-vb in ~ [12:41:43]
$ sudo ls -l /media/
total 0
drwxrwx--- 1 root vboxsf 0 Dec 12 23:17 sf_share_folder

# spondbob at bikinibottom-vb in ~ [12:41:52]
$ sudo ls -l /media/sf_share_folder
total 5
drwxrwx--- 1 root vboxsf 4096 Dec 12 23:51 projects
-rwxrwx--- 1 root vboxsf    4 Dec 12 23:13 tes.txt

# spondbob at bikinibottom-vb in ~ [12:41:54]
$ id
uid=1000(spondbob) gid=100(users) groups=100(users),10(wheel),95(storage),98(power),109(vboxsf)

# spondbob at bikinibottom-vb in ~ [12:41:59]
$ ls -l
total 0
lrwxrwxrwx 1 spondbob users 22 Dec 13 12:04 share_folder -> /media/sf_share_folder

# spondbob at bikinibottom-vb in ~ [12:42:07]
$ ls share_folder
ls: cannot access share_folder: Permission denied

fstab
After I messed up with the first approach, then I tried to use fstab. My fstab file:

vb_sf /home/spondbob/share_folder vboxsf comment=systemd.automount,uid=1000,gid=109 0 0

The error message from systemctl status home-spondbob-share_folder.mount -l

● home-spondbob-share_folder.mount - /home/spondbob/share_folder
   Loaded: loaded (/etc/fstab)
   Active: failed (Result: exit-code) since Tue 2014-12-16 16:06:24 AEDT; 15min ago
    Where: /home/spondbob/share_folder
     What: vb_sf
     Docs: man:fstab(5)
           man:systemd-fstab-generator(8)
  Process: 138 ExecMount=/bin/mount -n vb_sf /home/spondbob/share_folder -t vboxsf -o comment=systemd.automount,uid=1000,gid=109 (code=exited, status=1/FAILURE)

Dec 16 16:06:26 bikinibottom-vb mount[138]: /sbin/mount.vboxsf: mounting failed with the error: No such device

I think the problem is due to the vboxservice has not been loaded during mount process. And the wiki has suggested to put comment=systemd.automount to resolve this, but it seems no good. For the record, I have put the vboxservice enabled and I can do  mount -t vboxsf -o uid=1000,gid=109 vb_sf /home/spondbob/share_folder/ flawlessly.

Any suggestion is appreciated. Thx

Last edited by spondbob (2014-12-16 12:14:21)

Offline

#2 2014-12-16 12:13:45

spondbob
Member
Registered: 2014-01-30
Posts: 8
Website

Re: [SOLVED] automount virtualbox shared folder (guest arch)

I have solved it using 2nd approach by adding noauto to the option according to this blog https://www.happyassassin.net/2011/05/1 … te-shares/

Offline

#3 2015-10-12 11:56:15

DrWindows
Member
Registered: 2011-02-09
Posts: 2

Re: [SOLVED] automount virtualbox shared folder (guest arch)

I solved it using the 1st approach but changing /media/ group.

[root@archenl user1]# chown root:vboxsf /media
[root@archenl user1]# ls -la /media
total 56
drwxrwxr--  3 root vboxsf  4096 Oct 12 11:07 .
drwxr-xr-x 18 root root    4096 Oct 12 11:07 ..
drwxrwx---  1 root vboxsf 49152 Sep 29 16:14 sf_Software

Offline

Board footer

Powered by FluxBB