VirtualBox error after deleting snapshot

I have a Windows 7 Professional 64-bit virtual machine running on a Ubuntu 14.04LTS. I deleted an old snapshot of this VM. It took over 30 minutes to delete and exactly at the end of the process the laptop unexpectedly shut down. After restarting the laptop, I tried to start the virtual machine and got the error:

Failed to open a session for the virtual machine Main.
Could not open the medium '/home/user/VirtualBox VMs/Main/Snapshots/{eeeeeeeee-ffff-4144-b555-bbbbbb}.vmdk'.
VD: error VERR_FILE_NOT_FOUND opening image file '/home/user/VirtualBox VMs/Main/Snapshots/{eeeeeeeee-ffff-4144-b555-bbbbbb}.vmdk' (VERR_FILE_NOT_FOUND).


Result Code: 
NS_ERROR_FAILURE (0x80004005)
Component: Medium
Interface: IMedium {555bbb-a3a6-4b9b9-4949-acacacac}

Any idea on how to recover it?


Solution 1:

Problem is that once a snapshot file is missing, Virtualbox will not allow you to delete the snapshot from the GUI. To "force-delete" the snapshot you will have to let Virtualbox believe the file is not missing. So just copy an existing one and rename it to the missing file's name. Then u need to set for each new file its correct UUID and its parent UUID. For example:

VBoxManage.exe internalcommands sethduuid "path\{c87e9357-5d1a-4d00-84d8-7b43293ab92e}.vmdk" c87e9357-5d1a-4d00-84d8-7b43293ab92e
VBoxManage.exe internalcommands sethdparentuuid "path\{c87e9357-5d1a-4d00-84d8-7b43293ab92e}.vmdk" c9e9b5a8-fb3f-42f8-aeb7-4458bf92f625

All the missing filenames and their UUIDs you can find in the Virtual Media Manager.

Solution 2:

Ok, I found a solution!

I cloned the corrupted virtual machine with virtualbox manager and the clone started without problems, after it, one of the disks was unreadable, and running a chkdisk /f corrected it.