1

I am trying to create a Virtual Machine using Virtual Machine Manager. I have installed the following packages using the command:

sudo apt install -y qemu qemu-kvm libvirt-daemon libvirt-clients bridge-utils virt-manager

Virtual Machine Manager is now installed but when I start it the screen says QEMU/KVM-not connected. I right clicked and then clicked on connect which gave me the following error:

Unable to connect to libvirt qemu:///system.

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 956, in _do_open
    self._backend.open(connectauth.creds_dialog, self)
  File "/usr/share/virt-manager/virtinst/connection.py", line 172, in open
    conn = libvirt.openAuth(self._open_uri,
  File "/usr/lib/python3/dist-packages/libvirt.py", line 104, in openAuth
    if ret is None:raise libvirtError('virConnectOpenAuth() failed')
libvirt.libvirtError: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Permission denied

I have verfied the service libvirtd is already active(running). So what's the issue and how do i solve it?

Also I've already referred this question although it didn't help.

GAD3R
  • 2,821
  • 1
  • 18
  • 30
Shardul Birje
  • 113
  • 1
  • 7
  • 1
    You might need to re-login on that system to pick up the group and the environment variables. Is this issue persistent through a re-logon? – Christian Ehrhardt Feb 09 '21 at 11:06
  • Thank you, just tried re-login after reading your comment it solved the issue..Perhaps can you write this as an answer so that I can mark it.. – Shardul Birje Feb 10 '21 at 06:00

1 Answers1

2

Installing libvirtd and depending packages will automatically put users that are in the sudo group to also be able to use libvirt. It also sets environment variables for the shell commands.

All that won't be active for existing logons, therefore to be able to use everything you need to re-logon (or start a new terminal, ...) after installing the packages.

Christian Ehrhardt
  • 2,024
  • 12
  • 19