I'm running Arch Linux and have been running into trouble trying to use QEMU/KVM on virt-manager
, and this problem is likely to address my issues while using the similar gnome-boxes
.
Resolution
This error was related to the driver opencl-amdgpu-pro-orca. This answer details some background of what causes the error. Here's how I went about resolving the problem:
- Run
sudo systemctl edit libvirtd
, which opens Nano.
- That command creates a temporary file which will save to become
override.conf
within the directory of thelibvirtd
service.
- Enter the following into this (empty in my case) file:
[Service]
Environment="LD_LIBRARY_PATH=/usr/lib"
- Restart
libvirtd
withsudo systemctl restart libvirtd
. - Open
virt-manager
. The error should not be present.
- It's worth noting that I did not need to reboot following these changes.
The rest of the question as it originally was is detailed below.
Problem
Upon opening virt-manager, a connection appears to be successfully made with QEMU/KVM, and I am given the option to create a new VM. When I attempt to do so, I experience this error:
Warning: KVM is not available. This may mean the KVM package is not installed, or the KVM kernel modules are not loaded. Your virtual machines may perform poorly.
Log
journalctl -f
returns this when I reproduce the error:
Oct 14 22:23:00 okcomputer libvirtd[35615]: internal error: Failed to start QEMU binary /usr/bin/qemu-system-x86_64 for probing: /usr/bin/qemu-system-x86_64: symbol lookup error: /usr/lib/libvirglrenderer.so.1: undefined symbol: gbm_bo_unmap
Oct 14 22:23:00 okcomputer libvirtd[35615]: Failed to probe capabilities for /usr/bin/qemu-system-x86_64: internal error: Failed to start QEMU binary /usr/bin/qemu-system-x86_64 for probing: /usr/bin/qemu-system-x86_64: symbol lookup error: /usr/lib/libvirglrenderer.so.1: undefined symbol: gbm_bo_unmap
Research and attempts at resolution
Arch Wiki
This is an issue that seems quite common and I have researched extensively. I initially followed the Arch Wiki, reading the KVM, QEMU, and libvirt pages, in that order.
KVM
- My processor does have support for virtualisation and it is enabled.
Virtualisation support is enabled in my BIOS - both VT-x and VT-d.
- This is where the issue may lie - kernel modules. Running
zgrep CONFIG_KVM /proc/config.gz
outputs the following:
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_AMD_SEV=y
CONFIG_KVM_MMU_AUDIT=y
lsmod | grep kvm
outputs this:
kvm_intel 311296 0
kvm 778240 1 kvm_intel
irqbypass 16384 1 kvm
I noticed that kvm_intel
seems to be set to zero, but is mentioned at the end of the following line. I'm not particularly familiar with how kernel modules work, to be clear, but I decided to try load the module with sudo modprobe kvm_intel
, which returns nothing - a good sign, as far as I'm aware. Running sudo modprobe kvm
to be certain is the same.
QEMU
- I installed QEMU like any other package.
libvirt
- I installed libvirt and virt-manager like any other package.
- I ensured I had both
ebtables
anddnsmasq
installed and up-to-date. - I created
/etc/polkit-1/rules.d/50-libvirt.rules
and added this to the file:
/* Allow users in kvm group to manage the libvirt
daemon without authentication */
polkit.addRule(function(action, subject) {
if (action.id == "org.libvirt.unix.manage" &&
subject.isInGroup("kvm")) {
return polkit.Result.YES;
}
});
- I added myself to the
kvm
group (andlibvirt
, which I think I saw somewhere online?) viauseradd
; this can be confirmed by runninggroups <username>
, which I did:
wheel kvm libvirt <username>
I then enabled and started the
libvirtd
andvirtlogd
services, and rebooted.I then tested whether
virsh
works in addition tovirt-manager
;virsh
outputs the following:
Welcome to virsh, the virtualization interactive terminal.
Type: 'help' for help with commands
'quit' to quit
virsh #
Additional research
As I mentioned this is a seemingly widespread issue, but following the instructions of many a Stack Exchange answer results in generally the same thing.
I have tested the following:
-
As per the Wiki, I have already loaded the
kvm_intel
kernel module.The same advice is offered in this answer.
-
- I have ensured that virtualisation is enabled in my BIOS.
- I had enabled and started the
libvirtd
service.
Countless other articles and answers offer similar advice.
Software specifications
- Kernel 5.3.5-arch1-1-ARCH (latest default Arch kernel)
- libvirt 5.6.0-1
- virt-manager 2.2.1-1
- QEMU 4.1.0-2
- polkit 0.116-3
I have no idea if video-related packages are relevant, but the proprietary drivers have proven to be problematic in the past.
- mesa 192.2.1-1
- xf86-video-amdgpu 19.0.1-1
- opencl-amdgpu-pro-orca 19.30_855429-1
Hardware specifications
- CPU Intel i7 4790k
- Motherboard Asus Maximus VII Hero
Will provide any necessary additional specs as requested.