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



The information in this article 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:
  1. Start the virtual machine, and then defragment the virtual hard disk from the guest operating system.
  2. 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:

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

  3. Click Yes when you are prompted to prepare the disk for compacting.
  4. Shut down the virtual machine. If you use "undoable" virtual hard disk images, commit the changes to the virtual hard disks.
  5. In Virtual PC, click Virtual Disk Wizard on the File menu.
  6. Click Next, click Edit an existing virtual disk, and then click Next.
  7. Click Browse, and then locate the virtual hard disk image that you want to compact.
  8. Click the virtual hard disk image that you want to compact, click Open, and then click Next.
  9. Click Compact it, and then click Next.
  10. Use one of the following methods to create a compacted disk image:
    • 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.
    • 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.
  11. Click Next, and then click Finish. The virtual hard disk is compacted.
  12. On the message that the hard disk was compacted successfully, click Close.

Modification Type:MinorLast Reviewed:7/7/2005
Keywords:kbinfo KB833138 kbAudEndUser