Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WSL2 Ubuntu 22.04 (Network mode: Mirroring mode) "dnsmasq failed to bind DHCP server socket: Address already in use" #3530

Open
TrestenPool opened this issue May 16, 2024 · 1 comment
Assignees
Labels

Comments

@TrestenPool
Copy link

Describe the bug
Multipass not starting up due to dnsmasq wanting to publish to port 53

To Reproduce
How, and what happened?

  1. Installed multipass via snap
  2. Running Ubuntu 22.04 inside of wsl2
  3. Using networking mirrored mode wsl

Expected behavior
Multipass should start up correctly reguardless if using wsl mirrored mode or not.

Logs
trestenp@computer:~/Downloads$ tail -f /var/log/syslog
May 16 16:35:29 PD-ITCADTEST6 systemd[1]: Started Service for snap application multipass.multipassd.
May 16 16:35:29 PD-ITCADTEST6 multipassd[83942]: Using AppArmor support
May 16 16:35:29 PD-ITCADTEST6 multipassd[83942]: Failed to enable AppArmor: AppArmor is not enabled
May 16 16:35:29 PD-ITCADTEST6 multipassd[83942]: Starting dnsmasq
May 16 16:35:29 PD-ITCADTEST6 multipassd[83942]: [83981] started: dnsmasq --keep-in-foreground --strict-order --bind-interfaces --pid-file --domain=multipass --local=/multipass/ --except-interface=lo --interface=mpqemubr0 --listen-address=10.70.171.1 --dhcp-no-override --dhcp-ignore-clid --dhcp-authoritative --dhcp-leasefile=/var/snap/multipass/common/data/multipassd/network/dnsmasq.leases --dhcp-hostsfile=/var/snap/multipass/common/data/multipassd/network/dnsmasq.hosts --dhcp-range 10.70.171.2,10.70.171.254,infinite --conf-file=/var/snap/multipass/common/data/multipassd/network/dnsmasq-ergvWF.conf
May 16 16:35:29 PD-ITCADTEST6 multipassd[83942]:
May 16 16:35:29 PD-ITCADTEST6 multipassd[83942]: #012dnsmasq: failed to bind DHCP server socket: Address already in use
May 16 16:35:29 PD-ITCADTEST6 dnsmasq[83981]: failed to bind DHCP server socket: Address already in use
May 16 16:35:29 PD-ITCADTEST6 dnsmasq[83981]: FAILED to start up
May 16 16:35:29 PD-ITCADTEST6 multipassd[83942]: dnsmasq died: Process returned exit code: 2. Ensure nothing is using port 53.
May 16 16:35:29 PD-ITCADTEST6 multipassd[83942]: Caught an unhandled exception: dnsmasq died: Process returned exit code: 2. Ensure nothing is using port 53.
May 16 16:35:29 PD-ITCADTEST6 systemd[1]: snap.multipass.multipassd.service: Main process exited, code=exited, status=1/FAILURE
May 16 16:35:29 PD-ITCADTEST6 systemd[1]: snap.multipass.multipassd.service: Failed with result 'exit-code'.
May 16 16:35:29 PD-ITCADTEST6 systemd[1]: snap.multipass.multipassd.service: Scheduled restart job, restart counter is at 1.
May 16 16:35:29 PD-ITCADTEST6 systemd[1]: Stopped Service for snap application multipass.multipassd.
May 16 16:35:29 PD-ITCADTEST6 systemd[1]: Started Service for snap application multipass.multipassd.
May 16 16:35:29 PD-ITCADTEST6 multipassd[83983]: Using AppArmor support
May 16 16:35:29 PD-ITCADTEST6 multipassd[83983]: Failed to enable AppArmor: AppArmor is not enabled
May 16 16:35:29 PD-ITCADTEST6 multipassd[83983]: Starting dnsmasq
May 16 16:35:29 PD-ITCADTEST6 multipassd[83983]: [84023] started: dnsmasq --keep-in-foreground --strict-order --bind-interfaces --pid-file --domain=multipass --local=/multipass/ --except-interface=lo --interface=mpqemubr0 --listen-address=10.70.171.1 --dhcp-no-override --dhcp-ignore-clid --dhcp-authoritative --dhcp-leasefile=/var/snap/multipass/common/data/multipassd/network/dnsmasq.leases --dhcp-hostsfile=/var/snap/multipass/common/data/multipassd/network/dnsmasq.hosts --dhcp-range 10.70.171.2,10.70.171.254,infinite --conf-file=/var/snap/multipass/common/data/multipassd/network/dnsmasq-gDNllc.conf
May 16 16:35:29 PD-ITCADTEST6 multipassd[83983]: #012dnsmasq: failed to bind DHCP server socket: Address already in use
May 16 16:35:29 PD-ITCADTEST6 multipassd[83983]: dnsmasq died: Process returned exit code: 2. Ensure nothing is using port 53.
May 16 16:35:29 PD-ITCADTEST6 dnsmasq[84023]: failed to bind DHCP server socket: Address already in use
May 16 16:35:29 PD-ITCADTEST6 multipassd[83983]: Caught an unhandled exception: dnsmasq died: Process returned exit code: 2. Ensure nothing is using port 53.
May 16 16:35:29 PD-ITCADTEST6 dnsmasq[84023]: FAILED to start up
May 16 16:35:29 PD-ITCADTEST6 systemd[1]: snap.multipass.multipassd.service: Main process exited, code=exited, status=1/FAILURE
May 16 16:35:29 PD-ITCADTEST6 systemd[1]: snap.multipass.multipassd.service: Failed with result 'exit-code'.
May 16 16:35:29 PD-ITCADTEST6 systemd[1]: snap.multipass.multipassd.service: Scheduled restart job, restart counter is at 2.
May 16 16:35:29 PD-ITCADTEST6 systemd[1]: Stopped Service for snap application multipass.multipassd.
May 16 16:35:29 PD-ITCADTEST6 systemd[1]: Started Service for snap application multipass.multipassd.
May 16 16:35:29 PD-ITCADTEST6 multipassd[84025]: Using AppArmor support
May 16 16:35:29 PD-ITCADTEST6 multipassd[84025]: Failed to enable AppArmor: AppArmor is not enabled
May 16 16:35:29 PD-ITCADTEST6 multipassd[84025]: Starting dnsmasq
May 16 16:35:29 PD-ITCADTEST6 multipassd[84025]: [84063] started: dnsmasq --keep-in-foreground --strict-order --bind-interfaces --pid-file --domain=multipass --local=/multipass/ --except-interface=lo --interface=mpqemubr0 --listen-address=10.70.171.1 --dhcp-no-override --dhcp-ignore-clid --dhcp-authoritative --dhcp-leasefile=/var/snap/multipass/common/data/multipassd/network/dnsmasq.leases --dhcp-hostsfile=/var/snap/multipass/common/data/multipassd/network/dnsmasq.hosts --dhcp-range 10.70.171.2,10.70.171.254,infinite --conf-file=/var/snap/multipass/common/data/multipassd/network/dnsmasq-TjARLt.conf
May 16 16:35:29 PD-ITCADTEST6 multipassd[84025]: #012dnsmasq: failed to bind DHCP server socket: Address already in use
May 16 16:35:29 PD-ITCADTEST6 dnsmasq[84063]: failed to bind DHCP server socket: Address already in use
May 16 16:35:29 PD-ITCADTEST6 dnsmasq[84063]: FAILED to start up
May 16 16:35:29 PD-ITCADTEST6 multipassd[84025]: dnsmasq died: Process returned exit code: 2. Ensure nothing is using port 53.
May 16 16:35:29 PD-ITCADTEST6 multipassd[84025]: Caught an unhandled exception: dnsmasq died: Process returned exit code: 2. Ensure nothing is using port 53.
May 16 16:35:29 PD-ITCADTEST6 systemd[1]: snap.multipass.multipassd.service: Main process exited, code=exited, status=1/FAILURE
May 16 16:35:29 PD-ITCADTEST6 systemd[1]: snap.multipass.multipassd.service: Failed with result 'exit-code'.
May 16 16:35:29 PD-ITCADTEST6 systemd[1]: snap.multipass.multipassd.service: Scheduled restart job, restart counter is at 3.
May 16 16:35:29 PD-ITCADTEST6 systemd[1]: Stopped Service for snap application multipass.multipassd.
May 16 16:35:29 PD-ITCADTEST6 systemd[1]: Started Service for snap application multipass.multipassd.
May 16 16:35:29 PD-ITCADTEST6 multipassd[84065]: Using AppArmor support
May 16 16:35:29 PD-ITCADTEST6 multipassd[84065]: Failed to enable AppArmor: AppArmor is not enabled
May 16 16:35:29 PD-ITCADTEST6 multipassd[84065]: Starting dnsmasq
May 16 16:35:29 PD-ITCADTEST6 multipassd[84065]: [84102] started: dnsmasq --keep-in-foreground --strict-order --bind-interfaces --pid-file --domain=multipass --local=/multipass/ --except-interface=lo --interface=mpqemubr0 --listen-address=10.70.171.1 --dhcp-no-override --dhcp-ignore-clid --dhcp-authoritative --dhcp-leasefile=/var/snap/multipass/common/data/multipassd/network/dnsmasq.leases --dhcp-hostsfile=/var/snap/multipass/common/data/multipassd/network/dnsmasq.hosts --dhcp-range 10.70.171.2,10.70.171.254,infinite --conf-file=/var/snap/multipass/common/data/multipassd/network/dnsmasq-gjcazd.conf
May 16 16:35:29 PD-ITCADTEST6 multipassd[84065]: #012dnsmasq: failed to bind DHCP server socket: Address already in use
May 16 16:35:29 PD-ITCADTEST6 dnsmasq[84102]: failed to bind DHCP server socket: Address already in use
May 16 16:35:29 PD-ITCADTEST6 dnsmasq[84102]: FAILED to start up
May 16 16:35:29 PD-ITCADTEST6 multipassd[84065]: dnsmasq died: Process returned exit code: 2. Ensure nothing is using port 53.
May 16 16:35:29 PD-ITCADTEST6 multipassd[84065]: Caught an unhandled exception: dnsmasq died: Process returned exit code: 2. Ensure nothing is using port 53.
May 16 16:35:29 PD-ITCADTEST6 systemd[1]: snap.multipass.multipassd.service: Main process exited, code=exited, status=1/FAILURE
May 16 16:35:29 PD-ITCADTEST6 systemd[1]: snap.multipass.multipassd.service: Failed with result 'exit-code'.
May 16 16:35:30 PD-ITCADTEST6 systemd[1]: snap.multipass.multipassd.service: Scheduled restart job, restart counter is at 4.
May 16 16:35:30 PD-ITCADTEST6 systemd[1]: Stopped Service for snap application multipass.multipassd.
May 16 16:35:30 PD-ITCADTEST6 systemd[1]: Started Service for snap application multipass.multipassd.
May 16 16:35:30 PD-ITCADTEST6 multipassd[84127]: Using AppArmor support
May 16 16:35:30 PD-ITCADTEST6 multipassd[84127]: Failed to enable AppArmor: AppArmor is not enabled
May 16 16:35:30 PD-ITCADTEST6 multipassd[84127]: Starting dnsmasq
May 16 16:35:30 PD-ITCADTEST6 multipassd[84127]: [84166] started: dnsmasq --keep-in-foreground --strict-order --bind-interfaces --pid-file --domain=multipass --local=/multipass/ --except-interface=lo --interface=mpqemubr0 --listen-address=10.70.171.1 --dhcp-no-override --dhcp-ignore-clid --dhcp-authoritative --dhcp-leasefile=/var/snap/multipass/common/data/multipassd/network/dnsmasq.leases --dhcp-hostsfile=/var/snap/multipass/common/data/multipassd/network/dnsmasq.hosts --dhcp-range 10.70.171.2,10.70.171.254,infinite --conf-file=/var/snap/multipass/common/data/multipassd/network/dnsmasq-fgHJjN.conf
May 16 16:35:30 PD-ITCADTEST6 multipassd[84127]: #012dnsmasq: failed to bind DHCP server socket: Address already in use
May 16 16:35:30 PD-ITCADTEST6 multipassd[84127]: dnsmasq died: Process returned exit code: 2. Ensure nothing is using port 53.
May 16 16:35:30 PD-ITCADTEST6 dnsmasq[84166]: failed to bind DHCP server socket: Address already in use
May 16 16:35:30 PD-ITCADTEST6 multipassd[84127]: Caught an unhandled exception: dnsmasq died: Process returned exit code: 2. Ensure nothing is using port 53.
May 16 16:35:30 PD-ITCADTEST6 dnsmasq[84166]: FAILED to start up
May 16 16:35:30 PD-ITCADTEST6 systemd[1]: snap.multipass.multipassd.service: Main process exited, code=exited, status=1/FAILURE
May 16 16:35:30 PD-ITCADTEST6 systemd[1]: snap.multipass.multipassd.service: Failed with result 'exit-code'.
May 16 16:35:30 PD-ITCADTEST6 systemd[1]: snap.multipass.multipassd.service: Scheduled restart job, restart counter is at 5.
May 16 16:35:30 PD-ITCADTEST6 systemd[1]: Stopped Service for snap application multipass.multipassd.
May 16 16:35:30 PD-ITCADTEST6 systemd[1]: snap.multipass.multipassd.service: Start request repeated too quickly.
May 16 16:35:30 PD-ITCADTEST6 systemd[1]: snap.multipass.multipassd.service: Failed with result 'exit-code'.
May 16 16:35:30 PD-ITCADTEST6 systemd[1]: Failed to start Service for snap application multipass.multipassd.

