KVM/QEMU/VMM:本地主机未连接

KVM/QEMU/VMM:本地主机未连接

我正在使用 Ubuntu 14.04。我已经安装了kvm。当我尝试打开虚拟机时,出现此错误:

local host not connected

Unable to connect to libvirt.

Verify that:
 - The 'libvirt-bin' package is installed
 - The 'libvirtd' daemon has been started
 - You are member of the 'libvirtd' group

Unable to connect to libvirt.

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 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 105, in openAuth
    if ret is None:raise libvirtError('virConnectOpenAuth() failed')
libvirtError: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Permission denied

答案1

步骤1:安装所有需要的软件包。

sudo apt-get install qemu virt-manager  

如果它们已经安装,您会收到通知。

第2步:将您自己添加到 libvirt(d) 组。

sudo usermod -G libvirt -a <username>  

(这适用于较新的 KVM / Ubuntu 版本)

sudo usermod -G libvirtd -a <username>  

(这适用于旧版 KVM/Ubuntu)

<username>用。。。来代替你的用户名

步骤3:重新启动主机操作系统。

sudo reboot

现在一切都应该按预期进行。

如果你仍然再次遇到同样的错误 -

virt-manager以 root 权限打开:

sudo apt-get install gksu  

gksudo virt-manager  

关闭virt-manager并重新启动主机。

sudo reboot  

最后它应该与用户权限一起工作!

相关内容