Skip to content

Bug: Acrylic DNS and WSL2 Port Conflict Issues #14

@jerrens

Description

@jerrens

Description

After installing valet-windows, everything appeared to be working great until I rebooted. After the reboot, WSL2 would not launch, which also impacted Docker (uses WSL under the hood in Win 10) and a few other things.

When starting a new instance of WSL (Ubuntu), the following message would appear in the terminal:

Failed to configure network (networkingMode Nat). To disable networking, set wsl2.networkingMode=None in C:\Users\jerre.wslconfig
Error code: Wsl/Service/CreateInstance/CreateVm/ConfigureNetworking/HNS/0xffffffff

After some investigation, it turns out that Acrylic DNS Proxy service was using port 53 (default) which is needed by WSL2 in Windows and since the service was automatically starting, it was able to bind to port 53 first and then block whatever service (svchost.exe >> netsvcs -p) was needed by WSL2.

Following instructions from microsoft/WSL#4364 (comment), I was able to modify %AppData%\Composer\vendor\ycodetech\valet-windows\bin\acrylic\AcrylicConfiguration.ini and changed LocalIPv4BindingPort=54 (was =53). After running valet restart acrylic, the commands

Get-NetUDPEndpoint | Where {$_.LocalPort -eq "53"} | select LocalAddress,LocalPort,@{Name="Process";Expression={(Get-Process -Id $_.OwningProcess).ProcessName}}

Get-NetUDPEndpoint | Where {$_.LocalPort -eq "54"} | select LocalAddress,LocalPort,@{Name="Process";Expression={(Get-Process -Id $_.OwningProcess).ProcessName}}

showed the expected output:

PS C:\> Get-NetUDPEndpoint | Where {$_.LocalPort -eq "53"} | select LocalAddress,LocalPort,@{Name="Process";Expression={(Get-Process -Id $_.OwningProcess).ProcessName}}

LocalAddress LocalPort Process
------------ --------- -------
::                  53 AcrylicService
0.0.0.0             53 svchost


PS C:\> Get-NetUDPEndpoint | Where {$_.LocalPort -eq "54"} | select LocalAddress,LocalPort,@{Name="Process";Expression={(Get-Process -Id $_.OwningProcess).ProcessName}}

LocalAddress LocalPort Process
------------ --------- -------
0.0.0.0             54 AcrylicService

Some alternative suggestions that I didn't try were:

  1. Set the Acrylic DNS service to be Automatic (delayed) start. In theory, this would give time for the other service that used port 53 to start first, then Acrylic to attempt later (and be denied). This felt like an ugly work-around and having the potential of not always working as expected (ie. race condition).

  2. Set LocalIPv4BindingAddress=127.0.0.1 (instead of =0.0.0.0)

Since the Acrylic configuration change was made in the *.ini managed by valet-windows, what impact would there be for other users to make the above changes part of this package?

Steps To Reproduce

See Description

Diagnosis

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions