Differencing disk autoreset off for each user?

Discussions related to using VirtualBox on Windows hosts.
Post Reply
Mulderitey
Posts: 4
Joined: 25. Jan 2016, 16:51

Differencing disk autoreset off for each user?

Post by Mulderitey »

I am setting up VirtualBox to host an immutable VM Linux client on numerous Windows 7 machines in a classroom (the same VM will be copied to each of the workstations C: drives). I will have various domain accounts logging into the machines to use the VM and I want each account to have its own differencing disk with the autoreset set to OFF, so that changes are remembered. I have set the snapshot folder to point to the my documents drive of each user (the H: drive), so their differencing disk is stored in their area.

My problem is I'm unsure how I can set each differencing disk to have the autoreset flag set to OFF. I know this can be done using the command:

VBoxManage modifyhd {uuid} --autoreset off

but because each user's differencing disk will have a unique name I can't see how I can do this automatically via a script.

Does anyone have any suggestions how this can be accomplished?
Many thanks!
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: Differencing disk autorest off for each user?

Post by mpack »

Sounds like you actually needed linked clones, not immutable drives - mutable immutable drives really don't make much sense IMHO.
Mulderitey
Posts: 4
Joined: 25. Jan 2016, 16:51

Re: Differencing disk autoreset off for each user?

Post by Mulderitey »

I was working on the basis that there would be a 'vanilla' clean image on the C: drive which each user has access too but then their changes are stored in a smaller differencing disk. So for what I need this is not the correct way?
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: Differencing disk autoreset off for each user?

Post by scottgus1 »

each user's differencing disk will have a unique name
This might not be necessary. Theory: If the guest is set to look for the base disk in C:\base\basedisk.vdi (should be in the guest's folder) and the differencing disk in H:\MyDiff\Diffdisk.vdi, then the H drive switches to a different folder for each user (the guest must be shut down) then each user should be accessing their own differencing disk. The names and UUIDs of the differencing disks should all be the same, so the guest would find the disk no matter what H drive is being referenced.

Make the base disk on the C drive and an original differencing disk in the H drive. Make sure the guest .vbox is in a place where all users can run it. When you get a new student, and they've logged in, give them a copy of the original differencing disk in their H drive. Perhaps a script could automatically load the copy of the diff disk for each new student. The guest should see the new H drive disk and use it. But when another student logs in on their account, the guest will switch to their disk because it is also on the H drive, with the same name and UUID. The guest must be shut down when switching accounts.
Mulderitey
Posts: 4
Joined: 25. Jan 2016, 16:51

Re: Differencing disk autoreset off for each user?

Post by Mulderitey »

Thank you for your suggestion, I will certainly be giving this a try. Would you say this is better/easier for my needs than using a linked clone, as previously suggested?
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: Differencing disk autoreset off for each user?

Post by scottgus1 »

Good question. Linked clones are separate guests, each showing in the Virtualbox list. I think the immutable/differencing guest would be one guest showing in the list, and with the C & H drives setup each user that starts it would get their own state. It's all theory now, just take a whack and tell us how it works.

PS you may also have to look into setting/changing the VBOX_USER_HOME environment variable to a all-user-accessible folder to allow all users to be able to see the one common list of guest(s).
Mulderitey
Posts: 4
Joined: 25. Jan 2016, 16:51

Re: Differencing disk autoreset off for each user?

Post by Mulderitey »

In relation to what guests are visible to users, as I was thinking of just having the one VM stored on the C: drive which all users would use when logged onto that PC, my thought was to write a .bat file that registers and starts the vm without the user ever seeing the main VirtualBox Manager window:

"C:\Program Files\Oracle\VirtualBox\vboxmanage.exe" registervm "C:\VirtualBox\Linux\Linux.vbox"

"C:\Program Files\Oracle\VirtualBox\vboxmanage.exe" startvm "C:\VirtualBox\Linux\Linux.vbox"

Does that seem feasible?
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: Differencing disk autoreset off for each user?

Post by scottgus1 »

No, I think the registering would fail, because the guest is already registered. You can start the guest without seeing the GUI window with a Vboxmanage command in a script or a desktop shortcut made from the GUI.
Post Reply