1VIRT-WHAT(1)                Virtualization Support                VIRT-WHAT(1)
2
3
4

NAME

6       virt-what - detect if we are running in a virtual machine
7

SUMMARY

9       virt-what [options]
10

DESCRIPTION

12       "virt-what" is a shell script which can be used to detect if the
13       program is running in a virtual machine.
14
15       The program prints out a list of "facts" about the virtual machine,
16       derived from heuristics.  One fact is printed per line.
17
18       If nothing is printed and the script exits with code 0 (no error), then
19       it can mean either that the program is running on bare-metal or the
20       program is running inside a type of virtual machine which we don't know
21       about or cannot detect.
22

FACTS

24       aws Amazon Web Services cloud guest.
25
26           Status: contributed by Qi Guo.
27
28       bhyve
29           This is a bhyve (FreeBSD hypervisor) guest.
30
31           Status: contributed by Leonardo Brondani Schenkel.
32
33       docker
34           This is a Docker container.
35
36           Status: confirmed by Charles Nguyen
37
38       hyperv
39           This is Microsoft Hyper-V hypervisor.
40
41           Status: confirmed by RWMJ
42
43       ibm_power-kvm
44           This is an IBM POWER KVM guest.
45
46           Status: contributed by Adrian Likins.
47
48       ibm_power-lpar_shared
49       ibm_power-lpar_dedicated
50           This is an IBM POWER LPAR (hardware partition) in either shared or
51           dedicated mode.
52
53           Status: contributed by Adrian Likins.
54
55       ibm_systemz
56           This is an IBM SystemZ (or other S/390) hardware partitioning
57           system.  Additional facts listed below may also be printed.
58
59       ibm_systemz-direct
60           This is Linux running directly on a IBM SystemZ hardware
61           partitioning system.
62
63           This is expected to be a highly unusual configuration - if you see
64           this result you should treat it with suspicion.
65
66           Status: not confirmed
67
68       ibm_systemz-lpar
69           This is Linux running directly on an LPAR on an IBM SystemZ
70           hardware partitioning system.
71
72           Status: confirmed by Thomas Huth
73
74       ibm_systemz-zvm
75           This is a z/VM guest running in an LPAR on an IBM SystemZ hardware
76           partitioning system.
77
78           Status: confirmed by RWMJ using a Fedora guest running in z/VM
79
80       ibm_systemz-kvm
81           This is a KVM guest running on an IBM System Z hardware system.
82
83           Status: contributed by Thomas Huth
84
85       ldoms
86           The guest appears to be running on an Linux SPARC system with
87           Oracle VM Server for SPARC (Logical Domains) support.
88
89           Status: contributed by Darren Kenny
90
91       ldoms-control
92           The is the Oracle VM Server for SPARC (Logical Domains) control
93           domain.
94
95           Status: contributed by Darren Kenny
96
97       ldoms-guest
98           The is the Oracle VM Server for SPARC (Logical Domains) guest
99           domain.
100
101           Status: contributed by Darren Kenny
102
103       ldoms-io
104           The is the Oracle VM Server for SPARC (Logical Domains) I/O domain.
105
106           Status: contributed by Darren Kenny
107
108       ldoms-root
109           The is the Oracle VM Server for SPARC (Logical Domains) Root
110           domain.
111
112           Status: contributed by Darren Kenny
113
114       linux_vserver
115           This is printed for backwards compatibility with older virt-what
116           which could not distinguish between a Linux VServer container guest
117           and host.
118
119       linux_vserver-guest
120           This process is running in a Linux VServer container.
121
122           Status: contributed by BarXX Metin
123
124       linux_vserver-host
125           This process is running as the Linux VServer host (VxID 0).
126
127           Status: contributed by BarXX Metin and Elan Ruusamaee
128
129       lxc This process is running in a Linux LXC container.
130
131           Status: contributed by Marc Fournier
132
133       kvm This guest is running on the KVM hypervisor using hardware
134           acceleration.
135
136           Note that if the hypervisor is using software acceleration you
137           should not see this, but should see the "qemu" fact instead.
138
139           Status: confirmed by RWMJ.
140
141       lkvm
142           This guest is running on the KVM hypervisor using hardware
143           acceleration, and the userspace component of the hypervisor is lkvm
144           (a.k.a kvmtool).
145
146           Status: contributed by Andrew Jones
147
148       openvz
149           The guest appears to be running inside an OpenVZ or Virtuozzo
150           container.
151
152           Status: contributed by Evgeniy Sokolov
153
154       ovirt
155           The guest is running on an oVirt node.  (See also "rhev" below).
156
157           Status: contributed by RWMJ, not confirmed
158
159       parallels
160           The guest is running inside Parallels Virtual Platform (Parallels
161           Desktop, Parallels Server).
162
163           Status: contributed by Justin Clift
164
165       powervm_lx86
166           The guest is running inside IBM PowerVM Lx86 Linux/x86 emulator.
167
168           Status: data originally supplied by Jeffrey Scheel, confirmed by
169           Yufang Zhang and RWMJ
170
171       qemu
172           This is QEMU hypervisor using software emulation.
173
174           Note that for KVM (hardware accelerated) guests you should not see
175           this.
176
177           Status: confirmed by RWMJ.
178
179       rhev
180           The guest is running on a Red Hat Enterprise Virtualization (RHEV)
181           node.
182
183           Status: confirmed by RWMJ
184
185       uml This is a User-Mode Linux (UML) guest.
186
187           Status: contributed by Laurent Leonard
188
189       virt
190           Some sort of virtualization appears to be present, but we are not
191           sure what it is.  In some very rare corner cases where we know that
192           virtualization is hard to detect, we will try a timing attack to
193           see if certain machine instructions are running much more slowly
194           than they should be, which would indicate virtualization.  In this
195           case, the generic fact "virt" is printed.
196
197       virtage
198           This is Hitachi Virtualization Manager (HVM) Virtage hardware
199           partitioning system.
200
201           Status: data supplied by Bhavna Sarathy, not confirmed
202
203       virtualbox
204           This is a VirtualBox guest.
205
206           Status: contributed by Laurent Leonard
207
208       virtualpc
209           The guest appears to be running on Microsoft VirtualPC.
210
211           Status: not confirmed
212
213       vmm This is a vmm (OpenBSD hypervisor) guest.
214
215           Status: contributed by Jasper Lievisse Adriaanse.
216
217       vmware
218           The guest appears to be running on VMware hypervisor.
219
220           Status: confirmed by RWMJ
221
222       xen The guest appears to be running on Xen hypervisor.
223
224           Status: confirmed by RWMJ
225
226       xen-dom0
227           This is the Xen dom0 (privileged domain).
228
229           Status: confirmed by RWMJ
230
231       xen-domU
232           This is a Xen domU (paravirtualized guest domain).
233
234           Status: confirmed by RWMJ
235
236       xen-hvm
237           This is a Xen guest fully virtualized (HVM).
238
239           Status: confirmed by RWMJ
240

