Virtualbox, merging snapshots and base disk

mergesnapshotvhdvirtualbox

I have a virtual machine with about 30 snapshots in branches. The current development path is 22 snapshots plus the base disk. The amount of files is seemingly having an impact now on IO and the dev laptop I'm using (don't know if it is host disk performance issues with the 140GB total size over a lot of fragments, or just the fact that it is hitting sectors distributed across a lot of files).

I would like to merge the current development branch of snapshots together with the base disk, but I am unsure if the following command would produce the correct outcome. I am not able to boot this disk after the procedure completes (5-6 hours).

vboxmanage clonehd "C:\VPC-Storage\.VirtualBox\Machines\CRM\Snapshots\{245b27ac-e658-470a-b978-8e62137c33b1}.vhd" "E:\crm-20100624.vhd" --format VHD --type normal

Could anyone confirm if this is the correct approach or not?

Best Answer

What you want to do is from the snapshots dialog, select your parent snapshot that you want to merge all snapshots afterwards to a single VDI.

From your description it sounds like this is the root of the tree.

Right click and select 'Delete Snapshot'.

This will do what you want --- it will merge all the changes from all child snapshots into a single VDI.

Additionally - cloning the disk image that is in the latest snapshot - will also merge the differencing disk with its parent (and its parent, so on, until you get to a 'normal' hard disk type).

I suspect that 'deleting a snapshot' runs the clonehd command.

Check your VM settings (specifically IO APIC enabled/disabled) and make sure they match.

Related Question