有人知道如何修复这个问题吗?计算机似乎告诉我 libvirt 没有可连接的虚拟机。我可能错了。
我开始使用 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
答案1
使用命令检查 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