Virt-manager 的问题

New*_*nux 16 virtualization

我安装了virt-manager,但无法使其工作。

我已经尝试了一些以前发布的答案但没有成功。我已经证实:

  • libvirt-bin软件包安装
  • libvirtd守护程序已启动
  • 我是libvirtd小组成员
  • libvirt URI 是: qemu:///system

这是我尝试运行时遇到的错误virt-manager

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/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
Run Code Online (Sandbox Code Playgroud)

小智 11

您可能需要注销并重新登录。

假设/etc/libvirt/libvirtd.conf有:

# Set the UNIX domain socket group ownership. This can be used to
# allow a 'trusted' set of users access to management capabilities
# without becoming root.
#
# This is restricted to 'root' by default.
unix_sock_group = "libvirtd"

# Set the UNIX socket permissions for the R/O socket. This is used
# for monitoring VM status only
#
# Default allows any user. If setting group ownership, you may want to
# restrict this too.
unix_sock_ro_perms = "0777"

# Set the UNIX socket permissions for the R/W socket. This is used
# for full management of VMs
#
# Default allows only root. If PolicyKit is enabled on the socket,
# the default will change to allow everyone (eg, 0777)
#
# If not using PolicyKit and setting group ownership for access
# control, then you may want to relax this too.
unix_sock_rw_perms = "0770"
Run Code Online (Sandbox Code Playgroud)

如果您的用户是该libvirtd组的成员,它应该可以工作。

检查您的用户是否应该在组中,例如 user vagrant

$ cat /etc/group|grep $USER
vagrant:x:1000:
libvirtd:x:116:ubuntu,vagrant
Run Code Online (Sandbox Code Playgroud)

如果您的用户不在组中,则需要添加它:

$ sudo usermod -a -G libvirtd $USER
Run Code Online (Sandbox Code Playgroud)

如果您的用户已经在 组中/etc/group,则检查 的输出groups

$ groups
vagrant libvirtd
Run Code Online (Sandbox Code Playgroud)

如果您没有看到libvirtd,则需要注销并重新登录。

  • 对我来说,我必须重新启动它才能工作 (5认同)
  • 这太棒了!(注销/登录后)。就我而言,我使用了“libvirt”而不是“libvirtd”(我正在关注[this](https://vitux.com/how-to-install-kvm-to-create-and-manage-virtual-machines-在-ubuntu/) 文章) (2认同)
  • 您也可以尝试使用 `su $USER` 而不是重新登录 :) 它对我有用 (2认同)

小智 1

我遇到过同样的问题。尝试一下这个指南,它对我有用。将用户添加到“libvirtd”组后不要忘记重新登录


小智 0

尝试将此行添加到/etc/libvirt/libvirtd.conf

listen_tls = 0
Run Code Online (Sandbox Code Playgroud)

然后lirvirt通过以下方式重新启动:

/etc/init.d/libvirt-bin restart
Run Code Online (Sandbox Code Playgroud)