You can create, delete, run, stop, and manage your virtual machines from the command line, using a tool called virsh. Virsh is particularly useful for advanced Linux administrators, interested in script or automating some aspects of managing their virtual machines



Install virsh:

sudo apt-get install libvirt-bin



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

Virtual Machines managed by virsh are created by describing the virtual machine in a libvirt XML file, and importing that XML file into virsh.

You can export the XML of an existing virtual machine:

$ virsh dumpxml foo > /tmp/foo.xml
Connecting to uri: qemu:///system

And then edit /tmp/foo.xml, which should be rather straightforward. For more information about libvirt XML format, see:

Once you have an XML file describing the new virtual machine you want to create, import it into virsh, and run it immediately:

$ virsh create /tmp/foo_new.xml 
Connecting to uri: qemu:///system
Domain foo_new created from /tmp/foo_new.xml
$ virsh list
Connecting to uri: qemu:///system
 Id Name                 State
  3 foo_new              running

Alternatively, if you want to define it, but not run it, you could have used:

$ virsh define /tmp/foo_new.xml


Working with a Running Virtual Machine

Once a virtual machine is running, you can manage it in many different ways, such as:

$ virsh start foo


$ virsh reboot foo


$ virsh shutdown foo


$ virsh suspend foo


$ virsh resume foo

You can also affect the memory, dynamically attach devices, interfaces, modify the networking configuration, etc. This guide in this wiki page is clearly not comprehensive. For a complete description of virsh commands, see:

$ man virsh



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 ^]



To view the details about a particular virtual machine:

$ virsh dumpxml foo

These can be saved to a file, modified, and imported again using:

$ virsh define foo


Deleting a Virtual Machine

To delete a virtual machine, first terminate it (if running), and then undefine it:

$ virsh destroy foo_new
$ virsh undefine foo_new



Linux list a KVM vm guest using virsh command

Use the following command to list a kvm vm on Linux based server:
# virsh list

To list inactive & active VM/domains:
# virsh list --all
Here are all other options:

Option Description
--inactive list inactive domains
--all list inactive & active domains
--transient list transient domains
--persistent list persistent domains
--with-snapshot list domains with existing snapshot
--without-snapshot list domains without a snapshot
--state-running list domains in running state
--state-paused list domains in paused state
--state-shutoff list domains in shutoff state
--state-other list domains in other states
--autostart list domains with autostart enabled
--no-autostart list domains with autostart disabled
--with-managed-save list domains with managed save state
--without-managed-save list domains without managed save
--uuid list uuid’s only
--name list domain names only
--table list table (default)
--managed-save mark inactive domains with managed save state
--title show domain title


Trisquel Desktop Environment

You are right. However, for a full desktop, one wants to install as well the "recommended" packages:

$ sudo apt-get install trisquel trisquel-recommended
$ sudo apt-get install trisquel-mini trisquel-mini-recommended
$ sudo apt-get install triskel triskel-recommended

$ sudo tasksel