Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I've seen instructions for shrinking the .vdi image for a Windows guest machine in VirtualBox 4.1.8. However, it used a tool to write zeroes to free space in the .vdi (nullfile-1.02.exe) that is for Windows only.

The page did say you should find a zerospace.c to do so in a Linux guest, but I can't find such a file any where on the Internet.

Does anyone here have experience shrinking VirtualBox Linux guests?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Writing zeroes to free space isn't difficult (even on Windows!). Just write a file containing zeroes, until you run out of space. On unix, it's a simple shell command:

cat /dev/zero >fill_er_up
rm fill_er_up
share|improve this answer
    
oh yeah good idea! I'll try it and report back... –  hpy Feb 5 '12 at 1:36
    
And it worked! Thanks for your tip! –  hpy Feb 5 '12 at 2:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.