macosvirtual-machine

How to detect if Mac OS X is being run inside a Virtual Machine


I don't want my app to be run inside a virtual machine on Mac. How can I detect it from my Mac app. The solutions for Windows and Linux are pretty simple and discussed in details in other similar questions. I don't mind executing

system_profiler or ioreg

to find it out. But what to look for? I am targeting Parallels, VMware Fusion and Virtual Box


Solution

  • Searching for VirtualBox, Oracle, VMware and Parallels in the output of following command does the job very well:

    ioreg -l | grep -e Manufacturer -e 'Vendor Name'