Unable to Access Docker Container Services on WSL2 from Localhost but Accessible via Public IP

Copper Contributor


I have an Ubuntu distro running on WSL2 with Mirrored Networking enabled, so the virtual machine and the host share IP and adapter. Inside the distro, I have Docker installed with several services running, listening on different ports. I can correctly access the services running directly on the virtual machine (e.g., SSH on port 22) using localhost:22.

My problem is that I cannot access the Docker container services from the host using the local IP (, localhost, The strange thing is that I can access them through my public IP over the Internet.


Windows 11 Host (Public IP: Private IP:
|__WSL2 Ubuntu (Public IP: Private IP:
   |__SSH Server (Accessible from and localhost:22)
      |__Service 1 (Only accessible from
      |__Service 2 (Only accessible from

I have already done several tests, reinstalling various different distros and consulting the documentation, but I couldn't find the solution. Thank you very much.

Here is my .wslconfig config:





0 Replies