[Solved] Linux host with 2 user accounts sharing one Guest

This is for discussing general topics about how to use VirtualBox.
vboxmember
Posts: 33
Joined: 19. Apr 2009, 05:08
Primary OS: Ubuntu 8.04
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP

Re: Linux host with 2 user accounts sharing the same WinXP Guest

Post by vboxmember »

[CORRECTION]
In the line that reads:
"Ok, I've just checked the file permissions on the xml file in the machines folder, and when the VM was created VirtualBox assigned owner and group to user1, I changed the group to user2. I'm now going to login to user2's account to see if that did the trick..."

Where it says "...I changed the group to user2.", scratch that because thats NOT what I did. Sorry for any confusion this may have caused I was in a hurry to post my results and I ended up making a mistake. Sure would be nice if there was a way to edit posts after they've already been posted. :idea:

Detailed description:
So because the VM was not showing up in user1's account, I erased the xml file located in the /.VirtualBox/Machines folder. This allowed me to use the existing VDI file (A virtual hard disk located in /.VirtalBox/HardDisks) to create a new VM from the "NEW" button or "CTRL+N" in the main screen of VirtualBox. This essentially replaces the xml file located in /.VirtualBox/Machines with a new one. However VirtualBox will assign the owner and group of that xml file's permissions as the user that created the new xml file via the "NEW" button or "CTRL+N" command. So after the xml file is created it needs to have the "group" property of its permissions changed to "vboxusers" (using the the 'right+click' menu look under permissions tab of the files properties).

Short Description:
Delete the xml file in the /.VirtualBox/Machines directory
Create a new VM, and use an existing VDI file when you do it. (So you can restore the VM you got rid of when you deleted the XML).
Reset the permissions on the newly created XML file (located in /.VirtualBox/Machines/) leave the owner as is, and change the group to "vboxusers".

This concludes the correction to the previous post. Thank you for your time and patients.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Linux host with 2 user accounts sharing the same WinXP Guest

Post by Sasquatch »

You can edit your post. Just check the top right corner of the post. You will see the Edit button there, it's next to the quote button.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
vboxmember
Posts: 33
Joined: 19. Apr 2009, 05:08
Primary OS: Ubuntu 8.04
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP

Re: Linux host with 2 user accounts sharing the same WinXP Guest

Post by vboxmember »

Sasquatch,

Oops, ok I see them now.
Those buttons are completely invisible if the user chooses to view websites with a black background.
I had to change the display options in Firefox in order to see the edit button.
I'm only making this clear in case any one else reading this thread is having the same problem.

P.S. There doesn't seem to be a way to mark this thread as solved because I used all the available space in the subject line when the thread was created.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Linux host with 2 user accounts sharing the same WinXP Guest

Post by Sasquatch »

You can't mark it as solved, you have to edit your first post and change the subject to get the [solved] part in the title. I will do that now for you.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
ogoun
Posts: 8
Joined: 13. Oct 2009, 14:07
Primary OS: Other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: WinXP

Re: Linux host with 2 user accounts sharing the same WinXP Guest

Post by ogoun »

Sasquatch wrote:
The "magic" is in the .VirtualBox folder in your Home folder. If you put that in a generic location, like /home/virtualbox and have the vboxusers group be full owner and read/write permissions. Then you change the location for where VB looks for the settings and VMs by either symlinking to that folder, or simply set the VBOX_USER_HOME variable to that folder.

Good luck.
Sorry for bringing this thread up. The search brings me several threads with this solution.

When I try this I receive the message, that the vdi is already registered in the virtualbox.xml with the same UID.

