Linked Clones when Full VM is on Read-Only Shares

Discussions related to using VirtualBox on Linux hosts.
Post Reply
Mdk_1309
Posts: 2
Joined: 7. Sep 2022, 11:57

Linked Clones when Full VM is on Read-Only Shares

Post by Mdk_1309 »

I'm teaching a lab where approximately 25 students at the same time build their individual networks with multiple VMs on each lab PC.

My current setup, using VMWare Pro with a lab install, looks as follows:
*) The students log into the Ubuntu clients using LDAP accounts, and get their individual home directories (located at a central NAS) automatically mounted
*) Also automatically at login, a read-only network share, containing fully pre-configured VMs, is mounted
*) This read-only share also contains Linked clones for all the VMs

The workflow is now:
*) Students select the VMs they want and copy the corresponding linked clone to their own lab PC (i.e. to their individual home directory)
*) They start this clone and configure the VM according to the task at hand

Obvious benefits of this approach are:
*) the linked clone is initially very small, so copying it is very fast (usually all 25 students do this nearly simultaneously, putting quite some load on the network)
*) the linked clone only stores the deltas, so storage on the individual home directories is small
*) they can only modify their local copy, the copies on the server stay pristine

Due to licensing issues, I'd like to switch now to an alternative, and I'm basically only aware of Virtual Box. Problem here is: as far as I can tell, for...reasons...Virtual Box needs _write_ access to the Full VM a linked clone is created from, which is neither desirable nor practical in my given setting.

Using VMware Player as an alternative is not possible, since I require the granular network configuration only Workstation Pro (or Virtual Box) offer.

So what I'm now looking for: any suggestions on how I can still achieve my workflow (using Linked Clones where the corresponding Full VMs are on a read-only share)? Or is there a better alternative with the same benefits (small transfer/storage size)?

Best regards
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Linked Clones when Full VM is on Read-Only Shares

Post by mpack »

Mdk_1309 wrote:Problem here is: as far as I can tell, for...reasons...Virtual Box needs _write_ access to the Full VM a linked clone is created from
I do not use differencing images of any sort, so I could be wrong but... I'm pretty sure the quoted statement is not true. All of the shared components not only are frozen, they must be so treated for the feature to work. Now true, "frozen" means to treat as read-only, which doesn't necessary mean that it actually can be read-only - but that would be my expectation.

Once thing I will ask: why do you care? Someone using a linked clone can't modify the original. In fact someone using the original can't modify the original, because the linked original starts using a difference image just like the clones do.

Actually I'll ask a second thing: is the time taken to copy a VM really so significant? IMO this leads to the most robust solution by far - all of these differencing schemes are inherently interdependant and therefore worryingly fragile in my opinion. All to save 10 minutes of copying - and probably less on an academic network.
fth0
Volunteer
Posts: 5677
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Linked Clones when Full VM is on Read-Only Shares

Post by fth0 »

FWIW, I just did a quick test:

I created a VM Test and a VM Test-Clone as a linked clone of it. I stopped the VirtualBox Manager (and implicitly the background VBoxSVC process), made all files and folders of the VM Test read-only, started the VirtualBox Manager again, successfully started the VM Test-Clone and couldn't start the VM Test (as expected).

So it looks like that VM files and folders must only be writable when the VM is to be started, not when it is to be used as a base for a linked clone. I could even read and edit the VM's configuration, just not save it.
Mdk_1309
Posts: 2
Joined: 7. Sep 2022, 11:57

Re: Linked Clones when Full VM is on Read-Only Shares

Post by Mdk_1309 »

Interesting, thanks a lot to both of you for the answers. Re: the "impossible" part: that's what I believed too, however - at least in the version I've tested several months ago - the base VM actually stored information about all the clones linking to it, so it had to be writeable. I even found a forum thread back then confirming this, but I'm unable to find it again. This ticket [1] deals with an additional problem in this setup.

I will try to replicate what you suggested with the most current version.

Concerning the "performance" part: we are talking 10-15 Gigs per VM, 25 users at once, 8-10 VMs each. So even if the bandwith is ok (which is isn't), storage for the individual home directories becomes a challenge.

Best regards

[1] No URLS allowed, so look up Ticket 17487, "Strange behaviour of linked clones.", /ticket/17487
https://www.virtualbox.org/ticket/17487
Last edited by mpack on 7. Sep 2022, 18:01, edited 1 time in total.
Reason: Add link to referenced BugTracker ticket.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Linked Clones when Full VM is on Read-Only Shares

Post by mpack »

That ticket is rather old, so I would not assume that it's still true.
fth0
Volunteer
Posts: 5677
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Linked Clones when Full VM is on Read-Only Shares

Post by fth0 »

It's still the case, and you've found a difference between your and my testing:

When creating a clone VM, the base VM must be writable, but when executing a clone VM, the base VM may be read-only. ;)
Post Reply