2

I'm currently running Ubuntu 13.04, and I've got a Windows 8 VirtualBox VM installed. I put the VM's folder in a shared folder (/home/sharedHome/) that has read and write permissions assigned to the vboxusers group. This allows me to launch the VM from my account and my wife can launch it from hers.

The only problem is that when you launch the VM from either account, the permissions get changed so that only that user has read and write privileges on the .vbox file. After this happens, the other account can't launch the VM unless I go in and change the permissions again.

Does anyone know how to prevent VirtualBox from changing the permissions? Is there a better way to share a VM between users?

Thanks!

1

2 Answers 2

1

Here's some conjecture based on the VirtualBox Special Image Write Modes documentation and particularly the warning for sharable hard disk images:

Warning This is an expert feature, and misuse can lead to data loss -- regular filesystems are not prepared to handle simultaneous changes by several parties.

I'm guessing the mode changing is done to make accidental sharing of an image less likely. It should be obvious that chaos would reign if you were to both run the VM at the same time, and changing permissions seems like a cheap-and-easy way to make that less likely to happen my accident.

This does make me wonder what benefit of sharing a VM you are hoping to realize. Why would cloning the base image and using host (not guest) storage for user data files not satisfy? Yes, I know that a Windows installation is absurdly large for compared to an equivalent Ubuntu installation, but you might be trying to out-clever yourself on this one.

Is this even an answer? You decide.

5
  • I'm not concerned with running them both at the same time. In fact, I accidentally tried to run it twice from the same user one time and it wouldn't let me. It gave an error message about the file being locked. My main motivation for sharing the VM is so that my wife and I can both launch Windows when we need to even though we only have one Windows license. I suppose I could have tried cloning the VM so that it thinks it's the same machine for either user. I didn't think of trying that.
    – KevinC
    Sep 6, 2013 at 1:41
  • Since you only have one host, you would only be running one instance of the cloned guest at any time. I am not a lawyer, but that certainly seems in keeping with the spirit of a single windows licence.
    – msw
    Sep 6, 2013 at 3:10
  • I agree with you in principle, but I tried running it where I had a VM in my home directory and a VM in my wife's home directory. Both VMs were pointing to the same virtual disc so they were booting the same files, etc. When I launched the VM from my account the Windows 8 environment was fine, but when I launched it from my wife's account it had a notification saying that it needed to be activated and it locked down a bunch of the features. Whatever Windows 8 is doing to detect the hardware is showing those two VMs as different machines that would each require a license.
    – KevinC
    Sep 6, 2013 at 13:59
  • On second thought, when I tried that approach, I didn't clone the original, I just pointed a new one to the same disc. I'll try it again using a clone of the first VM and see what it does.
    – KevinC
    Sep 6, 2013 at 14:00
  • Well, I know this doesn't help anyone else looking at this problem, but I decided to just punt on sharing the VM. I don't ever really need to boot to Windows, so I just installed it under my wife's user name.
    – KevinC
    Sep 7, 2013 at 0:13
0

I had the same requirements (VM shared between two users) and the same problem (.vbox file with rw permission only to the last user of the VM).

To workaround this issue I created a vbox file for each user in the same folder (lets call them, for instance, xp_user1.vbox and xp_user2.vbox).

This would be the procedure:

  1. (user1) Create the VM. The VM, its snapshots and the .vbox file have to be stored in a directory that can be accessed by both users (File|Preferences, Machine|Configuration).
  2. (user2) Create the .vbox copy:

    cp xp_user1.vbox xp_user2.vbox

  3. (user2) Create the shared VM

    Select the Machine|Add... menu item, navigate to the xp_user2.vbox location, and select that file.

    In File|Preferences, set the default machine path to the .vbox location

Considerations:

  • If a snapshot is taken, the .vbox copy has to be updated

  • If one user restores a snapshot, the previous active one looses rw permissions for the other user. Assuming both users belong to the same group:

    chmod 0660 snapshot
    
  • I tried to store the .vbox files at different directories but it did not work (location issues).

6
  • What are you doing to keep the files synced?
    – KevinC
    Mar 25, 2015 at 12:58
  • Only the .vbox files have to be synced and just in case a snapshot is taken. Since snapshots are seldom done, I update the .vbox copy manually.
    – chus
    Mar 25, 2015 at 13:21
  • My concern with that is that files created by one user wouldn't be available to the other user until you synced up the .vbox files. Couldn't you do this with hardlinks to make sure they're always synced?
    – KevinC
    Mar 26, 2015 at 13:02
  • If you refer to files created at a VM, there is no problem, because they are stored at the .vmdk file pointed by both .vbox files.
    – chus
    Mar 26, 2015 at 13:15
  • Is the .vmdk file the same thing as the .vdi file? It looks like it is based on your description, but my VirtualBox VMs don't have any vmdk files.
    – KevinC
    Mar 30, 2015 at 1:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .