Home Arch Linux How to install Virtual Machine Manager (KVM) in Manjaro and Arch Linux

How to install Virtual Machine Manager (KVM) in Manjaro and Arch Linux

by Kiran Kumar
Published: Updated:
Installing kvm in manjaro

Linux users don’t need to have VMware or VirtualBox to run virtual machines. KVM is a Kernel-based Virtual Machine built with-in the Linux kernel. Using KVM, one can run several virtual operating systems including Linux, Microsoft Windows, and any other operating system.

In this article, let’s take a look at how to install KVM on Arch Linux and Manjaro Linux.

Installing KVM in Arch Linux and Manjaro Linux

Before installing KVM, you need to first check if your computer has the necessary hardware support to run virtual machines. KVM requires VT-x for Intel processors and AMD-V for AMD processors. Here is how to check:

Checking Hardware Support

Launch ‘Terminal’ and enter the following command:

LC_ALL=C lscpu | grep Virtualization

If your computer supports virtualization, you should see the output as “Virtualization: VT-x” or “Virtualization: AMD-V”.

For example, if my Intel-based test PC, I see the following output in the Terminal.

Check Virtualization Capability

Check Virtualization Capability

If nothing is displayed, it means your PC can’t be used to install Virtual machines. This is not the end of the world. Manufacturers sometimes disable the feature by default settings. To make sure, boot your computer’s BIOS and check. Refer to your computer maker and model manual for how to boot into BIOS.

Checking Kernel Support

Apart from hardware support, you also need a necessary kernel module to be installed on your computer to support KVM.

Launch Terminal and enter the following command to check:

zgrep CONFIG_KVM /proc/config.gz

Check the output. You should see CONFIG_KVM_INTEL or CONFIG_KVM_AMD as ‘m’ or ‘y’. Here is output in my test PC.

CONFIG_KVM_GUEST=y
# CONFIG_KVM_DEBUG_FS is not set
CONFIG_KVM_MMIO=y
CONFIG_KVM_ASYNC_PF=y
CONFIG_KVM_VFIO=y
CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT=y
CONFIG_KVM_COMPAT=y
CONFIG_KVM=m
CONFIG_KVM_INTEL=m
CONFIG_KVM_AMD=m
CONFIG_KVM_MMU_AUDIT=y

Installing KVM (Virtual Machine Manager)

STEP 1: Launch Terminal and enter the following command to install KVM and necessary dependencies.

sudo pacman -S virt-manager qemu vde2 ebtables dnsmasq bridge-utils openbsd-netcat

STEP 2: The next two steps are very important and often ignored by many users. Make sure to complete it else, you will get error “adduser: The group `libvirtd’ does not exist” when you run the Virtual Machine Manager after installation is complete!

Enable the service by entering the below command:

sudo systemctl enable libvirtd.service

STEP 3: Start the service using below command:

sudo systemctl start libvirtd.service

Virtual Machine manager should now be installed on your computer. You can launch it from ‘Applications’. Look for ‘Virtual Machine Manager’, not KVM!

Virtual Machine Manager running in Manjaro Linux

Virtual Machine Manager running in Manjaro Linux

You may also like

15 comments

Eddwin February 28, 2018 - 5:15 PM

Hi! I’m so excited navigating here this web show me and help me about my problem at Manjaro 17.1.6. Bless from México

Reply
Niloufar June 23, 2018 - 1:11 PM

Hi please help me .Even I followed your instruction I got bellow errors
I even used sudo for virt-manager

Unable to connect to libvirt lxc:///.

Verify that the ‘libvirtd’ daemon is running.

Libvirt URI is: lxc:///

Traceback (most recent call last):
File “/usr/share/virt-manager/virtManager/connection.py”, line 1036, in _do_open
self._backend.open(self._do_creds_password)
File “/usr/share/virt-manager/virtinst/connection.py”, line 144, in open
open_flags)
File “/usr/lib/python2.7/site-packages/libvirt.py”, line 105, in openAuth

Reply
bish June 24, 2018 - 11:51 AM

same problem i have face too

Reply
MarkDubya October 16, 2018 - 3:26 PM

The optional dependencies for libvirt should be installed as dependencies, not explicitly installed:
sudo pacman -S virt-manager
sudo pacman -S --asdeps qemu ebtables dnsmasq bridge-utils netcat

It’s not necessary to install vde2 separately as it’s a dependency of qemu.

Reply
Anon January 8, 2019 - 9:46 AM

if you’re using –asdeps option in this context, these packages become orphans. List them with pacman -Qdtq

If anyone periodically remove orphans they will deleted them too.

Reply
Marc April 12, 2019 - 7:37 PM

sudo systemctl enable –now libvirtd.service

enables and starts the service.

Reply
Tyrion March 14, 2020 - 11:15 AM

Thanks. Didn’t know you can combine that

Reply
hublahup April 10, 2020 - 9:41 AM

File /var/cache/pacman/pkg/glusterfs-1:7.3-1-x86_64.pkg.tar.zst corrupt
how to fix it?

Reply
jp September 13, 2020 - 12:13 AM

thank you man

Reply
SVT October 4, 2020 - 3:00 AM

This worked quickly and easily, thank you!

Reply
Gianluca October 8, 2020 - 2:00 PM

When I try to create a vm on another mounted harddisk, the emulator tells me that it doesn’t have the permissions to access the path. How can I solve the problem?

Reply
anon December 9, 2020 - 6:56 PM

Works fine on “xfce manjaro” thanks.

Reply
Bong Holio May 10, 2021 - 10:04 AM

This is what I have been looking for! I hated using vmWare and VirtualBox. Thank you for an excellent tutorial on setting up KVM!

Reply
sete July 6, 2021 - 12:30 PM

What does it mean “m” or “y” when you launch “zgrep CONFIG_KVM /proc/config.gz” ?

Reply
wojak July 22, 2023 - 6:55 PM

m = manual
y = yes

Reply

Leave a Comment

fl_logo_v3_footer

ENHANCE YOUR LINUX EXPERIENCE.



FOSS Linux is a leading resource for Linux enthusiasts and professionals alike. With a focus on providing the best Linux tutorials, open-source apps, news, and reviews written by team of expert authors. FOSS Linux is the go-to source for all things Linux.

Whether you’re a beginner or an experienced user, FOSS Linux has something for everyone.

Follow Us

Subscribe

©2016-2023 FOSS LINUX

A PART OF VIBRANT LEAF MEDIA COMPANY.

ALL RIGHTS RESERVED.

“Linux” is the registered trademark by Linus Torvalds in the U.S. and other countries.