EXIT STATUS

242       Programs that use or wrap "virt-what" should check that the exit status
243       is 0 before they attempt to parse the output of the command.
244
245       A non-zero exit status indicates some error, for example, an
246       unrecognized command line argument.  If the exit status is non-zero
247       then the output "facts" (if any were printed) cannot be guaranteed and
248       should be ignored.
249
250       The exit status does not have anything to do with whether the program
251       is running on baremetal or under virtualization, nor with whether
252       "virt-what" managed detection "correctly" (which is basically
253       unknowable given the large variety of virtualization systems out there
254       and that some systems deliberately emulate others).
255

RUNNING VIRT-WHAT FROM OTHER PROGRAMS

257       "virt-what" is designed so that you can easily run it from other
258       programs or wrap it up in a library.
259
260       Your program should check the exit status (see the section above).
261
262       Some programming languages (notably Python: issue 1652) erroneously
263       mask the "SIGPIPE" signal and do not restore it when executing
264       subprocesses.  "virt-what" is a shell script and some shell commands do
265       not work correctly when you do this.  You may see warnings from
266       "virt-what" similar to this:
267
268        echo: write error: Broken pipe
269
270       The solution is to set the "SIGPIPE" signal handler back to "SIG_DFL"
271       before running "virt-what".
272

