RuCore.NET – English Version

How to install qemu-kvm and gui (virt-manager) in Ubuntu

How to install qemu-kvm and gui (virt-manager) in Ubuntu

KVM (virtual machine-based) is a virtualization technology, open source, embedded in the Linux kernel. It allows you to run multiple isolated guest virtual machines on Linux or Windows. Each guest has its own operating system and dedicated virtual hardware, such as CPU, memory, network interfaces, and storage.

GNU / Linux user actually can perform virtualization of the computers, without using Oracle VirtualBox, simply using the already-enabled Linux kernel, KVM. KVM (virtual machine on top of the core) is a Linux kernel module that enables the operating system GNU / Linux to run a virtual machine of another operating system (same as VirtualBox). But since KVM is part of the kernel (a kernel module), it is very easy and quick (compared to VirtualBox and VMWare as external components). While KVM is running in the kernel space, we use QEMU as the emulator computer to the user space.

This combination of KVM, QEMU provides users with lightweight virtualization and good performance (but without GUI). We can do this using the Red Hat Virtual Machine Manager as a graphical interface for virtualization QEMU KVM. QEMU, KVM, and virtual machine Manager all free software.

Take a machine with a processor that supports one of these technologies hardware virtualization Intel VT-x and AMD-V, put on the Linux machine, in Linux installed KVM, the result is the ability to create a new path. So about cloud hosting, e.g. Amazon Web Services. Along with sometimes also used KVM and Xen, but the discussion of this technology goes beyond the scope of this post. In contrast to the technology of container virtualization, for example, the same Docker, KVM allows you to run as a guest any OS, but it has a and bonlong overhead for virtualization.

To install KVM

Check that it supports Intel VT-x or AMD-V, our CPU:

grep -E '(vmx|svm)' /proc/cpuinfo

If your CPU supports hardware virtualization, this command will display a number greater than zero, that is, the number of CPU cores. Otherwise, if the output is 0, it means that the CPU doesn’t support hardware virtualization.

To verify that you’ve enabled VT in the BIOS, use kvm-ok is included in the package cpu-checker. To install the package, run the following commands as the root user or a user with sudo privileges :

sudo apt update
sudo apt install cpu-checker

After that check whether your system can run KVM virtual machines with hardware acceleration:


If the virtualization capabilities of the processor is not disabled in the BIOS, the command will be given:

INFO: /dev/kvm exists
KVM acceleration can be used

Otherwise, the team will print and error message and maybe a short message about how to enable the extension. The process of incorporating technology AMD-V or VT depends on your motherboard and processor type. Refer to the motherboard documentation for information about configuring your system’s BIOS.

Proceed to the installation in the host system

sudo apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils
  • qemu-kvm contains the main program QEMU KVM
  • libvirt-bin contains programs for the libvirt library (library which uses the virtualization capabilities of Linux kernel)
  • ubuntu-vm-builder contains scripts Ubuntu VM Builder (to help in creating ready-to-use virtual machine in Ubuntu)
  • bridge-utils contains a program to connect to your host network for the virtual machine

or if you did not install using the above command, you can use the following:

sudo apt install qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils virt-manager

To install a GUI for KVM

sudo apt-get install virt-manager

It can be used to manage the virtual machines running on other hosts, and look at the beautiful graficki in real time. I personally find particularly useful in virt-manager that do not need to search for configu on which port VNC is spinning a specific guest system. Just find dev in the list, double-click, and get access to the monitor.

With the help of virt-manager is very easy to do things that otherwise would require tedious editing of XML files and in some cases perform additional commands. For example, renaming virtual machines, setting CPU affinity and things like that. By the way, the use of CPU affinity significantly reduces the effect of noisy neighbours and the impact of virtual machines on the host system. If possible, use it always.

If you decide to use KVM as a replacement for VirtualBox, please note that Chardonnay virtualization they share will not. To earned you have a KVM on the desktop, you not only have to stop all the path in VirtualBox, but to restart the system.

A common problem

Without re-registration or without adding your user name to the libvirtd group you can see the error Virtual Machine Manager, as shown in the figure below. If you followed the rest of the article, you just need to re-login.


Spelling error report

The following text will be sent to our editors: