Windows firewall blocking port for WSL2 development


Trying to setup a Java SDK running in WSL2. I can successfully do a mvn install and compile but
when trying to run the application I get this error:

Error connecting to; reason: connection timed out: / connection timed out: /
    at io.netty.util.concurrent.PromiseTask.runTask(
    at io.netty.util.concurrent.AbstractEventExecutor.runTask(
    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(
    at io.netty.util.concurrent.SingleThreadEventExecutor$
    at io.netty.util.internal.ThreadExecutorMap$
    at java.base/
Cannot establish network connection from WSL to Windows host (could be blocked by firewall). More details:

The selected port is blocked by windows firewall and my PC is under company system administration (sad, I know) so I cannot make any firewall changes.

This port is also selected at random it seems, so I cannot create a firewall rule based on ports only. 

Is there a way to tell IntelliJ what port to use instead of selecting a random port? We have a few unblocked ports for development.


Unfortunately, firewall rules needs to be adjusted to use WSL features in IntelliJ IDEA -

Please contact your IT/security for help

Feel free to upvote for IDEA-262876


Thanks for the reply.

Unfortunately my IT department is adamant not to open all ports on the WSL virtual ethernet interface.
Do you have a port range I can use at least? 


There is no specific list of ports WSL can use



It would be great to have the option to specify a port to use in the IDE settings.

Where can I ask for this feature change?


Please sign in to leave a comment.