How can I share a virtual machine with virtualbox

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help

How can I share a virtual machine with virtualbox

Postby zenobiaflex on Tue Jul 10, 2007 12:20 am

I finally have all my stuff working for me now, but I realized that my wife's account (and she is the one I have to convince) cannot access the XP machine I created in virtualbox. It is in my home directory, but I'm not sure how to make it accessible to her user account in Mint? If she can still do a few of the things she wants to do in Windows, then she will be sold. I can prove to her that Mint plus the VM loads faster than my old XP partition... but she cannot check her work email via linux... they use LotusNotes and it doesn't seem to like firefox.

After this, I think my last thing will be figuring out how to use iTunes (still do want to use that) and put my collection someplace the VM can see.
zenobiaflex
Level 1
Level 1
 
Posts: 25
Joined: Sat Jun 16, 2007 12:42 am

Linux Mint is funded by ads and donations.
 

Postby Boo on Tue Jul 10, 2007 1:08 am

this is a permissions job.

you will have to allow her user to see your home and rwx the VM dir.

you could do this by changing current permissions or adding her to your group or creating a new group that can rwx the VM dir in your home, and change group the VM dir and below to the new group.

:D
Image
Now where was i going? Oh yes, crazy!
User avatar
Boo
Level 8
Level 8
 
Posts: 2364
Joined: Mon Mar 26, 2007 7:48 am

Postby zenobiaflex on Wed Jul 11, 2007 11:19 pm

Boo wrote:this is a permissions job.

you will have to allow her user to see your home and rwx the VM dir.

you could do this by changing current permissions or adding her to your group or creating a new group that can rwx the VM dir in your home, and change group the VM dir and below to the new group.

:D


I changed the group on the VM dir to be vboxusers since it already existed as something you need for virtualbox... I then set all permissions for the group to match the owner... but in VirtualBox on the other account, no machines show up. I tried creating a new machine selecting the virtual HD then starting it, but the windows loging that pops up won't accept the password.

Also, when my user account does anything with the vm, it adds new files to the directory that don't belong to the new group so the other user can't do anything with them. I search the vbox forum to no avail...
zenobiaflex
Level 1
Level 1
 
Posts: 25
Joined: Sat Jun 16, 2007 12:42 am

Postby Boo on Thu Jul 12, 2007 12:40 am

sounds a bit sticky with that group or not sticky enough.

so set the sticky bit on the group of your VM dir.

sudo chmod -R g+s /home/name/VMdir

this is just like you did before but setting the sticky bit on the group.

this means you will both use the permissions of the owner of the files. It is more complicated than that but there is always google.

:D
Image
Now where was i going? Oh yes, crazy!
User avatar
Boo
Level 8
Level 8
 
Posts: 2364
Joined: Mon Mar 26, 2007 7:48 am

Postby zenobiaflex on Thu Jul 12, 2007 8:58 am

Thanks Boo... I googled the heck out of this one but only found a couple other people with the same question as I. The bright spot in this was that I found the tutorial on file permissions on the Ubuntu site as a result and managed to learn quite a bit in the process... which is always good. On my way to not being a noob!

Ultimately, if this just won't work, I'll just create another vm... it just seemed like an atrocious waste of space, but then again, Linux seems to be so much kinder on the drive space than windows on the best of days so I really ought not worry. I guess it just seems less elegant setting up two virtual machines... but ultimately I probably shouldn't care so much.

I'll try you chmod first to see if I can make it work... I just can't figure out why virtualbox doesn't give you the ability to select an existing machine... I have a feeling I'll run into the same issue when I try to get this setup... perhaps I can dig into the vbox xml file which seems to make everything work and just add the more complete path to the machines then copy that over to the other users directory...

it looks something like this (all from memory so that is why I say something like this)

\machines\name\file

I should just add the path back to the user

user\home\.VirtualBox\machines\file

and see if it works too... hmmmm...
zenobiaflex
Level 1
Level 1
 
Posts: 25
Joined: Sat Jun 16, 2007 12:42 am

Postby stafio on Fri Jul 13, 2007 8:21 pm

Hey zenobiaflex,

I have VirtualBox set up with one virtual machine shared between two users. One thing to note, we haven't both tried using the VM at the same time. I'm not sure if that's safe or not. I've just avoided it.

I created a partition on the hard drive specifically for the virtual machine to live. This allows me to hang on to it easily if I ever re-install (when a new version of Mint is released). I Installed XP via VirtualBox in the partition I created (/media/hda2/). I also created it with a fixed size, which helps improve performance. I assume you're comfortable with that part since you said you had it up and going.

Now for the sharing...
- Go to Administration > Users and Groups
- Click on Manage Groups
- Add a group (I called mine sharedstuff as I share all music and pictures with my fiance)
- In the group properties, add yourself and your wife as members of the group
- Close the Users and Groups management
- Open Nautilus and navigate to where you installed the .vdi VirtualBox disk
- Right click on the .vdi and select Properties
- Click on the Permissions tab in the properties dialog and change the Group to the group you created with yourself and your wife in it. Make sure the Access is set to Read and write.
- Close the properties dialog and Nautilus

Now to set up VirtualBox (from your wife's account)
- Start VirtualBox
- Open the Virtual Disk Manager
- Click Add and browse to the location of the .vdi
- You should be able to add the .vdi. Click ok.
- Click New to Create a New Virtual Machine
- Go through the same steps as you did with yours
- You may get some notices about a first run wizard prompting you to select the install media. Just click through these since the VM is actually set up already.

If all went well, you should boot into the VM.
User avatar
stafio
Level 2
Level 2
 
Posts: 96
Joined: Wed Dec 20, 2006 12:44 am

Postby zenobiaflex on Sun Jul 15, 2007 10:00 am

Thanks for the help guys...

I changed the permissions to make them sticky after googling to see what the chmod that was suggested would do... thanks for that tip! It isn't on the Ubutu permissions guide.

I then realized that I knew why this wasn't working... I had used the snapshot feature earlier. This really messes things up if you want to share a machine. I went back and deleted the snapshots... the reason that the machine wouldn't work at all before was that I was using the old original password. Her account was only seeing the "original state". When I deleted shortcuts and reconfigured the base state... everything works.

So, in short... you need to make a group...change permissions... and not use the shortcuts.

Hope this helps someone else! I'll probably cross-post this to the virtualbox forum since there was no answer over there. Should save someone else the hassle!
zenobiaflex
Level 1
Level 1
 
Posts: 25
Joined: Sat Jun 16, 2007 12:42 am

Linux Mint is funded by ads and donations.
 

Return to Newbie Questions

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 34 guests