﻿id	summary	reporter	owner	description	type	status	component	version	resolution	keywords	cc	guest	host
14496	Disk Encryption Cannot Be used with Compatected VDI files => fixed in SVN/5.0.x	vvv		"Disk encryption feature of VB 5 (General / Encryption menu) works fine on VDI files.

However, if 'vboxmanage modifyhd some.vdi --compact' command is used in a non-encrypted VDI file (for encrypted files the command seems to have no effect), then when trying to encrypt the VM via General / Encryption menu after that, the following error is shown:


Could not prepare disk images for encryption (VERR_VD_BLOCK_FREE): (VERR_VD_BLOCK_FREE).
Result Code: 
VBOX_E_FILE_ERROR (0x80BB0004)
Component: 
MediumWrap
Interface: 
IMedium {4afe423b-43e0-e9d0-82e8-ceb307940dda}


After this error, the VDI file is unrecoverably corrupted. It cannot be booted anymore, and it shows up as unallocated space (if attached to another VM).

Steps to reproduce:

1. Create a VM with some.vdi file, preferably with some guest in it (I had Linux guest).
2. vboxmanage modifyhd some.vdi --compact
3. Then via UI General / Encryption, select 256 encryption, enter password, press OK.
4. After a while the above error comes (visible in Details).
5. After the error, the some.vdi file is corrupted and I could not recover any data from it (did a backup before).

"	defect	closed	other	VirtualBox 5.0.2	fixed	encryption		Linux	other
