WSL 2 container suddenly not visible from network

I am running docker and compose inside a Ubuntu 24.04 WSL2 installation without Docker Desktop. More specifically a Storyteller instance (Storyteller · GitLab)

Up until a couple of weeks ago everything worked fine, including, surprisingly, CUDA GPU passthrough, and I could access the Storyteller server from my network either via a browser or the specific android app. Now only localhost and the WSL internal ip works from the windows host. On the host not even 127.0.0.1 or the host ip works.

wslinfo --networking-mode returns nat but I also tried mirror. When in mirror I get errors that 8001 is already occupied and using another port just gives no connectivity again.

compose.yaml contains

ports:
      - "8001:8001"

Any other suggestions?

I am battling with this for some time now.

Just out of curiousity: have you check to which ip localhost resolves? Does it resolve to the ipv4 or ipv6 address?

Furthermore, all ports bound in a wsl distribution should be reachable from 127.0.0.1:<port inside wsl>. In case of a container the <port inside wsl> is the published host port. If you were able to reach the wsl port using the host ip, then you must have configured portforwarding (google should yield plenty of results about how it’s done). Docker Desktop on the other hand would have taken care of this out of the box.

In mirror mode the network packages of the host are mirrored into the wsl distribution, and the wsl distributions network packages are mirrored to the host. That’s why it appears as if they would share a network adapter. It looks like you already use the port either on the host or wsl distribution side.

Have you tried using the netstat command (you will need to figure out the exact parameters, as I don’t have a windows machine at the moment) on the Windows host, to identify which process binds the port, so you can stop it and try to publish the container port inside the wsl again?

inside ubuntu both localhost and 127.0.0.1 work.

kostas@BigBoy:~/storyteller$ curl localhost:8001
/login
kostas@BigBoy:~/storyteller$ curl 127.0.0.1:8001
/login

inside ubuntu localhost resolves to 127.0.0.1, but you are right on the Windows terminal it points to a IPv6 address (vodafone.station is probably my router)

PS C:\Users\Kostas> nslookup localhost
Server:  vodafone.station
Address:  fe80::1

also ipconfig on windows gives the below. Do you think I can reach it throu a IPv6 address from the network?

PS C:\Users\Kostas> ipconfig

Windows IP Configuration


Ethernet adapter Ethernet:

   Connection-specific DNS Suffix  . :
   IPv6 Address. . . . . . . . . . . : 2a02:85f:e8d1:fc51:4ecb:987e:1e9b:83ec
   Temporary IPv6 Address. . . . . . : 2a02:85f:e8d1:fc51:3cc8:2855:ece0:4ec9
   Link-local IPv6 Address . . . . . : fe80::1a2a:1820:eefc:e75b%3
   IPv4 Address. . . . . . . . . . . : 192.168.2.60
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : fe80::1%3
                                       192.168.2.1

Ethernet adapter vEthernet (Default Switch):

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::2d1:e3ba:e351:ee71%16
   IPv4 Address. . . . . . . . . . . : 172.27.144.1
   Subnet Mask . . . . . . . . . . . : 255.255.240.0
   Default Gateway . . . . . . . . . :

Ethernet adapter vEthernet (WSL):

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::4c74:79ee:f5c3:714a%25
   IPv4 Address. . . . . . . . . . . : 172.20.80.1
   Subnet Mask . . . . . . . . . . . : 255.255.240.0
   Default Gateway . . . . . . . . . :

Can you try using the distribution’s host ip inside the wsl distribution? I am not sure if in nat-mode localhost inside the distribution is actually reachable from the host. In mirrored-mode it should work.

Looks like the address of your dns server (which in a home environment is usually the router). Though, the actual resolved entry is missing.

Can you share the output of wsl list -v?

Ok this is inside Ubuntu:

kostas@BigBoy:~/storyteller$ ping 192.168.2.60
PING 192.168.2.60 (192.168.2.60) 56(84) bytes of data.
64 bytes from 192.168.2.60: icmp_seq=1 ttl=127 time=1.96 ms
64 bytes from 192.168.2.60: icmp_seq=2 ttl=127 time=0.647 ms
64 bytes from 192.168.2.60: icmp_seq=3 ttl=127 time=0.610 ms
^C
--- 192.168.2.60 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2013ms
rtt min/avg/max/mdev = 0.610/1.073/1.963/0.629 ms

and wsl list -v did not work:

PS C:\Users\Kostas> wsl list -v
/bin/bash: line 1: list: command not found

It is actually wsl -l -v, so use -l instead of list. I’m pretty sure @meyay knew it as well, but many other tools have “ls” or “list” subcommands so it is easy to accidentally write that.

I see. Here’s the printout:

PS C:\Users\Kostas> wsl -l -v
  NAME      STATE           VERSION
* Ubuntu    Running         2
  Debian    Stopped         2

It should have been --list instead of list. The shortcut -l is fine as well :slight_smile:

Thank you for confirming that it’s a WSL2 distro.

I am not sure why you used ping to test access to the local ip, when you used curl before to test if the port is reachable.

You already showed curl commands that indicate the container is reachable from the host via locahost, I want to verify that it can be access from the distro’s own ip as well. I believe this is a necessity when you want it to be reachable from the Windows host.

Now I get it. But it doesn’t work either:

kostas@BigBoy:~/storyteller$ curl 192.168.2.60:8001
curl: (56) Recv failure: Connection reset by peer

I had also tried to disable the WSL firewall in .wslconfig, and tried to open 8001 in the windows firewall for incoming. nothing helped.

Just to be sure I got this right:

  • the curl command was executed inside the WSL2 distribution
  • the WSL2 distribution has the ip 192.168.2.60
  • you installed the docker-ce packge and use vanila docker
  • when you deploy the container, you publish the container port to 8081 to the “host” (=WSL distro) port 8081.
  • wsl still uses networking mode nat

Unless the ip is not correct, or the bound host port is different or pinned to a specific ip, the curl command should have worked with the host-ip:port, the same way like it did with localhost:port.

Within the WSL distribution the windows firewall should not cause any inference.

I’m away for a few days. It’ll be Wednesday when I’ll be able to check.

Στις Σάβ 13 Ιουν 2026, 13:52 ο χρήστης Metin Y. <notifications@docker.discoursemail.com> έγραψε:

According to the ipconfig output

192.168.2.60 is the host LAN IP and 172.20.80.1 would be the WSL gateway IP on the host. So curl was not used to send query to the WSL distro IP, but to the host. The prompt also indicates the curl command is not running on Windows at least, so I assume it is WSL, but trying to access a port on the host from the WSL distro.

@kgeorgokitsos

As far as I know, “reset by peer” means somethnig got the request and terminated the connection. Since you tried to send a query to the Windows host.

So I’m not sure what happened, but it still looks like the port works but something intentionally rejects the request Have you checked the application logs? Or do you have anything between the app and the client? A proxy maybe?

Have you tried with as imple independent port test like:

python3 -m http.server 9898

And try to access it from the host using the host LAN IP.

This took a bit longer to get back to, sorry. You are right. 192.168.2.60 is the Windows host. I tried python3 -m http.server 9898 but it’s not visible either. As I said I thought some firewall in the docker Ubuntu distribution might be responsible, but I tried closing that and it didn’t help. Also, to remind you, everything worked fine for a long time until, suddenly the server wasn’t visible from the LAN anymore.