Question about permissions from within a Virtualbox VM

Status
Not open for further replies.

hungarianhc

Patron
Joined
Mar 11, 2014
Messages
234
Hi There!

I'm working on a little project, and I'm ALMOST there.. I can't seem to get write access to shared folders from the VM.

Here's how I have it set up. I have a dataset on my FreeNAS box. dataset is owned by user "plex" and group "plex".

I do this so I can mount my Plex Metadata folder on that dataset, as opposed to the jail. I use the trick of having the same user / uid and group / gid from the virtual machine match the account on FreeNAS. That works just fine for my Plex jail.

Now I want to access that same folder from within a VirtualBox VM. So... I have a Virtualbox VM, and I use "add storage" to give the virtualbox jail access to the shared folder. That works just fine. I can read / write data from either directly on FreeNAS or within the jail and it shows up properly on the NAS. Now I need to make that folder accessible from a guest VM. So I use the "Shared Folder" functionality of Virtualbox to have it auto-mount the folder within the VM. That works - I can see files in there directly from the VM. HOWEVER, I can't write... I've tried creating a plex user / group with matching uid / gid in the VM, and this doesn't seem to solve the issue. I'm sure I'm just missing something obvious - would love some help here. THANKS!
 

hungarianhc

Patron
Joined
Mar 11, 2014
Messages
234
Add the plex user to the group vboxuser.
Do you mean group vboxsf? That is the available group, and this is the one people mention online. All of my users are a member of the vboxsf group already - i added them when I initially did the setup.
 

NodakBarnes

Dabbler
Joined
Apr 23, 2015
Messages
18
Yeah, that should do it to allow shared folder access. There are some online saying you also need vboxusers (even though it's not created...and it seems like that is more for USB access than shared folder access).
 

hungarianhc

Patron
Joined
Mar 11, 2014
Messages
234
And you made sure to uncheck "Read-only" when setting up the shared folder in VirtualBox?
Yep. This is not checked :).
Perhaps try setting your dataset permissions initially like this and see if that works:
https://www.zufallsheld.de/2013/11/...a-server/#changing-permissions-of-the-storage
Makes sense... make the permissions super lenient... and then walk backwards from there. Will do it now... BRB...

<--- time passing --->

Okay - this totally worked. Now this isn't exactly best practices to have the permissions that wide open... Is there something I'm missing here? I think there may be. Is the user on my VM mapping to the user that runs the virtualbox process? Sigh... Time to do some more digging. Thanks for the help to get started - let me know if you have ideas!
 

hungarianhc

Patron
Joined
Mar 11, 2014
Messages
234
Man, I'm really confused here. I consider myself decent w/ unix permissions, but when we're talking about a dataset being accessed by a jail running a set of VMs w/ users, there's so much nesting that I clearly don't know what's going on.

I've tried changing the group owner of the dataset to vboxsf, and that doesn't seem to fix the issue. I'm not sure what combination to try out. We know it's DEFINITELY a permissions issue because when I set full read/write privs to anyone, then it works just fine. I guess I'll just give that a go for a while. I'm going to post a blog post about it at some point. Maybe someone will help me solve the mystery.
 
Status
Not open for further replies.
Top