Skip to content

Virtualization with KVM, open source virtualization

26 mayo, 2021

If in the previous chapter of the special we talked about Virtual PC, the solution proposed by Microsoft for virtualization in desktop environments, today we are going to look for an open source virtualization platform within the different alternatives at our disposal. In my case the option chosen to analyze has been KVM. Let’s see what the virtualization with KVM as an open source virtualization option.

KVM It seems to me an option for the future since Red Hat has recently bet heavily on this solution, which guarantees an important path and development in the coming years. KVM it’s found integrated into the Linux kernel as of kernel version 2.6.20. This application needs hardware support to run virtualization, with either Intel or CPU processors. AMD. If our processor does not support these virtualization technologies, it will be useless to try to install it.

KVM installation

Therefore we are talking about a virtualization solution to use on Linux systems. KVM uses Virt-Manager as virtual machine manager and a modified Qemu as hypervisor. I have tried the installation in Ubuntu 9.04 and it has worked correctly. To install it, the first thing we must know is if our processor is compatible. For this we will introduce the following commands:


$ cat /proc/cpuinfo | grep vmx # para CPUs Intel

$ cat /proc/cpuinfo | grep svm # para CPUs AMD

If the system does not return anything, I am afraid that we do not have virtualization support in our processor or we do not have it activated. If so, we install the necessary packages:

$ sudo apt-get install kvm libvirt-bin ubuntu-vm-builder bridge-utils

and we include the user in the kvm group

$ sudo adduser $USER kvm

Once all these steps have been carried out, we will have to restart the session, depending on the version of Ubuntu that we are using. If everything has gone well, we will have a new entry in our menu Applications / System Tools / Virtual Machine Manager from where can we start the installation of our virtual machines.

Creation of the virtual machines

Once the Virtual Machine Manager is open, we will have to create a connection, in case it does not appear by default. For this, the only thing we have to select is QEMU as hypervisor and Local as connection. After selecting the new entry created, the New button will appear active, where after pressing it we access the Wizard for creating virtual machines.

KVM wizard

The first thing we have to do is assign a name to the system that we are going to virtualize, and then it allows us choose how we want to virtualize it, either full virtualization or paravirtualization. This second method uses the hypervisor to share access to the underlying hardware but integrates code that is aware of virtualization into the operating system itself. Hosted operating systems need to be modified by the hypervisor. It offers performance close to that of a non-virtualized system. In my case, I have opted for a full virtualization to try to approximate the results to the rest of the options that we have virtualized.

We start with the wizard to define the options of our virtual machine. We can choose viewer, either KVM or QEMU and the installation can be carried out by means of an image ISO, a CD or over the network. The next thing we must do is indicate where the image * is.ISO and where we are going to host our virtual hard disk. We can choose if we give it the fixed size or within the assigned size, the image file grows as we install files. Then it will be enough to choose the network options, either virtual network or share the physical network card with the host computer. Finally we allocate memory and CPU to the virtual machine and we will have our virtual machine created.

Once the virtual machine is created we will have to install the operating system we have chosen as we would do in this case with a computer to which we have just installed the hard disk. This process will take us more or less time depending on the memory and processor that we have assigned to our virtual machine, as well as if we install an image * via CD.ISO or network which are the available options.

W7 installation

General operation

Virtual machines perform very well, compared to the general performance of other virtual machines examined here. They have nothing to envy in any way. One of the things that I liked a lot is the fluid mode that works automatically in Windows without having to install extra applications for guest computers. The same does not happen with virtualized systems in Linux where I have not managed to have a fluid mode similar to that obtained with Windows systems.

The support of the USB it’s pretty good. We have to select the option to add hardware in the console options, hardware where we have an option to add hardware. In this case for devices USB we can add them as storage devices, directly selecting the disk partition and the disk option USB. With this option we can use our device both in our host system and in our guest. It is always possible to make improvements in this sector, which I think is one where all systems have room to make the user experience more satisfactory.

USB selection

Regarding the installation of the devices USB One of the positive aspects is that once the device driver is installed on the guest computer, we can connect it directly to hot. It is not necessary to have previously selected the device before starting the system, it is not even necessary that the unit be mounted in our system. The aspect that I liked the least was the graph, where I think KVM performs worse than other solutions in the graphic section since it does not support 3D hardware acceleration, which is available for example in VirtualBox.

One aspect that I found interesting is the incorporation of the performance graphs of virtual systems within Virtual Manager that tells us how our virtual system is behaving, what use it is making of the CPU or memory, data that helps us see the performance of these machines and to what extent we can have several working in parallel on our computer.

KVM

Regarding the negative points of this system we can underline that it is only available for Linux, therefore it is not a multiplatform system and this certainly takes away points. We could say that it is the equivalent of Virtual PC in Linux systems, with a good performance even at the cost of a worse graphic resolution. The good part is that being integrated into the Linux kernel the relationship between systems is quite good.

In general KVM it doesn’t seem very intuitive to meIt is not that we cannot say that it is complicated either, but it is true that for novice users it is not the system with which I would recommend that they start virtualization. There are simpler ways to provide solutions to different aspects of virtualization, and I am not referring to a technical level, but rather to the usability of the program, which sometimes you can get a little lost between the different options.

To end this series of articles on virtualized systems, next day we will do a Little summary of the characteristics of each of them and their most outstanding aspects, which help us choose the most suitable option for each oneSince, how have you been able to observe regarding the different options presented, there is no good and a bad one, but depending on the circumstances of each one, better or worse results will be obtained with one or the other option.

More information | KVM
In Genbeta | Virtualization with Virtual Pc, Microsoft’s proposal