Compact VDI

  1. Run defrag in guest
  2. Download SDelete from Sysinternals and run this || sdelete c: -z
  3. Shutdown the guest
  1. Run the following commands in guest:
    sudo dd if=/dev/zero | pv | sudo dd of=/bigemptyfile bs=4096
    sudo rm -rf /bigemptyfile
  2. Or run theese commands:
    telinit 1
    mount -o remount,ro /dev/sda1
    zerofree -v /dev/sda1
  3. Shutdown the guest
  1. run:
    “c:\Program Files\Oracle\VirtualBox\VBoxManage.exe” modifyhd c:\path\to\vdi\disk.vdi compact
  1. run:
    vboxmanage modifyhd /path/to/vdi/disk.vdi –compact
  1. run:
    VBoxManage modifyhd /path/to/vdi/disk.vdi –compact
Enter your comment:
K O N​ L H
  • compact_vdi.txt
  • Last modified: 2019-10-31 08:29
  • (external edit)