I set up a dynamic 128GB Windows 10 VM on my Ubuntu 17.04 256GB hard drive. The VM worked well and things were going fine. Then I noticed the file size of the .vdi had eventually expanded to around 250GB, eating up all my physical drive. Additionally the size of the Windows VM had drive had grown to 230GB!
I moved the .vdi to an external hard drive, and now run it through a USB connection. I'd like to shrink the VM down to 128GB and move it back to my HD.
I have run disk cleanup and sdelete to zero out the space. Then running commands like (and variations of this)
Code: Select all
VBoxManage modifymedium disk Metro_dynamic.vdi --compact
VBoxManage modifyhd --compact disk Metro_dynamic.vdi
So then I created a new VM and made the VM fixed and tried similar commands on the this one, like:
Code: Select all
VBoxManage modifymedium disk Metro_fixed.vdi --compact
VBoxManage modifyhd --compact disk Metro_fixed.vdi
I also tried changing the partitions of my Windows HD VM, so now I have a Windows C: partition which shows 50GB used and 72GB free for a total of 122GB, and a second 107GB Unallocated partition. I thought this might allow it to be compacted in that case. But running the modifymedium commands still has no effect.
Any suggestions for a way out of this? Thanks!