"리눅스 VM여부 확인, 하이퍼바이저 확인"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-</source> +</syntaxhighlight>, -<source +<syntaxhighlight ))
 
(다른 사용자 한 명의 중간 판 3개는 보이지 않습니다)
5번째 줄: 5번째 줄:
==방법 1: virt-what ★==
==방법 1: virt-what ★==
{{참고|리눅스 virt-what}}
{{참고|리눅스 virt-what}}
<source lang='console'>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# virt-what  
[root@zetawiki ~]# virt-what  
kvm
kvm
</source>
</syntaxhighlight>
<source lang='console'>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# virt-what  
[root@zetawiki ~]# virt-what  
vmware
vmware
</source>
</syntaxhighlight>
<source lang='console'>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# virt-what
[root@zetawiki ~]# virt-what
xen
xen
xen-domU
xen-domU
</source>
</syntaxhighlight>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# virt-what
hyperv
</syntaxhighlight>


==방법 2: lscpu ★==
==방법 2: lscpu ★==
<source lang='console'>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# lscpu | grep Hypervisor
[root@zetawiki ~]# lscpu | grep Hypervisor
Hypervisor vendor:    KVM
Hypervisor vendor:    KVM
</source>
</syntaxhighlight>
<source lang='console'>
<syntaxhighlight lang='console'>
[root@zetawiki02 ~]# lscpu | grep Hypervisor
[root@zetawiki02 ~]# lscpu | grep Hypervisor
Hypervisor vendor:    Xen
Hypervisor vendor:    Xen
</source>
</syntaxhighlight>
<syntaxhighlight lang='console'>
[root@zetawiki02 ~]# lscpu | grep Hypervisor
Hypervisor vendor:  Microsoft
</syntaxhighlight>


==방법 3: dmidecode==
==방법 3: dmidecode==
{{참고|리눅스 dmidecode}}
{{참고|리눅스 dmidecode}}
<source lang='bash'>
<syntaxhighlight lang='bash'>
dmidecode | head -5
dmidecode | head -5
</source>
</syntaxhighlight>
<source lang='bash'>
<syntaxhighlight lang='bash'>
dmidecode -s system-product-name
dmidecode -s system-product-name
</source>
</syntaxhighlight>


{{소스헤더|실행예시 (Xen VM)}}
{{소스헤더|실행예시 (Xen VM)}}
<source lang='console'>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# dmidecode | head -5
[root@zetawiki ~]# dmidecode | head -5
/dev/mem: mmap: Bad address
/dev/mem: mmap: Bad address
# dmidecode 2.10
# dmidecode 2.10
</source>
</syntaxhighlight>
<source lang='console'>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# dmidecode | head -5
[root@zetawiki ~]# dmidecode | head -5
# dmidecode 2.11
# dmidecode 2.11
# No SMBIOS nor DMI entry point found, sorry.
# No SMBIOS nor DMI entry point found, sorry.
</source>
</syntaxhighlight>


{{소스헤더|실행예시 (KVM)}}
{{소스헤더|실행예시 (KVM)}}
<source lang='console'>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# dmidecode -s system-product-name
[root@zetawiki ~]# dmidecode -s system-product-name
KVM
KVM
</source>
</syntaxhighlight>


{{소스헤더|실행예시 (VMware VM)}}
{{소스헤더|실행예시 (VMware VM)}}
<source lang='console'>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# dmidecode | head -5
[root@zetawiki ~]# dmidecode | head -5
# dmidecode 2.11
# dmidecode 2.11
63번째 줄: 71번째 줄:
364 structures occupying 14150 bytes.
364 structures occupying 14150 bytes.
Table at 0x000E0010.
Table at 0x000E0010.
</source>
</syntaxhighlight>
<source lang='console'>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# dmidecode -s system-product-name
[root@zetawiki ~]# dmidecode -s system-product-name
VMware Virtual Platform
VMware Virtual Platform
</source>
</syntaxhighlight>


{{소스헤더|실행예시 (berametal)}}
{{소스헤더|실행예시 (berametal)}}
<source lang='console'>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# dmidecode | head -5
[root@zetawiki ~]# dmidecode | head -5
# dmidecode 2.10
# dmidecode 2.10
76번째 줄: 84번째 줄:
308 structures occupying 8320 bytes.
308 structures occupying 8320 bytes.
Table at 0x7F7FD000.
Table at 0x7F7FD000.
</source>
</syntaxhighlight>
:→ 단독서버의 경우
:→ 단독서버의 경우


{{소스헤더|실행예시 (XenServer)}}
{{소스헤더|실행예시 (XenServer)}}
<source lang='console'>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# dmidecode | head -5
[root@zetawiki ~]# dmidecode | head -5
# dmidecode 2.7
# dmidecode 2.7
86번째 줄: 94번째 줄:
127 structures occupying 3808 bytes.
127 structures occupying 3808 bytes.
Table at 0xDF7FE000.
Table at 0xDF7FE000.
</source>
</syntaxhighlight>
:→ 하이퍼바이저의 경우
:→ 하이퍼바이저의 경우


==방법 4: ethtool==
==방법 4: ethtool==
{{소스헤더|KVM}}
{{소스헤더|KVM}}
<source lang='console'>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# ethtool -i eth0 | grep driver
[root@zetawiki ~]# ethtool -i eth0 | grep driver
driver: virtio_net
driver: virtio_net
</source>
</syntaxhighlight>


{{소스헤더|Xen VM}}
{{소스헤더|Xen VM}}
<source lang='console'>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# ethtool -i eth0 | grep driver
[root@zetawiki ~]# ethtool -i eth0 | grep driver
driver: netfront
driver: netfront
</source>
</syntaxhighlight>


{{소스헤더|VMware VM}}
{{소스헤더|VMware VM}}
<source lang='console'>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# ethtool -i eth0 | grep driver
[root@zetawiki ~]# ethtool -i eth0 | grep driver
driver: e1000
driver: e1000
</source>
</syntaxhighlight>


==방법 5: fdisk==
==방법 5: fdisk==
{{소스헤더|Xen VM}}
{{소스헤더|Xen VM}}
<source lang='console'>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# fdisk -l
[root@zetawiki ~]# fdisk -l


120번째 줄: 128번째 줄:
/dev/xvda1  *          1          13      104391  83  Linux
/dev/xvda1  *          1          13      104391  83  Linux
/dev/xvda2              14        3824    30611857+  8e  Linux LVM
/dev/xvda2              14        3824    30611857+  8e  Linux LVM
</source>
</syntaxhighlight>


{{소스헤더|KVM}}
{{소스헤더|KVM}}
<source lang='console'>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# fdisk -l
[root@zetawiki ~]# fdisk -l


133번째 줄: 141번째 줄:
/dev/vda1  *          1          13      104391  83  Linux
/dev/vda1  *          1          13      104391  83  Linux
/dev/vda2              14        5221    41833260  8e  Linux LVM
/dev/vda2              14        5221    41833260  8e  Linux LVM
</source>
</syntaxhighlight>


{{소스헤더|VMware VM}}
{{소스헤더|VMware VM, HyperV VM}}
<source lang='console'>
<syntaxhighlight lang='console'>
[root@zetawiki ~]# fdisk -l
[root@zetawiki ~]# fdisk -l


147번째 줄: 155번째 줄:
/dev/sda2              39        2353    18595237+  83  Linux
/dev/sda2              39        2353    18595237+  83  Linux
/dev/sda3            2354        2610    2064352+  82  Linux swap / Solaris
/dev/sda3            2354        2610    2064352+  82  Linux swap / Solaris
</source>
</syntaxhighlight>
:→ VM이지만 sda로 나오므로 확인 어려움
:→ VM이지만 sda로 나오므로 확인 어려움



2021년 1월 1일 (금) 00:00 기준 최신판

리눅스 자신이 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 }}