Open ports on my computer
trestenp@PD-ITCADTEST6:/Downloads$ ss -tul
Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
udp UNCONN 0 0 127.0.0.1:323 0.0.0.0:*
udp UNCONN 0 0 0.0.0.0:4789 0.0.0.0:*
udp UNCONN 0 0 :7946 :
udp UNCONN 0 0 [::1]:323 [::]:

tcp LISTEN 0 4096 0.0.0.0:domain 0.0.0.0:*
tcp LISTEN 0 4096 [::]:domain [::]:*
tcp LISTEN 0 4096 *:2377 :
tcp LISTEN 0 4096 *:7946 :
trestenp@PD-ITCADTEST6:
/Downloads$

Additional info

  • WSL2(Networking mode: mirrored) Ubuntu 22.04
  • multipass 1.13.1
  • multipass get local.driver
  • trestenp@computer:~/Downloads$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 22.04.4 LTS Release: 22.04 Codename: jammy

Additional context
The notes lead me to believe that something is running on port 53 but when I list open ports on my host port 53 is not listening.
Also is there any way to tell multipass to listen on another port?

@TrestenPool TrestenPool added bug needs triage Issue needs to be triaged labels May 16, 2024
@ricab
Copy link
Collaborator

ricab commented May 24, 2024

Hi @TrestenPool, as you've noticed, we do need port 53 for dnsmasq. This is the standard port for DNS.

Any port we chose could potentially conflict with something else in the system. We could allow configuring, but I'd rather avoid complicating the configuration with backend-specific settings. We could perhaps randomize the port, but there are very few cases of people reporting collisions. And we don't actually support WSL specifically, so this is pretty much out of scope.

I am curious, why are you trying to run Multipass on WSL, rather than directly on Windows?

@ricab ricab self-assigned this May 24, 2024
@ricab ricab added question and removed needs triage Issue needs to be triaged bug labels May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants