I recently tried to boot a virtual machine in Windows 7 Virtual PC after the .vhd file was created inside Hyper-V. But Win 7 Virtual PC would not completely boot the virtual computer.
Can a .vhd file created in Virtual PC run in a Hyper-V environment? Vice versa?
What is the difference between a .vhd file created in Hyper-V compared to a .vhd file created in Windows 7 Virtual PC?
Yes, they're the same. The file format hasn't changed since Microsoft acquired Connectix in 2003.
Yes, a VHD files could be used for both Hyper-V and Virtual PC, and even directly boot on hardware.
If your file isn't booting, it's a problem with the software. What error are you getting? A couple common problems are creating a 64-bit image on Hyper-V, Virtual PC only supports 32-bit images. Not installing the Virtual PC "hardware" drivers in the image before moving it. Also, it's possible you have Virtual PC misconfigured.
When you create a VHD file, they're essentially identical while they're empty. This is true for any system that can use a VHD file, including Microsoft Virtual PC, Virtual Server, Hyper-V, Xen and, I believe, Virtual Box.
But then you put something into that VHD and they're not identical anymore. In this case, you installed an OS on top of a virtual machine, and the OS customized itself for that virtual machine. Now the VHD files are no longer identical.
The amount by which two different OS installs (which is what you were really asking about) differ from each other depends on the amount by which the two different machines (physical or virtual) differ from each other. The Virtual PC and Hyper-V virtual machines differ to some extent. The important part here is that Hyper-V supports multiple processors and Virtual PC doesn't. So Windows will install itself in a way that depends on having multiple processor support, and thus won't run in Virtual PC unless you tell the loader to boot the slow way, choosing a HAL at each boot.
To do that, type "bcdedit /set detecthal yes".
You can mount the VHD and do this off-line if you like, using the "/store" argument for bcdedit, pointing it at the VHD.
In general, Xen and VirtualBox will differ even more from Virtual PC than Hyper-V. To move a VHD file between those systems, you'll probably need to mess with storage drivers and perhaps other things. You'll certainly want to uninstall any "additions" or "integration components" that are specific to the virtual machine before moving it around.