IMPORTANT NOTE

274       Most of the time, using this program is the wrong thing to do.  Instead
275       you should detect the specific features you actually want to use.  (As
276       an example, if you wanted to issue Xen hypervisor commands you would
277       look for the "/proc/xen/privcmd" file).
278
279       However people keep asking for this, so we provide it.  There are a few
280       legitimate uses:
281
282       Bug reporting tool
283           If you think that virtualization could affect how your program
284           runs, then you might use "virt-what" to report this in a bug
285           reporting tool.
286
287       Status display and monitoring tools
288           You might include this information in status and monitoring
289           programs.
290
291       System tuning (sometimes)
292           You might use this program to tune an operating system so it runs
293           better as a virtual machine of a particular hypervisor.  However if
294           installing paravirtualized drivers, it's better to check for the
295           specific features your drivers need (eg. for the presence of PCI
296           devices).
297

SEE ALSO

299       <http://people.redhat.com/~rjones/virt-what/>,
300       <http://www.vmware.com/>,
301       <http://www.microsoft.com/windows/products/winfamily/virtualpc>,
302       <http://xensource.com/>, <http://bellard.org/qemu/>,
303       <http://kvm.qumranet.com/>, <http://openvz.org/>
304

AUTHORS

306       Richard W.M. Jones <rjones @ redhat . com>
307
309       (C) Copyright 2008-2015 Red Hat Inc.,
310       <http://people.redhat.com/~rjones/virt-what/>
311
312       This program is free software; you can redistribute it and/or modify it
313       under the terms of the GNU General Public License as published by the
314       Free Software Foundation; either version 2 of the License, or (at your
315       option) any later version.
316
317       This program is distributed in the hope that it will be useful, but
318       WITHOUT ANY WARRANTY; without even the implied warranty of
319       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
320       General Public License for more details.
321
322       You should have received a copy of the GNU General Public License along
323       with this program; if not, write to the Free Software Foundation, Inc.,
324       675 Mass Ave, Cambridge, MA 02139, USA.
325

REPORTING BUGS

327       Bugs can be viewed on the Red Hat Bugzilla page:
328       <https://bugzilla.redhat.com/>.
329
330       If you find a bug in virt-what, please follow these steps to report it:
331
332       1. Check for existing bug reports
333           Go to <https://bugzilla.redhat.com/> and search for similar bugs.
334           Someone may already have reported the same bug, and they may even
335           have fixed it.
336
337       2. Capture debug and error messages
338           Run
339
340            virt-what > virt-what.log 2>&1
341
342           and keep virt-what.log.  It may contain error messages which you
343           should submit with your bug report.
344
345       3. Get version of virt-what.
346           Run
347
348            virt-what --version
349
350       4. Submit a bug report.
351           Go to <https://bugzilla.redhat.com/> and enter a new bug.  Please
352           describe the problem in as much detail as possible.
353
354           Remember to include the version numbers (step 3) and the debug
355           messages file (step 2) and as much other detail as possible.
356
357       5. Assign the bug to rjones @ redhat.com
358           Assign or reassign the bug to rjones @ redhat.com (without the
359           spaces).  You can also send me an email with the bug number if you
360           want a faster response.
361
362
363
364virt-what-1.18                    2017-07-31                      VIRT-WHAT(1)
Impressum