0

Background:

On my Ubuntu machine, there are two user accounts. In an attempt to allow easy sharing of files and mutual access to virtual machine files, I created a folder called shared at the root directory.

When first using this, I saw immediately that it had just permission for my particular user account, even though it was at root level (makes perfect sense, I just didn't foresee it).

To remedy this I looked online and one sensible solution seemed to be to create a group containing the users I want to access the folder. In this vein, I created the group sharedcontent and added both myself and my partner's account to it. And then I recursively added all files and folders to this group.

Problem:

Under this shared folder is a Windows virtual machine. The issue arises that whenever I actually use VirtualBox to run this machine it seems to alter the permissions on certain files.

If the files begin in the "correct" state (group is set to sharedcontent) and userA uses VirtualBox, as soon as userA logs out and userB logs in, certain files now have owner and group set to userA which means VirtualBox can't access it under this user account.

I've got a temporary solution of running the following command each time either of us wants to use the Windows virtual machine but it's a pain.

sudo find /shared -exec chown currentUser:sharedcontent {} \;

Edit:

Upon further investigation, it looks like even setting the correct group doesn't help. For VirtualBox to work it, it seems to require the current user to be the owner of the virtual machine files...

3
  • I'd go for ACL see askubuntu.com/questions/52584/…
    – Takkat
    Apr 22, 2017 at 10:47
  • I'm not sure that will work based on my discovery that I mentioned in the edit. It seems like VirtualBox gets upset so long as the owner is not the current user, even when the group settings are correct.
    – Geesh_SO
    Apr 22, 2017 at 10:51
  • Although it might fix the issue where VirtualBox changes the permissions when it modifies the files, so the group would always be correct. But I still imagine it wouldn't fix the owner issue.
    – Geesh_SO
    Apr 22, 2017 at 11:03

0

You must log in to answer this question.

Browse other questions tagged .