How to delete KVM VM guest using virsh command

To delete a KVM virtual machine guest using the virsh command, you can use the following steps:

  1. Connect to the host machine via ssh
  2. Start the virsh shell: virsh
  3. List all running VMs: virsh list --all
  4. Note the name or ID of the VM you want to delete.
  5. Destroy the VM: virsh destroy <name or ID of VM>
  6. Undefine the VM: virsh undefine <name or ID of VM>
  7. Verify that the VM has been deleted: virsh list --all

Leave a Comment