Virt-Manager: Graphical KVM Management Console.

Virt-Manager is a graphical console for managing KVM virtual machines from Red Hat. With Virt-Manager, you can create, edit, start and stop virtual machines on the KVM hypervisor. You can configure virtual machine settings, which is much easier than managing KVM from the command line interface.

In this article, we will look at installing Virt-Manager on a server with KVM, typical tasks for managing virtual machines in the graphical console, and show how to use virt-manager from a Windows client.

Installing Virt Manager on Linux.

First of all, you need to install the necessary packages from the base repository on the server with KVM (in our example, the KVM server is installed on Linux CentOS). Run the following yum (or dnf) command:

# yum install -y virt-manager xorg-x11-xauth liberation-sans-fonts
To remotely connect to virt-manager from a Windows computer, you need to additionally configure SSH. Open the sshd_config file:
# nano /etc/ssh/sshd_config

Enable the following options:

X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes

Restart the sshd service:
# service sshd restart

Managing KVM via virt-manager from Windows.

To remotely connect to virt-manager from a Windows computer, you will need the following software:

  • putty - ssh client
  • Xming is a server port for Windows OS.

You can download putty from the official site https://www.putty.org/, and Xming from the link https://sourceforge.net/projects/xming/ 

Open Putty, go to Connection->SSH-X11. Enable the option “Enable X11 Forwarding“.

Now on the Session tab, specify the KVM server address, session name, specify the port and save the connection.

To remotely connect to a KVM server via virt-manager from Windows , use the following order:

  • First start Xming;
  • Start a saved Putty session with the X11 Forwarding option;
  • Connect to virt-manager.

After turning on Xming , the X icon in your tray should glow:


Next, run Putty , and after authorization on the server, run:
# virt-manager

After a few seconds, you should have a virt-manager control window and an additional authorization window where you need to enter data to connect to the server:

After authorization, you should see a list of virtual machines.

Using Virt-Manager to Manage KVM Virtual Machines.

By right-clicking on a virtual machine, you can turn off, restart, turn on the VM.

Next, I want to change the directory for storing virtual machine files, since I gave the main disk space when installing the operating system on a server with KVM to the VZ directory. To change the default directory, go to the menu “Edit -> Connection Details”.

In the window that opens, you need to go to the “Storage” tab. To create a new pool, you need to stop the current one and then delete it:


After installing the pool, the delete button will become active:

Now you can create a pool in the directory or section you need:


After that, my main partition for VM files became active:

Or just delete the original directory and create a symlink to the desired section:

# rm -rf /var/lib/libvirt/images/
# ln -s /vz/disk/ /var/lib/libvirt/images
Now you can try to create a new KVM virtual machine. Below I will attach a series of screenshots, in which everything will be more or less clear step by step. At the end I will describe the whole process of creating a machine.







  1. Clicking the button in the first screenshot starts the process of creating a new KVM virtual machine;
  2. Then we specify where to start the OS installation on the virtual machine from. I used a local ISO image with a CentOS 8 distribution;
  3. Next, the resources of the virtual machine are configured: the amount of memory and vCPU, the size of the virtual disk ( if necessary, it can be expanded or reduced), name, and specify the network;
  4. After the VM is created, the OS installation image that was specified during creation will immediately be mounted to it.

To change the resources or some parameters of an already created machine, you need to select it and click the “Open” button. In the menu that opens, click on the light bulb and you will see a list of parameters for the KVM virtual machine.


To add a new KVM server, do the following “File -> Add Connection” and fill in the data in the window that opens:

Red Hat Linux changed the status of virt-manager in RHEL 8 to deprecated, and this package may not be available in future OC releases. Instead, it is proposed to use the Cockpit web interface . However, at the moment, the KVM management module in Cockpit does not yet have enough of all the necessary functions available in virt-manager.

Common problems with Virt-Manager.

While studying the interface of virt-manager, I encountered several errors and decided to describe them in an article. The first error I encountered was at the stage of creating a new virtual machine:

libvirt error: cannot execute binary /etc/libvirt/hooks.qemu: No such file or directory.

The system swears at the absence of a file that most likely should have been created when installing KVM on the server, but in my case it was missing. The issue was resolved by creating a file:

# touch /etc/libvirt/hooks/qemu
After that, you need to restart the libvirtd service :
# service libvirtd restart
The following error was waiting for me immediately at the next installation step:

Unable to complete install: “NoneType object has no attribute storageVolLookupByPath“

To solve this problem and possibly others, you need to install the qemu-kvm-tools package :

# yum install qemu-kvm-tools -y
After completing the steps, the virtual machine was created without errors, and I was able to install the guest operating system on it.

Managing KVM through virt-manager is very convenient. You will significantly reduce the time for performing ordinary operations with virtual machines, and you will also be able to connect to them from Windows.

Отправить комментарий

Добавлять новые комментарии запрещено.*

Новые Старые