How can one avoid the Failed To Delete The Snapshot error?

Discussions related to using VirtualBox on Windows hosts.
Post Reply
mkamoski
Posts: 18
Joined: 11. Sep 2015, 20:22
Primary OS: MS Windows other
VBox Version: OSE other
Guest OSses: Windows 8.1 + ETC
Location: ZULU-0500
Contact:

How can one avoid the Failed To Delete The Snapshot error?

Post by mkamoski »

Dear VirtualBox Users --

Please help, regarding an issue that I am having trying to delete some of my old Snapshots that I do not need any more and for which I want to reclaim my precious disk space.

The general question is-- Why cannot Vbox delete a snapshot successfully on my vanilla install of vbox 5.02 running on Windows 10 x64 (actual-machine) and a Windows 8.1 VM (virtual-machine)?

Here are the details.

I have several snapshots (SnapshotV01, SnapshotV02, SnapshotV03, SnapshotV04, SnapshotV05) and I want to delete one.

Tried to delete a snapshot, SnapshotV03, and got this...

"
Failed to delete the snapshot SnapshotV03 of the virtual machine MyVmName.
Details.
Result Code: VBOX_E_FILE_ERROR (0x80BB0004)
"

Tried to start my VM from the current state, which is SnapshotV05 and I got the following error...

"
error VERR_FILE_NOT_FOUND opening image file 'C:\Users\mkamoski\VirtualBox VMs\MKAMOSKI-VM-01\Snapshots/{b6e0115e-be20-4d1a-9671-132dc177a5e6}.hdd' (VERR_FILE_NOT_FOUND).
Result Code:
E_FAIL (0x80004005)
Component:
MediumWrap
Interface:
IMedium {4afe423b-43e0-e9d0-82e8-ceb307940dda}
"

Ug, that stinks.

I was trying to follow this from the manual...

https://www.virtualbox.org/manual/ch01. ... s-overview

...which says...

"
You can also delete a snapshot, which will not affect the state of the virtual machine, but only release the files on disk that VirtualBox used to store the snapshot data, thus freeing disk space. To delete a snapshot, right-click on it in the snapshots tree and select "Delete". As of VirtualBox 3.2, snapshots can be deleted even while a machine is running.
"

But that did NOT work in my case, (and Yes I did have the vm Powered Off) and while the process did seem to delete the actual file from the Snapshots hive but very sadly Vbox did NOT put that deleted file in the Recycle Bin-- why oh why, for the love of mercy, why not use the Recycle Bin? Ug. Common mistake among such software and a tragic shame that technology has not caught up to common sense and practicality-- but that's another story.

So, Vbox deleted the file but did not, apparently, tell itself that it deleted the snapshot because when Vbox Mgr was restarted SnapshotV03 was still listed in the Snapshot tree and the vm start process clearly expected that snapshot to still exist-- so vbox did some of the work to delete the snapshot but not all of it and it "forgot" what it did and there was quite confused. So, my VM was broken and would not restore or start to any snapshot.

To "fix" this I copied a snapshot ".hdd" file that was existing, from a snapshot close in time (but not exact) to the hdd snapshot file that vbox was looking for, then I renamed that hdd copy to be the same name as the one that the vbox was confused about, then I started my vbox vm and all was well.

So, I "fixed" this issue as a hack but the questions remain...

- Why cannot vbox delete snapshots successfully?

- What is the prescribed way to safely and reliably discard old snapshots in order to save disk space?

Please advise.

Thanks.

-- Mark Kamoski
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: How can one avoid the Failed To Delete The Snapshot erro

Post by scottgus1 »

If you're trying to get rid of snapshots, you may be better off just cloning the guest, See Mpack's CloneVDI tool, viewtopic.php?f=6&t=22422 I think it can make full single-disk clones from a snapshot chain, assuming the chain is still good.

Also, be sure that you've backed up that guest before trying to change the snapshot arrangement.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: How can one avoid the Failed To Delete The Snapshot erro

Post by mpack »

Well, if you're going to clone it with CloneVDI then in that instance there's no need to make a backup first, because CloneVDI doesn't touch the original files: in essence it makes its own backup.
Post Reply