http://vladimir-ivanov.net/how-to-compact-virtualboxs-vdmk-file-size/
- Fill the free space with zeros VirtualBox only knows that the space is really free if it’s been set to zero, and standard deletion won’t do this. Login into the virtual machine and run the following command:
cat /dev/zero > zero.fill; sync; sleep 1; sync; rm -f zero.fill
- compact vmdk
cd ~/VirtualBox\ VMs/kubernetes_master_1477538740395_78361/
VBoxManage clonehd fedora-23-x86_64-disk1.vmdk fedora-23-x86_64-disk1.vdi --format vdi
VBoxManage modifyhd fedora-23-x86_64-disk1.vdi --compact
虚拟介质管理 => remove fedora-23-x86_64-disk1.vmdk
VBoxManage clonehd fedora-23-x86_64-disk1.vdi fedora-23-x86_64-disk1.vmdk --format vmdk
虚拟介质管理 => remove fedora-23-x86_64-disk1.vdi
虚拟机设置=>添加虚拟硬盘=>add fedora-23-x86_64-disk1.vmdk