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...
0 Answers