How to determine whether the current host is a physical machine or a virtual machine?

Windows:

Type in CMD: Systeminfo | findstr / i "System Model"

If "System Model" contains Virutal, it is a virtual machine, the others are physical machines

Or use the powershell command: get-wmiobject win32_computersystem | fl model

Linux:

Type in bash: dmidecode -s system-product-name

Or lshw -class system

Or dmesg | grep -i virtual

 

 

原文地址:https://www.cnblogs.com/MasterMonkInTemple/p/12161075.html