VIRT-WHAT(1)

πŸ’– VIRT-WHAT(1) πŸ’– β€” Virtualization Support πŸ¦‹

okay bestie, welcome to virt-what, the little shell script that's about to tell you whether you're living rent-free inside a virtual machine or just vibing on actual hardware ✨ manual section 1, Virtualization Support, let's go 🌸


✨ NAME ✨

virt-what β€” detect if we are running in a virtual machine πŸ‘€


πŸŽ€ SUMMARY πŸŽ€

virt-what [options]

πŸ’… DESCRIPTION πŸ’…

okay so real talk: virt-what is a shell script, and its whole job is detecting whether the program is running inside a virtual machine πŸ–₯️✨

It prints out a list of "facts" about the virtual machine, and those facts come from heuristics (aka educated guesses, iykyk). One fact per line. That's the whole format. No cap.

And now the part that trips people up πŸ™ˆ β€” if nothing gets printed and the script exits with code 0 (no error), that could mean either of these two things:

  • the program is running on bare-metal, or
  • the program is running inside a type of virtual machine that we don't know about or cannot detect πŸ’€

so like… no output is not the same as "definitely not a VM", bestie. It's giving "either/or", fr fr.


🌈 FACTS 🌈

the moment you've all been waiting for β€” the whole fact roster, with the receipts 🫢

  • alibaba_cloud, alibaba_cloud-ebm β€” This is a cloud computing service based on Alibaba Cloud ☁️
    • Status: contributed by Weisson.
  • aws β€” Amazon Web Services.
    • Heads up πŸ‘‘: 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. kvm or xen) would not be present.
    • Status: contributed by Qi Guo, Vitaly Kuznetsov, confirmed by RWMJ.
  • bhyve β€” This is a bhyve (FreeBSD hypervisor) guest 🌊
    • Status: contributed by Leonardo Brondani Schenkel.
  • crio β€” The guest is running in a CRI-O container πŸ“¦
    • Status: suggested by Alessandro Taufer, confirmed by RWMJ & Xiaodai Wang
  • docker β€” This is a Docker container 🐳
    • Status: confirmed by Charles Nguyen
  • google_cloud β€” This is running on Google Cloud Platform / Google Compute Engine ☁️✨
    • Status: confirmed by RWMJ
  • hyperv β€” This is Microsoft Hyper-V hypervisor πŸ’ 
    • Status: confirmed by RWMJ
  • ibm_power-kvm β€” This is an IBM POWER KVM guest ⚑
    • Status: contributed by Adrian Likins.
  • ibm_power-lpar_shared, ibm_power-lpar_dedicated β€” This is an IBM POWER LPAR (hardware partition) in either shared or dedicated mode.
    • Status: contributed by Adrian Likins.
  • ibm_systemz β€” This is an IBM SystemZ (or other S/390) hardware partitioning system. Additional facts listed below may also be printed πŸ‘€
  • ibm_systemz-direct β€” This is Linux running directly on an IBM SystemZ hardware partitioning system.
    • > 🚨 This is expected to be a highly unusual configuration β€” if you see this result you should treat it with suspicion.
    • Status: not confirmed
  • ibm_systemz-lpar β€” This is Linux running directly on an LPAR on an IBM SystemZ hardware partitioning system.
    • Status: confirmed by Thomas Huth
  • ibm_systemz-zvm β€” This is a z/VM guest running in an LPAR on an IBM SystemZ hardware partitioning system πŸŽ€
    • Status: confirmed by RWMJ using a Fedora guest running in z/VM
  • ibm_systemz-kvm β€” This is a KVM guest running on an IBM System Z hardware system.
    • Status: contributed by Thomas Huth
  • illumos-lx β€” The guest is running on Illumos with a Linux syscall emulation layer 🌞
    • Status: contributed by Steve Mokris
  • ldoms β€” The guest appears to be running on a Linux SPARC system with Oracle VM Server for SPARC (Logical Domains) support.
    • Status: contributed by Darren Kenny
  • ldoms-control β€” The is the Oracle VM Server for SPARC (Logical Domains) control domain πŸ‘‘
    • Status: contributed by Darren Kenny
  • ldoms-guest β€” The is the Oracle VM Server for SPARC (Logical Domains) guest domain 🫢
    • Status: contributed by Darren Kenny
  • ldoms-io β€” The is the Oracle VM Server for SPARC (Logical Domains) I/O domain.
    • Status: contributed by Darren Kenny
  • ldoms-root β€” The is the Oracle VM Server for SPARC (Logical Domains) Root domain 🌱
    • Status: contributed by Darren Kenny
  • linux_vserver β€” This is printed for backwards compatibility with older virt-what which could not distinguish between a Linux VServer container guest and host πŸ•°οΈ
  • linux_vserver-guest β€” This process is running in a Linux VServer container.
    • Status: contributed by Barış Metin
  • linux_vserver-host β€” This process is running as the Linux VServer host (VxID 0).
    • Status: contributed by Barış Metin and Elan RuusamΓ€e
  • lxc β€” This process is running in a Linux LXC container πŸ“¦
    • Status: contributed by Marc Fournier
  • kvm β€” This guest is running on the KVM hypervisor using hardware acceleration ⚑
    • ngl, important: if the hypervisor is using software acceleration you should not see this β€” you should see the qemu fact instead.
    • Status: confirmed by RWMJ.
  • 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).
    • Status: contributed by Andrew Jones
  • nutanix_ahv β€” The guest is running inside Nutanix Acropolis Hypervisor (AHV) 🌸
    • Status: confirmed by RWMJ.
  • oci β€” The guest is running in an OCI container πŸ«™
    • Status: contributed by Alessandro Valentini, confirmed by RWMJ
  • openvz β€” The guest appears to be running inside an OpenVZ or Virtuozzo container.
    • Status: contributed by Evgeniy Sokolov
  • ovirt β€” The guest is running on an oVirt node. (See also rhev below πŸ‘‡)
    • Status: contributed by RWMJ, not confirmed
  • parallels β€” The guest is running inside Parallels Virtual Platform (Parallels Desktop, Parallels Server) πŸ–₯️
    • Status: contributed by Justin Clift
  • podman β€” This is a Podman container. (See also oci above. πŸ‘†)
    • Status: contributed by Jordan Webb
  • powervm_lx86 β€” The guest is running inside IBM PowerVM Lx86 Linux/x86 emulator πŸ’»
    • Status: data originally supplied by Jeffrey Scheel, confirmed by Yufang Zhang and RWMJ
  • qemu β€” This is QEMU hypervisor using software emulation 🐒
    • and reminder bestie: for KVM (hardware accelerated) guests you should not see this.
    • Status: confirmed by RWMJ.
  • rhev β€” The guest is running on a Red Hat Enterprise Virtualization (RHEV) node ❀️
    • Status: confirmed by RWMJ
  • redhat β€” The guest is running on the Red Hat hypervisor 🎩
    • Status: confirmed by RWMJ
  • uml β€” This is a User-Mode Linux (UML) guest 🐧
    • Status: contributed by Laurent LΓ©onard
  • upcloud β€” This is running on UpCloud ☁️
    • Status: contributed by Ville SkyttΓ€
  • 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 virt is printed.
  • virtage β€” This is Hitachi Virtualization Manager (HVM) Virtage hardware partitioning system.
    • Status: data supplied by Bhavna Sarathy, not confirmed
  • virtualbox β€” This is a VirtualBox guest πŸ“¦
    • Status: contributed by Laurent LΓ©onard
  • virtualpc β€” The guest appears to be running on Microsoft VirtualPC.
    • Status: not confirmed
  • vmm β€” This is a vmm (OpenBSD hypervisor) guest 🐑
    • Status: contributed by Jasper Lievisse Adriaanse.
  • vmware β€” The guest appears to be running on VMware hypervisor πŸ’œ
    • Status: confirmed by RWMJ
  • xen β€” The guest appears to be running on Xen hypervisor ✨
    • Status: confirmed by RWMJ
  • xen-dom0 β€” This is the Xen dom0 (privileged domain) πŸ‘‘
    • Status: confirmed by RWMJ
  • xen-domU β€” This is a Xen domU (paravirtualized guest domain) 🧚
    • Status: confirmed by RWMJ
  • xen-hvm β€” This is a Xen guest fully virtualized (HVM) πŸ”₯
    • Status: confirmed by RWMJ

