Linux, 工作, 生活, 家人

Gentoo

[Gentoo] virt-manager/libvirt virbr0 doesn’t exist

Once when I reboot the system, system shows, there is no virbr0

First, check the interface states, default network is inactive

# virsh net-list --all
Name State Autostart Persistent
----------------------------------------------------
bridged-network active yes yes
default inactive yes yes

Manual restart, it shows following message

# virsh net-start default
error: Failed to start network default
error: internal error: Child process (VIR_BRIDGE_NAME=virbr1 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/libexec/libvirt_leaseshelper) unexpected exit status 2:
dnsmasq: failed to create listening socket for 192.168.123.1: Address already in use

The root cause is, when libvirt start the default network, it will also bring up the dnsmasq as dns server, but if this system also has DNS server like named or another dnsmasq service, it will have port conflict.
Tried to modify the yaml to assign dnsmasq to another port, but doens’t work (old configure is to use /etc/dnsmasq.conf, but seems it will use default.xml after update the libvirt )

add <dns enable="no"/> to default network setting can solve this issue, ex:

# virsh net-edit default

<network>
<name>default</name>
<uuid>cdf10e75-0299-43b5-8c93-e6943e261ef3</uuid>
<forward mode='nat'/>
<bridge name='virbr0' stp='on' delay='0'/>
<mac address='52:54:00:66:c4:a3'/>
<dns enable='no'/>
<ip address='192.168.122.1' netmask='255.255.255.0'>
<dhcp>
<range start='192.168.122.2' end='192.168.122.254'/>
</dhcp>
</ip>
</network>

ref.
https://serverfault.com/questions/937188/disable-or-change-port-of-dnsmasq-service-in-libvirt

發佈留言