I've followed the guide posted here https://www.kali.org/docs/wsl/win-kex/

Right after the install I can run Kali in WSL2 and running "kex" launches as expected.

However once I reboot the host Windows 10 PC it fails with the following error.

Code:
 CConn:       unable to connect to socket: No connection could be made because
              the target machine actively refused it. (10061)
I completely removed Kali, reinstalled it from the windows store, went through the steps in that guide and again it worked, until a reboot then I see the same error.

I don't fully understand how this works, but I thought it must be the windows firewall or something.

I disabled all the windows firewalls, for private, public, and domain networks. No change.

Then I started trying to find the traffic for that VNC connection. Kali had 2 network interfaces lo, and an ethernet interface. Running a tcpdump on either of them did not show the VNC traffic.

Then I tried a wireshark capture in Windows 10 and found the VNC traffic on the loopback interface in windows.

After a fresh install Win-Kex works and I see the connection in the capture (image below)

pcap working.jpg

After a reboot I can see the TCP SYN responded to with an immediate RST as if the port isn't open / the firewall is blocking this. (image below)

pcap fail.jpg


Are there hidden settings for the windows firewall for the loop back interface or something? In my hours of google searching I couldn't find anything to indicate that could be the issue.

I'm hoping someone might have some suggestions here I would greatly appreciate it.