Sunday, April 14, 2013

VirtualBox VDI - Compacting to save space

For Windows Only: Easy way to compact or remove your unused space of VDI and free some space in your host drive.

Do this in your VDI Guest
Step 1: Defragmenter your disk drive. Use the simple Windows Disk Defragmenter. (Be patience coz this will take a while, it probably be finished after Pass 7 or 8)

Step 2: Execute "sdelete -c " example "sdelete -c C:". If you don't have sdelete, download it from Windows Sysinternals http://technet.microsoft.com/en-us/sysinternals/bb897443 and extract it.

Step 3: Shutdown your VDI and close VirtualBox
  Note: Before going to Step 4, make sure that your VDI is shutdown

Do this in your Host
Step 4: Open a command prompt

Step 5: Change your directory to where you install VirtualBox

Step 6: Type the command "VBoxManage modifyhd --compact" example: VBoxManage modifyhd "C:\VirtualBox VDIs\MyGuest.vdi" --compact.

If you noticed that I enclosed the location of my VDI with quote because I have space between VirtualBox and VDI, if you don't have space of the location of your VDI, you can ignore double quote.

Step 7: Wait until it finished the Step 6 then you have regain some disk space.

Enjoy Virtual Box VDI compacting!!

No comments: