가상 머신에서 Ubuntu가 실행 중인지 확인하는 명령?


16

VirtualBox 또는 Qemu와 같은 가상화 프로그램 내에서 Ubuntu가 게스트로 실행 중인지 또는 베어 메탈에서 실행 중인지 확인하는 데 사용할 수있는 명령 또는 도구가 있습니까?

답변:


16

virt-what virt-what 설치 은 프로그램이 가상 머신에서 실행 중인지 감지하는 데 사용할 수있는 쉘 스크립트입니다.

이 프로그램은 휴리스틱에서 파생 된 가상 머신에 대한 "사실"목록을 인쇄합니다. 한 줄에 하나의 사실이 인쇄됩니다.

아무것도 인쇄되지 및 스크립트 종료 코드 0 (오류)로되어있는 경우, 그것은 의미 할 수 프로그램이 베어 메탈 (bare-metal)에서 실행되고 있는지 또는 프로그램이 우리가 알지 못하거나 할 수 없습니다 않는 가상 머신의 유형 내에서 실행됩니다 감지합니다.

요약

sudo virt-what [facts]

사리

aws Amazon Web Services cloud guest.

    Status: contributed by Qi Guo.

bhyve
    This is a bhyve (FreeBSD hypervisor) guest.

    Status: contributed by Leonardo Brondani Schenkel.

docker
    This is a Docker container.

    Status: confirmed by Charles Nguyen

hyperv
    This is Microsoft Hyper-V hypervisor.

    Status: confirmed by RWMJ

ibm_power-kvm
    This is an IBM POWER KVM guest.

    Status: contributed by Adrian Likins.

ibm_power-lpar_shared
ibm_power-lpar_dedicated
    This is an IBM POWER LPAR (hardware partition) in either shared or
    dedicated mode.

    Status: contributed by Adrian Likins.

ibm_systemz
    This is an IBM SystemZ (or other S/390) hardware partitioning
    system. Additional facts listed below may also be printed.

ibm_systemz-direct
    This is Linux running directly on a IBM SystemZ hardware
    partitioning system.

    This is expected to be a highly unusual configuration - if you see
    this result you should treat it with suspicion.

    Status: not confirmed

ibm_systemz-lpar
    This is Linux running directly on an LPAR on an IBM SystemZ hardware
    partitioning system.

    Status: confirmed by Thomas Huth

ibm_systemz-zvm
    This is a z/VM guest running in an LPAR on an IBM SystemZ hardware
    partitioning system.

    Status: confirmed by RWMJ using a Fedora guest running in z/VM

ibm_systemz-kvm
    This is a KVM guest running on an IBM System Z hardware system.

    Status: contributed by Thomas Huth

ldoms
    The guest appears to be running on an Linux SPARC system with Oracle
    VM Server for SPARC (Logical Domains) support.

    Status: contributed by Darren Kenny

ldoms-control
    The is the Oracle VM Server for SPARC (Logical Domains) control
    domain.

    Status: contributed by Darren Kenny

ldoms-guest
    The is the Oracle VM Server for SPARC (Logical Domains) guest
    domain.

    Status: contributed by Darren Kenny

ldoms-io
    The is the Oracle VM Server for SPARC (Logical Domains) I/O domain.

    Status: contributed by Darren Kenny

ldoms-root
    The is the Oracle VM Server for SPARC (Logical Domains) Root domain.

    Status: contributed by Darren Kenny

linux_vserver
    This is printed for backwards compatibility with older virt-what
    which could not distinguish between a Linux VServer container guest
    and host.

linux_vserver-guest
    This process is running in a Linux VServer container.

    Status: contributed by Barış Metin

linux_vserver-host
    This process is running as the Linux VServer host (VxID 0).

    Status: contributed by Barış Metin and Elan Ruusamäe

lxc This process is running in a Linux LXC container.

    Status: contributed by Marc Fournier

