简体   繁体   English

如何从C ++的来宾OS X确定虚拟机类型?

[英]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.

相关问题 如何将文件从 docker 虚拟机复制到 OS X 上的主机? - How to copy file from docker virtual machine to the host on OS X? 如何从 Swift 确定设备类型? (OS X 或 iOS) - How to determine device type from Swift? (OS X or iOS) 如何确定进程所有者是否是C ++中Mac OS X的管理员 - How to determine if the process owner is an administrator on Mac OS X in C++ 如何在Mac OS X上从虚拟环境运行scrapy - how to run scrapy from virtual env on mac os x 从C / C ++程序在Mac OS X上对进程进行采样 - Sample a process on Mac OS X from a C/C++ program 如何检测 Mac OS X 是否正在虚拟机中运行 - How to detect if Mac OS X is being run inside a Virtual Machine 在OS X上从C ++到Arduino编程语言的通信 - Communication from C++ to Arduino Programming language on OS X 我可以确定操作系统是否在可可的虚拟机中运行吗? - Can I determine whether the OS is run in a virtual machine in cocoa? 如何获得gcc 4.5(从源代码编译)在Mac OS X上使用Objective C | C ++程序? - How do I get gcc 4.5 (compiled from source) to work with Objective C|C++ programs on Mac OS X? 目标C:如何以编程方式检查OS X中的来宾登录权限首选项 - Objective C: How to programmatically check guest login permission preference in OS X
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM