vbox owner changed after using with multiple users

Discussions related to using VirtualBox on Linux hosts.
Post Reply
farkas
Posts: 37
Joined: 5. Mar 2015, 09:16

vbox owner changed after using with multiple users

Post by farkas »

Hi,

I have started to use a common guest vm on a shared host desktop computer.
Users launch the vm on different days.
user1 was the owner of all the files in the folder of the vm.
two days ago user2 turned on the VM tested it then turned off.
today user1 was not able to use the same vm - it was reported as unaccessible by vm manager.
cheched the files and all was there but the .vob and .vbox-prev files changed. Their owner is now the user2.

I think this is a bug.
Why owner has changed? user2 already had read-write access to the files?
farkas
Posts: 37
Joined: 5. Mar 2015, 09:16

Re: vbox owner changed after using with multiple users

Post by farkas »

my version is
VirtualBox Graphical User Interface
Version 5.0.26 r108824
Copyright © 2016 Oracle Corporation and/or its affiliates. All rights reserved.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: vbox owner changed after using with multiple users

Post by socratis »

Unfortunately, this is not due to VirtualBox's behavior. This is your OS doing all the ownership/permissions. You have to search for your specific operating system (you never mentioned it) on how to implement shared files where the users can "share" each other's changes. Maybe it's good enough if you simply give the 'group' of the users read-write access.

On my OSX host, you have to change the 'umask'. The method varies, depending on the OSX version. For OSX this changes the global behavior of the system, so I haven't done it. Plus it doesn't actually work...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
farkas
Posts: 37
Joined: 5. Mar 2015, 09:16

Re: vbox owner changed after using with multiple users

Post by farkas »

I have a:
Linux 4.4.0-38-generic #57-Ubuntu SMP Tue Sep 6 15:42:33 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

I have found a workaround, created a separate copy of the vbox for all the users.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: vbox owner changed after using with multiple users

Post by socratis »

As long as there is no snapshots or earth-shattering changes, that could work, although I expect turbulence. By "earth-shattering changes" I mean anything vital to the VM: RAM, vRAM, hardware acceleration, hard drives, CDs, RAM, shares appearing/disappearing, USB filters, audio. You know... the details.

Why don't you simply give the whole folder/subfolders "group+rwx" and be done with it?
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
farkas
Posts: 37
Joined: 5. Mar 2015, 09:16

Re: vbox owner changed after using with multiple users

Post by farkas »

tried it but not working.
created a common group called vboxshare
assigned all users
changed the vbox folder permission to vboxshare+rw
Using a single vbox file has the above mentioned problem
after user1 launched the vm, she will be the owner of the common vbox file.
user 2 cannot use the same vbox file. VM is unaccesiible for her.

So I will use the 2 vbox file for the same vm
Martin
Volunteer
Posts: 2562
Joined: 30. May 2007, 18:05
Primary OS: Fedora other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: XP, Win7, Win10, Linux, OS/2

Re: vbox owner changed after using with multiple users

Post by Martin »

Vbox is designed as a single user application and makes sure that the relevant files belong to the user. ;)
When you get outside the design specification you need to use some tricks to work around this.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: vbox owner changed after using with multiple users

Post by socratis »

Martin wrote:Vbox is designed as a single user application
This I agree with. And that, only in the sense that you cannot have multiple users running the same VM with the default setup concurrently. You can however set it up with immutable images and different snapshot directories and actually make it work. Of course, technically, it's not the same VM, but you get my drift.
Martin wrote:and makes sure that the relevant files belong to the user.
This I don't agree with. VirtualBox does not set or change permissions. It couldn't care less. It's the host that's doing this. For example VirtualBox has no problem whatsoever working with a similar scenario on a Windows host (I just tried it). It's the POSIX hosts that are having "trouble" with shared files/folders.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Martin
Volunteer
Posts: 2562
Joined: 30. May 2007, 18:05
Primary OS: Fedora other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: XP, Win7, Win10, Linux, OS/2

Re: vbox owner changed after using with multiple users

Post by Martin »

My "interpretation" is that Vbox just uses standard linux functions to recreate the files from a process running under the current user account.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: vbox owner changed after using with multiple users

Post by socratis »

Exactly right! The problem as I mentioned is the creation permissions mask of the underlying OS.

So, for example the 'umask' for newly created files on OSX (that I'm mostly familiar with) is 0228 and if you combine it with the default create permissions of 7778 you get a file with 7558 or else, 'rwxr-xr-x', aka read-write for the owner and read-only for everyone else. If you want to change that, you'll have to change it throughout the system. Bummer...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Martin
Volunteer
Posts: 2562
Joined: 30. May 2007, 18:05
Primary OS: Fedora other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: XP, Win7, Win10, Linux, OS/2

Re: vbox owner changed after using with multiple users

Post by Martin »

Yes, this way you could change access rights for the group, but Vbox would still change the file owner to the last user accessing the file.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: vbox owner changed after using with multiple users

Post by socratis »

No, it's not about accessing a file, it's about creating a new file. Actually if I'm not mistaken it goes like:
- Create ".vbox-temp" to keep any run-time changes (owner is the user that runs VirtualBox).
- After it's done, remove ".vbox-prev". Rename ".vbox" to ."vbox-prev".
- Rename ".vbox-temp" to ".vbox".
So, the".vbox" is not simply accessed, it's created as ".vbox-temp" and then renamed to ".vbox".
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
farkas
Posts: 37
Joined: 5. Mar 2015, 09:16

Re: vbox owner changed after using with multiple users

Post by farkas »

Seems to me the creation of duplicates of vbox with the same content prefixed or suffixed with username like:
W10User1.vbox
W10User2.vbox
is a good solution.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: vbox owner changed after using with multiple users

Post by socratis »

I highly doubt that this will be implemented, as VirtualBox documents (VMs) are, by design, not to be shared. If you want to use VirtualBox in an unsupported fashion, you have to sure that it works, i.e. hack your system's setup so that it covers the scenario you've envisioned. But, you can always try to make a suggestion in the "Suggestions" sub-forum...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
farkas
Posts: 37
Joined: 5. Mar 2015, 09:16

Re: vbox owner changed after using with multiple users

Post by farkas »

Thanks for the info about how this file handling works, and why the owner changed.
Post Reply