1VIRT-WHAT(1) Virtualization Support VIRT-WHAT(1)
2
3
4
6 virt-what - detect if we are running in a virtual machine
7
9 virt-what [options]
10
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
24 bhyve
25 This is a bhyve (FreeBSD hypervisor) guest.
26
27 Status: contributed by Leonardo Brondani Schenkel.
28
29 docker
30 This is a Docker container.
31
32 Status: confirmed by Charles Nguyen
33
34 hyperv
35 This is Microsoft Hyper-V hypervisor.
36
37 Status: confirmed by RWMJ
38
39 ibm_power-kvm
40 This is an IBM POWER KVM guest.
41
42 Status: contributed by Adrian Likins.
43
44 ibm_power-lpar_shared
45 ibm_power-lpar_dedicated
46 This is an IBM POWER LPAR (hardware partition) in either shared or
47 dedicated mode.
48
49 Status: contributed by Adrian Likins.
50
51 ibm_systemz
52 This is an IBM SystemZ (or other S/390) hardware partitioning
53 system. Additional facts listed below may also be printed.
54
55 ibm_systemz-direct
56 This is Linux running directly on a IBM SystemZ hardware
57 partitioning system.
58
59 This is expected to be a highly unusual configuration - if you see
60 this result you should treat it with suspicion.
61
62 Status: not confirmed
63
64 ibm_systemz-lpar
65 This is Linux running directly on an LPAR on an IBM SystemZ
66 hardware partitioning system.
67
68 Status: not confirmed
69
70 ibm_systemz-zvm
71 This is a z/VM guest running in an LPAR on an IBM SystemZ hardware
72 partitioning system.
73
74 Status: confirmed by RWMJ using a Fedora guest running in z/VM
75
76 linux_vserver
77 This is printed for backwards compatibility with older virt-what
78 which could not distinguish between a Linux VServer container guest
79 and host.
80
81 linux_vserver-guest
82 This process is running in a Linux VServer container.
83
84 Status: contributed by BarXX Metin
85
86 linux_vserver-host
87 This process is running as the Linux VServer host (VxID 0).
88
89 Status: contributed by BarXX Metin and Elan Ruusamaee
90
91 lxc This process is running in a Linux LXC container.
92
93 Status: contributed by Marc Fournier
94
95 kvm This guest is running on the KVM hypervisor using hardware
96 acceleration.
97
98 Note that if the hypervisor is using software acceleration you
99 should not see this, but should see the "qemu" fact instead.
100
101 Status: confirmed by RWMJ.
102
103 lkvm
104 This guest is running on the KVM hypervisor using hardware
105 acceleration, and the userspace component of the hypervisor is lkvm
106 (a.k.a kvmtool).
107
108 Status: contributed by Andrew Jones
109
110 openvz
111 The guest appears to be running inside an OpenVZ or Virtuozzo
112 container.
113
114 Status: contributed by Evgeniy Sokolov
115
116 ovirt
117 The guest is running on an oVirt node. (See also "rhev" below).
118
119 Status: contributed by RWMJ, not confirmed
120
121 parallels
122 The guest is running inside Parallels Virtual Platform (Parallels
123 Desktop, Parallels Server).
124
125 Status: contributed by Justin Clift
126
127 powervm_lx86
128 The guest is running inside IBM PowerVM Lx86 Linux/x86 emulator.
129
130 Status: data originally supplied by Jeffrey Scheel, confirmed by
131 Yufang Zhang and RWMJ
132
133 qemu
134 This is QEMU hypervisor using software emulation.
135
136 Note that for KVM (hardware accelerated) guests you should not see
137 this.
138
139 Status: confirmed by RWMJ.
140
141 rhev
142 The guest is running on a Red Hat Enterprise Virtualization (RHEV)
143 node.
144
145 Status: confirmed by RWMJ
146
147 uml This is a User-Mode Linux (UML) guest.
148
149 Status: contributed by Laurent Leonard
150
151 virt
152 Some sort of virtualization appears to be present, but we are not
153 sure what it is. In some very rare corner cases where we know that
154 virtualization is hard to detect, we will try a timing attack to
155 see if certain machine instructions are running much more slowly
156 than they should be, which would indicate virtualization. In this
157 case, the generic fact "virt" is printed.
158
159 virtage
160 This is Hitachi Virtualization Manager (HVM) Virtage hardware
161 partitioning system.
162
163 Status: data supplied by Bhavna Sarathy, not confirmed
164
165 virtualbox
166 This is a VirtualBox guest.
167
168 Status: contributed by Laurent Leonard
169
170 virtualpc
171 The guest appears to be running on Microsoft VirtualPC.
172
173 Status: not confirmed
174
175 vmware
176 The guest appears to be running on VMware hypervisor.
177
178 Status: confirmed by RWMJ
179
180 xen The guest appears to be running on Xen hypervisor.
181
182 Status: confirmed by RWMJ
183
184 xen-dom0
185 This is the Xen dom0 (privileged domain).
186
187 Status: confirmed by RWMJ
188
189 xen-domU
190 This is a Xen domU (paravirtualized guest domain).
191
192 Status: confirmed by RWMJ
193
194 xen-hvm
195 This is a Xen guest fully virtualized (HVM).
196
197 Status: confirmed by RWMJ
198
200 Programs that use or wrap "virt-what" should check that the exit status
201 is 0 before they attempt to parse the output of the command.
202
203 A non-zero exit status indicates some error, for example, an
204 unrecognized command line argument. If the exit status is non-zero
205 then the output "facts" (if any were printed) cannot be guaranteed and
206 should be ignored.
207
208 The exit status does not have anything to do with whether the program
209 is running on baremetal or under virtualization, nor with whether
210 "virt-what" managed detection "correctly" (which is basically
211 unknowable given the large variety of virtualization systems out there
212 and that some systems deliberately emulate others).
213
215 "virt-what" is designed so that you can easily run it from other
216 programs or wrap it up in a library.
217
218 Your program should check the exit status (see the section above).
219
220 Some programming languages (notably Python: issue 1652) erroneously
221 mask the "SIGPIPE" signal and do not restore it when executing
222 subprocesses. "virt-what" is a shell script and some shell commands do
223 not work correctly when you do this. You may see warnings from
224 "virt-what" similar to this:
225
226 echo: write error: Broken pipe
227
228 The solution is to set the "SIGPIPE" signal handler back to "SIG_DFL"
229 before running "virt-what".
230
232 Most of the time, using this program is the wrong thing to do. Instead
233 you should detect the specific features you actually want to use. (As
234 an example, if you wanted to issue Xen hypervisor commands you would
235 look for the "/proc/xen/privcmd" file).
236
237 However people keep asking for this, so we provide it. There are a few
238 legitimate uses:
239
240 Bug reporting tool
241 If you think that virtualization could affect how your program
242 runs, then you might use "virt-what" to report this in a bug
243 reporting tool.
244
245 Status display and monitoring tools
246 You might include this information in status and monitoring
247 programs.
248
249 System tuning (sometimes)
250 You might use this program to tune an operating system so it runs
251 better as a virtual machine of a particular hypervisor. However if
252 installing paravirtualized drivers, it's better to check for the
253 specific features your drivers need (eg. for the presence of PCI
254 devices).
255
257 <http://people.redhat.com/~rjones/virt-what/>,
258 <http://www.vmware.com/>,
259 <http://www.microsoft.com/windows/products/winfamily/virtualpc>,
260 <http://xensource.com/>, <http://bellard.org/qemu/>,
261 <http://kvm.qumranet.com/>, <http://openvz.org/>
262
264 Richard W.M. Jones <rjones @ redhat . com>
265
267 (C) Copyright 2008-2015 Red Hat Inc.,
268 <http://people.redhat.com/~rjones/virt-what/>
269
270 This program is free software; you can redistribute it and/or modify it
271 under the terms of the GNU General Public License as published by the
272 Free Software Foundation; either version 2 of the License, or (at your
273 option) any later version.
274
275 This program is distributed in the hope that it will be useful, but
276 WITHOUT ANY WARRANTY; without even the implied warranty of
277 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
278 General Public License for more details.
279
280 You should have received a copy of the GNU General Public License along
281 with this program; if not, write to the Free Software Foundation, Inc.,
282 675 Mass Ave, Cambridge, MA 02139, USA.
283
285 Bugs can be viewed on the Red Hat Bugzilla page:
286 <https://bugzilla.redhat.com/>.
287
288 If you find a bug in virt-what, please follow these steps to report it:
289
290 1. Check for existing bug reports
291 Go to <https://bugzilla.redhat.com/> and search for similar bugs.
292 Someone may already have reported the same bug, and they may even
293 have fixed it.
294
295 2. Capture debug and error messages
296 Run
297
298 virt-what > virt-what.log 2>&1
299
300 and keep virt-what.log. It may contain error messages which you
301 should submit with your bug report.
302
303 3. Get version of virt-what.
304 Run
305
306 virt-what --version
307
308 4. Submit a bug report.
309 Go to <https://bugzilla.redhat.com/> and enter a new bug. Please
310 describe the problem in as much detail as possible.
311
312 Remember to include the version numbers (step 3) and the debug
313 messages file (step 2) and as much other detail as possible.
314
315 5. Assign the bug to rjones @ redhat.com
316 Assign or reassign the bug to rjones @ redhat.com (without the
317 spaces). You can also send me an email with the bug number if you
318 want a faster response.
319
320
321
322virt-what-1.11 2017-03-22 VIRT-WHAT(1)