Linux服务器:
[[email protected] ~]# dmidecode -s system-product-name
Alibaba Cloud ECS
[[email protected] ~]# lshw -class system
manage.ansible.com
description: Computer
product: Alibaba Cloud ECS
vendor: Alibaba Cloud
version: pc-i440fx-2.1
serial: ca717e64-75b1-45a1-b89f-004d6eb63ec0
width: 64 bits
capabilities: smbios-2.8 dmi-2.8 smp vsyscall32
configuration: boot=normal uuid=647E71CA-B175-A145-B89F-004D6EB63EC0
*-pnp00:00
product: PnP device PNP0b00
physical id: 1
capabilities: pnp
configuration: driver=rtc_cmos
[[email protected] ~]# dmesg | grep -i virtual
[ 0.000000] Booting paravirtualized kernel on KVM
[ 0.072025] KVM setup paravirtual spinlock
[ 1.195196] input: VirtualPS/2 VMware VMMouse as /devices/platform/i8042/serio1/input/input2
[ 1.195515] input: VirtualPS/2 VMware VMMouse as /devices/platform/i8042/serio1/input/input3
[ 1.249767] systemd[1]: Detected virtualization kvm.
[ 1.346833] systemd[1]: Starting Setup Virtual Console...
Windows服务器:
在CMD里输入:Systeminfo | findstr /i "System Model"
如果System Model:后面含有Virutal就是虚拟机,其他都是物理机
如果使用powershell命令:get-wmiobject win32_computersystem | fl model
原文地址:https://blog.51cto.com/molewan/2487364
时间: 2024-09-28 21:18:20