🚦 EXIT STATUS 🚦

bestie, listen closely, this part matters πŸ™

Programs that use or wrap virt-what should check that the exit status is 0 before they attempt to parse the output of the command.

A non-zero exit status indicates some error β€” for example, an unrecognized command line argument. And if the exit status is non-zero, then the output "facts" (if any were printed) cannot be guaranteed and should be ignored πŸ’€

Also super important: the exit status has nothing to do with whether the program is running on baremetal or under virtualization, and it also has nothing to do with whether virt-what managed detection "correctly" β€” which is basically unknowable given the large variety of virtualization systems out there, and the fact that some systems deliberately emulate others πŸ™ˆ


🧚 RUNNING VIRT-WHAT FROM OTHER PROGRAMS 🧚

virt-what is literally designed so you can easily run it from other programs, or wrap it up in a library 🫢 how thoughtful of it.

Your program should check the exit status (see the section above πŸ‘†).

Now here's the messy part 😭: some programming languages (notably Python: issue 1652) erroneously mask the SIGPIPE signal and do not restore it when executing subprocesses. And virt-what is a shell script, and some shell commands do not work correctly when you do this. So you may see warnings from virt-what similar to this:

 echo: write error: Broken pipe

The solution is to set the SIGPIPE signal handler back to SIG_DFL before running virt-what ✨


