# How do you mount a Virtualbox shared folder? Group or permissions issue?



## notorab (Nov 6, 2019)

Does anyone know the procedure for a non-root user to gain access to Virtualbox shared folders?

This was fairly straightforward in Debian, however I'm having challenges with FreeBSD.  It looks like a group and permissions issue.  In Debian, I simply created a group "vboxsf", added my unprivileged user to it, chgrp the mount folder and then mounted.  I tried this in FreeBSD I used this procedure, however the group gets changed on the folder to "wheel" after mounting the shared folder.

Your guidance appreciated.

```
$ mkdir /mnt/srcr

$ ls -ld /mnt/srcr
drwxr-xr-x  2 root  vboxsf  512 Nov  6 00:03 /mnt/srcr

$ sudo mount -t vboxvfs Source /mnt/srcr

$ ls -ld /mnt/srcr
drwxr-xr-x  1 root  wheel  576 Oct 14 21:45 /mnt/srcr

$ whoami
np
$ pwd
/mnt/srcr
$ ls /mnt/src
drwx------  10 root  wheel  320 Oct 14 21:35 X/
$ ls /mnt/src/X
ls: X/: Permission denied
```


----------



## SKull (Nov 6, 2019)

Chapter 19. Storage
					

This chapter covers the use of disks and storage media in FreeBSD. This includes SCSI and IDE disks, CD and DVD media, memory-backed disks, and USB storage devices.




					www.freebsd.org
				




Section 17.4.1 should answer your question.


----------



## notorab (Nov 6, 2019)

Thanks but I am not following this.  Is the VirtualBox shared folder a USB storage device? 

Following the instructions:
*** camcontrol devlist is only listing the drive with the root filesystem.

These are the rest, which I'm not sure apply.  Appreciate anyone's guidance on mounting with read write permissions.

/etc/devfs.rules:

```
[localrules=5]
add path 'da*' mode 0660 group operator
```
/etc/rc.conf:

```
devfs_system_ruleset="localrules"
```
/etc/sysctl.conf

```
vfs.usermount=1
```


```
$ sudo mount -t vboxvfs -o -m=644,-M=755 Source srcr
Password:
mount: illegal option -- m
usage: mount [-t fstype] [-o options] target_fs mount_point
```


----------



## notorab (Nov 6, 2019)

I actually tried mounting using:
`sudo mount -t vboxvfs -o uid=1001,gid=1001 Source srcr`
where 1001 is my GID.

I'm able to read and write, however some files appear corrupted.

Is the VirtualBox guest additions that come with FreeBSD compatible with VirtualBox 6.0?  Has anyone tested them?

Thank you


----------



## SirDice (Nov 6, 2019)

notorab Stick to one thread please. And please don't spam old threads with the exact same questions either.

And yes, the current emulators/virtualbox-ose-additions (5.2.34) should work on a Virtualbox 6 host. But I haven't looked at vboxfs, I don't use it, so I cannot comment on that.

I have to do some work on a port I maintain tonight. I'll see if I can squeeze in a couple of tests with vboxfs.


----------



## notorab (Nov 6, 2019)

SirDice said:


> notorab Stick to one thread please. And please don't spam old threads with the exact same questions either.
> 
> And yes, the current emulators/virtualbox-ose-additions (5.2.34) should work on a Virtualbox 6 host. But I haven't looked at vboxfs, I don't use it, so I cannot comment on that.
> 
> I have to do some work on a port I maintain tonight. I'll see if I can squeeze in a couple of tests with vboxfs.



Thanks.  For some insight I'm using VBox 6.0 on Mac OS Mojave 10.14.6 interfacing with FreeBSD 12.1.


----------



## notorab (Nov 20, 2019)

Did you find anything conclusive in your tests of the VirtualBox filesystem? Thanks



SirDice said:


> notorab Stick to one thread please. And please don't spam old threads with the exact same questions either.
> 
> And yes, the current emulators/virtualbox-ose-additions (5.2.34) should work on a Virtualbox 6 host. But I haven't looked at vboxfs, I don't use it, so I cannot comment on that.
> 
> I have to do some work on a port I maintain tonight. I'll see if I can squeeze in a couple of tests with vboxfs.


----------



## SirDice (Nov 20, 2019)

No, sorry, haven't had the time actually. For some reason I got a whole string of bad mojo happening at home that takes up most of my free time.


----------

