Questo contenuto non è disponibile nella lingua selezionata.

Chapter 8. Shutting down and restarting virtual machines


To shut down or restart a virtual machine on a RHEL 10 host, you can use the command line or the web console GUI.

8.1. Shutting down a virtual machine by using the command line

To shut down a virtual machine (VM), you can use the virsh shutdown command. If the VM is unresponsive, you can force the shutdown by using the virsh destroy command.

Prerequisites

Procedure

  1. To shut down a responsive VM, do one of the following:

    • If you are connected to the guest, use a shutdown command or a GUI element appropriate to the guest operating system.

      Note

      In some environments, such as in Linux guests that use the GNOME Desktop, using the GUI power button for suspending or hibernating the guest might instead shut down the VM.

    • Alternatively, use the virsh shutdown command on the host:

      • If the VM is on a local host:

        # virsh shutdown <demo-guest1>

        Successful output:

        Domain 'demo-guest1' is being shutdown
      • If the VM is on a remote host (in this example 192.0.2.1):

        # virsh -c qemu+ssh://root@192.0.2.1/system shutdown <demo-guest1>

        Successful output:

        root@192.0.2.1's password:
        Domain 'demo-guest1' is being shutdown
  2. If the VM is not responding, you can force it to shut down. To do this, use the virsh destroy command on the host:

    # virsh destroy <demo-guest1>

    Successful output:

    Domain 'demo-guest1' destroyed
    Important

    The virsh destroy command does not actually delete or remove the VM configuration or disk images. It only terminates the running instance of the VM, similarly to pulling the power cord from a physical machine.

    However, in rare cases, virsh destroy may cause corruption of the VM’s file system, so use this command only if all other shutdown methods have failed.

Verification

  • On the host, display the list of your VMs to see their status.

    # virsh list --all

    Successful output:

     Id    Name                 State
    ------------------------------------------
     1     demo-guest1          shut off

8.2. Shutting down a virtual machine by using the web console

To shut down a running virtual machine (VM), you can use the Virtual Machines interface in the RHEL 10 web console.

Prerequisites

Procedure

  1. In the Virtual Machines interface, find the row of the VM you want to shut down.
  2. On the right side of the row, click Shut Down.

    The VM shuts down.

Troubleshooting

  • If the VM does not shut down, click the Menu button next to the Shut Down button and select Force Shut Down.
  • To shut down an unresponsive VM, you can also send a non-maskable interrupt by clicking the Send non-maskable interrupt button in the Menu.

8.3. Restarting a virtual machine by using the command line

To restart a virtual machine (VM), you can use the virsh reboot command. If the VM is unresponsive, you can force the restart by using the virsh destroy command.

Prerequisites

Procedure

  1. To restart a responsive VM, do one of the following:

    • If you are connected to the guest, use a restart command or a GUI element appropriate to the guest operating system.
    • Alternatively, use the virsh reboot command on the host:

      • If the VM is on a local host:

        # virsh reboot demo-guest1

        Successful output:

        Domain 'demo-guest1' is being rebooted
      • If the VM is on a remote host (in this example 192.0.2.1):

        # virsh -c qemu+ssh://root@192.0.2.1/system reboot demo-guest1

        Successful output:

        root@192.0.2.1's password:
        Domain 'demo-guest1' is being rebooted
  2. If the VM is not responding, you can force it to shut down, and then start it:

    1. Force a VM to shut down.

      # virsh destroy demo-guest1

      Successful output:

      Domain 'demo-guest1' destroyed
      Important

      The virsh destroy command does not actually delete or remove the VM configuration or disk images. It only terminates the running instance of the VM, similarly to pulling the power cord from a physical machine.

      However, in rare cases, virsh destroy may cause corruption of the VM’s file system, so use this command only if all other shutdown methods have failed.

    2. Start the VM again.

      # virsh start demo-guest1

      Successful output:

      Domain 'demo-guest1' started

Verification

  • On the host, display the list of your VMs to see their status.

    # virsh list --all

    Successful output:

     Id    Name                 State
    ------------------------------------------
     1     demo-guest1          running

8.4. Restarting a virtual machine by using the web console

To restart a running virtual machine (VM), you can use the Virtual Machines interface in the RHEL 10 web console.

Prerequisites

Procedure

  1. In the Virtual Machines interface, find the row of the VM you want to restart.
  2. On the right side of the row, click the Menu button .

    A drop-down menu of actions appears.

  3. In the drop-down menu, click Reboot.

    The VM shuts down and restarts.

Troubleshooting

  • If the VM does not restart, click the Menu button next to the Reboot button and select Force Reboot.
  • To shut down an unresponsive VM, you can also send a non-maskable interrupt by clicking the Send non-maskable interrupt button in the Menu.
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

© 2026 Red Hat
Torna in cima