﻿id	summary	reporter	owner	description	type	status	component	version	resolution	keywords	cc	guest	host
7198	sharing guest impossible because xml settings files written in mode 600 instead of 660	jeff stern		"(this is with linux/ubuntu host and windowsxp guest, with vbox 3.2.6 -- not the OSE, but the linux host downloaded from http://www.virtualbox.org/wiki/Linux_Downloads for ubuntu 10.04 AMD64.)

i noticed that Virtualbox writes its .xml config files in the {{{~/.VirtualBox}}} and {{{~/.VirtualBox/Machines/MACHINE_NAME}}} directories in mode 600, which makes it impossible to share a virtualbox guest between users on the same system.  they should be written in mode '660'.

furthermore, if i as root correct the permissions to be 660 on the 2 relevant .xml files contained in these directories, then the next time VirtualBox is run for this guest, these 2 .xml files will unfortunately have their permissions re-set to 600. :o(

this shared setup worked successfully for me using the 3.1.6 OSE version from ubuntu -- i did not have this problem with the OSE.  now that i've upgraded (in an attempt to get access to my USB devices), i can't share the guest between the 2 users.

my use case:

if i have two users on my home box: usera and userb.  both users belong to group 'users'.  i have {{{/home/usera/.VirtualBox}}} and {{{/home/userb/.VirtualBox}}} both sym-linked to {{{/home/virtualbox/.VirtualBox}}}, and {{{/home/virtualbox/.VirtualBox}}} is group-owned by 'users' and has the setgid bit set so it is in mode 2775.  thus, every file and sub-directory created under it should belong to group 'users' (and this is true).  my vbox name is 'WindowsXP'.

the problem is that if usera uses the system, then, in the {{{/home/virtualbox/.VirtualBox}}} directory, the {{{VirtualBox.xml}}} file will have its permissions set to 600 when they should be 660:
{{{
-rw------- 1 usera  users     2261 2010-07-18 11:58 VirtualBox.xml
}}}
now only usera can use the system.

now if usera shuts down the guest and logs off and userb signs in and tries to access the guest, userb will get a dialogbox popping up saying:
{{{
VirtualBox - Critical Error
-------------------------------
Failed to create the VirtualBox COM object.
The application will now terminate.
Runtime error opening '/home/userb/.VirtualBox/VirtualBox.xml' for reading: -38 (Access denied.).
/home/vbox/vbox-3.2.6/src/VBox/Main/VirtualBoxImpl.cpp[535] (nsresult VirtualBox::init()).
}}}
and in the Details of that dialog box, it says:
{{{
Result Code: NS_ERROR_FAILURE (0x80004005)
Component: VirtualBox
Interface: IVirtualBox {3f36e024-7fed-4f20-a02c-9158a82b44e6}
}}}
(note that {{{/home/userb/.VirtualBox/VirtualBox.xml}}} is really {{{/home/virtualbox/.VirtualBox/VirtualBox.xml}}})

now if i try to reset the file permissions on the {{{/home/virtualbox/.VirtualBox/VirtualBox.xml}}} file:
{{{
$ chmod 660 /home/virtualbox/.VirtualBox/VirtualBox.xml
}}}
it makes that error go away, but now userb will get another, similar message, about the {{{/home/userb/.VirtualBox/Machines/WindowsXP/WindowsXP.xml}}} file (which of course is really {{{/home/virtualbox/.VirtualBox/Machines/WindowsXP/WindowsXP.xml}}}).

so i reset that 2nd XML file to mode 660 as well:
{{{
$ chmod 660 /home/virtualbox/.VirtualBox/Machines/WindowsXP/WindowsXP.xml
}}}

so that that file (which also belongs to 'users' group already) is accessible, now userb can fire up the WindowsXP guest. (assuming of course, that usera has shut down the guest from their side first).

however, now the reverse is true:  after userb has used the guest, VirtualBox has rewritten those files and reset their mode to 600 so that they are not accessible by the group, only owner. so now usera cannot use the system.  these files should be preserved in mode 660.

please let me know if there is a simple config to override this, or if i'm missing something super-obvious (most usually am :-) ) or if you need any more information, and thanks."	defect	closed	other	VirtualBox 3.2.6	invalid			Windows	Linux