⚠️ IMPORTANT NOTE ⚠️

okay, the big one, and it's a little shady but we're being honest here: Most of the time, using this program is the wrong thing to do. 😭 Instead, you should detect the specific features you actually want to use.

Like, for example πŸ‘‰ if you wanted to issue Xen hypervisor commands, you would look for the /proc/xen/privcmd file. See? Specific. Clean. No guessing.

However, people keep asking for this, so we provide it πŸ’… There are a few legit uses:

πŸ› Bug reporting tool

If you think that virtualization could affect how your program runs, then you might use virt-what to report this in a bug reporting tool.

πŸ“Š Status display and monitoring tools

You might include this information in status and monitoring programs.

πŸŽ›οΈ 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) πŸ‘‘


πŸ‘€ SEE ALSO πŸ‘€


πŸ’œ AUTHORS πŸ’œ

Richard W.M. Jones <rjones @ redhat . com> 🫢

okay bestie, legal era, stay with me for like thirty seconds and then we can go back to being unhinged πŸ’…

(C) Copyright 2008-2024 Red Hat Inc., <http://people.redhat.com/~rjones/virt-what/>

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. yes, "or later" β€” you get to pick, iconic behavior honestly πŸ’œ

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. ngl that's the whole "if it breaks, that's between you and the universe" clause 😭

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. physical mail era fr fr πŸ“¬


πŸ› REPORTING BUGS πŸ›

Bugs can be viewed on the Red Hat Bugzilla page: <https://bugzilla.redhat.com/>. obsessed with a public bug tracker, honestly 🫢

If you find a bug in virt-what, please follow these steps to report it β€” and no, you cannot skip steps, this is a group project and we're all doing our part πŸ’–

  1. Check for existing bug reports β€” Go to <https://bugzilla.redhat.com/> and search for similar bugs. Someone may already have reported the same bug, and they may even have fixed it. lowkey the search bar is right there bestie, use it before you type πŸ”
  2. Capture debug and error messages β€” Run
virt-what > virt-what.log 2>&1

and keep virt-what.log. It may contain error messages which you should submit with your bug report. that redirect is doing so much heavy lifting ✨

  1. Get version of virt-what. β€” Run
virt-what --version

yes literally just that, copy the output, we need it πŸŽ€

  1. Submit a bug report. β€” Go to <https://bugzilla.redhat.com/> and enter a new bug. Please describe the problem in as much detail as possible.

Remember to include the version numbers (step 3) and the debug messages file (step 2) and as much other detail as possible. detail is the vibe check here, the more the better, we're not gatekeeping context πŸ’…

  1. Assign the bug to rjones @ redhat.com β€” Assign or reassign the bug to rjones @ redhat.com (without the spaces). You can also send me an email with the bug number if you want a faster response. faster response unlocked πŸ”₯

and that's the whole page bestie, you ate that πŸ“

source/version virt-what-1.27, dated 2026-01-29 β€” that's the VIRT-WHAT(1) era we're living in, no cap πŸ‘‘ go forth and detect your virtualization πŸ’–πŸ§š

πŸ“¦ where this page comes from