Linux下查看虚拟机还是物理机
1.dmesg命令
[root@Template ~]# dmesg |grep -i hypervisor
[ 0.000000] Hypervisor detected: KVM
2.lscpu命令
[root@Template ~]# lscpu|grep Hypervisor
Hypervisor vendor: KVM
Hypervisor vendor: KVM #虚拟机
Virtualization: VT-x #实体机
KVM:
虚拟化技术有两种类型的实现:
Type-I : hypervisor------>VM
Type-II:host------>VM----->VMS
3.systemd-detect-virt命令
[root@Template ~]# systemd-detect-virt
kvm

4.dmidecode命令
[root@Template ~]# dmidecode -t 1
# dmidecode 3.2
Getting SMBIOS data from sysfs.
SMBIOS 2.8 present.
Handle 0x0100, DMI type 1, 27 bytes
System Information
Manufacturer: QEMU
Product Name: Standard PC (i440FX + PIIX, 1996)
Version: pc-i440fx-7.2
Serial Number: Not Specified
UUID: 691b84b0-ff79-4d28-bcba-19fc255abdf0
Wake-up Type: Power Switch
SKU Number: Not Specified
Family: Not Specified