Forrest logo
back to the virsh tool

virsh:tldr:0ef55

virsh: Delete a running guest.
$ virsh destroy ${guest_id} && virsh undefine ${guest_id}
try on your machine

This command is a combination of two separate commands:

  1. virsh destroy ${guest_id}: This command is used to forcefully stop the execution of a virtual machine with the specified ${guest_id}. The ${guest_id} parameter represents the unique identifier or name of the virtual machine.

  2. virsh undefine ${guest_id}: This command is used to remove the definition of a virtual machine with the specified ${guest_id}. It eliminates the configuration settings and specifications associated with the virtual machine.

The && operator is used to combine these two commands in a single line. It ensures that the second command (virsh undefine ${guest_id}) is executed only if the first command (virsh destroy ${guest_id}) is successful.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the virsh tool