Page 1 of 1

Cannot delete snapshot

Posted: 23. Jun 2017, 01:53
by virtualboxnewbie
Dear all,

Host OS:Windows 10
Guest OS:Suse 11 SP4
VirtualBox Version: 5.1.12

I've created this machine sles114-12102-se-si by cloning through another virtual machine which has many snapshots.

I realize that I need to resize one of the disk in sles114-12102-se-si, so next I resize one of the harddisk using VBoxManage modifymedium

after that I delete the snapshot one by one.
when I try to delete the last snapshot it gives me the following error:

Code: Select all

0%...
Progress state: E_FAIL
VBoxManage.exe: error: Snapshot operation failed
VBoxManage.exe: error: Cannot lock hard disk 'F:\yury\virtual_machine\virtualbox\sles114-12102-se-si\sles114-12102-se-si-disk1.vdi' when deleting a snapshot
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component SessionMachine, interface IMachine
VBoxManage.exe: error: --------
VBoxManage.exe: error: Could not open the medium 'F:\yury\virtual_machine\virtualbox\sles114-12102-se-si\Snapshots/{e8e669dc-e65d-4188-a3c9-64b6e3ff1618}.vdi'.
VBoxManage.exe: error: VD: error VERR_FILE_NOT_FOUND opening image file 'F:\yury\virtual_machine\virtualbox\sles114-12102-se-si\Snapshots/{e8e669dc-e65d-4188-a3c9-64b6e3ff1618}.vdi' (VERR_FILE_NOT_FOUND)
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component MediumWrap, interface IMedium
VBoxManage.exe: error: Context: "enum RTEXITCODE __cdecl handleSnapshot(struct HandlerArg *)" at line 533 of file VBoxManageSnapshot.cpp
here's snippet of VBoxManage showvminfo sles114-12102-se-si information

Code: Select all

Storage Controller Bootable (1):        on
IDE (1, 0): Empty
SCSI (0, 0): F:\yury\virtual_machine\virtualbox\sles114-12102-se-si\Snapshots/{e8e669dc-e65d-4188-a3c9-64b6e3ff1618}.vdi (UUID: e8e669dc-e65d-4188-a3c9-64b6e3ff1618)
SCSI (1, 0): F:\yury\virtual_machine\virtualbox\sles114-12102-se-si\Snapshots/{05a6990e-ffbe-4f54-8e27-dee5b69ad5d1}.vdi (UUID: 05a6990e-ffbe-4f54-8e27-dee5b69ad5d1)
SCSI (2, 0): F:\yury\virtual_machine\virtualbox\sles114-12102-se-si\Snapshots/{a0e4fe4c-7037-4ad2-8ce5-aaefd33f936a}.vdi (UUID: a0e4fe4c-7037-4ad2-8ce5-aaefd33f936a)
SCSI (3, 0): F:\yury\virtual_machine\virtualbox\sles114-12102-se-si\Snapshots/{a8b43848-0508-4d65-baff-59ff37d3a3d4}.vdi (UUID: a8b43848-0508-4d65-baff-59ff37d3a3d4)

how should I resolve the above error?

many thanks in advance

Re: Cannot delete snapshot

Posted: 23. Jun 2017, 13:55
by scottgus1
I'm not a big snapshot user, the forum gurus tend to warn against using them.

In the guest's snapshots folder, is there actually a file called "{e8e669dc-e65d-4188-a3c9-64b6e3ff1618}.vdi"? If so, then I would not know why Virtualbox can't find it. Was the guest running at the time? If so maybe that got in the way.

If the file does not actually exist, then there's your problem. How to solve it? Only way I know is to find it in a backup. (And copy everything you do have now to a new backup before you try to change anything.)

Does the guest actually still start and have all of the correct data in it? If so you could skip trying to delete snapshots and use Mpack's CloneVDI to make a new single disk clone of the whole snapshot chain. Follow CloneVDI's Release Notes instructions on how to do this correctly.

Additionally, you may want to reconsider using snapshots. Snapshots make a guest more delicate and do not work as backups. They are similar to Windows' System Restore points: they are point-in-past-time markers, not extractable, useless without the base system in place, but easier to corrupt because the files are accessible on the host drive. They do not store "files", like a backup folder would. Virtualbox snapshots store changed disk sectors, which may or may not contain the entire file. They should only be used on guests you're experimenting with and with data you wouldn't mind losing. (The forums are replete with users destroying their important data because they did something wrong with a snapshot.)

Additionally, each snapshot, if used long enough, has the potential to grow to the final size of the original drive, and will not shrink once another snapshot is taken. The guest's total data size on the host could be many times what it would have been without the snapshots, and with tremendous amounts of dead data that will never be used or changed.