.\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "VIRT-WHAT 1"
.TH VIRT-WHAT 1 2024-09-28 virt-what-1.27 "Virtualization Support"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
virt\-what \- detect if we are running in a virtual machine
.SH SUMMARY
.IX Header "SUMMARY"
virt-what [options]
.SH DESCRIPTION
.IX Header "DESCRIPTION"
\&\f(CW\*(C`virt\-what\*(C'\fR is a shell script which can be used to detect if the
program is running in a virtual machine.
.PP
The program prints out a list of "facts" about the virtual machine,
derived from heuristics. One fact is printed per line.
.PP
If nothing is printed and the script exits with code 0 (no error),
then it can mean \fIeither\fR that the program is running on bare-metal
\&\fIor\fR the program is running inside a type of virtual machine which we
don't know about or cannot detect.
.SH FACTS
.IX Header "FACTS"
.IP \fBalibaba_cloud\fR 4
.IX Item "alibaba_cloud"
.PD 0
.IP \fBalibaba_cloud\-ebm\fR 4
.IX Item "alibaba_cloud-ebm"
.PD
This is a cloud computing service based on Alibaba Cloud.
.Sp
Status: contributed by Weisson.
.IP \fBaws\fR 4
.IX Item "aws"
Amazon Web Services.
.Sp
Note that virt-what will print this fact for baremetal AWS instances,
which you might not consider to be true virtualization. In this case
other facts (eg. \f(CW\*(C`kvm\*(C'\fR or \f(CW\*(C`xen\*(C'\fR) would \fInot\fR be present.
.Sp
Status: contributed by Qi Guo, Vitaly Kuznetsov, confirmed by RWMJ.
.IP \fBbhyve\fR 4
.IX Item "bhyve"
This is a bhyve (FreeBSD hypervisor) guest.
.Sp
Status: contributed by Leonardo Brondani Schenkel.
.IP \fBcrio\fR 4
.IX Item "crio"
The guest is running in a CRI-O container.
.Sp
Status: suggested by Alessandro Taufer, confirmed by RWMJ & Xiaodai Wang
.IP \fBdocker\fR 4
.IX Item "docker"
This is a Docker container.
.Sp
Status: confirmed by Charles Nguyen
.IP \fBgoogle_cloud\fR 4
.IX Item "google_cloud"
This is running on Google Cloud Platform / Google Compute Engine.
.Sp
Status: confirmed by RWMJ
.IP \fBhyperv\fR 4
.IX Item "hyperv"
This is Microsoft Hyper-V hypervisor.
.Sp
Status: confirmed by RWMJ
.IP \fBibm_power\-kvm\fR 4
.IX Item "ibm_power-kvm"
This is an IBM POWER KVM guest.
.Sp
Status: contributed by Adrian Likins.
.IP \fBibm_power\-lpar_shared\fR 4
.IX Item "ibm_power-lpar_shared"
.PD 0
.IP \fBibm_power\-lpar_dedicated\fR 4
.IX Item "ibm_power-lpar_dedicated"
.PD
This is an IBM POWER LPAR (hardware partition) in either shared
or dedicated mode.
.Sp
Status: contributed by Adrian Likins.
.IP \fBibm_systemz\fR 4
.IX Item "ibm_systemz"
This is an IBM SystemZ (or other S/390) hardware partitioning system.
Additional facts listed below may also be printed.
.IP \fBibm_systemz\-direct\fR 4
.IX Item "ibm_systemz-direct"
This is Linux running directly on an IBM SystemZ hardware partitioning
system.
.Sp
This is expected to be a highly unusual configuration \- if
you see this result you should treat it with suspicion.
.Sp
Status: not confirmed
.IP \fBibm_systemz\-lpar\fR 4
.IX Item "ibm_systemz-lpar"
This is Linux running directly on an LPAR on an IBM SystemZ
hardware partitioning system.
.Sp
Status: confirmed by Thomas Huth
.IP \fBibm_systemz\-zvm\fR 4
.IX Item "ibm_systemz-zvm"
This is a z/VM guest running in an LPAR on an IBM SystemZ
hardware partitioning system.
.Sp
Status: confirmed by RWMJ using a Fedora guest running in z/VM
.IP \fBibm_systemz\-kvm\fR 4
.IX Item "ibm_systemz-kvm"
This is a KVM guest running on an IBM System Z hardware system.
.Sp
Status: contributed by Thomas Huth
.IP \fBillumos-lx\fR 4
.IX Item "illumos-lx"
The guest is running on Illumos with a Linux syscall emulation layer.
.Sp
Status: contributed by Steve Mokris
.IP \fBldoms\fR 4
.IX Item "ldoms"
The guest appears to be running on a Linux SPARC system with
Oracle VM Server for SPARC (Logical Domains) support.
.Sp
Status: contributed by Darren Kenny
.IP \fBldoms-control\fR 4
.IX Item "ldoms-control"
The is the Oracle VM Server for SPARC (Logical Domains) control domain.
.Sp
Status: contributed by Darren Kenny
.IP \fBldoms-guest\fR 4
.IX Item "ldoms-guest"
The is the Oracle VM Server for SPARC (Logical Domains) guest domain.
.Sp
Status: contributed by Darren Kenny
.IP \fBldoms-io\fR 4
.IX Item "ldoms-io"
The is the Oracle VM Server for SPARC (Logical Domains) I/O domain.
.Sp
Status: contributed by Darren Kenny
.IP \fBldoms-root\fR 4
.IX Item "ldoms-root"
The is the Oracle VM Server for SPARC (Logical Domains) Root domain.
.Sp
Status: contributed by Darren Kenny
.IP \fBlinux_vserver\fR 4
.IX Item "linux_vserver"
This is printed for backwards compatibility with older virt-what which
could not distinguish between a Linux VServer container guest and
host.
.IP \fBlinux_vserver\-guest\fR 4
.IX Item "linux_vserver-guest"
This process is running in a Linux VServer container.
.Sp
Status: contributed by Barış Metin
.IP \fBlinux_vserver\-host\fR 4
.IX Item "linux_vserver-host"
This process is running as the Linux VServer host (VxID 0).
.Sp
Status: contributed by Barış Metin and Elan Ruusamäe
.IP \fBlxc\fR 4
.IX Item "lxc"
This process is running in a Linux LXC container.
.Sp
Status: contributed by Marc Fournier
.IP \fBkvm\fR 4
.IX Item "kvm"
This guest is running on the KVM hypervisor using hardware
acceleration.
.Sp
Note that if the hypervisor is using software acceleration
you should \fInot\fR see this, but should see the \f(CW\*(C`qemu\*(C'\fR fact
instead.
.Sp
Status: confirmed by RWMJ.
.IP \fBlkvm\fR 4
.IX Item "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).
.Sp
Status: contributed by Andrew Jones
.IP \fBnutanix_ahv\fR 4
.IX Item "nutanix_ahv"
The guest is running inside Nutanix Acropolis Hypervisor (AHV).
.Sp
Status: confirmed by RWMJ.
.IP \fBoci\fR 4
.IX Item "oci"
The guest is running in an OCI container.
.Sp
Status: contributed by Alessandro Valentini, confirmed by RWMJ
.IP \fBopenvz\fR 4
.IX Item "openvz"
The guest appears to be running inside an OpenVZ or Virtuozzo
container.
.Sp
Status: contributed by Evgeniy Sokolov
.IP \fBovirt\fR 4
.IX Item "ovirt"
The guest is running on an oVirt node.
(See also \f(CW\*(C`rhev\*(C'\fR below).
.Sp
Status: contributed by RWMJ, not confirmed
.IP \fBparallels\fR 4
.IX Item "parallels"
The guest is running inside Parallels Virtual Platform
(Parallels Desktop, Parallels Server).
.Sp
Status: contributed by Justin Clift
.IP \fBpodman\fR 4
.IX Item "podman"
This is a Podman container. (See also \f(CW\*(C`oci\*(C'\fR above.)
.Sp
Status: contributed by Jordan Webb
.IP \fBpowervm_lx86\fR 4
.IX Item "powervm_lx86"
The guest is running inside IBM PowerVM Lx86 Linux/x86 emulator.
.Sp
Status: data originally supplied by Jeffrey Scheel, confirmed by
Yufang Zhang and RWMJ
.IP \fBqemu\fR 4
.IX Item "qemu"
This is QEMU hypervisor using software emulation.
.Sp
Note that for KVM (hardware accelerated) guests you should \fInot\fR see
this.
.Sp
Status: confirmed by RWMJ.
.IP \fBrhev\fR 4
.IX Item "rhev"
The guest is running on a Red Hat Enterprise Virtualization (RHEV) node.
.Sp
Status: confirmed by RWMJ
.IP \fBredhat\fR 4
.IX Item "redhat"
The guest is running on the Red Hat hypervisor.
.Sp
Status: confirmed by RWMJ
.IP \fBuml\fR 4
.IX Item "uml"
This is a User-Mode Linux (UML) guest.
.Sp
Status: contributed by Laurent Léonard
.IP \fBupcloud\fR 4
.IX Item "upcloud"
This is running on UpCloud.
.Sp
Status: contributed by Ville Skyttä
.IP \fBvirt\fR 4
.IX Item "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 \f(CW\*(C`virt\*(C'\fR is printed.
.IP \fBvirtage\fR 4
.IX Item "virtage"
This is Hitachi Virtualization Manager (HVM) Virtage
hardware partitioning system.
.Sp
Status: data supplied by Bhavna Sarathy, not confirmed
.IP \fBvirtualbox\fR 4
.IX Item "virtualbox"
This is a VirtualBox guest.
.Sp
Status: contributed by Laurent Léonard
.IP \fBvirtualpc\fR 4
.IX Item "virtualpc"
The guest appears to be running on Microsoft VirtualPC.
.Sp
Status: not confirmed
.IP \fBvmm\fR 4
.IX Item "vmm"
This is a vmm (OpenBSD hypervisor) guest.
.Sp
Status: contributed by Jasper Lievisse Adriaanse.
.IP \fBvmware\fR 4
.IX Item "vmware"
The guest appears to be running on VMware hypervisor.
.Sp
Status: confirmed by RWMJ
.IP \fBxen\fR 4
.IX Item "xen"
The guest appears to be running on Xen hypervisor.
.Sp
Status: confirmed by RWMJ
.IP \fBxen\-dom0\fR 4
.IX Item "xen-dom0"
This is the Xen dom0 (privileged domain).
.Sp
Status: confirmed by RWMJ
.IP \fBxen-domU\fR 4
.IX Item "xen-domU"
This is a Xen domU (paravirtualized guest domain).
.Sp
Status: confirmed by RWMJ
.IP \fBxen-hvm\fR 4
.IX Item "xen-hvm"
This is a Xen guest fully virtualized (HVM).
.Sp
Status: confirmed by RWMJ
.SH "EXIT STATUS"
.IX Header "EXIT STATUS"
Programs that use or wrap \f(CW\*(C`virt\-what\*(C'\fR should check that the exit
status is 0 before they attempt to parse the output of the command.
.PP
A non-zero exit status indicates some error, for example, an
unrecognized command line argument. If the exit status is non-zero
then the output "facts" (if any were printed) cannot be guaranteed and
should be ignored.
.PP
The exit status does \fInot\fR have anything to do with whether the
program is running on baremetal or under virtualization, nor with
whether \f(CW\*(C`virt\-what\*(C'\fR managed detection "correctly" (which is basically
unknowable given the large variety of virtualization systems out there
and that some systems deliberately emulate others).
.SH "RUNNING VIRT-WHAT FROM OTHER PROGRAMS"
.IX Header "RUNNING VIRT-WHAT FROM OTHER PROGRAMS"
\&\f(CW\*(C`virt\-what\*(C'\fR is designed so that you can easily run it from
other programs or wrap it up in a library.
.PP
Your program should check the exit status (see the section above).
.PP
Some programming languages (notably Python: issue 1652) erroneously
mask the \f(CW\*(C`SIGPIPE\*(C'\fR signal and do not restore it when executing
subprocesses. \f(CW\*(C`virt\-what\*(C'\fR is a shell script and some shell commands
do not work correctly when you do this. You may see warnings from
\&\f(CW\*(C`virt\-what\*(C'\fR similar to this:
.PP
.Vb 1
\& echo: write error: Broken pipe
.Ve
.PP
The solution is to set the \f(CW\*(C`SIGPIPE\*(C'\fR signal handler back to \f(CW\*(C`SIG_DFL\*(C'\fR
before running \f(CW\*(C`virt\-what\*(C'\fR.
.SH "IMPORTANT NOTE"
.IX Header "IMPORTANT NOTE"
Most of the time, using this program is the \fIwrong\fR thing to do.
Instead you should detect the specific features you actually want to
use. (As an example, if you wanted to issue Xen hypervisor commands
you would look for the \f(CW\*(C`/proc/xen/privcmd\*(C'\fR file).
.PP
However people keep asking for this, so we provide it. There are a
few legitimate uses:
.IP "Bug reporting tool" 4
.IX Item "Bug reporting tool"
If you think that virtualization could affect how your program runs,
then you might use \f(CW\*(C`virt\-what\*(C'\fR to report this in a bug reporting
tool.
.IP "Status display and monitoring tools" 4
.IX Item "Status display and monitoring tools"
You might include this information in status and monitoring programs.
.IP "System tuning (sometimes)" 4
.IX Item "System tuning (sometimes)"
You might use this program to tune an operating system so it runs
better as a virtual machine of a particular hypervisor. However if
installing paravirtualized drivers, it's better to check for the
specific features your drivers need (eg. for the presence of PCI devices).
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBvirt\-what\-cvm\fR\|(1),
,
,
,
,
,
,
.SH AUTHORS
.IX Header "AUTHORS"
Richard W.M. Jones
.SH COPYRIGHT
.IX Header "COPYRIGHT"
(C) Copyright 2008\-2024 Red Hat Inc.,
.PP
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
.PP
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.PP
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
.SH "REPORTING BUGS"
.IX Header "REPORTING BUGS"
Bugs can be viewed on the Red Hat Bugzilla page:
.
.PP
If you find a bug in virt-what, please follow these steps to report it:
.IP "1. Check for existing bug reports" 4
.IX Item "1. Check for existing bug reports"
Go to and search for similar bugs.
Someone may already have reported the same bug, and they may even
have fixed it.
.IP "2. Capture debug and error messages" 4
.IX Item "2. Capture debug and error messages"
Run
.Sp
.Vb 1
\& virt\-what > virt\-what.log 2>&1
.Ve
.Sp
and keep \fIvirt\-what.log\fR. It may contain error messages which you
should submit with your bug report.
.IP "3. Get version of virt-what." 4
.IX Item "3. Get version of virt-what."
Run
.Sp
.Vb 1
\& virt\-what \-\-version
.Ve
.IP "4. Submit a bug report." 4
.IX Item "4. Submit a bug report."
Go to and enter a new bug.
Please describe the problem in as much detail as possible.
.Sp
Remember to include the version numbers (step 3) and the debug
messages file (step 2) and as much other detail as possible.
.IP "5. Assign the bug to rjones @ redhat.com" 4
.IX Item "5. Assign the bug to rjones @ redhat.com"
Assign or reassign the bug to \fBrjones @ redhat.com\fR (without the
spaces). You can also send me an email with the bug number if you
want a faster response.