Eureka Moment Wiki

One eureka moment at the time

User Tools

Site Tools


compact_vdi

Differences

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

Link to this comparison view

compact_vdi [2017/08/10 12:59] (current)
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
  
compact_vdi.txt · Last modified: 2017/08/10 12:59 (external edit)