To exit from a virsh console for a Linux KVM virtual machine, you can use the CTRL
+ ]
key combination. This will close the console and return you to the virsh prompt.
Alternatively, you can also use the exit
command to close the console and return to the virsh prompt:
exit
If you are running the console in interactive mode, you can also use the CTRL
+ D
key combination to exit.
You can also use the CTRL
+ ]
key combination to escape from any command mode in virsh and return to the virsh prompt.
If you want to completely shut down the virtual machine and exit from virsh, you can use the shutdown
command:
shutdown
This will shut down the virtual machine gracefully and exit from the virsh console.