Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to only install the packages that provide virsh to create and manage KVM virtual machines. What do I need to install, what do I need not install to skip the GUI elements?

For the record, I want to run them headless. KVM displays the VMs' visual output using VNC transmitting on certain ports. It would be great if someone could tell me how to know and control what those ports are.

share|improve this question
up vote 3 down vote accepted

virsh is provided by the package libvirt-bin. If you type


on the command line, Ubuntu tells you the package name and how to install it:

sudo apt-get install libvirt-bin python-libvirt

This does not seem to depend on GUI stuff. python-libvirt makes it easy to install KVM guests as opposed to directly editing virsh's XML machine configuration to create them. Refer to man python-libvirt for more info.

share|improve this answer

You can run VMs totally headless, but then you need to set up the guest OS to use serial console. Recent QEMU versions (post-0.14) can also route BIOS output to serial console.

See also

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.