无法建立从 WSL 到 Windows 主机的网络连接(可能被防火墙阻止)

问题描述 投票:0回答:1

每次重新启动笔记本电脑和 intellij idea IDE 时,都会出现以下错误:
当想法尝试索引时会发生这种情况。

Abnormal build process termination: 
C:\Windows\system32\wsl.exe --distribution Ubuntu --exec /bin/bash -l -c "cd ....
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.intellij.openapi.diagnostic.JulLogger (file:/root/.cache/JetBrains/IntelliJIdea2023.2/compile-server/jps-IU-232.10203.10/util-8.jar) to field java.lang.ApplicationShutdownHooks.hooks
WARNING: Please consider reporting this to the maintainers of com.intellij.openapi.diagnostic.JulLogger
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Build process started. Classpath: /root/.cache/JetBrains/IntelliJIdea2023.2/compile-server/jps-IU-232.10203.10/jps-launcher.jar
Error connecting to 172.....:61....; reason: connection timed out: /172......1:61...
io.netty.channel.ConnectTimeoutException: connection timed out: /172....:61....
    at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe$1.run(AbstractNioChannel.java:261)
    at io.netty.util.concurrent.PromiseTask.runTask(PromiseTask.java:98)
    at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:153)
    at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174)
    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167)
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569)
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at java.base/java.lang.Thread.run(Thread.java:829)
Exiting.
Cannot establish network connection from WSL to Windows host (could be blocked by firewall). More details: https://jb.gg/wsl-firewall

作为解决方法,我按照 https://jb.gg/wsl-firewall 中的说明执行了该步骤,并且它有效。但我每次重新启动机器时都必须这样做。我需要知道,我们可以永久禁用 intellij idea IDE 和 WSL 进程的防火墙规则吗?

windows intellij-idea windows-firewall
1个回答
0
投票

这是 Microsoft WSL 中的一个已知问题,尚未修复,请检查 https://github.com/microsoft/WSL/issues/4139#issuecomment-1200345491 作为解决方法。

© www.soinside.com 2019 - 2024. All rights reserved.