Centos

錯誤:virPidFileAcquirePath:422:無法獲取 pid 文件“/run/user/1000/libvirt/libvirtd.pid”:資源暫時不可用

  • November 1, 2021

任何人有任何想法如何解決這個問題?看起來電腦告訴我 libvirt 沒有要連接的 VM。我在那裡可能不合時宜。

我開始玩 vitrd。我正在考慮使用 CentOS7 上的機器連接到我在伺服器啟動的虛擬機。

error : virPidFileAcquirePath:422 : Failed to acquire pid file '/run/user/1000/libvirt/libvirtd.pid': Resource temporarily unavailable

   [orca@orcacomputers ~]$ systemctl status libvirtd
● libvirtd.service - Virtualization daemon
  Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled; vendor preset: enabled)
  Active: active (running) since Sun 2020-11-01 15:15:47 PST; 1 day 4h ago
    Docs: man:libvirtd(8)
          https://libvirt.org
Main PID: 1770 (libvirtd)
   Tasks: 19 (limit: 32768)
  Memory: 10.1M
  CGroup: /system.slice/libvirtd.service
          ├─1770 /usr/sbin/libvirtd
          ├─2418 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/libexec/libvirt_leaseshelper
          └─2419 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/libexec/libvirt_leaseshelper

Nov 02 13:44:41 orcacomputers.orcainbox dnsmasq-dhcp[2418]: DHCPACK(virbr0) 192.168.122.48 52:54:00:39:15:6b
Nov 02 13:51:14 orcacomputers.orcainbox libvirtd[1770]: 2020-11-02 21:51:14.332+0000: 1770: error : virNetSocketReadWire:1806 : End of file while reading data: Input/output error
Nov 02 14:05:06 orcacomputers.orcainbox dnsmasq-dhcp[2418]: DHCPREQUEST(virbr0) 192.168.122.48 52:54:00:39:15:6b
Nov 02 14:05:06 orcacomputers.orcainbox dnsmasq-dhcp[2418]: DHCPACK(virbr0) 192.168.122.48 52:54:00:39:15:6b
Nov 02 14:25:11 orcacomputers.orcainbox dnsmasq-dhcp[2418]: DHCPREQUEST(virbr0) 192.168.122.48 52:54:00:39:15:6b
Nov 02 14:25:11 orcacomputers.orcainbox dnsmasq-dhcp[2418]: DHCPACK(virbr0) 192.168.122.48 52:54:00:39:15:6b
Nov 02 14:50:50 orcacomputers.orcainbox dnsmasq-dhcp[2418]: DHCPREQUEST(virbr0) 192.168.122.48 52:54:00:39:15:6b
Nov 02 14:50:50 orcacomputers.orcainbox dnsmasq-dhcp[2418]: DHCPACK(virbr0) 192.168.122.48 52:54:00:39:15:6b
Nov 02 15:18:21 orcacomputers.orcainbox dnsmasq-dhcp[2418]: DHCPREQUEST(virbr0) 192.168.122.48 52:54:00:39:15:6b
Nov 02 15:18:21 orcacomputers.orcainbox dnsmasq-dhcp[2418]: DHCPACK(virbr0) 192.168.122.48 52:54:00:39:15:6b

   [orca@orcacomputers ~]$ libvirtd -v
2020-11-03 03:27:35.145+0000: 30042: info : libvirt version: 4.5.0, package: 33.el7_8.1 (CentOS BuildSystem <http://bugs.centos.org>, 2020-05-12-16:25:35, x86-01.bsys.centos.org)
2020-11-03 03:27:35.145+0000: 30042: info : hostname: orcacomputers.orcainbox
2020-11-03 03:27:35.145+0000: 30042: info : virObjectNew:248 : OBJECT_NEW: obj=0x5649c93d1eb0 classname=virAccessManager
2020-11-03 03:27:35.145+0000: 30042: info : virObjectNew:248 : OBJECT_NEW: obj=0x5649c93cfea0 classname=virAccessManager
2020-11-03 03:27:35.145+0000: 30042: info : virObjectRef:382 : OBJECT_REF: obj=0x5649c93d1eb0
2020-11-03 03:27:35.145+0000: 30042: info : virObjectUnref:344 : OBJECT_UNREF: obj=0x5649c93d1eb0
2020-11-03 03:27:35.145+0000: 30042: error : virPidFileAcquirePath:422 : Failed to acquire pid file '/run/user/1000/libvirt/libvirtd.pid': Resource temporarily unavailable
2020-11-03 03:27:35.145+0000: 30042: info : virNetlinkEventServiceStopAll:865 : stopping all netlink event services
2020-11-03 03:27:35.145+0000: 30042: info : virNetlinkEventServiceStop:828 : stopping netlink event service
2020-11-03 03:27:35.145+0000: 30042: info : virNetlinkEventServiceStop:828 : stopping netlink event service
2020-11-03 03:27:35.145+0000: 30042: info : virNetlinkEventServiceStop:828 : stopping netlink event service
2020-11-03 03:27:35.145+0000: 30042: info : virNetlinkEventServiceStop:828 : stopping netlink event service
2020-11-03 03:27:35.145+0000: 30042: info : virNetlinkEventServiceStop:828 : stopping netlink event service
2020-11-03 03:27:35.145+0000: 30042: info : virNetlinkEventServiceStop:828 : stopping netlink event service
2020-11-03 03:27:35.145+0000: 30042: info : virNetlinkEventServiceStop:828 : stopping netlink event service
2020-11-03 03:27:35.145+0000: 30042: info : virNetlinkEventServiceStop:828 : stopping netlink event service
2020-11-03 03:27:35.145+0000: 30042: info : virNetlinkEventServiceStop:828 : stopping netlink event service

使用命令檢查 libvirtd 是否在您的系統上執行

ps -ef | grep libvirtd

使用命令移動您的 pid 文件

mv /var/run/libvirtd.pid /var/run/libvirtd.pid.old

使用命令停止 libvirtd 服務

systemctl stop libvirtd.service

並使用命令重新開始

systemctl start libvirtd.service

引用自:https://serverfault.com/questions/1041057