虛擬機:
root@heto1-k1:~/jiaxl5/jia_scripts/openstack/heto1# lscpu |grep vendor
Hypervisor vendor: KVM
root@heto1-k1:~/jiaxl5/jia_scripts/openstack/heto1# dmidecode -s system-manufacturer
QEMU
root@heto1-k1:~/jiaxl5/jia_scripts/openstack/heto1# virt-what
kvm
root@heto1-k1:~/jiaxl5/jia_scripts/openstack/heto1# dmidecode -s system-product-name
Standard PC (Q35 + ICH9, 2009)
(base) [root@sltvb7v2wy3 ~]# dmidecode -s system-product-name
OpenStack Nova
root@heto1-k1:~/jiaxl5/jia_scripts/openstack/heto1# lshw -class system
heto1-k1
description: Computer
product: Standard PC (Q35 + ICH9, 2009)
vendor: QEMU
version: pc-q35-2.11
width: 64 bits
capabilities: smbios-2.8 dmi-2.8 smp vsyscall32
configuration: boot=normal uuid=154091F6-0752-9949-B9A9-109BDA8519C6
*-pnp00:00
product: PnP device PNP0b00
physical id: 1
capabilities: pnp
configuration: driver=rtc_cmos
(base) [root@sltvb7v2wy3 ~]# dmesg | grep -i virtual
[ 0.000000] Booting paravirtualized kernel on KVM
[ 0.239723] KVM setup paravirtual spinlock
[ 3.062371] input: VirtualPS/2 VMware VMMouse as /devices/platform/i8042/serio1/input/input2
[ 3.062549] input: VirtualPS/2 VMware VMMouse as /devices/platform/i8042/serio1/input/input3
[ 3.075841] systemd[1]: Detected virtualization kvm.
[ 3.099964] systemd[1]: Starting Setup Virtual Console...
[ 3.132483] systemd[1]: Started Setup Virtual Console.
物理機:
root@heto1-j11:~# lscpu |grep vendor
root@heto1-j11:~#
root@heto1-j11:~# dmidecode -s system-manufacturer
Lenovo
root@heto1-j11:~# virt-what
root@heto1-j11:~#
root@heto1-j11:~# dmidecode -s system-product-name
ThinkSystem SR650 V2
root@heto1-j11:~# lshw -class system
heto1-j11
description: Rack Mount Chassis
product: ThinkSystem SR650 V2 (7Z73CTO1WW)
vendor: Lenovo
version: 07
serial: J30AAHLA
width: 64 bits
capabilities: smbios-3.3.0 dmi-3.3.0 smp vsyscall32
configuration: boot=normal chassis=rackmount family=ThinkSystem sku=7Z73CTO1WW uuid=F0D7D78E-9102-ED11-8B33-3A68DD80E28B
root@heto1-j11:~# dmesg | grep -i virtual
[ 4.373616] Booting paravirtualized kernel on bare hardware
[ 9.223455] DMAR: Intel(R) Virtualization Technology for Directed I/O
[ 10.503607] scsi 0:0:68:0: Enclosure LSI VirtualSES 03 PQ: 0 ANSI: 7
擴展閱讀
Intel的虛擬化技術(shù)稱為Intel-VT(Virtual Technology),
而AMD的叫做AMD-V(AMD Virtualization,AMD主板的BIOS中稱為SVM)。
如何檢查 Linux 系統(tǒng)是運行在虛擬機上還是物理機上月幌?
https://www.51cto.com/article/746440.html
簡介:
介紹了 dmidecode 和 virt-what
DMI 是桌面管理界面(Desktop Management Interface)的縮寫,是幾乎所有系統(tǒng)制造商都遵守的標(biāo)準(zhǔn)悬蔽。DMI 框架用于管理和跟蹤桌面扯躺、筆記本電腦或服務(wù)器計算機中的組件。
由于有了 DMI蝎困,我們可以獲得有關(guān)系統(tǒng)硬件缅帘、系統(tǒng)制造商和設(shè)備序列號的信息,而使用 dmidecode(DMI Decode)命令难衰,可以獲取這些信息钦无。另外,使用 -s system-manufacturer 也可獲取制造商的詳細信息盖袭。
如何檢查你拿到手的Linux系統(tǒng)是物理機失暂,還是虛擬機彼宠?
https://www.cnblogs.com/panw/p/16359561.html
簡介: