Questo contenuto non è disponibile nella lingua selezionata.

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


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

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.
Copy to Clipboard Toggle word wrap
# 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.
Copy to Clipboard Toggle word wrap
# 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:
    Copy to Clipboard Toggle word wrap
    # virsh hostname
    dhcp-2-157.eus.myhost.com
    
  • # virsh sysinfo - displays the XML representation of the hypervisor's system information, if available, for example:
    Copy to Clipboard Toggle word wrap
    # virsh sysinfo
    <sysinfo type='smbios'>
      <bios>
        <entry name='vendor'>LENOVO</entry>
        <entry name='version'>GJET71WW (2.21 )</entry>
    [...]
    
Torna in cima
Red Hat logoGithubredditYoutubeTwitter

Formazione

Prova, acquista e vendi

Community

Informazioni sulla documentazione di Red Hat

Aiutiamo gli utenti Red Hat a innovarsi e raggiungere i propri obiettivi con i nostri prodotti e servizi grazie a contenuti di cui possono fidarsi. Esplora i nostri ultimi aggiornamenti.

Rendiamo l’open source più inclusivo

Red Hat si impegna a sostituire il linguaggio problematico nel codice, nella documentazione e nelle proprietà web. Per maggiori dettagli, visita il Blog di Red Hat.

Informazioni su Red Hat

Forniamo soluzioni consolidate che rendono più semplice per le aziende lavorare su piattaforme e ambienti diversi, dal datacenter centrale all'edge della rete.

Theme

© 2025 Red Hat, Inc.