套接字至‘/var/run/libvirt/virtxend-sock’:未找到文件或目录

套接字至‘/var/run/libvirt/virtxend-sock’:未找到文件或目录

我在 ubuntu 20.04 上运行 xen,并尝试使用 virt-manager 创建新的 xen 连接,但不起作用,因为出现错误:“无法将套接字连接到‘/var/run/libvirt/-virtxend-sock。未找到文件或目录”。我尝试执行以下操作:

root@ziomario-I9:/etc/xen# systemctl status libvirtd
● libvirtd.service - Virtualization daemon
     Loaded: loaded (/lib/systemd/system/libvirtd.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2020-07-14 07:41:04 CEST; 14h ago
TriggeredBy: ● libvirtd-admin.socket
             ● libvirtd.socket
             ● libvirtd-ro.socket
       Docs: man:libvirtd(8)
             https://libvirt.org
   Main PID: 2376 (libvirtd)
      Tasks: 17 (limit: 32768)
     Memory: 41.0M
     CGroup: /system.slice/libvirtd.service
             └─2376 /usr/sbin/libvirtd

lug 14 21:31:19 ziomario-I9 libvirtd[2376]: End of file while reading data: Error di input/output
lug 14 21:33:15 ziomario-I9 libvirtd[2376]: Failed to connect socket to '/var/run/libvirt/virtxend-sock': File o directory not found
lug 14 21:33:15 ziomario-I9 libvirtd[2376]: End of file while reading data: Errore di input/output
lug 14 21:39:29 ziomario-I9 libvirtd[2376]: Failed to connect socket to '/var/run/libvirt/virtxend-sock': File o directory no>
lug 14 21:39:29 ziomario-I9 libvirtd[2376]: End of file while reading data: Error input/output
lug 14 21:41:13 ziomario-I9 libvirtd[2376]: operation failed: pool 'default' already exists with uuid 4794da80-c4ef-43a5-aee5>
lug 14 21:41:23 ziomario-I9 libvirtd[2376]: Failed to connect socket to '/var/run/libvirt/virtbhyved-sock': File or directory not found
lug 14 21:41:23 ziomario-I9 libvirtd[2376]: End of file while reading data: Errore di input/output
lug 14 21:41:46 ziomario-I9 libvirtd[2376]: Failed to connect socket to '/var/run/libvirt/virtxend-sock': File o directory no>
lug 14 21:41:46 ziomario-I9 libvirtd[2376]: End of file while reading data: Errore di input/output

我也尝试过这样做:

sudo systemctl enable libvirtd
sudo systemctl start libvirtd

但我得到了相同的结果。我该怎么办?

更新 :

root@ziomario-I9:/etc/xen# apt install libvirt-daemon-driver-xen

root@ziomario-I9:/etc/xen# sudo systemctl restart libvirtd

root@ziomario-I9:/etc/xen# systemctl status libvirtd
lines 1--1...skipping...
● libvirtd.service - Virtualization daemon
     Loaded: loaded (/lib/systemd/system/libvirtd.service; enabled; vendor preset: enabled)
     Active: inactive (dead) since Wed 2020-07-15 18:14:28 CEST; 18s ago
TriggeredBy: ● libvirtd-admin.socket
             ● libvirtd.socket
             ● libvirtd-ro.socket
       Docs: man:libvirtd(8)
             https://libvirt.org
    Process: 31289 ExecStart=/usr/sbin/libvirtd $libvirtd_opts (code=exited, status=0/SUCCESS)
   Main PID: 31289 (code=exited, status=0/SUCCESS)

lug 15 18:14:27 ziomario-I9 systemd[1]: Starting Virtualization daemon...
lug 15 18:14:27 ziomario-I9 systemd[1]: Started Virtualization daemon.
lug 15 18:14:28 ziomario-I9 libvirtd[31289]: libvirt version: 6.0.0, package: 0ubuntu8.1 (Christian Ehrhardt <christian.ehrha>
lug 15 18:14:28 ziomario-I9 libvirtd[31289]: hostname: ziomario-I9
lug 15 18:14:28 ziomario-I9 libvirtd[31289]: Unable to configure libxl's memory management parameters
lug 15 18:14:28 ziomario-I9 libvirtd[31289]: Initialization of LIBXL state driver failed: no error
lug 15 18:14:28 ziomario-I9 libvirtd[31289]: Driver state initialization failed
lug 15 18:14:28 ziomario-I9 systemd[1]: libvirtd.service: Succeeded.

现在错误是:

libxenlight 状态驱动程序未处于活动状态。

LOG 收集了这些装甲否认,但它们在创建 xen 域之前就出现了:

root@ziomario-I9:/home/ziomario# dmesg -w | grep apparmor
[    5.887830] evm: security.apparmor
[   31.653223] audit: type=1400 audit(1594897201.258:2): apparmor="STATUS" operation="profile_load" profile="unconfined" name="libreoffice-senddoc" pid=665 comm="apparmor_parser"
[   31.702186] audit: type=1400 audit(1594897201.306:3): apparmor="STATUS" operation="profile_load" profile="unconfined" name="libreoffice-xpdfimport" pid=672 comm="apparmor_parser"
[   31.802911] audit: type=1400 audit(1594897201.406:4): apparmor="STATUS" operation="profile_load" profile="unconfined" name="libreoffice-oopslash" pid=671 comm="apparmor_parser"
[   31.823300] audit: type=1400 audit(1594897201.430:5): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/ipsec/stroke" pid=663 comm="apparmor_parser"
[   31.953066] audit: type=1400 audit(1594897201.558:6): apparmor="STATUS" operation="profile_load" profile="unconfined" name="nvidia_modprobe" pid=669 comm="apparmor_parser"
[   31.953076] audit: type=1400 audit(1594897201.558:7): apparmor="STATUS" operation="profile_load" profile="unconfined" name="nvidia_modprobe//kmod" pid=669 comm="apparmor_parser"
[   31.966592] audit: type=1400 audit(1594897201.570:8): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/bin/man" pid=660 comm="apparmor_parser"
[   31.966601] audit: type=1400 audit(1594897201.570:9): apparmor="STATUS" operation="profile_load" profile="unconfined" name="man_filter" pid=660 comm="apparmor_parser"
[   31.966607] audit: type=1400 audit(1594897201.570:10): apparmor="STATUS" operation="profile_load" profile="unconfined" name="man_groff" pid=660 comm="apparmor_parser"
[   31.975582] audit: type=1400 audit(1594897201.582:11): apparmor="STATUS" operation="profile_load" profile="unconfined" name="lsb_release" pid=664 comm="apparmor_parser"
[   48.715193] audit: type=1400 audit(1594897218.322:59): apparmor="DENIED" operation="open" profile="/{,usr/}sbin/dhclient" name="/proc/1733/task/1734/comm" pid=1733 comm="dhclient" requested_mask="wr" denied_mask="wr" fsuid=0 ouid=0
[   48.715835] audit: type=1400 audit(1594897218.322:60): apparmor="DENIED" operation="open" profile="/{,usr/}sbin/dhclient" name="/proc/1733/task/1735/comm" pid=1733 comm="dhclient" requested_mask="wr" denied_mask="wr" fsuid=0 ouid=0
[   48.716222] audit: type=1400 audit(1594897218.322:61): apparmor="DENIED" operation="open" profile="/{,usr/}sbin/dhclient" name="/proc/1733/task/1736/comm" pid=1733 comm="dhclient" requested_mask="wr" denied_mask="wr" fsuid=0 ouid=0
[  137.782108] audit: type=1400 audit(1594897307.641:62): apparmor="DENIED" operation="capable" profile="/usr/sbin/cups-browsed" pid=2396 comm="cups-browsed" capability=23  capname="sys_nice"
[  183.363064] audit: type=1400 audit(1594897353.229:63): apparmor="STATUS" operation="profile_load" profile="unconfined" name="docker-default" pid=3461 comm="apparmor_parser"

答案1

检查一些常见问题:

#1 dmesg 中是否有相关的 apparmor 拒绝?您需要在一个控制台中运行dmesg -w,然后在另一个控制台中启动您的客户端。如果收集的日志有任何appamor ... DENIED ...消息,请检查它们并考虑添加相应的规则。

#2 此外,只有在使用 virtxend 的拆分守护进程时才需要该套接字,Ubuntu 在 20.04 中不使用它。但也许您会错过该功能 - libvirt xen 支持现在是一个单独的非默认安装包 - 考虑安装libvirt-daemon-driver-xen然后重新启动 libvirtd。

apt install libvirt-daemon-driver-xen
systemctl restart libvirtd

相关内容