Page 1 of 1
Claim Unused Space on Guest
Posted: 6. Jan 2009, 03:12
by doracle
Hi
I could not find much info on this topic on the forums or manual. This is a general question, even though I am posting it in this forum.
Basically I have a VDI which uses 350GB. It has a bunch of applications installed, and works great.
However I would like to claim around 200GB which is unused by the guest, and give it back to the Host (Windows XP in my case is the Host and RedHat is the Guest).
Any pointers would be appreciated.
Yes... I agree it was bad space planning on my part to block 350GB
- D
Posted: 6. Jan 2009, 08:42
by Hypnoz
I had this same issue after adding and removing several GB of data from my linux VM.
You will need a utility called "zerofree" and need to know how to boot into init 1 (single user mode)
I used this tutorial, and it worked perfectly for me and caused no issues to my VM after running it.
http://ubuntuforums.org/showthread.php?t=908172
If you're wondering what it does, basically after deleting files the data in the VM isn't set to null 0 values, it still holds the space as used until it is overwritten. The zerofree utility overwrites any files that were deleted on the VM file with zeros, which allows the VBoxManage compact command to know which sectors are safe to compress.
Hope this helps!

Posted: 6. Jan 2009, 08:50
by Hypnoz
An update to my last post. It seems with the new 2.1.0 version, some people are having issues with the last command in that write up, which calls VBoxManage modifyvdi
You may want to read through this thread before going through the process.
http://forums.virtualbox.org/viewtopic.php?t=12383
Looks like some people might be having luck doing clonevdi instead of modifyvdi after zeroing out the empty space?
Posted: 6. Jan 2009, 17:10
by TerryE
There is also my tutorial
All about VDIs.

Posted: 6. Jan 2009, 19:57
by doracle
Thanks for your responses.
I am on 2.0.6 and cannot move to 2.1 because of the port-forwarding issue on WINXP
TerryE: your tutorial is informative, however I should have mentioned that my VDI is "normal" fixed-size".
I am trying out the other options available.
- D
Posted: 6. Jan 2009, 23:33
by Sasquatch
doracle wrote:TerryE: your tutorial is informative, however I should have mentioned that my VDI is "normal" fixed-size".
There was a user who had that too, and after issuing the modifyvm compact command, it changed it to a dynamic VDI and actually shrunk the file.