kvm This guest is running on the KVM hypervisor using hardware
    acceleration.

    Note that if the hypervisor is using software acceleration you
    should *not* see this, but should see the "qemu" fact instead.

    Status: confirmed by RWMJ.

lkvm
    This guest is running on the KVM hypervisor using hardware
    acceleration, and the userspace component of the hypervisor is lkvm
    (a.k.a kvmtool).

    Status: contributed by Andrew Jones

openvz
    The guest appears to be running inside an OpenVZ or Virtuozzo
    container.

    Status: contributed by Evgeniy Sokolov

ovirt
    The guest is running on an oVirt node. (See also "rhev" below).

    Status: contributed by RWMJ, not confirmed

parallels
    The guest is running inside Parallels Virtual Platform (Parallels
    Desktop, Parallels Server).

    Status: contributed by Justin Clift

powervm_lx86
    The guest is running inside IBM PowerVM Lx86 Linux/x86 emulator.

    Status: data originally supplied by Jeffrey Scheel, confirmed by
    Yufang Zhang and RWMJ

qemu
    This is QEMU hypervisor using software emulation.

    Note that for KVM (hardware accelerated) guests you should *not* see
    this.

    Status: confirmed by RWMJ.

rhev
    The guest is running on a Red Hat Enterprise Virtualization (RHEV)
    node.

    Status: confirmed by RWMJ

uml This is a User-Mode Linux (UML) guest.

    Status: contributed by Laurent Léonard

virt
    Some sort of virtualization appears to be present, but we are not
    sure what it is. In some very rare corner cases where we know that
    virtualization is hard to detect, we will try a timing attack to see
    if certain machine instructions are running much more slowly than
    they should be, which would indicate virtualization. In this case,
    the generic fact "virt" is printed.

virtage
    This is Hitachi Virtualization Manager (HVM) Virtage hardware
    partitioning system.

    Status: data supplied by Bhavna Sarathy, not confirmed

virtualbox
    This is a VirtualBox guest.

    Status: contributed by Laurent Léonard

virtualpc
    The guest appears to be running on Microsoft VirtualPC.

    Status: not confirmed

vmm This is a vmm (OpenBSD hypervisor) guest.

    Status: contributed by Jasper Lievisse Adriaanse.

vmware
    The guest appears to be running on VMware hypervisor.

    Status: confirmed by RWMJ

xen The guest appears to be running on Xen hypervisor.

    Status: confirmed by RWMJ

xen-dom0
    This is the Xen dom0 (privileged domain).

    Status: confirmed by RWMJ

xen-domU
    This is a Xen domU (paravirtualized guest domain).

    Status: confirmed by RWMJ

xen-hvm
    This is a Xen guest fully virtualized (HVM).

    Status: confirmed by RWMJ

미안하지만 이것은 당신의 녀석입니다 ....)


6

lspci'VirtualBox'문자열을 실행 하고 확인하십시오.

당신은 실행할 수 있습니다 lspci | grep VirtualBox

lsusb문자열 'VirtualBox'를 실행 하고 확인할 수도 있습니다 . 와 같은lsusb | grep VirtualBox

또한 dmesg작동, 실행 dmesg | grep VirtualBox또는dmesg | grep virtual


virtualbox 게스트를 실행하는 호스트에 하나 이상의 virtualbox 메시지가 나타날 수 있으므로 dmesg 옵션을 삭제합니다. 그러나 lspci와 lsusb는 좋습니다.
Joe P

커맨드 라인 솔루션이 패키지를 설치하는 것보다 낫다고 생각합니다. 패키지를 설치하기 위해 시스템에 대한 수퍼 유저 권한이 있다면 가상화되었는지 확실하지 않습니까?
Joe P

@JoeP 당신 말이 맞아요 ... 당신의 컴퓨터에서 스크립트를 실행하고 호스트가 가상화되었는지 아닌지를 알아야한다면 어떻게해야합니까?
메이

당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.