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


如何判断当前主机是物理机还是虚拟机?


Windows:

在CMD里输入:Systeminfo | findstr /i "System Model"

如果System Model:后面含有Virutal就是虚拟机,其他都是物理机

或者用powershell命令:get-wmiobject win32_computersystem | fl model

Linux:

在bash里输入:dmidecode -s system-product-name

或者lshw -class system

或者dmesg | grep -i virtual

具体参考:http://unix.stackexchange.com/questions/89714/easy-way-to-determine-virtualization-technology

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325260027&siteId=291194637