Shrinking a bloated VirtualBox disk image
Sunday, October 9th, 2011 | Misc, Tech-savvy
I like to keep my house clean. I was always puzzled by ever growing vdis (VirtualBox disk images). Just today I did a clean install of WinXP Home SP1 and installed SP3 afterwards (a pity the online photo printing software my wife uses is only available for Windoze). After getting rid of everything that bloated my VM in the first place I was still sitting on a 2.6 Gig image. Seemed a tiny bit too much, so I looked for a way to make sure the vdi only holds real data, not “empty” space.
The trick I am about to show you made me decrease the real size of my vdi from 2.6 to 1.5 Gig. That’s pretty neat and you should be able to free up even more space if you already used your VM quite heavily (more fragmented thus more space available to optimize).
It’s simple: first defrag your virtual host’s file system, second make sure the empty space is really empty (I used nullfile 1.2). After that, use VirtualBox‘s command line tool VBoxManage to recompress the image:
VirtualBox 3.x:
VBoxManage modifyvdi WinXP.vdi compact |
VirtualBox 4.x:
VBoxManage modifyhd --compact WinXP.vdi |
That’s it. This trick may be rather old, yet helped me save some bytes. Not that I actually needed that extra Gig, but hey, why should I waste it?
No comments yet.
Leave a comment
Search
Categories
- (X)HTML/CSS (5)
- Activities (29)
- Gadgets (35)
- Insights (2)
- Java (22)
- Certification (1)
- IDE (10)
- JSP (1)
- Language (16)
- Quirks (9)
- Vocabulary (10)
- Linux (16)
- Misc (58)
- Photography (16)
- Reviews (69)
- Tech-savvy (81)
Tag Cloud
Archives
- May 2013 (3)
- April 2013 (1)
- March 2013 (1)
- February 2013 (1)
- January 2013 (1)
- December 2012 (3)
- November 2012 (1)
- October 2012 (3)
- September 2012 (3)
- July 2012 (1)
- May 2012 (1)
- April 2012 (1)
- February 2012 (7)
- January 2012 (1)
- December 2011 (2)
- November 2011 (4)
- October 2011 (5)
- September 2011 (3)
- August 2011 (3)
- July 2011 (2)
- June 2011 (4)
- May 2011 (1)
- April 2011 (2)
- March 2011 (2)
- February 2011 (2)
- January 2011 (6)
- December 2010 (2)
- November 2010 (5)
- October 2010 (7)
- September 2010 (13)
- August 2010 (6)
- July 2010 (4)
- June 2010 (3)
- May 2010 (3)
- April 2010 (2)
- March 2010 (2)
- February 2010 (1)
- January 2010 (1)
- December 2009 (1)
- November 2009 (2)
- October 2009 (5)
- September 2009 (1)
- August 2009 (3)
- July 2009 (5)
- June 2009 (5)
- May 2009 (6)
- April 2009 (3)
- March 2009 (3)
- February 2009 (2)
- January 2009 (1)
- December 2008 (9)
- November 2008 (15)
- October 2008 (15)
- September 2008 (13)