Page 1 of 1
Delete Snapshot without reverting to old version
Posted: 4. Jan 2020, 02:04
by MarkFoley
I experimented with snapshot a while back and decided not to use them. Currently in my VirtualBox VMs directory I have:
-rw------- 1 mfoley users 56G Mar 21 2018 WIN7VM.vdi
WIN7VM/Snapshots:
-rw------- 1 mfoley users 80G Jan 3 18:57 {ee97dda2-5ac1-4f37-9196-5acbcfbfcec1}.vdi
As you can see, the "snapshot" is 86G and dated today. The original WIN7VM.vdi is 56G and dated March, 2018, probably from back when I originally created the snapshot. Having both files on my drive chews up a lot of space. I want to get rid of either the snapshot file, or the WIN7VM.vdi file and just have the one. Various posts I've read lead me to believe that if I deleted the snapshot, I'll end up reverting back to the 2018 file, which I certainly don't want to do. Is there a way to accomplish what I want?
Re: Delete Snapshot without reverting to old version
Posted: 4. Jan 2020, 11:57
by mpack
MarkFoley wrote:Various posts I've read lead me to believe that if I deleted the snapshot, I'll end up reverting back to the 2018 file
I don't know where you read that. Delete and revert are separate operations.
Conceptually, snapshots are just markers on a timeline. Deleting a marker loses you the ability to revert to that moment in time, it does not alter the current state.
That said, snapshots are dangerous, fragile, bug prone. It would do no harm to make a backup of your VM before you start.
Another possibility is to clone the VM, current state only, which will completely eliminate the taint of snapshots from the VM, however you have to be careful not to affect Windows activation, or be prepared to reactivate. Again, backups, good idea.
Re: Delete Snapshot without reverting to old version
Posted: 5. Jan 2020, 03:05
by MarkFoley
Well, I've read that in various posts, including here on virtualbox.org, but it's entirely possible I didn't understand what I was reading.
And, likewise with your reply (thanks, BTW), I'm not sure of what you are advising me. I do have a backup of the VM, but still not sure of how you are advising me to be rid of, or consolidate, the snapshot. It appears that all updates to the VM have been done only to the snapshot and that the original .vdi file has remained untouched since 2018.
So, are you suggesting that in order to do what I want I should clone the VM?
Re: Delete Snapshot without reverting to old version
Posted: 5. Jan 2020, 11:05
by mpack
Use the UI to delete all the snapshot(s). As I said, deleting a snapshot does not delete any data, it only deletes a marker from a timeline.
You say you already made a backup, and presumably you know how to restore from one, so I don't understand the hesitation.
Re: Delete Snapshot without reverting to old version
Posted: 5. Jan 2020, 16:33
by scottgus1
The terminology of Virtualbox snapshots is confusing to me too. "Deleting" a snapshot sounds to me like getting rid of everything in it, as in it's destroyed, gone, deleted. But it's really a Merge. The data in the snapshot gets merged into the previous snapshot or base disk. And the ability to pick that particular point in time in the life of the guest gets 'deleted', as Mpack says.
As far as I understand snapshots, the only time data is lost (aside from merely doing something wrong with them, which seems to happen rather a lot) is when one 'restores' to another snapshot and does not allow the 'current state' of the guest to be saved into another snapshot. That 'current state' is then lost.
If the guest is fully shut down from within the guest OS, not save-stated through Virtualbox, then a perfect backup is a complete copy of the whole guest folder and all files therein. If guest disk files are saved in other folders these have to be backed up too. You can FC file-compare the copies to confirm the backup integrity. Then 'delete' the snapshots to your heart's content. If anything goes wrong, copy the backup over the original location and you're back to where you started.
Re: Delete Snapshot without reverting to old version
Posted: 5. Jan 2020, 17:13
by mpack
scottgus1 wrote:But it's really a Merge.
Actually it isn't.

That terminology assumes a particular implementation of snapshots that a user shouldn't be required to know anything about, and isn't necessarily fixed in stone anyway.
Personally I believe the basic problem is that the "snapshots" feature was misnamed from day one, as the similarity to photography is too weak to add understanding. I would have used the term "Timelines", and the available operations would be "create a timeline marker", "delete a timeline marker", "revert to a timeline marker (keep later states)", and "revert to a timeline marker (discard later states)". Or maybe I'd make the effect of the last two more explicit, i.e. "Create a timeline branch at this marker" and "Reset VM to timeline marker".
I have no place for the word "merge" I'm afraid.

[SOLVED] Re: Delete Snapshot without reverting to old version
Posted: 8. Jan 2020, 05:56
by MarkFoley
mpack: my "hesitation" was that in my reading it was unclear to me that changes would be "merged" back to the .vdi file. Even though I have a backup (I've been doing such per scottgus1's comment and have done plenty of restores) I didn't want to waste my time deleting the snapshot if I simply ended up having to restore things back. scottgus1's post clarified the process and reassured me, so I went ahead and deleted the snapshot (after another backup) and all appears to be well. BTW - the 'Delete Snapshot' dialogue on the Virtual Box Manager does use the term "merge" to describe the operation.
Issue resolved!