OpenCode Windows CLI fails on WSL2 mirrored networking: port 45278 falsely reported as in use

zhpengsy · ghdev · 2026-10-16

A bug report against OpenCode 2.0.30's native Windows CLI describes startup failures on machines running WSL2 with mirrored networking: the managed service claims 127.0.0.1:45278 is in use, yet no process or connection appears in Windows or WSL networking tools.

Key findings from the investigation:

The author concludes this matches WSL mirrored mode's HNS ephemeral port reservation behavior (microsoft/WSL#40169): the port is reserved by the system with no actual process occupying it, making OpenCode's error message misleading. Workaround: opencode service set port 18080. The report suggests OpenCode should detect usable ports automatically and mention system reservations in its error.

Original post →

More from coding & agent

coding & agent channel →