Archive: Detect Virtual Machine


Detect Virtual Machine
Hi,

I'm looking to prevent my program from being installed on Virtual PCs and am trying to find a way to determine if the machine is virtual?

If anyone has any clues that would be much appreciated.

Cheers


looks like it will be easy to do in the program:

hXXp://www.codeproject.com/KB/system/VmDetect.aspx


Why does everyone want to prevent their users from doing stuff? Anyway, the whole point of a virtual machine is to trick the OS and its apps to think they are running on hardware...so, you might be able to put some checks in there, but not for everything out there (Not just VPC and VMWare, you also have Parallels,QEMU, VirtualBox and Bochs and several others, and lets not forget about WINE)


Maybe for reason that the program can be unstable on virtual machines? :confused:


It may be better to give them a warning somewhere that the software is not supported on virtual machines. That would also save some work.

Stu


If the Virtual Machine Monitor (VMM) aka Hypervisor is implemented properly, then neither the Guest-OS itself nor any program running on the Guest-OS will be able to detect that it's running on a Virtual Machine. That's the whole point about virtualization! Well, the x86 architecture (IA-32) cannot be virtualized that easy, so software solutions (VMWare, VirtualBox. etc.) have some limitations, which might allow the Guest-OS to detect that it's running in a VM. But new hardware-extensions to x86, like Intel VT-x, will allow proper virtualization. And then there should be no chance to detect a VM. So better give up about that idea and do it like suggested by Afrow...


Hi all,

Gold star to Afrow UK.

Andres, I agree 100% except when your trying to secure your software from vm copies thats when you want to prevent your users from doing stuff. The real problem for me is that I'm faced with customers without web access, its complicated..

I bet you red-gate will trawl thru this forum and see this - and go img wtf - lets make a virtual pc detection component!


How is a copy running in a VM any different from running on a normal box? What about the people using linux or osX and use VM's for win32 apps, are you just gonna screw them over, even tho they have a perfectly valid reason to use a VM


Originally posted by Anders
How is a copy running in a VM any different from running on a normal box?
There is no difference. At least there should be no difference ;)

And it's impossible for a program to detect that it's running inside a VM, unless you exploit a bug in the VMM/Hypervisor...

Equivalence 
A program running under the VMM should exhibit a behavior essentially
identical to that demonstrated when running on an equivalent machine directly.
Resource control
The VMM must be in complete control of the virtualized resources.
Efficiency
A statistically dominant fraction of machine instructions must be
executed without VMM intervention.


For further info, refer to:
http://en.wikipedia.org/wiki/Popek_a...n_requirements