2

I tried to encrypt the dynamic disk (vdi) with VirtualBox's disk encryption, and I didn't realize that it'd fill up the entire space on the host. The encryption resulted in an error because the host ran out of disk space. To shrink it back to normal, I wanted to go into the guest and write zeros then use VBoxManage, but I can't even boot up the guest now because of "No bootable medium". Does this mean the vdi is permanently damaged?

No Name
  • 129
  • 1
    A fully encrypted drive cannot be shrunk because, even if the image has zero data, the encryption mechanism operates on a per volume basis rather than per file. If you would like the virtual disk to be encrypted, it will always be its full size regardless of whether you’re using dynamic or fixed – matigo Jan 10 '22 at 05:38

1 Answers1

1

The vdi is either permanently damaged or it's too unreliable to be used anymore, so your best option is to delete the existing vdi, start over create a new vdi.

karel
  • 114,770
  • 1
    OP: Also, remember to take regular backups of anything important, even if you are using a VM. If you had a backup that you could've restored to, that would have saved you here. – cocomac Jan 10 '22 at 05:04
  • So all those data are lost just like that? If encryption doesn't work on dynamic disks then why is it an option in the first place and why are there no warnings whatsoever? Granted I should've taken backups and done this and that but why does virtualbox expect every user, new or experienced, to do this and be aware of this trap? – No Name Jan 10 '22 at 05:26
  • All my VMs are KVM/QEMU (qemu-kvm) virtual machines created in Virtual Machine Manager (virt-manager), because I found QEMU virtualization to be more reliable on Ubuntu than VirtualBox. Unfortunately the documentation for QEMU virtualization is incomplete, but it seems to work better than VirtualBox on my system. – karel Jan 10 '22 at 05:32
  • @MysteriousShadow Linux assumes (almost always) that you know what you are doing, and it does it's best to stay out of your way. That is why you can recursively chmod on the root folder of your system (although don't do that!). The assumption is if you don't know exactly what something will do, either have a safe backup, or be OK with losing it. There are very few exceptions to this rule. One of the few things is the rm command, it won't let you rm the root folder (but if you really want, there is the --no-preserve-root option to bypass that). – cocomac Jan 10 '22 at 05:40
  • Continued... that said, VirtualBox could (and probobly should) make a check to make sure you have sufficient space, if you are going to use full disk encryption. You could suggest it on the VirtualBox mailing list or the forum. – cocomac Jan 10 '22 at 05:43