trucbidule wrote:What I am still not sure about is : what happens to branches if I decide to delete one or some of them? There are many posts about this subject, but the behaviour - if I understood correctly - has changed with the 3.x+ versions?
Delete Snapshot is the same as the old Discard Snapshot.
The old 'Delete Current Snapshot and State' was different and brain dead and is now gone (yay!)
If a snapshot has 2 or more branches under it (the Current State counts as a branch), then you can't delete that snapshot until you also delete some of the branches.
Things to remember:
- Delete Snapshot never affects the 'Current State': that is always kept the same (same VM setup, same virtual hard disk contents).
- If you delete the first, topmost snapshot, changes made to the base virtual hard disks after that snapshot was taken (but before the immediate child snaphot was taken) are merged back into the base virtual hard disk.
(This is not quite correct, see below.) - When you delete other snapshots, merging happens as well, but between various differencing hard disks, and WHO CARES, just let VirtualBox get on with it... (If you care for the exactly correct gory detail, see below.)
trucbidule wrote:Let's say I delete the "2-5 (windows restarting)" snap of the picture, are some infos merged with nomething else?
In the example, VirtualBox won't let you delete 'Snapshot 2-5 (windows restarted)', because it has two immediate children in the tree: 'Snapshot 2-8' and 'Current State'.
If you were to restore the Current State elsewhere, then the differencing hard disk(s) attached to 'Snapshot 2-5 (windows restarted)' are merged with the differencing hard disk(s) attached to 'Snapshot 2-8', but WHO CARES?
trucbidule wrote:What if I delete the 2-1 "root" branch?
Some merging happens (see above: WHO CARES) and 'Snapshot 2-2 (MSN open again)' is moved up by one to take the place of the 2-1 parent.
* When you delete a snapshot, what is merged into what depends upon what virtual disk files are attached to the snapshot and its immediate child snapshot.
virtual hard disk files attached to a snapshot can be one of 4 types: Normal, Differencing, Immutable, Write-through.
Normal hard disks are usually in the .VirtualBox/HardDisks/ folder.
Differencing hard disks are usually in the .VirtualBox/(machinename)/SnapShots/ folder.
You can see what file is attached to a snapshot using File>Virtual Media Manager...
Suppose Snapshot AAA has an immediate child snapshot BBB.
AAA
|
+--BBB
If snapshot AAA has a Normal hard disk file 'HardDisk.VDI' attached, and snapshot BBB has a differencing hard disk '{99-9-99}.VDI' attached, then deleting AAA will merge '{99–9–99}.VDI' into 'HardDisk.VDI', then delete the '{99–9–99}.VDI' file, then attach 'HardDisk.VDI' to snapshot BBB.
If snapshot AAA has a differencing hard disk file '{11–1–11}.VDI' attached, and snapshot BBB has a differencing hard disk '{99–9–99}.VDI' attached, then deleting AAA will merge '{11–1–11}.VDI' into '{99–9–99}.VDI'.
Differencing hard disks are described further here:
Tutorial: All about VDIs