I have been creating some VMs on the fly: set up one, created a snapshot, made a few changes, cloned it, repeated the process with the clone, and then with a clone of the clone etc.
After cleaning up some unneeded VMs, I now have some disk images in my Virtual Media Manager that are no longer attached to anything but still have child images, so I cannot delete them.
The tree roughly looks like this:
original.vdi
, attached to original VM{08932168-600d-beef-cafe-950824113607.vdi}
, attached to original VM{15552878-d00d-fa1a-fe15-badd0990f00d.vdi}
, not attached (formerly a snapshot of a since-deleted VM){d09905e2-f00d-aca7-1e55-babefee15bad.vdi}
, attached to a still-in-use VM
Now, obviously 15552878
may have some data that is still needed by d09905e2
but not in that image, nor do any of the parent images 08932168
or original
have an up-to-date version of that data, so we can’t simply delete that image.
On the other hand, some of the data 15552878
may be overridden by d09905e2
and thus obsolete, so in theory we should be able to compact 15552878
, dropping these sectors, or merge whatever data in 15552878
is still in use into d09905e2
.
Any way to do that in VirtualBox? I have tried vboxmanage modifyhd ... compact
as well as vboxmanage modifymedium --compact
, both on the unattached image and its child, to no avail – size does not change.