Skip to content

Setup Local connection

Ihor Dvoretskyi edited this page Nov 7, 2015 · 2 revisions

This configuration is useful for situations when webvirtmgr is installed on the same host as KVM/libvirt hypervisor.

On webvirtmgr web page click on Connections, then Add Connection and choose the Local Socket. Enter any label name and click Add. Your local connection is added.

Possible issues:

Error after creating local connection in web-interface:

Failed to connect socket to '/var/run/libvirt/libvirt-sock': Permission denied

Or in /var/log/supervisor/webvirtmgr.log log file:

libvirt: XML-RPC error : Failed to connect socket to '/var/run/libvirt/libvirt-sock': Permission denied

Both errors are caused by unsufficient permissions to access the libvirt Unix socket.

$ ls -l /var/run/libvirt/libvirt-sock
srwxrwx--- 1 root libvirtd 0 févr. 12 16:03 /var/run/libvirt/libvirt-sock

$ sudo usermod -a -G libvirtd $USER
# Where $USER is a user, that runs a gunicorn instance, which manages the webvirtmgr connections.
To find that user you may run:
$ ps -ef | grep run_gunicorn | awk 'NR==1{ print $1 }'

After adding the user to the group the supervisor service should be restarted:

Ubuntu, Debian

$ sudo service supervisor stop
$ sudo service supervisor start

CentOS, RedHat, Fedora

$ sudo service supervisord stop
$ sudo service supervisord start

xrfctgmvjykjhtgcf

Clone this wiki locally