Page 1 of 1
Sharing a VM
Posted: 25. Jan 2009, 13:46
by solanum
I have XP installed in a VM on linux (Mandriva 2009) using virtualbox. (I was using the free vmware server, but have found the performance has just got worse and worse. Virtualbox seems a LOT faster).
My missus and I share our main PC and usually both have a kde desktop up on different virtual terminals, so we can ctrl-alt-F* between desktops. What I would like to do is have a shared winXP VM with read/write access for both users. Ideally, with simulataneuos access possible so that we can use the winxp 'switch users' feature when we switch linux desktops (if only it was as good as the Linux way....).
So firstly, is this possible? And secondly how should I set it up? I haven't seen a guide on the virtualbox site to do that, but feel free to point me to one.
If I can't do this then what is the best way to set the vm up to be accessible by both users (but not simultaneously)?
Posted: 25. Jan 2009, 16:50
by Sasquatch
Two users can access the same VM, but not at the same time. That will cause violations in the file access. To get this setup to work, you need a usergroup (vboxusers can be used for this) that both of you are a member of, and a common location for the settings.
Now, create a new folder in your /home folder. Call it whatever you want, but for now, let's call it 'vm'. Change the ownership to the vboxuser group. sudo chown :vboxusers /home/vm.
Copy or move the VM to the new location. It's best to keep it in a subfolder, so you have /home/vm/virtualbox.
You now have to options. Either keep the settings and all other VMs per user, or set them to be shared. Setting it shared will prevent certain settings mistakes, but all VMs you have, will also show up for the other user.
To make it shared, be sure to have all the needed files in the proper location. Now that you have that set, create two symlinks, one in each home folder. sudo ln -s /home/vm/virtualbox /home/<user>/.VirtualBox. Run it for each user. You have to either rename or remove the existing .VirtualBox folder in the user profiles.
Now if you want to run that VM from both users at the same time, you can use the VRDP option to take control of the VM. The other user can still use it normally, it won't get locked or whatever. You can also use VNC, but I don't really like that as it can be slower than RDP.
Posted: 26. Jan 2009, 00:58
by solanum
Thanks, that's similar to how I had VMWare set up, and it seems to work fine. BTW I'm using the open source version of VBox so I don't think it has the VRDP support (or USB for that matter).
I still can't believe how much better the performance is than vmware server.....
Posted: 26. Jan 2009, 03:57
by solanum
Or maybe it doesn't quite work....
For anyone trying to set up a similar installation, you might want to be aware of a bug in VirtualBox (1260), that means that when a user runs it, the state is saved with permissions as 0600 instead of 0661 (or whatever umask is in force). VirtualBox is ignoring umask, which means that when another user tries to run the vm they can't because they can't access the current state of the vm without changing the file permissions first....
A very basic bug that hasn't been addressed a year after being reported. Anyone would think that Sun didn't want people using virtualbox for shared use of a vm.....