Este contenido no está disponible en el idioma seleccionado.

Chapter 8. Shutting down and restarting virtual machines


On RHEL 10, you can shut down or restart a virtual machine by using the command line or by using the web console GUI.

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

Shutting down a virtual machine (VM) requires different steps based on whether the VM is responsive.

Shutting down a responsive VM

  • 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
      Domain 'demo-guest1' is being shutdown
      Copy to Clipboard Toggle word wrap
    • 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
      
      root@192.0.2.1's password:
      Domain 'demo-guest1' is being shutdown
      Copy to Clipboard Toggle word wrap

Shutting down an unresponsive VM

To force a VM to shut down, for example if it has become unresponsive, use the virsh destroy command on the host:

# virsh destroy demo-guest1
Domain 'demo-guest1' destroyed
Copy to Clipboard Toggle word wrap
Note

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.

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
    
     Id    Name                 State
    ------------------------------------------
     1     demo-guest1          shut off
    Copy to Clipboard Toggle word wrap

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

If a virtual machine (VM) is in the running state, you can shut it down by using 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

Restarting a virtual machine (VM) requires different steps based on whether the VM is responsive.

Restarting a responsive VM

  • 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
      Domain 'demo-guest1' is being rebooted
      Copy to Clipboard Toggle word wrap
    • 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
      
      root@192.0.2.1's password:
      Domain 'demo-guest1' is being rebooted
      Copy to Clipboard Toggle word wrap

Restarting an unresponsive VM

To force a VM to restart, for example if it has become unresponsive, use the virsh destroy command on the host and start the VM again.

  1. Force a VM to shut down.

    # virsh destroy demo-guest1
    Domain 'demo-guest1' destroyed
    Copy to Clipboard Toggle word wrap
    Note

    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.

    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
    Domain 'demo-guest1' started
    Copy to Clipboard Toggle word wrap

Verification

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

    # virsh list --all
    
     Id    Name                 State
    ------------------------------------------
     1     demo-guest1          running
    Copy to Clipboard Toggle word wrap

8.4. Restarting a virtual machine by using the web console

If a virtual machine (VM) is in the running state, you can restart it by using 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.
Volver arriba
Red Hat logoGithubredditYoutubeTwitter

Aprender

Pruebe, compre y venda

Comunidades

Acerca de la documentación de Red Hat

Ayudamos a los usuarios de Red Hat a innovar y alcanzar sus objetivos con nuestros productos y servicios con contenido en el que pueden confiar. Explore nuestras recientes actualizaciones.

Hacer que el código abierto sea más inclusivo

Red Hat se compromete a reemplazar el lenguaje problemático en nuestro código, documentación y propiedades web. Para más detalles, consulte el Blog de Red Hat.

Acerca de Red Hat

Ofrecemos soluciones reforzadas que facilitan a las empresas trabajar en plataformas y entornos, desde el centro de datos central hasta el perímetro de la red.

Theme

© 2025 Red Hat