I had a major oops moment that led to my VirtualBox guest VM's hard drive being larger than the host's hard drive. I rushed through reading the commands for resizing a virtual hard drive. As such, I wound up resizing my virtual hard drive from 25 GB to 45 TB.
My research on how to shrink VirtuaBox VDI's says to log into the guest system, zero out all the free space, and then compact the hard drive using VBoxManage commands. This would work, if the max size of the VDI was smaller than the host system. It is untenable for my situation, because writing zeros into the free space of my resized VDI will try to fill up 45 TB with zeros. Since my Mac has a 750 GB hard drive, 45 TB of zeros is going to blow it away.
Some forums say that the virtual max size is not a big deal, as a dynamic hard drive will only take up host disk space that corresponds to data in the guest. This is true, but that upper limit of 45 TB scares me. What if a process in my guest goes crazy and keeps logging until it fills up both the guest and the host hard drives? That will bring down both my machines, and it is not a possibility I want to allow.
So my question is: how do you really reduce the max size of a VirtualBox dynamic virtual hard drive?
Host: Mac OS X Guest: Windows 8 I have not started the VM since I resized the VDI