0% found this document useful (0 votes)
92 views

How To Compact Virtualbox'S Vdi File Size?: 1 Answer

The document discusses how to compact the size of a VirtualBox virtual disk image (VDI) file that has grown larger than the host system's storage capacity. It provides steps to 1) defragment files on the guest virtual machine, 2) use utilities like dd or sdelete to nullify unused space, 3) shut down the guest VM, and 4) run VBoxManage's compact command to shrink the VDI file size. Compacting reduces the file size by removing unused space.

Uploaded by

ggg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
92 views

How To Compact Virtualbox'S Vdi File Size?: 1 Answer

The document discusses how to compact the size of a VirtualBox virtual disk image (VDI) file that has grown larger than the host system's storage capacity. It provides steps to 1) defragment files on the guest virtual machine, 2) use utilities like dd or sdelete to nullify unused space, 3) shut down the guest VM, and 4) run VBoxManage's compact command to shrink the VDI file size. Compacting reduces the file size by removing unused space.

Uploaded by

ggg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

02/12/13

How to compact VirtualBox's VDI file size? - Super User

Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration
required.

Tell me more

How to compact VirtualBox's VDI file size?


I've a VirtualBox VM which configured a very large hard disk size (bigger than host). By my mistake, a
program on the VM generated lots of log files and the VDI file size keeps growing until there is no space
on the host.
Now I've deleted the log files but the VDI file size are not getting smaller after using VBoxManage.exe
modifyhd "C:\Virts\mybox-i386.vdi" compact
Is there a way to really compact the VDI file size? Thanks!
virtualbox

vdi

edited Jan 7 at 3:43


Karan
22.2k 5 18 51

asked Jan 7 at 3:41


DeepNightTwo
160 1 5

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

answered Jan 7 at 5:05


magicandre1981
14.2k 4 13 24

@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

How to compact VirtualBox's VDI file size? - Super User

ask your own question.

superuser.com/questions/529149/how-to-compact-virtualboxs-vdi-file-size

2/2

You might also like