• Virtual network fails to start: dnsmasq: failed to create listening soc

    From Charles Curley@21:1/5 to All on Tue Jan 14 20:10:01 2025
    I have a virtual network controlled with Virtual Machine Manager. I
    just gracefully rebooted the host machine. Bringing up the virtual
    network produces the following:

    Error starting network 'default': internal error: Child process (VIR_BRIDGE_NAME=virbr0 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper) unexpected exit status 2:
    dnsmasq: failed to create listening socket for 192.168.122.1: Address already in use


    Traceback (most recent call last):
    File "/usr/share/virt-manager/virtManager/asyncjob.py", line 72, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
    File "/usr/share/virt-manager/virtManager/asyncjob.py", line 108, in tmpcb
    callback(*args, **kwargs)
    File "/usr/share/virt-manager/virtManager/object/libvirtobject.py", line 57, in newfn
    ret = fn(self, *args, **kwargs)
    ^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/share/virt-manager/virtManager/object/network.py", line 69, in start
    self._backend.create()
    File "/usr/lib/python3/dist-packages/libvirt.py", line 3547, in create
    raise libvirtError('virNetworkCreate() failed')
    libvirt.libvirtError: internal error: Child process (VIR_BRIDGE_NAME=virbr0 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper) unexpected exit status 2:
    dnsmasq: failed to create listening socket for 192.168.122.1: Address already in use


    Near as I can tell, that address is not already in use. The host is on 192.168.100.0/24.

    root@hawk:~# ifconfig -a
    enp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
    inet 192.168.100.6 netmask 255.255.255.0 broadcast 192.168.100.255
    ether 30:5a:3a:81:83:79 txqueuelen 1000 (Ethernet)
    RX packets 2027 bytes 661510 (646.0 KiB)
    RX errors 0 dropped 0 overruns 0 frame 0
    TX packets 2016 bytes 669884 (654.1 KiB)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

    lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
    inet 127.0.0.1 netmask 255.0.0.0
    inet6 ::1 prefixlen 128 scopeid 0x10<host>
    loop txqueuelen 1000 (Local Loopback)
    RX packets 1525 bytes 1023413 (999.4 KiB)
    RX errors 0 dropped 0 overruns 0 frame 0
    TX packets 1525 bytes 1023413 (999.4 KiB)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

    root@hawk:~#

    dnsmasq is not running now.

    Might this be related to the upgrade of dnsmasq-base on January 12
    (2.89-1, 2.90-4~deb12u1)?

    --
    Does anybody read signatures any more?

    https://charlescurley.com
    https://charlescurley.com/blog/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to Charles Curley on Tue Jan 14 20:40:02 2025
    Whenever I restart dnsmasq (including a system restart), I have to start
    with a new (empty) DHCP leases file. Your DHCP leases file is specified
    in your dnsmasq configuration file (*.conf).

    Your config file appears to be /var/lib/libvirt/dnsmasq/default.conf

    Your DHCP leases file appears to be /usr/lib/libvirt/libvirt_leaseshelper

    Hope that helps,
    Ken


    On 1/14/25 2:00 PM, Charles Curley wrote:
    I have a virtual network controlled with Virtual Machine Manager. I
    just gracefully rebooted the host machine. Bringing up the virtual
    network produces the following:

    Error starting network 'default': internal error: Child process (VIR_BRIDGE_NAME=virbr0 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper) unexpected exit status 2:
    dnsmasq: failed to create listening socket for 192.168.122.1: Address already in use


    Traceback (most recent call last):
    File "/usr/share/virt-manager/virtManager/asyncjob.py", line 72, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
    File "/usr/share/virt-manager/virtManager/asyncjob.py", line 108, in tmpcb
    callback(*args, **kwargs)
    File "/usr/share/virt-manager/virtManager/object/libvirtobject.py", line 57, in newfn
    ret = fn(self, *args, **kwargs)
    ^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/share/virt-manager/virtManager/object/network.py", line 69, in start
    self._backend.create()
    File "/usr/lib/python3/dist-packages/libvirt.py", line 3547, in create
    raise libvirtError('virNetworkCreate() failed')
    libvirt.libvirtError: internal error: Child process (VIR_BRIDGE_NAME=virbr0 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper) unexpected exit status 2:
    dnsmasq: failed to create listening socket for 192.168.122.1: Address already in use


    Near as I can tell, that address is not already in use. The host is on 192.168.100.0/24.

    root@hawk:~# ifconfig -a
    enp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
    inet 192.168.100.6 netmask 255.255.255.0 broadcast 192.168.100.255
    ether 30:5a:3a:81:83:79 txqueuelen 1000 (Ethernet)
    RX packets 2027 bytes 661510 (646.0 KiB)
    RX errors 0 dropped 0 overruns 0 frame 0
    TX packets 2016 bytes 669884 (654.1 KiB)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

    lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
    inet 127.0.0.1 netmask 255.0.0.0
    inet6 ::1 prefixlen 128 scopeid 0x10<host>
    loop txqueuelen 1000 (Local Loopback)
    RX packets 1525 bytes 1023413 (999.4 KiB)
    RX errors 0 dropped 0 overruns 0 frame 0
    TX packets 1525 bytes 1023413 (999.4 KiB)
    TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

    root@hawk:~#

    dnsmasq is not running now.

    Might this be related to the upgrade of dnsmasq-base on January 12
    (2.89-1, 2.90-4~deb12u1)?


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Charles Curley@21:1/5 to [email protected] on Tue Jan 14 21:20:02 2025
    On Tue, 14 Jan 2025 14:22:57 -0500
    [email protected] wrote:

    Whenever I restart dnsmasq (including a system restart), I have to
    start with a new (empty) DHCP leases file. Your DHCP leases file is specified in your dnsmasq configuration file (*.conf).

    Your config file appears to be /var/lib/libvirt/dnsmasq/default.conf

    Your DHCP leases file appears to be


    Thanks, Ken.

    You are correct on the config file.

    Unfortunately /usr/lib/libvirt/libvirt_leaseshelper is an ELF compiled executable. It has no man page. I hesitate to just up and run it. If
    dnsmasq has a leases file anywhere, I haven't found it.

    This may be because dnsmasq is called with --leasefile-ro, which will "Completely suppress use of the lease database file." This requires the dhcp-script to maintain the leases internally.

    In other news, I rebooted another bookworm system, and its virtual
    network came up without issue. Some comparisons are in order.

    --
    Does anybody read signatures any more?

    https://charlescurley.com
    https://charlescurley.com/blog/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Charles Curley@21:1/5 to Charles Curley on Wed Jan 15 00:20:01 2025
    On Tue, 14 Jan 2025 12:00:22 -0700
    Charles Curley <[email protected]> wrote:

    dnsmasq: failed to create listening socket for 192.168.122.1: Address
    already in use

    I've identified the problem. I have bind9 running on the problematic
    host but not the host where things worked. Apparently as soon as
    libvirt would create the host's interface for the network, bind grabbed
    it, precluding dnsmasq from doing so.

    Shutting down bind9 allowed me to solve that problem. Now to dig into
    the bind 9 documentation and make it a bit less greedy.

    --
    Does anybody read signatures any more?

    https://charlescurley.com
    https://charlescurley.com/blog/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From john doe@21:1/5 to Charles Curley on Wed Jan 15 14:00:01 2025
    On 1/15/25 00:09, Charles Curley wrote:
    On Tue, 14 Jan 2025 12:00:22 -0700
    Charles Curley <[email protected]> wrote:

    dnsmasq: failed to create listening socket for 192.168.122.1: Address
    already in use

    I've identified the problem. I have bind9 running on the problematic
    host but not the host where things worked. Apparently as soon as
    libvirt would create the host's interface for the network, bind grabbed
    it, precluding dnsmasq from doing so.

    Shutting down bind9 allowed me to solve that problem. Now to dig into
    the bind 9 documentation and make it a bit less greedy.


    Question is, why do you need Bind9 on this host in the first place!

    --
    John Doe

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to All on Wed Jan 15 15:40:01 2025
    Sent: Wednesday, January 15, 2025 at 7:57 AM
    From: "john doe" <[email protected]>
    To: [email protected]
    Subject: Re: Virtual network fails to start: SOLVED

    On 1/15/25 00:09, Charles Curley wrote:
    On Tue, 14 Jan 2025 12:00:22 -0700
    Charles Curley <[email protected]> wrote:

    dnsmasq: failed to create listening socket for 192.168.122.1: Address
    already in use

    I've identified the problem. I have bind9 running on the problematic
    host but not the host where things worked. Apparently as soon as
    libvirt would create the host's interface for the network, bind grabbed
    it, precluding dnsmasq from doing so.

    Shutting down bind9 allowed me to solve that problem. Now to dig into
    the bind 9 documentation and make it a bit less greedy.


    Question is, why do you need Bind9 on this host in the first place!


    If properly configured then bind isn't an issue

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)