Multiple levels of linked clones?

This is for discussing general topics about how to use VirtualBox.
Post Reply
janvanveldhuizen
Posts: 4
Joined: 24. Oct 2018, 22:00

Multiple levels of linked clones?

Post by janvanveldhuizen »

Has anyone experience making linked clones with more than one level of cloning?

Like having a clean Windows10 machine as a base machine.
Then making for example two linked clones where I set up Visual Studio 2015 and Visual Studio 2017.
After that I could again make linked clones for different development projects.
This would save a lot of disk space.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Multiple levels of linked clones?

Post by socratis »

Can't say that I've heard it, but I have one piece of advice, just like every other feature not well tested/understood; try it on a throw away VM. Don't test it on something that you're not willing to lose.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
janvanveldhuizen
Posts: 4
Joined: 24. Oct 2018, 22:00

Re: Multiple levels of linked clones?

Post by janvanveldhuizen »

I did a few tests. It seems to work fine to create linked clones to several levels.
You can even use the intermediate VM's, and what you do on that machine will not be reflected onto the clones, because they rely on the snapshot that was made at the time you cloned the machine.

I even tested what happens when you remove the middle VM in a chain of three linked clones.
So I had a Base VM (1), a linked clone from that one: Base Clone (2), and again made a linked clone of it: Base Clone Clone (3).
I removed VM 2. You should never do that, but it was just for the sake of this test.
VirtualBox popped up an error message saying that it couldn't fully delete the machine.
What happened was that all files were removed, except for the snapshot vmdk file.
I started VM 3, and look, it still works!! :-)
So... we shouldn't rely on this behavior, but it is quite fortunate that VB keeps the chain intact in case you accidentally remove the wrong machine.

This means that I can implement the chain of machines I was thinking of, and still not use all my disk space for saving virtual drives.
This is great.

Now I still have one other thing on my wish-list, but that is off topic here. How to create a linked clone from another VM with Vagrant, instead of using a vagrant box as a starting point all the time....
Post Reply