您尚未登录。

#1 2024-01-08 12:16:39

assion
会员
注册时间: 2023-12-11
帖子: 15

[已解决]virt-manager 无法使用

virt-manager  在尝试 连接 kvm/qemu 时连接不上,显示的信息如下

Unable to connect to libvirt qemu:///system.
Failed to connect socket to '/var/run/libvirt/virtqemud-sock': No such file or directory
Libvirt URI is: qemu:///system
Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/connection.py", line 923, in _do_open
    self._backend.open(cb, data)
  File "/usr/share/virt-manager/virtinst/connection.py", line 171, in open
    conn = libvirt.openAuth(self._open_uri,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/libvirt.py", line 147, in openAuth
    raise libvirtError('virConnectOpenAuth() failed')
libvirt.libvirtError: Failed to connect socket to '/var/run/libvirt/virtqemud-sock': No such file or directory



这是 /var/run/libvirt/ 下的东西
> ls -al /var/run/libvirt/
total 0
drwxr-xr-x  3 root root 140 Jan  8 11:15 .
drwxr-xr-x 30 root root 720 Jan  8 11:15 ..
drwx------  2 root root  60 Jan  8 11:11 common
srw-------  1 root root   0 Jan  8 11:11 virtlockd-admin-sock
srw-------  1 root root   0 Jan  8 11:11 virtlockd-sock
srw-------  1 root root   0 Jan  8 11:11 virtlogd-admin-sock
srw-------  1 root root   0 Jan  8 11:11 virtlogd-sock

kvm的内核模块正常加载
> lsmod | grep kvm
kvmgt                 479232  0
mdev                   20480  1 kvmgt
vfio                   77824  2 kvmgt,vfio_iommu_type1
kvm_intel             438272  0
kvm                  1449984  2 kvmgt,kvm_intel
irqbypass              12288  1 kvm
i915                 4460544  11 kvmgt

这是为为啥,该咋解决

最近编辑记录 assion (2024-01-08 13:09:35)

离线

#2 2024-01-08 12:27:59

依云
会员
所在地: a.k.a. 百合仙子
注册时间: 2011-08-21
帖子: 8,480
个人网站

Re: [已解决]virt-manager 无法使用

你开启了服务没有?

离线

#3 2024-01-08 12:39:20

assion
会员
注册时间: 2023-12-11
帖子: 15

Re: [已解决]virt-manager 无法使用

依云 说:

你开启了服务没有?

libvirtd.service 和 virtlogd.service 这两个服务吗?开了

> sudo systemctl status libvirtd.service
[sudo] password for unqit:
○ libvirtd.service - libvirt legacy monolithic daemon
     Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled; preset: disabled)
     Active: inactive (dead)
TriggeredBy: ○ libvirtd-ro.socket
             ○ libvirtd.socket
             ○ libvirtd-admin.socket
       Docs: man:libvirtd(8)
             https://libvirt.org/
> sudo systemctl status virtlogd.service
● virtlogd.service - libvirt logging daemon
     Loaded: loaded (/usr/lib/systemd/system/virtlogd.service; enabled; preset: disabled)
     Active: active (running) since Mon 2024-01-08 12:14:01 CST; 24min ago
TriggeredBy: ● virtlogd.socket
             ● virtlogd-admin.socket
       Docs: man:virtlogd(8)
             https://libvirt.org/
   Main PID: 681 (virtlogd)
      Tasks: 1 (limit: 18800)
     Memory: 2.6M (peak: 2.8M)
        CPU: 31ms
     CGroup: /system.slice/virtlogd.service
             └─681 /usr/bin/virtlogd

Jan 08 12:14:01 whl systemd[1]: Starting libvirt logging daemon...
Jan 08 12:14:01 whl systemd[1]: Started libvirt logging daemon.
~

离线

#4 2024-01-08 12:46:19

Mr.I
路人丙
所在地: Kerbal
注册时间: 2015-08-29
帖子: 308

Re: [已解决]virt-manager 无法使用

assion 说:
依云 说:

你开启了服务没有?

libvirtd.service 和 virtlogd.service 这两个服务吗?开了

> sudo systemctl status libvirtd.service
[sudo] password for unqit:
○ libvirtd.service - libvirt legacy monolithic daemon
     Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled; preset: disabled)
     Active: inactive (dead)

libvirtd 没启动

离线

#5 2024-01-08 12:57:03

assion
会员
注册时间: 2023-12-11
帖子: 15

Re: [已解决]virt-manager 无法使用

Mr.I 说:
assion 说:
依云 说:

你开启了服务没有?

libvirtd.service 和 virtlogd.service 这两个服务吗?开了

> sudo systemctl status libvirtd.service
[sudo] password for unqit:
○ libvirtd.service - libvirt legacy monolithic daemon
     Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled; preset: disabled)
     Active: inactive (dead)

libvirtd 没启动

我尝试手动启动,但是我看状态好像没有起来。
> sudo systemctl status libvirtd
○ libvirtd.service - libvirt legacy monolithic daemon
     Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled; preset: disabled)
     Active: inactive (dead) since Mon 2024-01-08 12:54:16 CST; 34s ago
   Duration: 21ms
TriggeredBy: ● libvirtd-ro.socket
             ● libvirtd.socket
             ● libvirtd-admin.socket
       Docs: man:libvirtd(8)
             https://libvirt.org/
    Process: 2638 ExecStart=/usr/bin/libvirtd $LIBVIRTD_ARGS (code=exited, status=0/SUCCESS)
   Main PID: 2638 (code=exited, status=0/SUCCESS)
        CPU: 48ms

Jan 08 12:54:16 whl systemd[1]: Starting libvirt legacy monolithic daemon...
Jan 08 12:54:16 whl systemd[1]: Started libvirt legacy monolithic daemon.
Jan 08 12:54:16 whl libvirtd[2638]: libvirt version: 9.10.0
Jan 08 12:54:16 whl libvirtd[2638]: hostname: whl
Jan 08 12:54:16 whl libvirtd[2638]: Cannot find 'dmidecode' in path: No such file or directory
Jan 08 12:54:16 whl libvirtd[2638]: configuration file syntax error: /etc/libvirt/qemu.conf:842: expecting a value
Jan 08 12:54:16 whl libvirtd[2638]: Initialisation of QEMU state driver failed: configuration file syntax error: /etc/libvirt/qemu.conf:842: expecting a value
Jan 08 12:54:16 whl libvirtd[2638]: Driver state initialisation failed
Jan 08 12:54:16 whl systemd[1]: libvirtd.service: Deactivated successfully.

离线

#6 2024-01-08 13:04:22

Mr.I
路人丙
所在地: Kerbal
注册时间: 2015-08-29
帖子: 308

Re: [已解决]virt-manager 无法使用

configuration file syntax error: /etc/libvirt/qemu.conf:842: expecting a value

配置文件写错了

离线

#7 2024-01-08 13:09:06

assion
会员
注册时间: 2023-12-11
帖子: 15

Re: [已解决]virt-manager 无法使用

谢谢大家的帮助,virt-manager 已经可以运行了

离线

页脚