[英]How to determine virtual machine type from guest OS X from C++?
How to determine virtual machine type from guest OS X? 如何从来宾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.
主机操作系统是OS X,来宾操作系统也是OSX。并且以下虚拟机之一是VMware Fusion,Parallels或Virtual Box。
Is it possible to detect the virtual machine type proogrammatically from C++ code? 是否可以从C ++代码中按程序检测虚拟机类型?
I have solution only for VMware Fusion. 我只有VMware Fusion的解决方案。 cpuid assembler command return VMwareVMware string for CPU vendor.
cpuid assembler命令返回CPU供应商的VMwareVMware字符串。 So it was easy.
这样很容易。
But what about Parallels and Virtual Box? 但是Parallels和Virtual Box呢? I have no idea at all.
我一点都不知道
I run ubuntu in parallels, and a number of devices report as being manufactured by Parallels, Inc. For example: 我并行运行ubuntu,许多设备报告为Parallels,Inc.制造。例如:
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. 在OS X中,system_profiler命令返回许多有关您的系统的信息。 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. 将使您走上正确的道路。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.