- Download the SDelete program provided by Microsoft onto your Windows Guest machine.
- Clean up unnecessary files and programs. One useful utility is WinDirStat.
- Run the following command in the terminal to write zeroes over unused disk storage in your Windows guest:
sdelete64 -z c:
- Shut down your VM and run the following command on your Windows Guest VDI:
VBoxManage modifyhd /misc/virtualbox-vms/Windows10/Windows10LargeDisk.vdi
- Create a new VDI with the new desired maximum size:
VBoxManage createhd --filename /misc/virtualbox-vms/Windows10/Windows10Disk.vdi --size 92160
- Clone the existing VDI into the newly allocated one:
VBoxManage clonehd /misc/virtualbox-vms/Windows10/Windows10LargeDisk.vdi /misc/virtualbox-vms/Windows10/Windows10Disk.vdi --existing