Revision 2 as of 2009-11-09 18:53:03

Clear message

You can create, delete, run, stop, and manage your virtual machines from the command line, using a tool called virsh.

Installing

Install virsh:

  1. From a Command Line
    sudo apt-get install virsh

Connecting

Connect to your hypervisor. This can be local, or even remote. In most cases, if you want to manage VMs running on the local hypervisor:

$ virsh connect qemu:///system
Connecting to uri: qemu:///system

Listing VMs

$ virsh list
 Id Name                 State
----------------------------------
  1 foo                  running

Creating a Virtual Machine

Working with a Running Virtual Machine

Console

Sometimes, it's useful to attach to the console of a running VM, to obtain debugging information, etc.

$ virsh console foo
Connected to domain foo
Escape character is ^]

Details

Deleting a Virtual Machine

More Information

For more complete documentation on virsh, see: