2

Here's the situation -

  1. I have a 1TB drive mounted at /data.
  2. There are multiple local users on the desktop. All of them are in the localusers group
  3. I have a virtualbox VM with a 50 GB VDI dsik stored at /data/common/vms

I would like the virtualbox VM to be available to all members of the localusers group.

What I've done so far:

  1. As the primary user, create the VM
  2. Moved the vbox machine folder to /data/common/vbox [so if the machine is Win10Pro, then I have the folder at /data/common/vbox/Win10Pro]
  3. Group Perms - group of the folder to localusers and chmod -R g+rw /data/common/vbox /data/common/vms
  4. Copied over ~/.Virtualbox/Virtualbox.xml and adjusted Default machine folder and machine entry to point to /home/user/VirtualBox VMs.
  5. ln -sf /data/common/vbox/Win10Pro ~/VirtualBox VMs/Win10Pro for each user

The problem

This only works once... If as user X I open virtualbox and launch the machine, then the permissions on the /data/common/Win10Pro/* file(s) revert to rw only for the user after the Virtualbox GUI exits.

PS: Earlier I used toe have the disk formatted as exfat and was able to achieve a shared disk/vm using the uid and gid masks but that doesn't work for ext4.

1 Answer 1

1

for those landing here with a similar predicament, I posted the question on Reddit and was quickly pointed in the right direction

basically:

  1. Set the setgid bit on the shared folder /data/common
  2. Set default acl to rwx for user and group like so: setfacl -d -m u::rwx,g::rwx,o::r-x /data/common

A more detailed walkthrough's available here http://brunogirin.blogspot.com/2010/03/shared-folders-in-ubuntu-with-setgid.html

The article's from 2010 - so the only differences were that I did not have to install any packages or set mount options - ACLs were on by default

2
  • Note, IME this does not work well when you move files in to it. This is partly a regression introduced by systemd --user overriding the "umask". Also, if you move photos into such a shared directory from a camera SD card mounted by udisks, the same problem occurs even without systemd. unix.stackexchange.com/questions/278396/… Also note, if you have the correct umask set as per security.ias.edu/how-and-why-user-private-groups-unix , group writes will be permitted, without needing a default ACL.
    – sourcejedi
    Commented Jun 21, 2018 at 12:11
  • @sourcejedi - Thanks... I'm finding out some of these limitations the hard way. It was way simpler with exfat but it was slow :(. Looks like I can't have my cake and eat it too :(
    – rrr
    Commented Jun 21, 2018 at 13:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .