How to Install and Configure QEMU on Ubuntu 22.04?

QEMU KVM is an emulator allowing users to run several operating systems on a single device. It works similarly to the Virtual Machine in which different operating systems can be installed for testing different applications.

In this blog, an installation method of QEMU with its configuration is explained for Ubuntu. The content of this post is as follows:

Let’s install QEMU first:

How to Install QEMU on Ubuntu 22.04?

To install QEMU KVM, use the apt package manager and also install some other packages that are required for its running:

$ sudo apt install qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils -y

After the installation of QEMU KVM, install the virtual manager to use QEMU/KVM:

$ sudo apt install virt-manager -y

When all the mentioned packages are installed, you can head over to the configuration of QEMU.

How to Configure QEMU on Ubuntu 22.04?

This section presents a few configuration steps necessary to use QEMU on Ubuntu. Let’s start:

Step 1: Revolve the “QEMU/KVM -Not Connected” Error

The first and foremost step to configure QEMU is to resolve the “QEMU/KVM -Not Connected” error. The following screenshot represents the error:

To resolve this, add the user to the libvirt group with the command (where the “itslinux” is the name of the user):

$ sudo usermod -G libvirt -a itslinux

Then again, launch the application, the error has vanished:

Step 2: Create Virtual Machine

Click on the “Create a new virtual machine” icon as shown below:

Doing so, a small window will appear. Choose the installation method you want to use for installing the new operating system. It is recommended to go with “Local install media” and click on “Forward”:

Then, choose the path of the “iso” file and click on the “Forward” button:

Assign the memory on the computer and the RAM by setting the number of CPUs:

Now, set suitable storage space for the virtual machine:

Assign a name for the computer and click on the “Finish” button:

The Ubuntu operating System has been loaded, hit the “Try or Install Ubuntu” option to install/try Ubuntu:

In such a way, QEMU machines can be configured for any operating system.

That’s it from this QEMU installation and configuration guide!

Conclusion

First, install the QEMU using the command “sudo apt install qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils -y” and then follow the process mentioned in this post to configure QEMU on Ubuntu 22.04.