在使用 virt-manager
时报错 Unable to connect to libvirt qemu:///- system
具体报错信息如下
Unable to connect to libvirt.
Failed to connect socket to '/var/run/libvirt/libvirt-sock': Permission denied
Verify that:
- The 'libvirt-bin' package is installed
- The 'libvirtd' daemon has been started
- You are member of the 'libvirtd' group
Libvirt URI is: qemu:///system
Traceback (most recent call last):
File "/usr/share/virt-manager/virtManager/connection.py", line 1185, in _open_thread
self.vmm = self._try_open()
File "/usr/share/virt-manager/virtManager/connection.py", line 1167, in _try_open
flags)
File "/usr/lib/python2.7/dist-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': Permission denied
查看文件权限
kane@kane-E500:/var/run/libvirt$ ll
total 0
drwxr-xr-x 2 root root 40 Dec 24 14:20 hostdevmgr/
drwx------ 2 root root 60 Dec 24 14:20 interface/
srw------- 1 root root 0 Dec 24 14:20 libvirt-admin-sock=
srw-rw---- 1 root libvirt 0 Dec 24 14:20 libvirt-sock=
srw-rw-rw- 1 root root 0 Dec 24 14:20 libvirt-sock-ro=
drwxr-xr-x 2 root root 140 Dec 24 14:20 network/
drwx------ 2 root root 60 Dec 24 14:20 nodedev/
drwx------ 2 root root 60 Dec 24 14:20 nwfilter/
drwx------ 2 root root 40 Dec 24 14:20 nwfilter-binding/
drwxr-xr-x 3 root root 100 Dec 24 14:20 qemu/
drwx------ 2 root root 60 Dec 24 14:20 secrets/
drwxr-xr-x 2 root root 80 Dec 24 14:20 storage/
srw------- 1 root root 0 Dec 24 14:20 virtlockd-admin-sock=
srw------- 1 root root 0 Dec 24 14:20 virtlockd-sock=
srw------- 1 root root 0 Dec 24 14:20 virtlogd-admin-sock=
srw------- 1 root root 0 Dec 24 14:20 virtlogd-sock=
将文件 libvirt-sock
权限改为 666 即可
sudo chmod 666 /var/run/libvirt/libvirt-sock
重启 virt manager 即可。
附录
参考链接
本文由 柒 创作,采用 知识共享署名4.0
国际许可协议进行许可。
转载本站文章前请注明出处,文章作者保留所有权限。
最后编辑时间: 2021-12-12 11:24 AM