Managing Virtual Machines from the command line with `virsh`
Virtual machines can be managed on the command line with the virsh utility. The virsh utility is built around the libvirt management API and has a number of advantages over the traditional Xen xm tool:
virsh has a stable set of commands whose syntax & semantics will be preserved across updates to Xen.
virsh can be used as an unprivileged user for read-only operations (eg listing domains, getting info, etc)
virsh will (in future) be able to manage QEMU, VMWare, etc machines in additional to Xen, since libvirt is hypervisor agnostic.
To start a new virtual machine from an XML vm definition:
To list the virtual machines currently running, use:
To gracefully power off a guest use:
To save a snapshot of the machine to a file of your choosing:
To restore a previously saved snapshot:
To export the XML config associated with a virtual machine:
For a complete list of commands available for use with virsh run:
Or consult the manual page virsh(1)
Bugs in the virsh tool should be reported in BugZilla against the 'libvirt' component