.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" 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 .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' '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 turned on, 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. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "VIRT-WHAT 1" .TH VIRT-WHAT 1 "2012-04-22" "virt-what-1.12" "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 \*(L"facts\*(R" 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 "\fBhyperv\fR" 4 .IX Item "hyperv" This is Microsoft Hyper-V hypervisor. .Sp Status: confirmed by \s-1RWMJ\s0 .IP "\fBibm_systemz\fR" 4 .IX Item "ibm_systemz" This is an \s-1IBM\s0 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 a \s-1IBM\s0 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 \s-1LPAR\s0 on an \s-1IBM\s0 SystemZ hardware partitioning system. .Sp Status: not confirmed .IP "\fBibm_systemz\-zvm\fR" 4 .IX Item "ibm_systemz-zvm" This is a z/VM guest running in an \s-1LPAR\s0 on an \s-1IBM\s0 SystemZ hardware partitioning system. .Sp Status: confirmed by \s-1RWMJ\s0 using a Fedora guest running in z/VM .IP "\fBlinux_vserver\fR" 4 .IX Item "linux_vserver" This process is running in a Linux VServer container. .Sp Status: contributed by BarXX Metin .IP "\fBkvm\fR" 4 .IX Item "kvm" This guest is running on the \s-1KVM\s0 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 \s-1RWMJ\s0. .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 "\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 "\fBpowervm_lx86\fR" 4 .IX Item "powervm_lx86" The guest is running inside \s-1IBM\s0 PowerVM Lx86 Linux/x86 emulator. .Sp Status: data originally supplied by Jeffrey Scheel, confimed by Yufang Zhang and \s-1RWMJ\s0 .IP "\fBqemu\fR" 4 .IX Item "qemu" This is \s-1QEMU\s0 hypervisor using software emulation. .Sp Note that for \s-1KVM\s0 (hardware accelerated) guests you should \fInot\fR see this. .Sp Status: confirmed by \s-1RWMJ\s0. .IP "\fBuml\fR" 4 .IX Item "uml" This is a User-Mode Linux (\s-1UML\s0) guest. .Sp Status: contributed by Laurent Le\*'onard .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 (\s-1HVM\s0) 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 Le\*'onard .IP "\fBvirtualpc\fR" 4 .IX Item "virtualpc" The guest appears to be running on Microsoft VirtualPC. .Sp Status: not confirmed .IP "\fBvmware\fR" 4 .IX Item "vmware" The guest appears to be running on VMware hypervisor. .Sp Status: confirmed by \s-1RWMJ\s0 .IP "\fBxen\fR" 4 .IX Item "xen" The guest appears to be running on Xen hypervisor. .Sp Status: confirmed by \s-1RWMJ\s0 .IP "\fBxen\-dom0\fR" 4 .IX Item "xen-dom0" This is the Xen dom0 (privileged domain). .Sp Status: confirmed by \s-1RWMJ\s0 .IP "\fBxen-domU\fR" 4 .IX Item "xen-domU" This is a Xen domU (paravirtualized guest domain). .Sp Status: confirmed by \s-1RWMJ\s0 .IP "\fBxen-hvm\fR" 4 .IX Item "xen-hvm" This is a Xen guest fully virtualized (\s-1HVM\s0). .Sp Status: confirmed by \s-1RWMJ\s0 .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 \*(L"facts\*(R" (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 \*(L"correctly\*(R" (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. .SH "SEE ALSO" .IX Header "SEE ALSO" http://people.redhat.com/~rjones/virt\-what/ , , , , , , .SH "AUTHORS" .IX Header "AUTHORS" Richard W.M. Jones .SH "COPYRIGHT" .IX Header "COPYRIGHT" (C) Copyright 2008\-2011 Red Hat Inc., http://people.redhat.com/~rjones/virt\-what/ .PP This program is free software; you can redistribute it and/or modify it under the terms of the \s-1GNU\s0 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 \s-1WITHOUT\s0 \s-1ANY\s0 \s-1WARRANTY\s0; without even the implied warranty of \&\s-1MERCHANTABILITY\s0 or \s-1FITNESS\s0 \s-1FOR\s0 A \s-1PARTICULAR\s0 \s-1PURPOSE\s0. See the \&\s-1GNU\s0 General Public License for more details. .PP You should have received a copy of the \s-1GNU\s0 General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, \s-1MA\s0 02139, \s-1USA\s0. .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.