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

EXIT STATUS

256       Programs that use or wrap "virt-what" should check that the exit status
257       is 0 before they attempt to parse the output of the command.
258
259       A non-zero exit status indicates some error, for example, an
260       unrecognized command line argument.  If the exit status is non-zero
261       then the output "facts" (if any were printed) cannot be guaranteed and
262       should be ignored.
263
264       The exit status does not have anything to do with whether the program
265       is running on baremetal or under virtualization, nor with whether
266       "virt-what" managed detection "correctly" (which is basically
267       unknowable given the large variety of virtualization systems out there
268       and that some systems deliberately emulate others).
269

RUNNING VIRT-WHAT FROM OTHER PROGRAMS

271       "virt-what" is designed so that you can easily run it from other
272       programs or wrap it up in a library.
273
274       Your program should check the exit status (see the section above).
275
276       Some programming languages (notably Python: issue 1652) erroneously
277       mask the "SIGPIPE" signal and do not restore it when executing
278       subprocesses.  "virt-what" is a shell script and some shell commands do
279       not work correctly when you do this.  You may see warnings from
280       "virt-what" similar to this:
281
282        echo: write error: Broken pipe
283
284       The solution is to set the "SIGPIPE" signal handler back to "SIG_DFL"
285       before running "virt-what".
286

IMPORTANT NOTE

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

SEE ALSO

313       <http://people.redhat.com/~rjones/virt-what/>,
314       <http://www.vmware.com/>,
315       <http://www.microsoft.com/windows/products/winfamily/virtualpc>,
316       <http://xensource.com/>, <http://bellard.org/qemu/>,
317       <http://kvm.qumranet.com/>, <http://openvz.org/>
318

AUTHORS

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

REPORTING BUGS

341       Bugs can be viewed on the Red Hat Bugzilla page:
342       <https://bugzilla.redhat.com/>.
343
344       If you find a bug in virt-what, please follow these steps to report it:
345
346       1. Check for existing bug reports
347           Go to <https://bugzilla.redhat.com/> and search for similar bugs.
348           Someone may already have reported the same bug, and they may even
349           have fixed it.
350
351       2. Capture debug and error messages
352           Run
353
354            virt-what > virt-what.log 2>&1
355
356           and keep virt-what.log.  It may contain error messages which you
357           should submit with your bug report.
358
359       3. Get version of virt-what.
360           Run
361
362            virt-what --version
363
364       4. Submit a bug report.
365           Go to <https://bugzilla.redhat.com/> and enter a new bug.  Please
366           describe the problem in as much detail as possible.
367
368           Remember to include the version numbers (step 3) and the debug
369           messages file (step 2) and as much other detail as possible.
370
371       5. Assign the bug to rjones @ redhat.com
372           Assign or reassign the bug to rjones @ redhat.com (without the
373           spaces).  You can also send me an email with the bug number if you
374           want a faster response.
375
376
377
378virt-what-1.21                    2021-04-19                      VIRT-WHAT(1)
Impressum