Sharing guests across multiple host user accounts

Discussions related to using VirtualBox on Windows hosts.
Post Reply
andrewch
Posts: 8
Joined: 4. Dec 2009, 13:38
Primary OS: MS Windows Vista
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: SUSE

Sharing guests across multiple host user accounts

Post by andrewch »

Is it possible to share guest machines between all users on the host machine? (I am using Windows as both host and guest).

The kind of scenario I am looking at is for all users to have a desktop short cut that would launch the same virtual machine. So for example:
- Host user A logs onto host
- Host User A runs the desktop shortcut to run the virtual machine.
- Host User A finishes on the virtual machine
- Host user A logs out of the host

- Host User B logs onto host
- Host user B runs the desktop shortcut to run the same virtual machine that host user A ran. B sees the effects of what A did to that virtual machine (e.g. new files created etc).
...

Is this possible? If necessary I am happy to attempt using the API interface to Virtual Box to achieve the above (but would rather not if it is already easily achievable so other way).

Thanks in advance for your help.
noteirak
Site Moderator
Posts: 5231
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Sharing guests across multiple host user accounts

Post by noteirak »

Short answer : no, it's not possible and will break.

Long answer : Virtualbox is designed that each user has its own VMs and will do some prep & cleanup work on any VM used by a user. This include resetting permissions.
When you share a VM, you keep changing these permissions (among other things) which will cause issues very soon.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
andrewch
Posts: 8
Joined: 4. Dec 2009, 13:38
Primary OS: MS Windows Vista
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: SUSE

Re: Sharing guests across multiple host user accounts

Post by andrewch »

Hello noteirak,

Thank you for taking time to reply. I do appreciate it.

Please let me update you with the results of some experiments I have done.

First, As one user I created a VM (the VM files were placed in a public area), and created a desktop shortcut for the VM (using the VirtualBox Manager "Create Shortcut on Desktop" feature). I then copied that shortcut link so that it would appear for all users (by placing it in C:\Users\Public\Desktop). Then logged in as a different user I tried to run the shortcut. Very much as you predicted this failed to work straight away.

However, I thought I would take a different approach. Instead of using the shortcut created by VirtualBox, I manually created a shortcut to the ".vbox" file. I then copied this shortcut link so that it would be appear for all users. Then logged in as a different user I was able to run the shortcut. The first time I ran it as a different user the VirtualBox Manager appeared with the Virtual Machine listed inside it. The second time I ran the shortcut (and every subsequent time) the Virtual Machine ran up just as I wanted. What is more I have been able to repeat this with a number of different users of the host machine.

I seem to have achieved precisely what I wanted; to be able to share a virtual machine between multiple users (obviously not simultaneously, but I was never after that). My only worrying feeling is that noteirak seemed to be quite certain that this would not work. Have I struck lucky so far, but perhaps am sitting on a time-bomb, or does what I am doing sound like a valid workable solution?

For information, I am using VirtualBox 4.2.12 r84980, running on a Windows 7 host (the guest is Windows XP).

With regards,
Andrew Ch
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: Sharing guests across multiple host user accounts

Post by mpack »

As far as I know there would be no problem doing this from multiple user accounts on a Windows host, provided the VBox software is installed properly for each user. I think this may present greater issues on OS X hosts, maybe Linux too.
andrewch
Posts: 8
Joined: 4. Dec 2009, 13:38
Primary OS: MS Windows Vista
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: SUSE

Re: Sharing guests across multiple host user accounts

Post by andrewch »

Hello mpack,
Thanks for your response.
Regards,
Andrew Ch.
noteirak
Site Moderator
Posts: 5231
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Sharing guests across multiple host user accounts

Post by noteirak »

It all boils down to what permissions the users have on the machine.
VB will reset them, but if people are admin, or you've relaxed the overall permissions, or the VMs are located in a shared location, then yes it would work, since you wouldn't be blocked by permissions.
As mpack pointed it, the effect is much stronger on any UNIX based system, less on Windows, but it could break easily regardless. But that's only a "could", not a "will".
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
jorgensen
Posts: 589
Joined: 20. Oct 2009, 01:22
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows

Re: Sharing guests across multiple host user accounts

Post by jorgensen »

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: Sharing guests across multiple host user accounts

Post by mpack »

noteirak wrote:or the VMs are located in a shared location
I'm taking it for granted that we're discussing a VM folder located in a shared space, and we are not talking about one user accessing anything in a different user's private documents folder.
Post Reply