20.5. Displaying Information about a Guest Virtual Machine and the Hypervisor

download PDF
The virsh list command will list guest virtual machines connected to your hypervisor that fit the search parameter requested. The output of the command has 3 columns in a table. Each guest virtual machine is listed with its ID, name, and state.
A wide variety of search parameters is available for virsh list. These options are available on the man page, by running man virsh or by running the virsh list --help command.


Note that this if this command only displays guest virtual machines created by the root user. If it does not display a virtual machine you know you have created, it is probable you did not create the virtual machine as root.
Guests created using the virt-manager interface are by default created by root.

Example 20.1. How to list all locally connected virtual machines

The following example lists all the virtual machines your hypervisor is connected to. Note that this command lists both persistent and transient virtual machines.
# virsh list --all

Id              Name                      State
8		guest1			running
22		guest2			paused
35		guest3			shut off
38              guest4			shut off

Example 20.2. How to list the inactive guest virtual machines

The following example lists guests that are currently inactive, or not running. Note that the list only contains persistent virtual machines.
# virsh list --inactive

Id              Name                      State
35		guest3			shut off
38		guest4			shut off
In addition, the following commands can also be used to display basic information about the hypervisor:
  • # virsh hostname - displays the hypervisor's host name, for example:
    # virsh hostname
  • # virsh sysinfo - displays the XML representation of the hypervisor's system information, if available, for example:
    # virsh sysinfo
    <sysinfo type='smbios'>
        <entry name='vendor'>LENOVO</entry>
        <entry name='version'>GJET71WW (2.21 )</entry>
Red Hat logoGithubRedditYoutubeTwitter


Try, buy, & sell


About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.