I came across this problem the other day, where I wanted to determine if a Virtual Machine was running on Hyper-V or Virtual Server 2005 host system.
WMI exposes the Win32_ComputerSystem class which contains information about the Manufacturer and Model of a particular system (this is very hand if you want to check type of system before installing an application, e.g. Virtual Machine Additions). The unfortunate news is that Win32_ComputerSystem returns the following on both Hyper-V and Virtual Server hosts:
So how to determine what it is I am looking at? Well there is another WMI class, Win32_BIOS, which can help. Here you can see a difference in the Version between products.
Hyper-V
Virtual Server 2005 SP1
So far this seems to work for me; I am interested if anyone has alternate suggestions on how to solve my little problem, especially if there are cases where this will break (for example limiting the CPU functionality to run NT 4.0?)