我有一个全新的 Fedora Server 36 最小安装,它将运行的只是 KVM。
安装dnf group install "Headless Virtualization"
并重新启动服务器。
systemctl status libvirtd
显示它没有运行; IE
[root@dell-fedora-kvm ~]# systemctl status libvirtd
○ libvirtd.service - Virtualization daemon
Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled; vendor preset: disabled)
Active: inactive (dead)
TriggeredBy: ○ libvirtd-tcp.socket
○ libvirtd-admin.socket
○ libvirtd-ro.socket
○ libvirtd-tls.socket
○ libvirtd.socket
Docs: man:libvirtd(8)
https://libvirt.org
所以我尝试启用它
systemctl enable libvirtd
重启了还是没有自动启动。当我手动启动它时,systemctl start libvirtd
这就是我得到的结果status
。不确定这是否告诉我们问题可能出在哪里。
root@dell-fedora-kvm ~]# systemctl status libvirtd
● libvirtd.service - Virtualization daemon
Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled; vendor preset: disabled)
Active: active (running) since Sun 2022-07-03 16:32:23 AEST; 52s ago
TriggeredBy: ○ libvirtd-tcp.socket
● libvirtd-admin.socket
● libvirtd-ro.socket
○ libvirtd-tls.socket
● libvirtd.socket
Docs: man:libvirtd(8)
https://libvirt.org
Main PID: 857 (libvirtd)
Tasks: 21 (limit: 32768)
Memory: 44.8M
CPU: 480ms
CGroup: /system.slice/libvirtd.service
├─ 857 /usr/sbin/libvirtd --timeout 120
├─ 957 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/libexec/libvirt_leaseshelper
└─ 958 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/libexec/libvirt_leaseshelper
Jul 03 16:32:23 dell-fedora-kvm systemd[1]: Started libvirtd.service - Virtualization daemon.
Jul 03 16:32:24 dell-fedora-kvm dnsmasq[957]: started, version 2.86 cachesize 150
Jul 03 16:32:24 dell-fedora-kvm dnsmasq[957]: compile time options: IPv6 GNU-getopt DBus no-UBus no-i18n IDN2 DHCP DHCPv6 no-Lua TFTP conntrack ipset auth cryptoh>
Jul 03 16:32:24 dell-fedora-kvm dnsmasq-dhcp[957]: DHCP, IP range 192.168.122.2 -- 192.168.122.254, lease time 1h
Jul 03 16:32:24 dell-fedora-kvm dnsmasq-dhcp[957]: DHCP, sockets bound exclusively to interface virbr0
Jul 03 16:32:24 dell-fedora-kvm dnsmasq[957]: reading /etc/resolv.conf
Jul 03 16:32:24 dell-fedora-kvm dnsmasq[957]: using nameserver 127.0.0.53#53
Jul 03 16:32:24 dell-fedora-kvm dnsmasq[957]: read /etc/hosts - 2 addresses
Jul 03 16:32:24 dell-fedora-kvm dnsmasq[957]: read /var/lib/libvirt/dnsmasq/default.addnhosts - 0 addresses
Jul 03 16:32:24 dell-fedora-kvm dnsmasq-dhcp[957]: read /var/lib/libvirt/dnsmasq/default.hostsfile
然而,该服务在一段时间后就死掉了......
[root@dell-fedora-kvm ~]# systemctl status libvirtd
○ libvirtd.service - Virtualization daemon
Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled; vendor preset: disabled)
Active: inactive (dead) since Sun 2022-07-03 16:37:25 AEST; 6s ago
TriggeredBy: ○ libvirtd-tcp.socket
● libvirtd-admin.socket
● libvirtd-ro.socket
○ libvirtd-tls.socket
● libvirtd.socket
Docs: man:libvirtd(8)
https://libvirt.org
Process: 994 ExecStart=/usr/sbin/libvirtd $LIBVIRTD_ARGS (code=exited, status=0/SUCCESS)
Main PID: 994 (code=exited, status=0/SUCCESS)
Tasks: 2 (limit: 32768)
Memory: 31.7M
CPU: 330ms
CGroup: /system.slice/libvirtd.service
├─ 957 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/libexec/libvirt_leaseshelper
└─ 958 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/libexec/libvirt_leaseshelper
Jul 03 16:35:25 dell-fedora-kvm systemd[1]: Starting libvirtd.service - Virtualization daemon...
Jul 03 16:35:25 dell-fedora-kvm systemd[1]: Started libvirtd.service - Virtualization daemon.
Jul 03 16:35:25 dell-fedora-kvm dnsmasq[957]: read /etc/hosts - 2 addresses
Jul 03 16:35:25 dell-fedora-kvm dnsmasq[957]: read /var/lib/libvirt/dnsmasq/default.addnhosts - 0 addresses
Jul 03 16:35:25 dell-fedora-kvm dnsmasq-dhcp[957]: read /var/lib/libvirt/dnsmasq/default.hostsfile
Jul 03 16:37:25 dell-fedora-kvm systemd[1]: libvirtd.service: Deactivated successfully.
Jul 03 16:37:25 dell-fedora-kvm systemd[1]: libvirtd.service: Unit process 957 (dnsmasq) remains running after unit stopped.
Jul 03 16:37:25 dell-fedora-kvm systemd[1]: libvirtd.service: Unit process 958 (dnsmasq) remains running after unit stopped.
知道发生什么事了吗?