Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 258
adnan kamili Avatar asked Feb 15 '15 18:02

adnan kamili


People also ask

Does macOS run in VM?

To boot and run macOS in a VM, you must first install a macOS image onto the new VM. Installing macOS in a new machine requires the following steps: Obtain a restore image. Set up a compatible VM configuration.

How do I find virtual machine on Mac?

In macOS Spotlight Search Spotlight Search indexes all the files on your Mac including virtual machine bundles. Find its icon in the right top corner to begin with. Type in pvm (Parallels virtual machine) or just the machine's name.


1 Answers

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'
like image 140
adnan kamili Avatar answered Nov 15 '22 16:11

adnan kamili