各位腐竹们,wsl上的minecraft服务器连接被宿主机中断了

游戏内报错如图

Failed to coninect to theserver
InternalException:Jiavaio.IoException:你的主机中的软件中止了一个已建立的连接

服务器使用rcon,连接时服务器输出如下:

[15:35:46] [Server thread/INFO] [ne.mi.se.pe.PermissionAPI/]: Successfully initialized permission handler forge:default_handler
[15:39:11] [RCON Listener #1/INFO] [minecraft/GenericThread]: Thread RCON Client /172.17.112.1 started
[15:39:11] [RCON Client /172.17.112.1 #2/INFO] [minecraft/RconClient]: Thread RCON Client /172.17.112.1 shutting down
[15:41:27] [RCON Listener #1/INFO] [minecraft/GenericThread]: Thread RCON Client /172.17.112.1 started
[15:41:27] [RCON Client /172.17.112.1 #3/INFO] [minecraft/RconClient]: Thread RCON Client /172.17.112.1 shutting down
[15:42:57] [RCON Listener #1/INFO] [minecraft/GenericThread]: Thread RCON Client /172.17.112.1 started
[15:42:57] [RCON Client /172.17.112.1 #4/INFO] [minecraft/RconClient]: Thread RCON Client /172.17.112.1 shutting down
[15:43:18] [RCON Listener #1/INFO] [minecraft/GenericThread]: Thread RCON Client /172.17.112.1 started
[15:43:18] [RCON Client /172.17.112.1 #5/INFO] [minecraft/RconClient]: Thread RCON Client /172.17.112.1 shutting down

一开始以为是防火墙的问题,检查了ubuntu的防火墙已经把端口打开了,也看了windows的防火墙,minecraft java和wsl都是允许通过的,不知道是什么问题,欢迎各位佬友指教
@MatsuzakaSato @PlayMcBKuwu @KlNonR 佬有空麻烦看看~

腐竹是什么称呼?

服主?

楼下正解~

有无完整log?

坏了 1个1个可以看懂 一起就看不懂了

一次启动的完整记录,用的forge和rcon,版本1.20.1,jdk18,可ping通(网络知识实在没有,只能这样自己测试看看了)

minecraft-server@LAPTOP-MetaIns:~/server/minecraftServer$ bash run.sh
[17:20:36] [main/INFO] [cp.mo.mo.Launcher/MODLAUNCHER]: ModLauncher running: args [--launchTarget, forgeserver, --fml.forgeVersion, 47.2.0, --fml.mcVersion, 1.20.1, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20230612.114412, nogui]
[17:20:36] [main/INFO] [cp.mo.mo.Launcher/MODLAUNCHER]: ModLauncher 10.0.9+10.0.9+main.dcd20f30 starting: java version 17.0.11 by Ubuntu; OS Linux arch amd64 version 5.15.133.1-microsoft-standard-WSL2
[17:20:36] [main/INFO] [ne.mi.fm.lo.ImmediateWindowHandler/]: ImmediateWindowProvider not loading because launch target is forgeserver
[17:20:36] [main/INFO] [mixin/]: SpongePowered MIXIN Subsystem Version=0.8.5 Source=union:/opt/minecraft-server/server/minecraftServer/libraries/org/spongepowered/mixin/0.8.5/mixin-0.8.5.jar%2365!/ Service=ModLauncher Env=SERVER
[17:20:36] [main/WARN] [ne.mi.fm.lo.mo.ModFileParser/LOADING]: Mod file /opt/minecraft-server/server/minecraftServer/libraries/net/minecraftforge/fmlcore/1.20.1-47.2.0/fmlcore-1.20.1-47.2.0.jar is missing mods.toml file
[17:20:36] [main/WARN] [ne.mi.fm.lo.mo.ModFileParser/LOADING]: Mod file /opt/minecraft-server/server/minecraftServer/libraries/net/minecraftforge/javafmllanguage/1.20.1-47.2.0/javafmllanguage-1.20.1-47.2.0.jar is missing mods.toml file
[17:20:36] [main/WARN] [ne.mi.fm.lo.mo.ModFileParser/LOADING]: Mod file /opt/minecraft-server/server/minecraftServer/libraries/net/minecraftforge/lowcodelanguage/1.20.1-47.2.0/lowcodelanguage-1.20.1-47.2.0.jar is missing mods.toml file
[17:20:36] [main/WARN] [ne.mi.fm.lo.mo.ModFileParser/LOADING]: Mod file /opt/minecraft-server/server/minecraftServer/libraries/net/minecraftforge/mclanguage/1.20.1-47.2.0/mclanguage-1.20.1-47.2.0.jar is missing mods.toml file
[17:20:36] [main/INFO] [ne.mi.fm.lo.mo.JarInJarDependencyLocator/]: No dependencies to load found. Skipping!
[17:20:38] [main/INFO] [cp.mo.mo.LaunchServiceHandler/MODLAUNCHER]: Launching target 'forgeserver' with arguments [nogui]
[17:20:45] [modloading-worker-0/INFO] [ne.mi.co.ForgeMod/FORGEMOD]: Forge mod loading, version 47.2.0, for MC 1.20.1 with MCP 20230612.114412
[17:20:45] [modloading-worker-0/INFO] [ne.mi.co.MinecraftForge/FORGE]: MinecraftForge v47.2.0 Initialized
[17:20:45] [Forge Version Check/INFO] [ne.mi.fm.VersionChecker/]: [forge] Starting version check at https://files.minecraftforge.net/net/minecraftforge/forge/promotions_slim.json
[17:20:46] [Forge Version Check/INFO] [ne.mi.fm.VersionChecker/]: [forge] Found status: OUTDATED Current: 47.2.0 Target: 47.3.0
[17:20:47] [main/INFO] [mojang/YggdrasilAuthenticationService]: Environment: authHost='https://authserver.mojang.com', accountsHost='https://api.mojang.com', sessionHost='https://sessionserver.mojang.com', servicesHost='https://api.minecraftservices.com', name='PROD'
[17:20:48] [main/WARN] [minecraft/VanillaPackResourcesBuilder]: Assets URL 'union:/opt/minecraft-server/server/minecraftServer/libraries/net/minecraft/server/1.20.1-20230612.114412/server-1.20.1-20230612.114412-srg.jar%23101!/assets/.mcassetsroot' uses unexpected schema
[17:20:48] [main/WARN] [minecraft/VanillaPackResourcesBuilder]: Assets URL 'union:/opt/minecraft-server/server/minecraftServer/libraries/net/minecraft/server/1.20.1-20230612.114412/server-1.20.1-20230612.114412-srg.jar%23101!/data/.mcassetsroot' uses unexpected schema
[17:20:50] [main/INFO] [minecraft/RecipeManager]: Loaded 7 recipes
[17:20:50] [main/INFO] [minecraft/AdvancementList]: Loaded 1271 advancements
[17:20:51] [Server thread/INFO] [minecraft/DedicatedServer]: Starting minecraft server version 1.20.1
[17:20:51] [Server thread/INFO] [minecraft/DedicatedServer]: Loading properties
[17:20:51] [Server thread/INFO] [minecraft/DedicatedServer]: Default game type: SURVIVAL
[17:20:51] [Server thread/INFO] [minecraft/MinecraftServer]: Generating keypair
[17:20:51] [Server thread/INFO] [minecraft/DedicatedServer]: Starting Minecraft server on *:25565
[17:20:51] [Server thread/INFO] [minecraft/ServerConnectionListener]: Using epoll channel type
[17:20:51] [Server thread/INFO] [minecraft/DedicatedServer]: Preparing level "world"
[17:20:54] [Server thread/INFO] [minecraft/MinecraftServer]: Preparing start region for dimension minecraft:overworld
[17:20:59] [Worker-Main-5/INFO] [minecraft/LoggerChunkProgressListener]: Preparing spawn area: 0%
[17:20:59] [Worker-Main-5/INFO] [minecraft/LoggerChunkProgressListener]: Preparing spawn area: 0%
[17:20:59] [Worker-Main-6/INFO] [minecraft/LoggerChunkProgressListener]: Preparing spawn area: 0%
[17:20:59] [Worker-Main-6/INFO] [minecraft/LoggerChunkProgressListener]: Preparing spawn area: 0%
[17:20:59] [Worker-Main-2/INFO] [minecraft/LoggerChunkProgressListener]: Preparing spawn area: 0%
[17:20:59] [Worker-Main-2/INFO] [minecraft/LoggerChunkProgressListener]: Preparing spawn area: 0%
[17:20:59] [Worker-Main-1/INFO] [minecraft/LoggerChunkProgressListener]: Preparing spawn area: 0%
[17:20:59] [Worker-Main-1/INFO] [minecraft/LoggerChunkProgressListener]: Preparing spawn area: 0%
[17:20:59] [Worker-Main-4/INFO] [minecraft/LoggerChunkProgressListener]: Preparing spawn area: 0%
[17:20:59] [Worker-Main-4/INFO] [minecraft/LoggerChunkProgressListener]: Preparing spawn area: 0%
[17:20:59] [Worker-Main-7/INFO] [minecraft/LoggerChunkProgressListener]: Preparing spawn area: 0%
[17:21:00] [Worker-Main-6/INFO] [minecraft/LoggerChunkProgressListener]: Preparing spawn area: 13%
[17:21:00] [Worker-Main-3/INFO] [minecraft/LoggerChunkProgressListener]: Preparing spawn area: 40%
[17:21:01] [Worker-Main-5/INFO] [minecraft/LoggerChunkProgressListener]: Preparing spawn area: 78%
[17:21:01] [Server thread/INFO] [minecraft/LoggerChunkProgressListener]: Time elapsed: 6817 ms
[17:21:01] [Server thread/INFO] [minecraft/DedicatedServer]: Done (9.762s)! For help, type "help"
[17:21:01] [Server thread/INFO] [minecraft/DedicatedServer]: Starting remote control listener
[17:21:01] [Server thread/INFO] [minecraft/GenericThread]: Thread RCON Listener started
[17:21:01] [Server thread/INFO] [minecraft/RconThread]: RCON running on 0.0.0.0:33861
[17:21:01] [Server thread/INFO] [ne.mi.se.pe.PermissionAPI/]: Successfully initialized permission handler forge:default_handler
[17:21:07] [RCON Listener #1/INFO] [minecraft/GenericThread]: Thread RCON Client /172.17.112.1 started
[17:21:07] [RCON Client /172.17.112.1 #2/INFO] [minecraft/RconClient]: Thread RCON Client /172.17.112.1 shutting down

有老哥指出我访问失败可能是由于不在一个网桥内
总之我现在打算先把服务放到公网ip上,但得先等我爸告诉我我的路由器密码是什么(

我把访问的端口改成了rcon监听之前的端口居然成功了(

wsl需要一直开着控制台 关闭控制台 隔一会儿wsl 就会自动关闭了 为了省资源 你可以使用 wsl -l -v查看状态 怎么挂后台保活 你百度一下 应该就知道了

已经解决了,wsl一直都挂着,只要不走那个rcon就可以连。。。
现在要考虑怎么把服务放到公网上了,我没有公网IP,是不是可以买个腾讯云之类的?直接把wsl导出到云服务器似乎也可以

—Original—

1 Like