Comments (11)
I run into the same problem on my MBP server, and my solution is to specify -p 0.0.0.0:19132:19132/udp
instead of the default localhost
. Then this server shows up in my LAN world as well as a dedicated server.
from docker-minecraft-bedrock-server.
That's a really great discovery and thanks for posting all of the information.
from docker-minecraft-bedrock-server.
Ok... I have done some reading (and a lot of Googling) and come up with a working solution for me!
When looking up how to assign a static IP address to a container you will find this SO quesiton/answer: https://stackoverflow.com/questions/27937185/assign-static-ip-to-docker-container The very last response spun me off to learning about macvlan in docker here: https://docs.docker.com/network/macvlan/
That looked very promising. So I added a new macvlan to the host with:
docker network create -d macvlan --subnet=192.168.94.0/24 --gateway=192.168.94.1 -o parent=ens3 pub_chenery
This gives the same range as the host
I then removed the IP addresses from the host I had assigned before (see earlier post).
Removed the existing containers and then started them up like this:
docker run -d --name mc-survival --restart=unless-stopped -e EULA=TRUE -v /opt/docker-minecraft/survival:/data --net pub_chenery --ip=192.168.94.12 itzg/minecraft-bedrock-server
Did the same for the second container (different name, path and IP address of course). And joy they both started with the two IPs I wanted.
And best of all I can now see them on my network as they've got their own "public" IP on my subnet. They are pingable too. Didnt have to map any ports as you'll have seen in the command.
For me the hint was on the docker page about some services needing access to the network card with the wording:
expect to be directly connected to the physical network
from docker-minecraft-bedrock-server.
Ok... I have done some reading (and a lot of Googling) and come up with a working solution for me!
When looking up how to assign a static IP address to a container you will find this SO quesiton/answer: https://stackoverflow.com/questions/27937185/assign-static-ip-to-docker-container The very last response spun me off to learning about macvlan in docker here: https://docs.docker.com/network/macvlan/
That looked very promising. So I added a new macvlan to the host with:
docker network create -d macvlan --subnet=192.168.94.0/24 --gateway=192.168.94.1 -o parent=ens3 pub_chenery
This gives the same range as the host
I then removed the IP addresses from the host I had assigned before (see earlier post).
Removed the existing containers and then started them up like this:
docker run -d --name mc-survival --restart=unless-stopped -e EULA=TRUE -v /opt/docker-minecraft/survival:/data --net pub_chenery --ip=192.168.94.12 itzg/minecraft-bedrock-server
Did the same for the second container (different name, path and IP address of course). And joy they both started with the two IPs I wanted.
And best of all I can now see them on my network as they've got their own "public" IP on my subnet. They are pingable too. Didnt have to map any ports as you'll have seen in the command.
For me the hint was on the docker page about some services needing access to the network card with the wording:
expect to be directly connected to the physical network
I'm fighting with this issue in the last couple of days, but finally I found your comment. This is still working with Minecraft Bedrock 1.20.31.01! Thank you!
from docker-minecraft-bedrock-server.
Have tried mapping different ports (e.g. 19142
instead but that doesnt work either). Seems only 19132
will show up under LAN games :(
from docker-minecraft-bedrock-server.
That's a great idea with adding multiple IP addresses on the host. I would recommend debugging by running sudo tcpdump -v udp port 19132
to see if the broadcast packets (and others) are making it to the host.
Unfortunately I can't work on recreating this since I recently stopped my Xbox Gold membership and that seems to have prevented LAN games from showing up at all for me :( .
from docker-minecraft-bedrock-server.
Ahh good call with tcpdump
.
I had fired up Wireshark on the PC and could see the broadcasts going out but nothing back from the host when the IP address is specified. The tcpdump
doesnt reveal anything either. Tried disabling the firewall on the host (which is Ubuntu BTW) - no change with that either.
So it only responds when no IP is specified (or 0.0.0.0 is specified).
At a bit of a loss how to check things with the container - bit new to Docker.
from docker-minecraft-bedrock-server.
Previously my normal setup "wasn't working" because I didn't have the container running :) After adding an IP address to my host's (also Ubuntu) interface and using a -p
with that address I'm guessing I'm seeing the same as you in tcpdump: just broadcast packets coming in but no responses.
Using sudo lsof -i:19132
I can see the docker-proxy process is supposedly listening:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
docker-pr 912 root 4u IPv4 563066 0t0 UDP nuc:19132
One thing that looked suspicious is that when using arp
the HWaddress
of the IP address I added shows (incomplete)
.
At this point I'm left wondering if it's a multi-homing issue in general or something with docker-proxy not fully supporting it.
from docker-minecraft-bedrock-server.
So weirdly the host cant ping the addresses (other clients on the network can just fine). Im not sure why that is - perhaps cause the gateway is defined as the IP address of the host. That needs a bit of investigation.
Anyway - feel free to close this issue. Might be worth adding some documentation about how to run multiple instances and still make them discoverable by Minecraft though 😃
from docker-minecraft-bedrock-server.
So weirdly the host cant ping the addresses (other clients on the network can just fine). Im not sure why that is - perhaps cause the gateway is defined as the IP address of the host. That needs a bit of investigation.
Anyway - feel free to close this issue. Might be worth adding some documentation about how to run multiple instances and still make them discoverable by Minecraft though
Fyi, macvlan usually has issues with host communication even in vm's. Why, I don't remember but there is some router nat magic you can use to circumvent if needed.
from docker-minecraft-bedrock-server.
I had a very similar issue, however, in a kubernetes cluster. What fixed it for me, was setting the container's network in host mode (in k8s context, hostNetwork=true
).
from docker-minecraft-bedrock-server.
Related Issues (20)
- Server.properties command HOT 3
- Can't connect using domain HOT 1
- Try to install mods World Wide Animal HOT 1
- Investigate issues with mv command during version backup
- Looks like the release of 2024.1.0 is failing HOT 2
- How to get the latest version of 1.20.x.y ? HOT 1
- Oracle Cloud port or address fail HOT 2
- Too many open files on M2 Mac HOT 1
- PS4 can no longer find the Bedrock server HOT 2
- Server disconnect everyone every 30 min HOT 1
- Issues with certain blocks not being available for collections HOT 2
- Nintendo Switch bedrock server over LAN HOT 2
- /bin/sh: 1: /build/install-packages: not found HOT 1
- Could not connect: Outdated client! HOT 4
- Unknown errors using `@minecraft/server-net`. HOT 1
- Sever Property file generation seems to be incorrectly escaping special characters HOT 2
- Can't connect to the server HOT 8
- How to enable experiments? HOT 3
- Enter the world and Build terrain takes +2m when moving from overwold to neither HOT 4
- crash after some minutes on orange pi 5 (arm64) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-minecraft-bedrock-server.