Although it is optional, you can compact the virtual hard disk (VHD) to reclaim empty disk space and reduce the size of the VHD before you configure the Windows Virtual PC image.
Before you proceed, create a backup copy of your Windows XP image.
Preparing the Virtual Hard Disk
Open your Windows XP image.
Click Start, click All Programs, click Windows Virtual PC, click Windows Virtual PC, then double-click your Windows XP image.
Clear the DLL cache.
At a command prompt in the virtual machine, type sfc /cachesize=1.
Restart the virtual machine.
At a command prompt in the virtual machine, type sfc /purgecache.
Delete unnecessary files, such as uninstallers, temp files, log files, page files, shared folders, and so on.
Turn off System Restore. You can also specify this step in your Sysprep.inf file.
In Control Panel, double-click System, and then select the System Restore tab.
Select Turn off System Restore, and then click OK.
Set maximum event log sizes and clear all events.
Open the event viewer.
Click Start, click Control Panel, double-click Administrative Tools, then double-click Event Viewer.
Right-click Application, and click Properties.
In the Log Size area, set Maximum Log Size to 512KB and then select Overwrite events as needed.
Click Clear Log. In the Event Viewer dialog box that appears, click No.
In the Properties window, click OK.
Repeat steps a through e for the Security and System logs.
Run the Disk Cleanup Tool.
Click Start, click All Programs, click Accessories, click System Tools, and then click Disk Cleanup.
Configure your page file as needed for your applications.
In Control Panel, double-click System, and then select the Advanced tab.
In the Performance area, click Settings.
In the Virtual Memory area, click Change.
Configure your page file settings.
Shut down the Windows XP image.
Defragmenting and Pre-compacting the Virtual Hard Disk
In Control Panel on the host computer that is running Windows 7, click Administrative Tools, double-click Computer Management, then click Disk Management.
By using the Disk Management Console, attach (mount) the virtual hard disk and then defragment the disk.
By using an ISO extraction tool, extract the precompact.iso located in the \Program Files\Windows Virtual PC\Integration Components folder.
Use the precompact.exe program to compress the Windows XP virtual hard disk.
By using the Disk Management Console, detach the virtual hard disk.
Compacting the Virtual Hard Disk
Open Windows Virtual PC.
Click Start, click All Programs, click Windows Virtual PC, then click Windows Virtual PC.
Right-click your Windows XP image and select Settings.
Click Hard Disk for the one that corresponds to your Windows XP image, and then click Modify.
Click Compact virtual hard disk.
Click Compact and then click OK.
Create a backup copy of your compacted virtual hard disk.