Page 1 of 1

Locking .vbox files

Posted: 11. Nov 2015, 18:19
by ChasSoto
Hi. We have a unique situation where we need multiple users on a particular Mac be able to launch the same VM from their own user spaces. I save the VM to a folder in /Users/Shared/VMs, and this directory and all files have User and Group read/write permissions. This works fine, UNTIL someone quits the VM and VBox saves the .vbox file with the current user as the owner and no permissions for Group/Other. This locks out any other user.

What I have found is that if I set the permissions, then add the "Locked" bit (chflags uchg VM.vbox), this prevents the problem.

Does anyone see an issue with this? Is there a way to change the VBox behavior such that it doesn't change the permissions/ownership on the .vbox file?

Thanks,
Charles

Re: Locking .vbox files

Posted: 11. Nov 2015, 18:38
by loukingjr
I don't have more than one user on any of my Macs but, if you select the .vbox file, right click it and choose Get Info, you can change the permissions for "everyone" to Read and Write. Are you saying VirtualBox overrides it?

Re: Locking .vbox files

Posted: 20. Nov 2015, 10:58
by socratis
It's not VirtualBox's problem, it's an OSX problem. It does the same with TextEdit or with a photo or anything else for that matter. The default flag for any new or modified file is to have user-only read-write access. You may need to change the default "umask". For more information, take a look at https://support.apple.com/en-us/HT201684. From the article:
For example, the default umask of 022 results in permissions of 644 on new files and 755 on new folders. Groups and other users can read the files and traverse the folders, but only the owner can make changes.
But be careful if you change the umask you can severely affect the security and stability of your system.