Fri Jun 18, 2010
The Discard current snapshot and state command dishappeared as of VirtualBox version 3.1 leaving VirtualBox with no obvious way of deleting snapshot disk state (the misnamed Delete Snapshot command merges the snapshot into the parent). The good news is that you can delete snapshots using the branched snapshots feature introduced in version 3.1.
Note: Throughout this post I use the word delete to mean removing both the snapshot and the associated disk state, I use the word merge to mean deleting the snapshot and merging the associated disk state into the parent (the latter refers to the misname VirtualBox Delete Snapshot command and was discussed in a previous post).
The technique to delete snapshots involves grafting an empty snapshot at the point you want to delete to; merging snapshots down to that point; and finally merging the empty snapshot to its parent. The following screenshots should make the process a bit clearer:
Here’s our starting point – the goal is to delete snapshots 3 and 4.
Restore to snapshot 2.
Graft a snapshot (snapshot 5) to snapshot 2.
Restore back to snapshot 4.
Merge snapshot 4 (i.e. use the VirtualBox Delete Snapshot command).
Merge snapshot 3 (i.e. use the VirtualBox Delete Snapshot command).
Restore to the empty snapshot 5.
Merge the empty snapshot 5 (i.e. use the VirtualBox Delete Snapshot command). This last step effectively deletes snapshots 3 and 4 disk state from snapshot 2.
I discuss merging and compacting Snapshots in this post (which also includes a utility (vboxmerge.py) that I wrote to merge VirtualBox snapshots).