Detecting Virtual Machines

11. September 2006 05:09 by smurillo in General  //  Tags:   //   Comments (0)

I was a firm believer in the fact that an application could not for sure detect that it was running on a Virtual Machine. I had thought of things like checking if the VM Additions were installed, or checking if the hardware devices in the system matched those used by Microsoft's Virtualization products, but I still thought these techniques could not be conclusive enough, not beyond ALL reasonable doubt.

Then I decided to look for solid ways to detect if an application is running on a Virtual Machine. This could be helpful for example, if you want to release a time-limited trial version of an application you are developing and you want to restrict it from running on a VM.

Turns out if you check the motherboard on a Microsoft VM you are going to find that it was made by Microsoft. Since Microsoft doesn't really make motherboards (yet?), this is a clear indicator that you are in the presence of a VM. You can find a programmatic way to do this on Virtual PC Guy's Weblog. Of course if Microsoft decided in the future to start manufacturing motherboards your applications will refuse to work on some physical machines too :-)

I also found an interesting article on The Code Project website, that uses an exception method to detect a VM running on Virtual PC. And it also includes a technique for VMWare.

Turns out it is not impossible after all, there are plenty of ways you can find in the Web to detect when your application is running on a VM. Just be careful to choose one that is trust worthy and use it wisely.