Windows: publishing a port on a host IP (-p IP:port:port) fails with 'Address not available (os error 99)'; 0.0.0.0 is loopback-only

Open
#218 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
rust

Research direction

Start by tracing how published port host addresses are passed from the daemon into the WSL2 guest, then inspect the Windows-side forwarder kiri-win.exe and its listener configuration. The issue suggests either forwarding the requested host IP from Windows or changing how unspecified binds reach Windows interfaces; compare those paths and their existing tests. Done means a host-IP bind is reachable from another machine, or Windows reports clearly that published ports are loopback-only.

Written by the indexing model from the issue text.

Description

What you're trying to do

Publish a container port on a specific Windows host address, e.g. a VPN/overlay or LAN interface, so other machines on that network can reach it:

docker run -d -p 192.0.2.10:8080:80 nginx:alpine

Docker Desktop supports this: its Windows-side proxy binds the host address you give it. This is common in Compose files that use ${BIND_IP}:port:port to keep a service off other interfaces.

What happens on Kiri (0.2.0, Windows 11, WSL2 backend)

With a host IP that exists on Windows but not in the Kiri VM, the daemon fails the start:

docker: Error response from daemon: Address not available (os error 99)

os error 99 is EADDRNOTAVAIL, so the bind appears to happen inside the guest's network namespace, where the host address doesn't exist.

Other bind addresses:

-p host address Result
127.0.0.1:18081:80 Works, reachable from the Windows host only
0.0.0.0:18082:80 Container starts, but Windows only listens on 127.0.0.1:18082. Connecting via the host's LAN/overlay address is refused.
192.0.2.10:18080:80 (a real host interface address) Address not available (os error 99)

So a published port can never be reached from another machine, and a compose file that pins a bind address fails to start instead of falling back.

What you'd like Kiri to do

Either of these would cover it:

  1. Honour the host IP in -p IP:host:container by having the Windows-side forwarder (kiri-win.exe) listen on that address and forward to the guest, instead of passing the address to the guest.
  2. Make 0.0.0.0 / unspecified bind actually listen on all Windows interfaces, as Docker Desktop does, with an opt-in setting if you'd rather keep the loopback-only default.

If neither fits, a clear error that says published ports are loopback-only on Windows would help. The current message points at the wrong place.

Would you like to build it?

No, just suggesting it

Dominant language
Rust
Stars
7.5k
Forks
329
Avg merge
7h 48m
Merged PRs (30d)
105

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from libracoder/kiri

All issues in libracoder/kiri

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.