Page 1 of 1

Share VM between two Mac OS X users

Posted: 30. Jul 2008, 22:04
by moojoo
Hi there,

i'm totally new to VirtualBox but i'm very impressed by both the software and the community around it. I want to give VirtualBox a try against my current solution based on Parallels.

But my greatest challenge is to share the same VM with my wife on the same computer. I found a way to use the same disk image with two different VMs but this does not solve my problem.

We make intensive use of the suspend feature. For example I suspend the VM and my wife wakes it up and sees the guest system in the state I have left it. So we need the same VM in use but I can't get this to work for me...

When I create a VM on my account and change to my wife's I don't see any VMs in the list.

Can anyone help me?

Best regards
moojoo

Posted: 30. Jul 2008, 22:28
by Technologov
I'm in no way Mac expert, but I still try to help...

I believe it is possible by using some shared folder on Mac OS X.
Is there such thing on OS X ?
How do you share pictures and data between users?
(same way should work with VirtualBox - basically you need to share the virtual hard disk *.vdi)

-Technologov

Posted: 31. Jul 2008, 08:15
by moojoo
Hi Technologov,

thanks for your reply. Yes there's a shared folder concept on Mac OS X and it's freely configurable with Access Control Lists. I'm also able to share the *.vdi-file with this concept.

But when I create a VM using the shared vdi-file, I don't see the VM on the other account. I can create a second VM that uses the shared vdi-file but that's not what I need, because of the pause/resume-issue.

-moojoo

Posted: 31. Jul 2008, 10:16
by h1d
In VBox preference, set the folder to store the guest configuration to the common shared folder and create a new guest with the existing vdi. I guess something crazy can happen if you run another VBox with fast user switch on same vdi while one is running though.

Posted: 31. Jul 2008, 20:56
by moojoo
Hi folks,

thank you for your help but nothing helped out yet. But I found a solution on my own and I think this solution works:

Every User has a VirtualBox.xml within his Library-folder on Mac OS X. So I copied my VirtualBox.xml to the Shared folder and created a symbolic link (in Terminal with the "ln"-command) to the file on my Library-folder and on the folder of my wife.

Since then the VBox GUI shows up the configured VMs in both accounts and I am able to start and suspend the machine from within every account. I'm quite happy with this solution.

@h1d: I never gonna start the same VM or two VMs with same VDI at one time - we have one rule: everytime we finished our work in the VM we have to suspend it and quit the application...

-moojoo

Thanks Moojoo!!

Posted: 12. Aug 2008, 22:52
by knowtown
That is exactly what I was looking for. I cannot wait to try it tonight.

Re: Share VM between two Mac OS X users

Posted: 28. Mar 2009, 17:34
by wayneham
moojoo: working on this but can you give more detail on the Terminal command for symbolic link? I've tried a Finder alias and that does not work.

Re: Share VM between two Mac OS X users

Posted: 28. Mar 2009, 22:35
by moojoo
Just open the Terminal, move to Library/VirtualBox/ and type

Code: Select all

ln -s [fullpathtoyoursharedvirtualbox.xml]
In my case this is

Code: Select all

ln -s /Users/Shared/VirtualBox/VirtualBox.xml
This will create a symbolic link in the current directory. A symbolic link is treated like the physical file from the OS.
Good luck
Achim

Re: Share VM between two Mac OS X users

Posted: 25. Oct 2009, 14:56
by marcelo1402
Moojoo thank for your help but i didn't get success with ln -s command. It return a error message - ln: ./virtualbox.xml: File exists.
I thought that with this message problem was solved, but when i log on with my wife account i didn't find VM. Could you help me?

Re: Share VM between two Mac OS X users

Posted: 26. Oct 2009, 19:11
by vmmaestro
The simplest way:
- Place YourVM.VDI + YourVM.XML for your VM in shared folder that is outside of the User directories.
- Edit\Copy the User\Name\Library\Virtualbox\VirtualBox.xlm file so it is the same for both users.
Everything should work fine.

Re: Share VM between two Mac OS X users

Posted: 27. Oct 2009, 10:38
by moojoo
marcelo1402 wrote:Moojoo thank for your help but i didn't get success with ln -s command. It return a error message - ln: ./virtualbox.xml: File exists.
I thought that with this message problem was solved, but when i log on with my wife account i didn't find VM. Could you help me?
It's exactly the problem as described in the error message: the file already exists. So you have to delete the virtualbox.xml file first (You can use Finder if you don't know how to do this in Terminal). After that, the creation of a symbolic link will be successful.

Achim

Re: Share VM between two Mac OS X users

Posted: 19. Feb 2010, 16:38
by jmscholen
I am trying to do the same thing, but I get an error when I try and start up VB in the other users account....do I need to install windows on the other users account first before I create the link to the shared folder?

The error I get: Failed to create the VirtualBox COM object.

Re: Share VM between two Mac OS X users

Posted: 1. Nov 2011, 18:34
by OCR14a
I'm trying to do the same thing, but I need a solution in which I can just set it once, for everyone.
I can't keep going back in and editing or copying/pasting files around every time a new user logs into the Mac.

Is there a way of just setting up a VM that can be used by ANYONE/EVERYONE?

Re: Share VM between two Mac OS X users

Posted: 1. Nov 2011, 19:37
by OCR14a
I figured out a limited-solution...


1. create a folder where you will store the VM and all related files to be shared with all users later. This folder can be anywhere, but higher in the hierarchy makes it less complicated to set permissions on. I put mine at the root of the HD, and named it 'VirtualMachines'

2. Move the vdisk file into the newly created folder. In my case, that is the .vdi file associated with the VM. Previously, it resided in the following location…
/users/username/virtualbox vas

3. Move all necessary related files into the 'shared folder'…
a. /users/username/virtualbox vms/vmName.vbox
b. /users/username/library/virtualbox/virtualbox.xml

4. Create a group in 'Accounts' that will be used to give users access to the VM/s (I named my group 'VMGroup'), and place all relevant users into that new group.

5. Change permissions on the 'shared folder' so that 'VMGroup' has read/write access to the folder.

6. Set the permissions to propagate to all child objects with the 'Apply to enclosed items' option.

7. Edit the two files (vmName.xml and vmName.vbox) to make sure the paths all line up correctly with their new homes. You'll just have to open the two files in text editor and look for obvious paths, and change them to match where they are actually located now after you moved them to the 'shared folder'.

8. Add VM for each user
Now, when a new user wants to use the VM, they just have to 'Add' it via the 'Machine' menu within VirtualBox (i.e. NOT 'New' or 'Import', or anything else, but 'ADD').

Now they can all use the same VM.

Of course, it would be nice if there were a way to do it so that I don't even have to help each use 'ADD' the VM, but at least this is better than having to go in and reconfigure all of the settings for each and every new user.

If you have a way of configuring it so that the VM will automatically show up for each and every new user when they first open VirtualBox, please let me know.

Thanks.