How to install KVM/QEMU on Linux Mint 20.1

From time to time I want to run a virtual machine on my computer, a sandbox containing another operating system with some programs running in total isolation. Under Linux my answer for this need is a set of three components:

  1. KVMa virtualization module in the Linux kernel that allows the kernel to function as a hypervisor. (Wikipedia)
  2. QEMUa machine emulator and virtualizer that can perform hardware virtualization. It can cooperate with KVM to run virtual machines at near-native speed (Wikipedia)
  3. Virtual Machine Manager – a nice GUI to use above things as simply as possible.

Problem

How prepare all above components on a fresh installation of Linux Mint 20.1?

Solution

This solution is based on the article “Install KVM Virtualization on Linux Mint 20” with my additions.

First execute following commands:

sudo apt-get install qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils virt-manager
sudo adduser $USER libvirt
sudo adduser $USER kvm
sudo adduser $USER libvirt-qemu

Here the above-mentioned article claimed everything is ready and working. But it wasn’t in my case. So just restart Linux now. Then proceed with verification steps:

virsh -c qemu:///system list

The output should be:

 Id   Name   State
--------------------

Then execute:

systemctl status libvirtd.service

The output should start with following lines:

● libvirtd.service - Virtualization daemon
     Loaded: loaded (/lib/systemd/system/libvirtd.service; enabled; vendor preset: enabled)
     Active: active (running) since Wed 2021-02-03 22:54:41 CET; 31s ago

Then start Virtual Machine Manager. It should show that it is connected to KVM/QEMU. It should look like this:

Now it’s ready.

About krzysztoftomaszewski

I've got M.Sc. in software engineering. I graduated in 2005 at Institute of Computer Science, Warsaw University of Technology, Faculty of Electronics and Information Technology. I'm working on computer software design and engineering continuously since 2004.
This entry was posted in Linux and tagged , , , . Bookmark the permalink.

1 Response to How to install KVM/QEMU on Linux Mint 20.1

  1. Pingback: Off-line migration of QEMU/KVM virtual machine | The Art of Code

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s