Here is what I've done:
- mkdir /home/virtualbox
- cp -a /home/user1/.Virtualbox/* /home/virtualbox
- chown and chmod to give the group "vboxusers" full reading and writing permissons.
- Created symlinks in ~/.VirtualBox of user1 and user2

The I tried to add the vdi but both users receive the error message.

TIA for yout help

Ogoun
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Linux host with 2 user accounts sharing the same WinXP Guest

Post by Sasquatch »

ogoun wrote:
Sasquatch wrote:
The "magic" is in the .VirtualBox folder in your Home folder. If you put that in a generic location, like /home/virtualbox and have the vboxusers group be full owner and read/write permissions. Then you change the location for where VB looks for the settings and VMs by either symlinking to that folder, or simply set the VBOX_USER_HOME variable to that folder.

Good luck.
Sorry for bringing this thread up. The search brings me several threads with this solution.

When I try this I receive the message, that the vdi is already registered in the virtualbox.xml with the same UID.

Here is what I've done:
- mkdir /home/virtualbox
- cp -a /home/user1/.Virtualbox/* /home/virtualbox
- chown and chmod to give the group "vboxusers" full reading and writing permissons.
- Created symlinks in ~/.VirtualBox of user1 and user2

The I tried to add the vdi but both users receive the error message.

TIA for yout help

Ogoun
You don't register the VDI again, they are already registered. You only need to modify the files to reflect the new location, full path.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
ogoun
Posts: 8
Joined: 13. Oct 2009, 14:07
Primary OS: Other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: WinXP

Re: [Solved] Linux host with 2 user accounts sharing one Guest

Post by ogoun »

Then I don't get it :(

The original user1s VBox still points to its old path /home/user1/.VirtualBox instead of the new /home/virtualbox

And the user2s VBox only shows me an unstartable VM and the following error message and in the "machine manager" it also points to user2s home instead of the /home/virtualbox :

Code: Select all

Assertion failed at '/home/vbox/tinderbox/3.0-lnx32-rel/src/VBox/Main/MachineImpl.cpp' (5030) in nsresult Machine::loadSettings(bool).
Unexpected exception 'N3xml11EInvalidArgE' (In 'xml::File::File(RTFILE, const char*)', '/home/vbox/tinderbox/3.0-lnx32-rel/src/VBox/Main/xml/xml.cpp' at #207).
Please contact the product vendor!.
Fehlercode:
NS_ERROR_FAILURE (0x80004005)
Komponente:
VirtualBox
Interface:
IVirtualBox {3f4ab53a-199b-4526-a91a-93ff62e456b8}
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: [Solved] Linux host with 2 user accounts sharing one Guest

Post by Sasquatch »

You copied/moved the .VirtualBox folder contents to /home/virtualbox, so even the VirtualBox.xml file is now there. You should have an empty .VirtualBox folder. With that, symlink to the VirtualBox.xml file:

Code: Select all

ln -s /home/virtualbox/VirtualBox.xml /home/user1/.VirtualBox/VirtualBox.xml
Do the same for user2.

Open the VirtualBox.xml file, and check the paths for the files. They should be relative by default, so you have to modify that to have the full path. So, a VM and VDI would have the entries Machines/VM/VM.xml and HardDisks/VM.vdi which need to be changed. Add the full location /home/virtualbox/, so you get a full path noted.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
ogoun
Posts: 8
Joined: 13. Oct 2009, 14:07
Primary OS: Other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: WinXP

Re: [Solved] Linux host with 2 user accounts sharing one Guest

Post by ogoun »

Sasquatch wrote:You copied/moved the .VirtualBox folder contents to /home/virtualbox, so even the VirtualBox.xml file is now there. You should have an empty .VirtualBox folder. With that, symlink to the VirtualBox.xml file:

Code: Select all

ln -s /home/virtualbox/VirtualBox.xml /home/user1/.VirtualBox/VirtualBox.xml
Do the same for user2.

Open the VirtualBox.xml file, and check the paths for the files. They should be relative by default, so you have to modify that to have the full path. So, a VM and VDI would have the entries Machines/VM/VM.xml and HardDisks/VM.vdi which need to be changed. Add the full location /home/virtualbox/, so you get a full path noted.

Ok...I missed to adjust the entries. Thought the relative path can handle this. After a log out and log in it seems to work.

Thanks for your patient help!
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: [Solved] Linux host with 2 user accounts sharing one Guest

Post by Sasquatch »

As you found out, the relative paths can't. Because VB looks for the VirtualBox.xml file in ~/.VirtualBox, it then assumes the machines and hard drives are in that same folder. But because you link to the file that's actually on a different location, those relative paths are no longer valid and no machine or VDI can be found.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
AdamMemon
Posts: 1
Joined: 21. Aug 2012, 07:25

Re: [Solved] Linux host with 2 user accounts sharing one Gue

Post by AdamMemon »

This post was very helpful to me.Thanks a lot for the input guyz..
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: [Solved] Linux host with 2 user accounts sharing one Gue

Post by mpack »

AdamMemon wrote:This post was very helpful to me.Thanks a lot for the input guyz..
Well, just be careful, because the last message (before yours) in this thread is almost 3 years old and some info is obsolete, e.g. default paths and folder names.
Post Reply