The virsh program is the main interface for managing virsh guest domains (or virtual machines). The program can be used to create, pause, and shutdown domains. It can also be used to list current domains. On my PC, I started off with managing new VMs using the Virtual Machine Manager GUI but when it comes to managing VMs on a headless remote server, its easier done using the text-only virsh. I find creating a fresh guest VM is the easiest using a modified xml dump from an existing VM(if one exists)
Following are some basic virsh commands I've been used to using over time-
To execute the following commands 'libvirtd' daemon should be running.
1. To see what guests are there on a particular host
virsh list --all
2. To define the guest
3. To start the guest
4. To shutdown the guest
5. Get the libvirt xml
6. Edit libvirt xml, with this command if there are any changes then no need to 'undefine' and 'define' the domain
7. To undefine the guest, CAUTION: if you want your domain back, then have domainxml back up.
Cues to what basic changes are to be made to create a new VM from an existing xml-dump can be taken from the following sample xml dump: