Quickest way to merge snapshots in VirtualBox?

Found the solution. It is as simple as the last step from the commands I wrote here. I.e.

VBoxManage clonehd fullpath/{uuid-of-last-snapshot}.vdi thedisk-full.vdi

So I should clonehd only the last snapshot, not every snapshot from the chain. And it is thousands percent faster.

The uuid can be found from VBoxManage list hdds | grep VmName | tail

In the GUI (on Windows), select the VM, select Snapshots from the top right, right click on the snapshot you want, select Clone..., and select Full Clone in the dialog.


Here's a technique (tested on VirtualBox 4.3.4) that uses the 'Clone' command to merge and compact all the snapshots to a new VM containing a single VDI file:

  1. Rename the VM so you can reuse its current name for cloned VM (you can change the VM name from the 'Basic' tab of the 'General' settings).

  2. Right-click on the VM and run the 'Clone...' command:

    • Set the name to the VM's original name.
    • Accept the remaining defaults i.e. Clone type: 'Full clone'; Snapshots: 'Current machine state'.
  3. Delete the old VM (right-click on the VM and run the 'Remove...' command).


You can try to export to OVF and then import back the generated file.

As explained here:

OVF cannot describe snapshots that were taken for a virtual machine. As a result, when you export a virtual machine that has snapshots, only the current state of the machine will be exported, and the disk images in the export will have a "flattened" state identical to the current state of the virtual machine.

As result you will have a cloned VM with the current state without other snapshots.