Inadvertently disconnected the encrypted disk from the virtual machine

This is for discussing general topics about how to use VirtualBox.
Post Reply
a2g
Posts: 1
Joined: 24. Aug 2016, 14:09

Inadvertently disconnected the encrypted disk from the virtual machine

Post by a2g »

Inadvertently disconnected the encrypted (cipher AES-XTS256-PLAIN64) disk from the virtual machine.
That's what I tried to solve the problem:

1) Сonnected the disk again and after starting the virtual machine I have received an error message:
FATAL: No bootable media found! System halted.
The password for the virtual machine is not even requested. Immediately there was an error message.

2) Again entered the password in the password settings:
Enable-encryption-in-virtualbox.png
Enable-encryption-in-virtualbox.png (25.66 KiB) Viewed 1215 times
VirtualBox began to encrypt the already encrypted disk.

3) In order to cancel the re-encryption, I gave the command:

Code: Select all

VBoxManage encryptmedium "C:\Users\User\VirtualBox VMs\lubuntu\lubuntu.vdi" --oldpassword "C:\Users\User\VirtualBox VMs\lubuntu\password.txt"
4) I do not know, but it seems to me that the command for the decryption using AES-XTS128-PLAIN64 cipher by default. So I again via GUI encrypted disk with AES-XTS128-PLAIN64 cipher, to cancel incorrect decoding. After this operation, I had to return to the state after the second step.

5) Then I think I gave the correct command:

Code: Select all

VBoxManage encryptmedium "C:\Users\User\VirtualBox VMs\lubuntu\lubuntu.vdi" --oldpassword "C:\Users\User\VirtualBox VMs\lubuntu\pwd.txt" --cipher AES-XTS256-PLAIN64
Now I had to get the original state it was in before re-encrypting.

6) I have run the virtual machine. In the pop-password request box I typed the password, which has been successfully tested.
But I got an error message again:
FATAL: No bootable media found! System halted.
What do I need to do now to restore the disk to a virtual machine?

P.S. Sorry for the inaccuracy, I use machine translation.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: Inadvertently disconnected the encrypted disk from the virtual machine

Post by scottgus1 »

Sorry to bear bad news, but unless you have a backup, I'm afraid it's "game over, user loses".

The .vbox file is an XML file wih a .vbox extension. It holds the "recipe" for the guest. There's a section in the .vbox file for encryption keys that work with the passwords you enter to start the guest. If I recall correctly, when an encrypted disk is removed from a guest, the encryption key associated with that disk is deleted out of the .vbox file. It can only be put back by shutting down the guest and manually adding in the encryption key from a backup of the .vbox file.

Each time a guest's settings are changed, Virtualbox makes one copy of the .vbox file (called .vbox-prev) as a tempoary backup in case editing the .vbox file fails. Each new edit to the guest settings deletes the present .vbox-prev and makes a new copy. If you haven't made too many changes to the guest the encryption keys may be in the .vbox-prev file. Changing the name of the .vbox file to something else and editing the extension on the .vbox-prev file back to .vbox may get your guest running again.

But if you have made too many changes to that the keys are gone in the .vbox-prev and you don't have a backup of the .vbox, the data is lost.
Post Reply