Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a Windows 2003 Server setup in Virtual PC. I loaded it with VS2005, SQL Server etc., and the size of the VHD file was 15 GB. Over the months, I have tried various things including setting up replication etc., and now the size is 39 GB.

I have removed all of the unwanted DB's, installation etc., and now my C drive on my VPC reads as 15 GB, however, the VHD file still reads as 39 GB and shows it has 24 GB free space.

Question - How can I ensure that the VHD file size is only 15 GB and not 39 GB?

share|improve this question

3 Answers 3

up vote 5 down vote accepted

You'll want to defragment the drive inside the virtual machine (to get everything in a logical order) and then compact the drive using Virtual PC. While I don't have Virtual PC installed here at work the directions on compacting a virtual hard drive are quite straight forward. Once you complete the compaction operation, the file should be the same size as the space actually used.

Of course, keep in mind that the drive will expand again as space is needed and won't shrink until another compaction is performed.

share|improve this answer
    
+1 for "compaction operation" –  Jared Harley Nov 9 '09 at 15:09

If you go in to the hard disk wizard when the VM is selected, an option should be to compact the hard drive.

This should do what you want.

share|improve this answer

my guess: Volume Shadow Copy (VSS) is the culprit.

read this article at asktheadmin.com:

Mysterious Server 2003 disk space consumption

share|improve this answer

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.