How To Compact Virtualbox'S Vdi File Size?: 1 Answer
How To Compact Virtualbox'S Vdi File Size?: 1 Answer
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration
required.
Tell me more
vdi
This is not exactly related to the question but may be useful. I had an issue on virtual box : "Zeroing free space
on C:\: 0%Could not create free-space cleanup file: The system cannot find the path specified." The solution
was to set sdelete.exe in compatibility mode for windows 98 and it worked. Hope this helps others with the
same issue. codea 2 days ago
add comment
1 Answer
You have to do the following steps:
1. run defrag in the guest (Windows)
2. nullify free space:
With Linux guest run this:
sudo dd if=/dev/zero of=/bigemptyfile bs=4096k
sudo rm -rf /bigemptyfile
With Windows guest, download SysinternalsSuite and run this:
sdelete z
3. shutdown the guest VM
4. now run VBoxManage's compact command
VBoxManage.exe modifyhd thedisk.vdi --compact
This reduces the size.
edited Oct 2 at 13:06
Community
1
@user248749 FYI, dd with no argument copies one block at a time, not one byte. Using a larger block size
can speed things up, but the effect is pretty minor. Gilles Aug 27 at 0:15
add comment
Not the answer you're looking for? Browse other questions tagged virtualbox
superuser.com/questions/529149/how-to-compact-virtualboxs-vdi-file-size
vdi or
1/2
02/12/13
superuser.com/questions/529149/how-to-compact-virtualboxs-vdi-file-size
2/2