Unable to connect to libvirt qemu
This is my first time using Virtual Machine Manager on Linux. The installation is also very easy with the command “sudo apt install virt-manager”. But after I installed it, when the virtual manager was run I got the error “Virtual Machine Manager Connection Failure Linux” as shown in the following picture:
If you look at the error text, it looks like this:
Verify that the ‘libvirtd’ daemon is running.
Libvirt URI is: qemu:///system
Traceback (most recent call last):
File “/usr/share/virt-manager/virtManager/connection.py”, line 923, in _do_open
File “/usr/share/virt-manager/virtinst/connection.py”, line 153, in open
conn = libvirt.openAuth(self._open_uri,
File “/usr/lib/python3/dist-packages/libvirt.py”, line 148, in openAuth
raise libvirtError(‘virConnectOpenAuth() failed’)
libvirt.libvirtError: Failed to connect socket to ‘/var/run/libvirt/libvirt-sock’: Permission denied
About Virt-Manager Linux
The virt-manager software is a GUI for running OS with virtual machines via libvirt developed by Red Hat.
The most famous virtual machine is Virtual Box by Oracle Company, but this virtual manager has the advantage of being simple.
This Virtual Manager application can also be run on various Linux distributions such as Ubuntu, Gentoo, OpenBSD and Fedora.
The command for the installation is as follows:
# yum install virt-manager (Fedora) # apt-get install virt-manager (Debian) # emerge virt-manager (Gentoo) # pkg_add virt-manager (OpenBSD)
Virt-Manager also has supporting tools such as provisioning the operating system into a virtual machine, a lightweight UI interface that can interact with graphical displays of cloning existing inactive guests, editing the libvirt XML domain, and setting up a libvirt-based root file system.
Why this error occurs?
If you look at the last line, it’s because of Permission Denied, which means we have to run the Virt-Manager application with root.
For that how to fix it is very easy.
If you want to run quickly, open a terminal and use sudo like the following command:
but that way, you have to type every time if you have logged out or rebooted the computer.
To fix that problem, you have to add the list to the usergroup. So every time you log in, this error does not occur.
The command is:
sudo usermod -a -G libvirt $USER
Hopefully this Virtual Machine Manager Connection Failure Linux article is useful.
> VT-x is disabled in BIOS for CPU ThinkPad
> How to Install VirtualBox 6.1 Ubuntu Terminal
> Kernel driver not installed (rc=-1908) Ubuntu [Solved]
> IP Address Ubuntu Server Not Available In VirtualBox
> Install Ubuntu Virtual Machine in VirtualBox
> Kernel driver not installed (rc=-1908) Ubuntu, How to Fix it?