1

How to determine virtual machine type from guest OS X?

The setup is the following. Host operation system is OS X, guest operation system is also OS X. And one of the following virtual machines VMware Fusion, Parallels or Virtual Box.

Is it possible to detect the virtual machine type proogrammatically from C++ code?

I have solution only for VMware Fusion. cpuid assembler command return VMwareVMware string for CPU vendor. So it was easy.

But what about Parallels and Virtual Box? I have no idea at all.

Vlad
  • 2,090
  • 3
  • 21
  • 37

1 Answers1

1

I run ubuntu in parallels, and a number of devices report as being manufactured by Parallels, Inc. For example:

user@ubuntu:~$ lspci | grep Parallels
00:03.0 Unassigned class [ff00]: Parallels, Inc. Virtual Machine Communication Interface
01:00.0 VGA compatible controller: Parallels, Inc. Accelerated Virtual Video Adapter

In OS X, the system_profiler command returns a LOT of info about your system. I don't have a virtual machine to test this on, but I would guess that

system_profiler | grep Parallels

will put you on the right track.

flangford
  • 196
  • 4
  • yes. system_profiler -detailLevelFull returns huge report with a lot of information. Tomorow i will check it in the Parallels environment. But actually i 'd like to get his information programmatically from C++ code. I have checked opensource.apple.com. Unfortuanetly there was not system_profiler source code (( – Vlad Feb 12 '15 at 19:16