Microsoft KB Archive/833138

= A virtual hard disk file is larger than the used disk space that the guest operating system reports =

Article ID: 833138

Article Last Modified on 7/7/2005

-

APPLIES TO


 * Microsoft Virtual PC 2004

-





SUMMARY
The virtual hard disk file may be larger than the used disk space that your guest operating system reports. This article describes how to reduce the size of the virtual hard disk image file so that it is closer to the used hard disk space that the guest operating system reports.



MORE INFORMATION
When you install a Windows guest operating system on a virtual machine that you create, Setup copies several temporary files to the virtual hard disk of that virtual machine. Typically, these temporary files are removed when the operating system installation is completed. However, the virtual machine's virtual hard disk image expands to hold the temporary files. When the temporary files are removed, the virtual hard disk image does not automatically contract. To resolve this issue, compact the virtual hard disk image.

To compact the virtual hard disk image, follow these steps:  Start the virtual machine, and then defragment the virtual hard disk from the guest operating system. Mount the Virtual Disk Precompactor.iso CD image file in the virtual machine.

The Virtual Disk Precompactor.iso CD image file is included in Virtual PC 2004 Service Pack 1. The image file is installed in the following folder:

\Program Files\Microsoft Virtual PC\Virtual Machine Additions\

 Click Yes when you are prompted to prepare the disk for compacting. Shut down the virtual machine. If you use &quot;undoable&quot; virtual hard disk images, commit the changes to the virtual hard disks. In Virtual PC, click Virtual Disk Wizard on the File menu. Click Next, click Edit an existing virtual disk, and then click Next. Click Browse, and then locate the virtual hard disk image that you want to compact.</li> Click the virtual hard disk image that you want to compact, click Open, and then click Next.</li> Click Compact it, and then click Next.</li> Use one of the following methods to create a compacted disk image: <ul> Click Saving the file as, click Browse, type a new file name for this virtual hard disk image, and then click Save.

When you use this method, a new image file is created for the compacted virtual hard disk image. Because the original file is not overwritten during the compaction, Microsoft recommends that you use this method. When you use this method, you can verify the integrity of the virtual hard disk before you must remove the original virtual hard disk image.</li> Click Replacing the original file.

When you use this method, the virtual hard disk image is compacted to the same file as the original virtual hard disk image. This method uses less disk space on the host computer. However, if the virtual hard disk file becomes corrupted during the compaction, you may lose virtual machine data.</li></ul> </li> Click Next, and then click Finish. The virtual hard disk is compacted.</li> On the message that the hard disk was compacted successfully, click Close.</li></ol>

Keywords: kbinfo KB833138

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.