Corrupted VDI after failed encryption

This is for discussing general topics about how to use VirtualBox.
Post Reply
fros
Posts: 1
Joined: 24. May 2019, 09:38

Corrupted VDI after failed encryption

Post by fros »

Hello everyone!

I decided to encrypt my virtual machine, during the encryption I got information that there is no disk space.
I canceled the encryption and decided to turn on the virtual machine, I received an error:

Code: Select all

Location: 'C:\Users\admin/.VirtualBox\VirtualBox.xml', line 1 (0), column 1.
I renamed the -prev file and that worked.

Now I want to open my VM and there is error:

Code: Select all

FATAL no bootable medium found system halted
I had Windows 10 installed and im trying to do everything to restore my files from W10, there is any chance?
I convert VDI into RAW and using QPhotoRec tried recovery only .BIN files {which are one most important for me} but no results.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Corrupted VDI after failed encryption

Post by mpack »

I'm sure that you certainly backed up the VM before trying something so obviously dangerous as to deliberately randomize the contents of your VMs (aka encryption), so just restore from that backup?

Without a backup: no, there is absolutely no chance of fixing this. If it was possible to recover your data without a key then what would be the point of encryption?
 Edit:  (1) First understand that the real encryption key (DEK) is stored in the .vbox file, the short password you enter serves only to decode the much tougher DEK. (2) AFAIK VirtualBox only writes an updated .vbox when shutting down the VM session, so if it had crashed while running then it should not have corrupted the .vbox file because it isn't even open. (3) Suppose somehow it was for some reason in the middle of updating the .vbox file. The procedure it follows (last time I looked anyway), is to first write a ".vbox-tmp" file, and then if that succeeds it renames the old .vbox file to .vbox-prev, and renames the .vbox-tmp to .vbox. So if it crashes in thel middle of this sequence you might find the encoded DEK in the .vbox-tmp file (if it still exists), or in the .vbox, or in .vbox-prev.

If the DEK is truly lost then as mentioned there is no chance of decrypting a VM. 
Post Reply