리눅스 VM여부 확인, 하이퍼바이저 확인

(리눅스 VM 하이퍼바이저 확인에서 넘어옴)
리눅스 자신이 VM인지 아닌지 확인
리눅스 VM 하이퍼바이저 확인
Guest OS 여부 확인

1 방법 1: virt-what ★[ | ]

[root@zetawiki ~]# virt-what 
kvm
[root@zetawiki ~]# virt-what 
vmware
[root@zetawiki ~]# virt-what
xen
xen-domU
[root@zetawiki ~]# virt-what
hyperv

2 방법 2: lscpu ★[ | ]

[root@zetawiki ~]# lscpu | grep Hypervisor
Hypervisor vendor:     KVM
[root@zetawiki02 ~]# lscpu | grep Hypervisor
Hypervisor vendor:     Xen
[root@zetawiki02 ~]# lscpu | grep Hypervisor
Hypervisor vendor:   Microsoft

3 방법 3: dmidecode[ | ]

dmidecode | head -5
dmidecode -s system-product-name
실행예시 (Xen VM)
[root@zetawiki ~]# dmidecode | head -5
/dev/mem: mmap: Bad address
# dmidecode 2.10
[root@zetawiki ~]# dmidecode | head -5
# dmidecode 2.11
# No SMBIOS nor DMI entry point found, sorry.
실행예시 (KVM)
[root@zetawiki ~]# dmidecode -s system-product-name
KVM
실행예시 (VMware VM)
[root@zetawiki ~]# dmidecode | head -5
# dmidecode 2.11
SMBIOS 2.4 present.
364 structures occupying 14150 bytes.
Table at 0x000E0010.
[root@zetawiki ~]# dmidecode -s system-product-name
VMware Virtual Platform
실행예시 (berametal)
[root@zetawiki ~]# dmidecode | head -5
# dmidecode 2.10
SMBIOS 2.6 present.
308 structures occupying 8320 bytes.
Table at 0x7F7FD000.
→ 단독서버의 경우
실행예시 (XenServer)
[root@zetawiki ~]# dmidecode | head -5
# dmidecode 2.7
SMBIOS 2.7 present.
127 structures occupying 3808 bytes.
Table at 0xDF7FE000.
→ 하이퍼바이저의 경우

4 방법 4: ethtool[ | ]

KVM
[root@zetawiki ~]# ethtool -i eth0 | grep driver
driver: virtio_net
Xen VM
[root@zetawiki ~]# ethtool -i eth0 | grep driver
driver: netfront
VMware VM
[root@zetawiki ~]# ethtool -i eth0 | grep driver
driver: e1000

5 방법 5: fdisk[ | ]

Xen VM
[root@zetawiki ~]# fdisk -l

Disk /dev/xvda: 31.4 GB, 31457280000 bytes
255 heads, 63 sectors/track, 3824 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot      Start         End      Blocks   Id  System
/dev/xvda1   *           1          13      104391   83  Linux
/dev/xvda2              14        3824    30611857+  8e  Linux LVM
KVM
[root@zetawiki ~]# fdisk -l

Disk /dev/vda: 42.9 GB, 42949672960 bytes
255 heads, 63 sectors/track, 5221 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/vda1   *           1          13      104391   83  Linux
/dev/vda2              14        5221    41833260   8e  Linux LVM
VMware VM, HyperV VM
[root@zetawiki ~]# fdisk -l

Disk /dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          38      305203+  83  Linux
/dev/sda2              39        2353    18595237+  83  Linux
/dev/sda3            2354        2610     2064352+  82  Linux swap / Solaris
→ VM이지만 sda로 나오므로 확인 어려움

6 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}