Deleted VM snapshots in file manager and broke my VM

I have a tree that looks like this:

Snapshots

While making a backup, i noticed that these snapshots take up a ton of space! I deleted everything except the 2 most recent files, one being 7.8GB and the other one 2MB. I deleted the files from the file manager, not the app.

Now trying to run the VM, i get this:

Could not open the medium 'C:\Users\qwerty\VirtualBox VMs\Ubuntu 20\Snapshots/{8ba72d7a-5f5a-499c-9258-b1ff77e9c0cc}.vdi'.

VD: error VERR_FILE_NOT_FOUND opening image file 'C:\Users\qwerty\VirtualBox VMs\Ubuntu 20\Snapshots/{8ba72d7a-5f5a-499c-9258-b1ff77e9c0cc}.vdi' (VERR_FILE_NOT_FOUND).

Trying to delete the snapshots from the app looks the same:

Cannot lock hard disk 'C:\Users\qwerty\VirtualBox VMs\Ubuntu 20\Ubuntu 20.vdi' when deleting a snapshot.

Could not open the medium 'C:\Users\qwerty\VirtualBox VMs\Ubuntu 20\Snapshots/{8ba72d7a-5f5a-499c-9258-b1ff77e9c0cc}.vdi'.

VD: error VERR_FILE_NOT_FOUND opening image file 'C:\Users\qwerty\VirtualBox VMs\Ubuntu 20\Snapshots/{8ba72d7a-5f5a-499c-9258-b1ff77e9c0cc}.vdi' (VERR_FILE_NOT_FOUND).

Is there a way to fix this?


Solution 1:

The best way to fix this problem is to restore the missing snapshots from backup. This way no data will be lost.

Each snapshot keeps the changed parts, it is not a complete copy of the VM. When deleting a snapshot via VirtualBox, its data is merged with the previous snapshot.

As you deleted the snapshots via the file manager, required data is now lost.

If you don't have a backup but wish to recover as much as possible, try to build a new VM using a copy of the .vdi disk-image of the damaged VM. With luck, the new VM will boot, but I'm unclear about the actual state of its data.