KVM, QEMU start or stop virtual machine from the bash prompt
To start or stop virtual machines using ssh or the console, you will need to use the bash prompt. There is more than one way, but this is the way I prefer
First check which virtual machines are available:
virsh list --all
In my case the output is:
Id Name State
----------------------------------------------------
1 FS3 shut off
3 mail8 shut off
5 MX1 shut off
11 FS4 shut off
12 WS019 shut off
I will start the FS3 virtual machine:
virsh start FS3
The output is:
Domain FS3 started
To shut it down, just enter.
virsh shutdown FS3
Update –
I have discovered that if the virtual machine is Windows, to shut it down you need the option –mode acpi as follows:
virsh shutdown FS3 --mode acpi