Saturday Jun 13, 2009

How to compact your Virtual Disks

In the previous article, we've discussed the reasons that cause your virtual disk images to become quite large over time. It might seem to be a pretty hopeless situation, but let me assure you: there is a way out. This article will show you how to reclaim your disk space. A couple of steps are presented and while each of them make sense, it is important that you execute them in the exact order given if you want to achieve the best results.

The first step (don't shoot me for that) is to delete files in your VM you don't really need. Clean up your trashcan, the temp directories, download stuff, uninstall applications you never use, etc. There are a lot of tools out there to delete unused files from Windows, I'm sure you will find a tool that suits your needs.

Now when you have just the files on the disk that you need, it's time to defragment the hard disk. After defragmentation, the files will be nicely aligned and there will be little free space between files. Windows comes with (not so good) defragmentation software, you will find it in the properties of your disk drive in My Computer under the "Tools" tab. Just give it a run and hope it will improve fragmentation. There are better tools out there, some of them cost money.

The data is now nicely aligned but we still got all those unused blocks that contain garbage (the contents of the files that used to live there). Therefore we need a tool that can find these blocks and overwrite them with zeros. Windows does not come with such a compact tool but it's available for download from Microsoft: http://technet.microsoft.com/en-us/sysinternals/bb897443.aspx

Close all your programs and do a

sdelete.exe -c

This will take a while, you should let it do its job without interfering. The tool will go through all parts of your virtual disk and look for things it can wipe out. It's known to be a very safe process, so don't worry.

Next, you should shutdown your virtual machine (power off, not save state) and let VirtualBox optimize the disk image and cut out all parts that SDelete zeroed out. There are two ways to do this: first you could compact the image (this will just operate on the disk image and make it smaller) or you could clone the disk image to a new image. The former needs more disk space but the latter has the advantage of being more secure (you still got the orginal bloated file after all) and it even allows you to switch from one virtual disk format (e.g. VDI) to another (e.g. VMDK). Let look at both options.

VBoxManage modifyhd XP.vdi --compact

This will compact your disk image and it will take some time. The cloning from VDI to VMDK works as follows:

VBoxManage clonehd XP.vdi NewXP.vmdk --format VMDK 

There are a lot more options to clonehd and modifyhd, have a look at the VirtualBox user manual.

This concludes our article and I hope I've given you some useful information that allows you to reclaim some of your disk space. I'm about to go on a 11h intercontinental flight and the virtual machine I want to work with was too big for my small notebook so I've used these techniques to shrink the image to less than half of its previous size. 

Friday Sep 12, 2008

Version 2.0.2 now available

Fixing a few hiccups, version 2.0.2 is the new improved vintage.

Go GetIt now.

-FB 

Wednesday Aug 13, 2008

VirtualBox-Powered stuff

When you say "VirtualBox" to someone they immediately think "desktop virtualization" and maybe picture the VirtualBox Console.

VirtualBox Console 

 

But the same virtualization engine that powers VirtualBox can be put to work in other ways too.

Sun just released a Press Release and accompanying Podcast about a few partners who have taken the technology and built upon it to deliver some innovative solutions.

Seems like the compact, efficient and modular architecture of VirtualBox coupled with the APIs available make it an ideal starting point for people wanting to innovate by using virtualization in different ways. And if partners want to know more they can email 

 

- FB 

Wednesday Jul 09, 2008

Recent Coverage now moved

The blogosphere coverage was creating so much noise that it was drowning out other useful blogs, so we've moved it to it's own VirtualBoxBuzz blog.

-FB

Thursday Jul 03, 2008

Recent Coverage - July 3rd, 2008

Recent Coverage - July 3rd, 2008[Read More]

Wednesday Jul 02, 2008

Recent Coverage - July 2nd, 2008

Recent Coverage - July 2nd, 2008[Read More]

Tuesday Jul 01, 2008

Recent Coverage - July 1st, 2008

Recent Coverage - July 1st, 2008[Read More]

Monday Jun 30, 2008

Recent Coverage - June 30th, 2008

Recent Coverage - June 30th, 2008[Read More]

Sunday Jun 29, 2008

Recent Coverage - June 29th, 2008

Recent Coverage - June 29th, 2008[Read More]

Saturday Jun 28, 2008

Recent Coverage - June 28th, 2008

Recent Coverage - June 28th, 2008[Read More]

Recent Coverage - June 27th, 2008

Recent Coverage - June 27th, 2008[Read More]

Recent Coverage - June 25th, 2008

Recent Coverage - June 25th, 2008[Read More]

Wednesday Jun 25, 2008

Recent Coverage - June 26th, 2008

Recent Coverage - June 26th, 2008[Read More]

Recent Coverage - June 24th, 2008

Recent Coverage - June 24th, 2008[Read More]

Tuesday Jun 24, 2008

Recent Coverage - June 23th, 2008

Recent Coverage - June 23th, 2008[Read More]
About

This blog concerns all things VirtualBox.

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today