如何查找 Windows 是在虚拟机上还是在物理机上运行?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19499974/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 11:00:51  来源:igfitidea点击:

How to find if windows is running on a vm or on a physical machine?

windowsvirtual-machine

提问by usha

I have a windows server where we run some of the project managements services. I usually remote desktop into it to manage the service.

我有一个 Windows 服务器,我们在其中运行一些项目管理服务。我通常远程桌面进入它来管理服务。

The service has become really slow and the documentation says that its not advisable to run the service on a VM.

该服务变得非常缓慢,文档说不建议在 VM 上运行该服务。

Now how do i find out if the windows install is running on a VM?

现在如何确定 Windows 安装是否在 VM 上运行?

回答by Samuel Nicholson

You could take a look through device manager, you'll most likely have quite a few VMWare of virtual drivers that you wouldn't get on a physical machine.

您可以查看设备管理器,您很可能会拥有很多在物理机上无法获得的 VMWare 虚拟驱动程序。

Also you could type systeminfointo a CMD window and if it says System Manufacturer: VMware, Inc.or similar instead of Microsoft Windows then you'll be able to work out of the set-up is virtual or not.

此外,您可以systeminfo在 CMD 窗口中键入内容,如果它显示System Manufacturer: VMware, Inc.或类似而不是 Microsoft Windows,那么您将能够确定设置是否为虚拟。

回答by user6751391

For windows, Click Start → Write msinfo32 → press Enter

对于 Windows,单击开始 → 写入 msinfo32 → 按 Enter

System manufacturer info will display "VMWare. Inc" if it is a VMWare VM. Probably other VM platforms like Hyper-V, etc. will also fill this info.

如果是 VMWare VM,系统制造商信息将显示“VMWare. Inc”。可能其他 VM 平台(如 Hyper-V 等)也会填写此信息。

回答by Waman

Try this code:

试试这个代码:

@echo off
systeminfo > temp.txt
findstr /e "System Model:              Virtual Machine" temp.txt
del temp.txt
if errorlevel 1 (
    echo Physical machine

) else (
    echo Virtual machine
)