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:
- KVM – a virtualization module in the Linux kernel that allows the kernel to function as a hypervisor. (Wikipedia)
- QEMU – a machine emulator and virtualizer that can perform hardware virtualization. It can cooperate with KVM to run virtual machines at near-native speed (Wikipedia)
- 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.
Pingback: Off-line migration of QEMU/KVM virtual machine | The Art of Code