Building better businesses… with Technology
16 Jul
After many trial and error runs, I’ve finally been able to reduce my fully updated Windows XP SP2 Virtual Machine to a rather lean 802 MB (uncompressed) 276 MB (compressed). WOW!!
 In order to get the XP VM at a reasonable size, follow these steps:
*You must be using a Dynamically Expanding VHD, I’ve not tested the other formats VPC supports!
This entire process could literally take a couple hours to 10 minutes, depending on the size of your vhd.
 Tips:
**UPDATE**
“What does the pre-compactor do for the VHD?”
To understand how the pre-compactor works, you need to understand how a standard hard drive works!
When a hard drive saves data to the disk, it attempts to place all the data in a contiguous form. If data is deleted, that leaves a blank hole on the disk where data used to be stored. Now, for example, you install a program that takes up a large portion of your hard disk, the hard drive will fill in data where you previously deleted thus the new data will be fragmented or scattered throughout the various holes on the disk!
In a typical hard drive, when data is deleted the hard drive “un-links” the data from the OS so you cannot access it, but it is technically still written on the hard drive until it is overwritten by new data. This is why there are data recovery specialist in the world!
The same is true in a virtual environment! Since your virtual hard disk is continuously expanding, it sees this “un-linked” data as good data and keeps it stored in the VHD file which is really just wasted space! The pre-compactor program finds these data chunks and permanently deletes them by writing zeros in place of that data. The VHD compactor is able to then remove zero-ed data from your VHD file, thus reducing the size of the VHD!
“What is the whole purpose of compacting your VHD??”
Well, it really depends on what you’re doing with your Virtual Machine! It all boils down to efficiency when sending the VHD across
In our environment, we use VPC as a testing tool. When we need a fresh install of XP to test a new solution we grab our VHD from the network, load it in VM, and test away.
Unfortunately, installing a fresh XP each time you want to test takes a little while… It is far more efficient to stage a fresh XP and store it on the network, to be downloaded whenever needed. Changes can be made on an “Undo Disk”, which is a great feature of VPC 2007, thereby always maintaining a fresh XP VHD!
Similar Posts:Sharepoint Apple TotalCare Web Development Wireless Issues Network Security QuickBooks iPhone Hosting Jing Microsoft Office Windows Vista Toys & Gadgets Software Office Communicator Random Cool Things Cisco Virtualization Exchange UC/VoIP Hardware Mobility Uncategorized Tips
2 Responses for "Steps to Compact an XP Virtual Hard Disk"
These are great instructions. The first time I tried this with Flexomizer Defrag, I got a pretty basic installation down from 3.5 GB to 2.7 GB, which is decent. However, following you spirit of getting it below 1 GB, I tried to run the defrag several times and ended up with a VHD of 3.7 GB! Larger than I started!
Are you using the boot time defrag? What else are you removing to reduce the size of the image?
Thanks for the help!
Hmm.. It sounds like you’ve got “stuff” installed on the XP installation. In order to get my VHD below 1GB, I performed a fresh install of XP and installed only the bare minimum, Windows Updated only “Critical” updates.
Go to the Add/Remove programs,directly after installing XP, and remove all unnecessary programs. Then flop over to the Add/Remove Windows Components and remove everything that you probably wont use in the XP environment. In our case we dont need calculator, games, MSN explorer etc. So I removed all these items.
Also, don’t forget to turn off System Restore!! You don’t need this feature and it consumes large amounts of space!
I believe I have the boot time defrag option in XP enabled, I cant verify that right now.. I’ll get back to you on that…
Thats about all I can think of.. just make sure you’re using a fresh install of XP… I see you said “pretty basic” installation. Remember if you install ANY programs, it’s going to consume space. My example is referring to a very slim XP with nothing on it!
Leave a reply
You must be logged in to post a comment.