Compressing .vmc files in Virtual PC
<REVISION August 28, 2008> This evening I spoke with Adam again who corrected himself, a bit of a relief, as neither I nor any of my colleagues with whom I chatted had ever heard of bloated VMC files. It turns out that it is indeed a virtual hard disk (.vhd) file that was bloated, and Adam was unable to compress those with decent results. This article will still work in the event that a virtual machine file corrupts, so I will leave it here, and post a new article about virtual hard disk files.
Question: What is the simplest way to recover a virtual machine when the virtual machine file (.vmc) is corrupted? Delete it!
Ok, it is not as simple as that, but not much harder. Follow these steps to a clean <15kb Virtual PC configuration file.
- Start Virtual PC. (remember that you should always be running the latest version of Virtual PC. The current version is Virtual PC 2007 Service Pack 1.)
- Ensure that the virtual machine that is the issue is turned off. Check the Settings to make sure you know the path of both the current .vmc file and any virtual hard drive files, as well as any settings that may need to be saved.
- Create a new virtual machine in Virtual PC.
- In the Virtual Machine Name and Location window of the New Virtual Machine Wizard navigate to the same path of the old file, but give it a new filename (XP_1 instead of XP).
- Follow the wizard, assigning the settings needed (operating system, memory, etc...)
- In the Virtual Hard Disk Options page select the option to use An existing virtual hard disk.
- In the Virtual Hard Disk Location page navigate to the path of the .vhd file that contains the system partition, and select that drive.
- if you have more than one virtual hard disk connected to the virtual machine ensure that after completing the wizard but before booting the new virtual machine you go into the settings and attach the other .vhd files.
That's it... there is nothing magical about the virtual machine configuration files, and if they do get 'bloated' then rather than compressing them, simply recreate them. Once you have successfully booted into the new machine, you can simply delete the old machines from the Virtual PC console.
I hope this helps... now go out and enjoy the sunshine! Winter is just around the corner!