Linux - Virtualization and CloudThis forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am facing problems while I'm trying to install virtual machine. When I first run the virt-manager, I am able to install new virtual machine but when I try to start it the virt-manager show an error "Unable to connect to libvirt." and "Verify that the 'libvirtd' daemon is running."
The details are:
Code:
Unable to connect to libvirt.
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 1027, in _open_thread
self.vmm = self._try_open()
File "/usr/share/virt-manager/virtManager/connection.py", line 1009, in _try_open
flags)
File "/usr/lib64/python2.7/site-packages/libvirt.py", line 102, in openAuth
if ret is None:raise libvirtError('virConnectOpenAuth() failed')
libvirtError: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Connection refused
Note, I was trying to fix this and I re-installed all required packages on my Slackware distribution but the result is the same.
Yes the /etc/rc.d/rc.libvirt is running. I think here is something wrong - when I restart the deamon I saw that there is no such process but the /etc/rc.d/rc.libvirt shows there is running process
Code:
bash-4.2# /etc/rc.d/rc.libvirt stop
error: failed to connect to the hypervisor
error: no valid connection
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Connection refused
Waiting machineserror: failed to connect to the hypervisor
error: no valid connection
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Connection refused
error: failed to connect to the hypervisor
error: no valid connection
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Connection refused
Stopping libvirtd...
error: failed to connect to the hypervisor
error: no valid connection
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Connection refused
/etc/rc.d/rc.libvirt: line 101: kill: (2814) - No such process
bash-4.2# /etc/rc.d/rc.libvirt start
libvirt is already running...
bash-4.2#
bash-4.2#
bash-4.2# ps -ef | grep libvirt
root 20709 4541 0 17:09 pts/0 00:00:00 grep libvirt
bash-4.2#
But this is only when I restart the deamon if I run it when the system is rebooted the status is OK and there is such process indeed.
The output of ps -ef only shows your grep command so I'd say the daemon is not running and rc.libvirt statement about the service running is false.
Okay lets check if the socket is there
ls /var/run/libvirt -lh
If there make sure you are allowed to access it. For this edit /etc/libvirt/libvirtd.conf. The link I gave you has some more details for this. Might be enough if you add root to the libvirt group. Check /etc/group for the correct name of the group. After adding your self to the group don't forget to logout and back in again. Else the groups don't take effect.
You might also try to start libvirtd by hand. Not sure where its installed. Either use tab completion or the find command to get the path.
But I think the key is that the scrip reports both that the process is running and not running ?!
This come from when I execute /etc/rc.d/rc.libvirt stop - says no such process
but /etc/rc.d/rc.libvirt start - already running
Im a bit puzzled here. As the socket exists and the permissions at least for root are good there should be no problem connecting. And the default permission for the group users is okay. But this has do be evaluated later I'd say when we have access going. The config file just sets up some sane permission for the two sockets and also disables policy kit with the two lines of auth_unix_ro = "none" auth_unix_rw = "none". At least according to the link.
Did you try any other libvirt binary besides virtmanager? Maybe virsh? I just want to rule out that there are any other hurdles we are tripping.
Can you setup any logging for libvirt? Maybe over the configuration file that may show us why access to the socket is denied. Same goes for virtmanager or any other tool that access the libvirt socket.
Maybe the first thing to achieve here is that the daemon is started all good on reboot and then go from there. So you can rule out one piece after another.
But now the settings are different - the socets are root:users
Code:
bash-4.2# virt-install
ERROR Failed to connect socket to '/var/run/libvirt/libvirt-sock': Connection refused
bash-4.2# ls -la /var/run/libvirt/libvirt-sock
srwxrwx--- 1 root users 0 Oct 18 11:25 /var/run/libvirt/libvirt-sock
bash-4.2# ls -la /var/run/libvirt/
total 36
drwxr-xr-x 8 root root 4096 Oct 18 11:25 .
drwxr-xr-x 20 root root 4096 Oct 18 11:21 ..
srwxrwx--- 1 root users 0 Oct 18 11:25 libvirt-sock
srwxrwxrwx 1 root users 0 Oct 18 11:25 libvirt-sock-ro
-rw-r--r-- 1 root root 4 Oct 18 11:25 libvirtd.pid
drwxr-xr-x 2 root root 4096 Oct 14 19:18 lockd
drwxr-xr-x 2 root root 4096 Oct 14 19:18 lxc
drwxr-xr-x 2 root root 4096 Oct 18 11:25 network
drwxr-xr-x 2 root root 4096 Oct 18 11:32 qemu
drwxr-xr-x 2 root root 4096 Oct 14 19:18 uml
drwxr-xr-x 2 root root 4096 Jul 2 12:49 uml-guest
bash-4.2#
But before trying to install new VM with the virt-manager I installed a VM with virt-install !!! : )
But unfortunately the strange behavior of the daemon still persist.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.