compact_vdi

Differences

This shows you the differences between two versions of the page.


compact_vdi [2019/10/31 08:29] (current) – created - external edit 127.0.0.1
Line 1: Line 1:
 +====== Compact VDI ======
 +===== Windows guest =====
 +  - Run defrag in guest
 +  - Download [[https://technet.microsoft.com/en-us/sysinternals/bb897443|SDelete]] from Sysinternals and run this || sdelete c: -z
 +  - Shutdown the guest
 +
 +===== Linux guest =====
 +  - Run the following commands in guest: \\ **sudo dd if=/dev/zero** | **pv** | **sudo dd of=/bigemptyfile bs=4096** \\ **sudo rm -rf /bigemptyfile**
 +  - Or run theese commands: \\ **telinit 1** \\ **mount -o remount,ro /dev/sda1** \\ **zerofree -v /dev/sda1**
 +  - Shutdown the guest
 +
 +===== Windows host =====
 +  - run: \\ "c:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyhd c:\path\to\vdi\disk.vdi compact
 +
 +===== Linux host =====
 +  - run: \\ vboxmanage modifyhd /path/to/vdi/disk.vdi --compact
 +
 +===== OSx host =====
 +  - run: \\ VBoxManage modifyhd /path/to/vdi/disk.vdi --compact