The easiest way for a program to determine whether it is in a VM is by identifying known file names of running processes. Here's a list for each of the most popular pieces of VM software:
Virtualbox | VMWare | QEMU | Parallels | VirtualPC |
vboxtray.exe |
vmtoolsd.exe vmwaretray.exe vmwareuser VGAuthService.exe vmacthlp.exe |
qemu-ga.exe | prl_cc.exe prl_tools.exe |
vmsrvc.exe vmusrvc.exe |