Minecraft Bedrock Edition – Ubuntu Dedicated Server Guide

Minecraft Bedrock Edition Logo
Minecraft: Bedrock Edition Logo

Minecraft Bedrock Edition is the version of Minecraft that powers the iPhone / Android versions (formerly Minecraft Pocket Edition), the Xbox / PlayStation / Nintendo Switch editions and the free Windows 10 Minecraft edition.

Mojang has released a dedicated server which is considered to be in alpha testing.  I have found it to be very stable and able to run on a wide variety of hardware.

This script and guide are written to help you get a robust Minecraft Bedrock dedicated server up and running in only a few minutes!

Features

  • Sets up fully operational Minecraft Bedrock edition server in a couple of minutes
  • Ubuntu / Debian distributions supported
  • Fully operational Minecraft Bedrock edition server in a couple of minutes
  • Sets up Minecraft as a system service with option to autostart at boot
  • Automatic backups when server restarts
  • Supports multiple instances — you can run multiple Bedrock servers on the same system
  • Updates automatically to the latest version when server is started
  • Easy control of server with start.sh, stop.sh and restart.sh scripts
  • Optional scheduled daily restart of server using cron

UPDATE 12/10/20 – Multiple instances are currently broken due to the Minecraft Bedrock Edition dedicated server opening up a set of ports it is not supposed to. Official bug is here on Mojang’s official website. This should fix itself eventually as it has nothing to do with this script but is in fact a bug in the server itself but for now be advised multiple instances don’t work. Single instances of the server are still fine.

Requirements

  • A computer with a 64 bit processor (if you are trying to use ARM read my article on the limitations). 32 bit binaries of the official server are not available so it needs to be 64 bit!
  • 1 GB of RAM or higher
  • Ubuntu Server 20.04 / 18.04

Recommended Gear

Game Editions

Minecraft: Bedrock Edition is the “Windows 10” version of Minecraft as well as the version of Minecraft on the Xbox / Playstation / Switch. The versions of Minecraft for Android and iOS are also the Bedrock edition.

All of these versions support cross-platform play with each other (but not with the Java edition).

This is the PC Minecraft for Windows 10 (Bedrock) edition of Minecraft. It is able to play cross-platform with other players on Android / iOS / Playstation / Xbox / Switch. Available as a code that is instantly activated to give you permanent access to the game!

Links: Amazon.com*, Amazon.co.jp*, Amazon.co.uk*, Amazon.de*, Amazon.es*, Amazon.fr*, Amazon.in*, Amazon.it*

This is the Microsoft Xbox version of Minecraft: Bedrock edition.

Links: Amazon.ae*, Amazon.ca*, Amazon.com*, Amazon.com.au*, Amazon.com.mx*, Amazon.co.uk*, Amazon.de*, Amazon.es*, Amazon.fr*, Amazon.in*, Amazon.it*, Amazon.nl*, Amazon.sg*

Recommended Storage (Solid State Drive)

I strongly recommend a Solid State drive (SSD) for your server. This is because Minecraft is constantly reading/storing chunks to the disk which makes I/O performance very important.

These are much cheaper than they used to be. Here’s a decent 120 GB one (higher capacity options are available) at a very low price:

Kingston A400 2.5″ SATA SSD

The Kingston A400 has been a great drive to use for years. It’s reliable, widely available around the world, has low power requirements and performs very well. It’s also very affordable. This drive has been benchmarked over 1000 times at storage.jamesachambers.com and is the #1 most popular SSD!

Links: AliExpress.com*, Amazon.ae*, Amazon.ca*, Amazon.com*, Amazon.com.au*, Amazon.com.mx*, Amazon.co.jp*, Amazon.co.uk*, Amazon.de*, Amazon.es*, Amazon.fr*, Amazon.in*, Amazon.it*, Amazon.nl*, Amazon.pl*, Amazon.sa*, Amazon.se*, Amazon.sg*

If you have a M.2 NVME slot in your motherboard you can go with a high end drive. This will give your server maximum performance even if a large number of players are running around on the server changing blocks and triggering disk writes.

This is the one I have in my machine. These range from 250 GB to 2 TB depending on how big your server might grow:

Samsung 970 EVO Plus NVMe SSD

The Samsung 970 EVO Plus is a fantastic drive and has fallen in price substantially. It’s widely available around the world. The smaller capacities (such as the 250GB version) of this drive are perfect! This is the top performance option without going into the “Pro” series of the lineup which are much more expensive.

Links: AliExpress.com*, Amazon.ae*, Amazon.ca*, Amazon.com*, Amazon.com.au*, Amazon.com.mx*, Amazon.co.jp*, Amazon.co.uk*, Amazon.de*, Amazon.es*, Amazon.fr*, Amazon.in*, Amazon.it*, Amazon.nl*, Amazon.pl*, Amazon.sa*, Amazon.se*, Amazon.sg*

Computer / CPU / Memory

Almost any PC made in the last few years will be a x86_64 bit computer. If you have an older computer around that isn’t being used then it will most likely have the right CPU and amount of memory (as well as fast storage) to run a basic server.

Throwing a SSD in one of these older computers will provide an excellent server experience for small and larger player counts.

The speed of your storage will make the largest difference. Older HDDs are going to have significantly slower performance than any modern SSD even with all other hardware equal. This is because the Minecraft server is constantly reading/writing chunks of your world as well as updates to it to the disk so this tends to be the bottleneck.

Operating System

I highly recommend using Ubuntu Server to run the Minecraft dedicated server. It is available here: https://ubuntu.com/download/server

At the time of writing the current version is Ubuntu Server 20.04. This is a secure and robust operating system and will leave plenty of resources available for the server to run.

The script should run on any Debian based flavor of Linux but since the Minecraft Bedrock server is compiled natively for Ubuntu I recommend sticking with it. If you have a GUI flavor of Ubuntu and a decent PC (>= 2 GB of RAM) the server will work just fine on it.

Note: People have reported in the comments that Ubuntu 16.x is no longer working with the latest official Mojang binaries. Ubuntu 18.04 is the minimum requirement for the latest versions, and 20.04 is recommended!

Installation

Log into your Linux server either using SSH or a mouse and keyboard and paste/type the following command:

wget https://raw.githubusercontent.com/TheRemote/MinecraftBedrockServer/master/SetupMinecraft.sh
chmod +x SetupMinecraft.sh
./SetupMinecraft.sh 

The script will setup the Minecraft sever and ask you some questions on how to configure it. I’ll explain here what they mean.

“Start Minecraft server at startup automatically (y/n)?” – This will set the Minecraft service to start automatically when your server boots. This is a great option to set up a Minecraft server that is always available.

“Automatically restart and backup server at 4am daily (y/n)?” – This will add a cron job to the server that reboots the server every day at 4am. This is great because every time the server restarts it backs up the server and updates to the latest version. See the “Scheduled Daily Reboots” section below for information on how to customize the time or remove the reboot.

That is it for the setup script. The server will finish configuring and start!

First Run

The server will start up and start displaying output to the console.

[2019-03-30 20:25:12 INFO] Starting Server
[2019-03-30 20:25:12 INFO] Version 1.10.0.7
[2019-03-30 20:25:12 INFO] Level Name: Bedrock level
[2019-03-30 20:25:12 INFO] Game mode: 0 Survival
[2019-03-30 20:25:12 INFO] Difficulty: 1 EASY
[2019-03-30 20:25:20 INFO] IPv4 supported, port: 19132
[2019-03-30 20:25:20 INFO] IPv6 supported, port: 19133
[2019-03-30 20:25:23 INFO] Server started.

Once you see the “Server started” line you will be able to connect from the client.

To add the server to the client open Minecraft and click “Play”. Then at the top of the screen select the “Servers” tab and click “Add Server”.

This will ask you for a Server Name and Server IP Address. For the name you can put anything and for the server IP address put the address of your Linux server. Leave the port as the default 19132. For more information on how to let people from outside your network on go to the “Port Forwarding” section below.

Now choose the server you just added in the list and connect!

Start, Stop and Restart Server

The server can be started, stopped and restarted two different ways. You can use the provided scripts in the Minecraft folder or you can use systemctl. Here are the commands:

cd ~/minecraftbe
./start.sh
./stop.sh
./restart.sh

-OR-

sudo systemctl start minecraftbe
sudo systemctl stop minecraftbe
sudo systemctl restart minecraftbe

Automatic Backups

The server backs up each time it starts. This helps you recover easily if something goes wrong. This system works best if you configured the server to restart daily since it means you will have a backup every day.

To access these backups type:

cd ~/minecraftbe/backups
ls

When a backup is made the filename will be the date and time the backup was taken. If you need to restore a backup it’s very easy. Substitute the timestamp in my example to the backup you want to roll back to. Type:

cd ~/minecraftbe
./stop.sh
rm -rf worlds
tar -xf backups/2019.02.15.22.06.30.tar.gz
./start.sh

Your world has now been restored! It’s a good idea to download these backups off the server periodically just in case the server’s storage fails.

Installing Resource Packs / RTX Support

For instructions on how to install resource packs (including optional RTX support) view my step by step Minecraft Bedrock Dedicated Server Resource Packs guide here.

Scheduled Daily Reboots

The daily reboots are scheduled using cron. It’s very easy to customize the time your server restarts.

To change the time that the server restarts type: crontab -e

This will open a window that will ask you to select a text editor (I find nano to be the easiest) and will show the cronjobs scheduled on the server. The Minecraft one will look like the following:

0 4 * * * /home/ubuntu/minecraftbe/restart.sh
Crontab's syntax layout
Crontab’s syntax layout

There are 5 fields here. The default restart time is set to reboot at 0 minutes of the 4th hour of the day (4 AM). The other 3 fields are left as * to represent every day of every month. Make any desired changes here and press Ctrl+X to exit nano and update the cronjob.

To remove the daily reboot simply delete the line and save.

Reconfigure / Update Scripts

The scripts can always be reconfigured and updated by downloading the latest SetupMinecraft.sh and running the installer again. It will update all of the scripts in the Minecraft directory and reinstall the startup service for you.

Running SetupMinecraft.sh again will also give you a chance to reconfigure options such as the memory dedicated to the server, daily reboots, starting the server on boot, etc.

This will not overwrite your world or any other data so it is safe to run!

Port Forwarding

If everyone on your server is on the same LAN or WiFi network as you then you don’t need to do this. If you want people to connect from outside your local network then you need to set up port forwarding on your router.

The process for this is different for every router so the best thing to do is just look at your router and find the model # and put that in google with port forwarding for easy instructions on how to do it for your specific router.

You want to forward port 19132. The type of connection is both TCP and UDP. On some routers you need to do both a TCP entry and then a second entry as UDP.

Once you do this people will be able to connect to your Minecraft server through your public IP address. This is different than your local IP which is usually a 192.x.x.x or 10.x.x.x. If you don’t know what that is just go to google and type “what’s my ip” and Google will kindly tell you!

Wired vs. Wireless

Going with an ethernet (wired) connection is going to be faster and more reliable. There’s so much wireless traffic and other interference in the air that running your server on WiFi is not recommended.

Even if it is working great 99% of the time it can ruin your experience very quickly if the WiFi drops for a couple of seconds and you get blown up by a creeper!

All that being said, the server works fine on wireless. The script will work fine as is with a wireless connection.

Conclusion

The Minecraft Bedrock Edition dedicated server runs much better than previous third party servers in the past that were missing critical features. The performance is very good even on low end hardware. It has never been easier to set up a Minecraft Bedrock server.

If you have any feedback or suggestions let me know in the comment section. A lot of the changes and developments in this script and guide are directly from readers.

Have fun!

535 thoughts on “Minecraft Bedrock Edition – Ubuntu Dedicated Server Guide”

  1. Avatar for Jason

    Firstly, let me raise a virtual glass to you for this. Saved me a ton of time and I now have my server up and running on Azure (free credits!). Great job!
    I’m far from a Linux expert so this was a life saver – all I googled was how to autostart minecraft on server boot and found this.
    Couple of hopefully quick questions.
    1) for some reason, starting or stopping the server using systemctl doesn’t work. I get this message “Failed to stop minecraftbe.service: Unit minecraftbe.service not loaded.” I can start and stop using start.sh and stop.sh – I’m not sure if that will cause an issue with the autostart on boot or not – I haven’t tried that yet.
    2) What would be helpful to me is to be able to stop the server on a schedule so that I can stop the server gracefully before my scheduled virtual machine shut-down managed through Azure. I won’t have the server running 24/7 to keep the costs down. Any suggestions on that one?

    Thanks again for a great bit of work.

    1. Avatar for Jason

      I think I’ve solved both issues!

      1) I took a look at the install script and discovered that the service name is the name you specify during execution – not minecraftbe. So sudo systemctl stop nameofmyserver works fine.
      2) I editied the chontab file and changed the script from restart to stop.sh and modified the time accordingly, so should be good to go now.

      Thanks again though!

        1. Avatar for David

          I have the same issue, but suspect it is because I’m not sure where to enter the commands. I assumed I would open a new terminal (I have the desktop version of Ubuntu 20.04, with all current updates), and type the commands into the terminal. With this message as a result regardless of whether I try to stop, start or restart the server. I’ve also tried to type the commands into the window that pops up after installation with no results. I’ve tried both sets of commands in this way. Aside from this issue I found your process to be quite slick! Easy and straight forward. Perhaps to easy because it has allowed someone like me who has not used linux for nearly 20 years to get this far…

          Thanks for your help!

          1. Avatar for jamesachambers

            Hey David,

            I think you’re really close! When you open the terminal it should default to your home folder (usually represented in Linux as ~).

            To get into the folder that all the scripts are in once the terminal opens type:

            cd minecraft
            ls

            These commands will move you to the minecraft folder and then list the contents of the folder. In there you should see start.sh, stop.sh, etc. To start the server you can use:

            ./start.sh

            This will run the start script. If you set the server to start automatically you may want to try:

            screen -r

            This will pull up the server console from the background. Can you give those a try and let’s see if it’s already running or just needs to be started!

  2. Avatar for TJ

    Hello,
    I’m currently setting this up on a Raspberry Pi 3B+(or trying to). I’m stuck with a strange issue. It seems to get the starting process going when I start, but it then says “Error: Unknown option Logfile”
    I also don’t see any files in the logs area, but I don’t know if that’s an issue or not.
    I understand it may have some issues on raspberry pi, but I’d like to at least try to get it going if I can.

    1. Avatar for jamesachambers

      Hey TJ,

      It takes quite a while to start up, especially the first time, even on a Model 4B. I’d say it can take 5-10 minutes sometimes to fully load up on the 4B. How long have you waited for it to start? Does it exit after it says that about the log file or if you let it run for a long time will it eventually load?

      So about the log warning message: this is unfortunately normal. The Minecraft Bedrock Dedicated Server actually still has not implemented logging so there’s nothing you can do about that. Check out the “Minecraft Feedback” post about this with 84 votes and lots of snarky comments over the past 2 years about it still not being done: https://feedback.minecraft.net/hc/en-us/community/posts/360027682372-Bedrock-Dedicated-Server-log-chat-to-output-stdout.

      The way my script is able to achieve logging is by using a trick. Here’s an excerpt from the bash script to show you what I mean:

      echo "Starting Minecraft server. To view window type screen -r servername"
      echo "To minimize the window and let the server run in the background, press Ctrl+A then Ctrl+D"
      # screen command to spawn log files in logs/ directory never checked to see if a directory named logs/ exists. Now we check and create one if it doesn't
      if [ ! -d "logs/" ]
      then
      mkdir logs
      fi
      screen -L -Logfile logs/servername.$(date +%Y.%m.%d.%H.%M.%S).log -dmS servername /bin/bash -c "LD_LIBRARY_PATH=dirname/minecraftbe/servername dirname/minecraftbe/servername/bedrock_server"

      On the very last line is where the magic happens. We are using a feature built into “screen” to even have any logging at all. You can do the same trick (and indeed you can run this very same command) yourself on the command line to get logs.

      Do you see the logs folder in the directory? The lines right before it are supposed to check and create the folder but it may be worth seeing if it’s there or not and if there’s anything else inside there. Sometimes the log file may have an extra line that only prints right as the program is exiting but too quickly for you to see on the screen. The log file will capture those very last lines which may help!

      1. Avatar for TJ

        I am immediately pushed back to the command line when it runs into the log issue. I’m able to see a log folder, but there’s nothing inside it. I tried running the bottom parts separately, but it gives me the same error. I’ve been running the commands in an already open command line to prevent it from closing, and haven’t seen anything else.

        1. Avatar for jamesachambers

          Hey TJ,

          Thanks for the additional information. Are you using the 64 bit version of Raspberry Pi OS? It is available here or use the Raspberry Pi Imager tool to create a more up to date version.

          From what you’re describing it isn’t getting very far. Can you tell us exactly which OS you’re running? A 64 bit flavor of another OS like Ubuntu would work too!

          I should have thought to ask you this the first time as unless you’ve made an effort you’re probably running a 32 bit OS. The Minecraft Bedrock server is 64 bit and in another architecture, but at least going 64 bit to 64 bit speeds things up a little bit by not adding another layer of translation from 32 bit to 64 bit on top of ARM to x86_64 (grossly oversimplified to illustrate the point) if that makes sense!

          1. Avatar for TJ

            I’ve been running a 32-bit OS, but I have an issue when I try to install the imaging tool. The Pi can’t find the package when I use the “sudo apt install rpi-imager” command as it is intructed to do on the place you linked. Is there a way to fix this?

            1. Avatar for jamesachambers

              Hey TJ,

              Absolutely! It should be in the official repository but it sounds like yours may be out of date. Can you do a:

              sudo apt update

              and then try again here? Is this Raspbian/Raspberry Pi OS?

              You could also just download the file that says it’s the package for Ubuntu from here: https://www.raspberrypi.org/software/ and follow the instructions for Ubuntu which should work on Raspberry Pi OS!

  3. Avatar for Steve

    Great guide, covers everything needed to get a vanilla Bedrock server up and running, even provides scrips for quick setup and management.

    Just one question… I was hosting this on a VPS for about a month then moved it to a local PC running Ubuntu Server. Now with it on the local PC, the MOTD doesn’t show up to me when using the public IP to connect to the server, only when using the internal IP (which is only available to me). Is this a bug in Mojang’s software or did I happen to do something wrong?

    Much appreciated.

    1. Avatar for jamesachambers

      Hey Steve,

      The Bedrock dedicated server does have some bugs right now related to the ports it opens. When you start the server you’ll see it start one set of ports that matches what is in your config and then a second set of ports that are seemingly randomly chosen.

      These seem to be the local discovery ports which send information like the MOTD/# of players online and they are the ones that are broken. Here’s a pretty extensive bug report about these “discovery” ports and he has some really good steps that may be worth checking on your configuration: https://bugs.mojang.com/browse/BDS-1094.

      There is something else we should take into account here. How did you set up your port forwarding? Minecraft Bedrock is 99% UDP based traffic when you’re in the game and playing (unless it needs to fall back to TCP) but it actually does use TCP for some parts of discovery like checking the ping and the number of players online. Did you forward both types of traffic for TCP and UDP? Some routers you can choose both, others you need to create 2 separate entries. It could also be reversed where if you only forwarded TCP not everything is getting through but enough to connect and join the server is.

      I’ve also wondered if you added TCP and UDP port forwarding for the random set of ports it opens up when you start the server (the ones that aren’t 19131/19132 or in your config.txt) if this would actually fix discovery. The Bedrock server used to listen on the same ports your game did and there were no second set of ports. Even if this worked it would be extremely annoying because every time you restart the Bedrock server you’d have to change your port forwarding entries since it will select different random ports. We really need them to fix that bug to fix this issue!

      I vaguely remember that the ‘online-mode’ in your server.properties might have an effect on which IP address your server “binds” on. In online mode it’s probably your public IP. This is probably how your server was setup. You may want to try online-mode as false just as a test to see if it binds to your private IP for MOTD. Unfortunately if this works then it means you’ll have to choose one or the other since there’s no option to set or control anything about these discovery ports.

      I suspect none of this was an issue on your previous config because as a VPS you would have always had to access it through public IP address. It also wasn’t going through a router with network address translation (NAT) and port forwarding so whatever random ports it was opening up wouldn’t have mattered unless you had a strict firewall setup.

      Hopefully that helps, let us know what you find out!

  4. Avatar for thetechguy

    Hi.
    The script was able to setup the server successfully, however I cannot connect to the world. It says unable to connect to world. I am on minecraft version 1.16.201. It says in the console version 1.16.201.2. How do I downgrade the server version so that I can play?

    1. Avatar for jamesachambers

      Hey thetechguy,

      Your version looks ok. If you are on the wrong version it will tell you that instead of fail to connect.

      When this happens to me I have to completely close the Minecraft client and relaunch it. It seems like once it’s down it will fail until you restart it.

      Of course check all IPs and firewalls etc as well!

  5. Avatar for Geoff Sutton

    I have setup a Hyper-V virtual machine. On that machine I installed Ubuntu Server v20.10. Next I used putty to remote in and ran your script, which worked beautifully. After I had established a world from the initial start I stopped the server then copied my existing server.properties and worlds/ folder into the server folder via putty. Now I cannot access the server either through the Friends tab (which I could on port 19132 running bedrock server from Windows) nor through the Servers tab using the correct IP and port.

    Are there any suggestions you may have as to why this auto install you created isn’t visible over the LAN?

    Thanks

    1. Avatar for jamesachambers

      Hey Geoff,

      I have two theories. It may have something to do with the ‘online-mode’ parameter in the Bedrock server.properties file (make sure you scroll down to the “Bedrock” section since the first section is Java). Check out the properties documentation here:

      https://minecraft.gamepedia.com/Server.properties.

      Basically, online mode puts the server in “online-mode” and requires all players to be authenticated to Xbox Live to connect. It would not surprise me if this disables the “LAN mode” broadcasting when it is in this mode. It could also be your replacement server has this off and it needs to be off to behave like you’re expecting. It’s worth toggling this on and off and see if there’s a change.

      The second theory is that this has something to do with the other set of ports that the Bedrock server open up for Minecraft. Did you change the ports that Minecraft listens on? What I mean is that when you launch the server you’ll notice that a second set of ports that you didn’t put in server.properties is also opened up. I think these ports may have something to do with the LAN server browser.

      I don’t have a solution for this second piece because it’s an official bug, but if it’s working before you replace your server.properties file I would check the entries one by one against that list paying particular attention to the ‘online-mode’ and the ports. Stick to the default ports if you can just to rule out any port related shenanigans!

  6. Avatar for Andrew

    Hi James,

    Great guide, I believe set-up went flawlessly.

    When I try to connect from my laptop in W10 bedrock, the screen gets stuck on Generating World and Locating Server. I can see my ID has connected using the Linux screen.

    Not sure if I am doing something wrong, as I am not familiar with Minecraft servers – trying to set it up for my son.

    Any help would be great.

  7. Avatar for ilium007

    If I switch apps on iOS, or if the iOS device goes to sleep (even just briefly) I can’t reconnect to the bedrock server unless I force quite the iOS client and reopen and reconnect to the server.

    1. Avatar for jamesachambers

      Hey illum007,

      Thanks for that. I’ve encountered the same behavior on the Android version and the PC version. It’s like once the application thinks it can’t reach the server/loses connection due to switching/etc. a single time it marks it permanently down. This is a great tip to help people get it going. Thanks!

  8. Avatar for Devilotx

    How do I host multiple worlds on this server? I have one world for my family to do creative builds etc etc, but when the server stopped updating (see note above) I rebuilt the server with a new name on the same computer, here I built a survival world, but the server info is different.
    I did try to move the old world from the old install into the new folder structure.

    ~/minecraftbe/OLDSERVER/worlds/OLDWORLD
    ~/minecraftbe/NEWSERVER/worlds/NEWWORLD

    New world works, I then copied the OLDWORLD folder into the worlds folder of the NEWSERVER, but I cannot seem to get OLDWORLD to work at the same time as NEWWORLD. restarting the server still only shows NEWWOLRD.

    Wondering what config needs to be changed for this to work.

    thanks~

  9. Avatar for Matt

    James,

    No option for reply to your last post on my thread, so I’m leaving a new comment. I did decide to go with the xfce. It’s progress is loading and unpacking at the time of your post. I’ll let you know, Still excited to try!

    1. Avatar for Matt

      Sorry for the massive data dumps here James. Issue appears to be in line 13/17 for me,

      Minecraft Bedrock server is up to date…
      Starting Minecraft server. To view window type screen -r bedrock_server
      To minimize the window and let the server run in the background, press Ctrl+A then Ctrl+D
      matt@MC-Server:~/minecraftbe/bedrock_server$ screen -r bedrock_server
      There is no screen to be resumed matching bedrock_server.
      matt@MC-Server:~/minecraftbe/bedrock_server$ ./start.sh
      ./start.sh: line 13: route: command not found
      Network interface not up, will try again in 1 second
      ./start.sh: line 17: route: command not found
      Network interface not up, will try again in 1 second
      ./start.sh: line 17: route: command not found
      Network interface not up, will try again in 1 second
      ./start.sh: line 17: route: command not found
      Network interface not up, will try again in 1 second
      ./start.sh: line 17: route: command not found
      Network interface not up, will try again in 1 second
      ./start.sh: line 17: route: command not found
      Network interface not up, will try again in 1 second
      ./start.sh: line 17: route: command not found
      Network interface not up, will try again in 1 second
      ./start.sh: line 17: route: command not found
      Network interface not up, will try again in 1 second
      ./start.sh: line 17: route: command not found
      Network interface not up, will try again in 1 second
      ./start.sh: line 17: route: command not found
      Network interface not up, will try again in 1 second
      ./start.sh: line 17: route: command not found
      Network interface not up, will try again in 1 second
      ./start.sh: line 17: route: command not found
      Network interface not up, will try again in 1 second
      ./start.sh: line 17: route: command not found
      Network interface not up, will try again in 1 second
      ./start.sh: line 17: route: command not found
      Network interface not up, will try again in 1 second
      ./start.sh: line 17: route: command not found
      Network interface not up, will try again in 1 second
      ./start.sh: line 17: route: command not found
      Network interface not up, will try again in 1 second
      ./start.sh: line 17: route: command not found
      Network interface not up, will try again in 1 second
      ./start.sh: line 17: route: command not found
      Network interface not up, will try again in 1 second
      ./start.sh: line 17: route: command not found
      Network interface not up, will try again in 1 second
      ./start.sh: line 17: route: command not found
      Network interface not up, will try again in 1 second
      ./start.sh: line 17: route: command not found
      Network interface not up, will try again in 1 second
      ./start.sh: line 17: route: command not found
      Waiting for network interface to come up timed out – starting server without network connection …
      Checking for the latest version of Minecraft Bedrock server …
      –2020-12-22 20:56:30– https://minecraft.net/en-us/download/server/bedrock/
      Resolving minecraft.net (minecraft.net)… 13.249.51.53, 13.249.51.38, 13.249.51.61, …
      Connecting to minecraft.net (minecraft.net)|13.249.51.53|:443… connected.
      HTTP request sent, awaiting response… 302 Moved Temporarily
      Location: https://www.minecraft.net/en-us/download/server/bedrock/ [following]
      –2020-12-22 20:56:30– https://www.minecraft.net/en-us/download/server/bedrock/
      Resolving http://www.minecraft.net (www.minecraft.net)… 23.47.48.16, 23.47.48.22, 23.47.48.7, …
      Connecting to http://www.minecraft.net (www.minecraft.net)|23.47.48.16|:443… connected.
      HTTP request sent, awaiting response… 301 Moved Permanently
      Location: https://www.minecraft.net/en-us/download/server/bedrock [following]
      –2020-12-22 20:56:30– https://www.minecraft.net/en-us/download/server/bedrock
      Reusing existing connection to http://www.minecraft.net:443.
      HTTP request sent, awaiting response… 200 OK
      Length: unspecified [text/html]
      Saving to: ‘downloads/version.html’

      downloads/version.html [ ] 302.88K 1.58MB/s in 0.2s

      2020-12-22 20:56:31 (1.58 MB/s) – ‘downloads/version.html’ saved [310146]

      Minecraft Bedrock server is up to date…
      Starting Minecraft server. To view window type screen -r bedrock_server
      To minimize the window and let the server run in the background, press Ctrl+A then Ctrl+D
      matt@MC-Server:~/minecraftbe/bedrock_server$ screen -r bedrock_server
      There is no screen to be resumed matching bedrock_server.

      So it’s taking issue with 13 and 17 in start.sh

      DefaultRoute=$(route -n | awk ‘$4 == “UG” {print $2}’)

      SInce the QEMU version is good, no problem there, I’m thinking I need to bridge my eth connection to a virtual LAN port? That’s not in the instructions, but I’m not exactly attempting it the same way.

      Thanks sir,
      Matt

      1. Avatar for jamesachambers

        Hey Matt,

        This is a problem that came up in a pull request on GitHub but I’ve been trying to figure out the best way to fix it. The issue is that ‘route’ is not on the default path for Debian so it needs to be /sbin/route I believe.

        An easy temp fix would be to edit start.sh and just change the ‘route’ lines to /sbin/route. Check out this pull request to see how it was fixed by GitHub contributor goodoldme: https://github.com/TheRemote/MinecraftBedrockServer/pull/43/commits/489ac8f22d7246eb2dbd9bef91d698fb941c8131

        My concern with implementing this pull request as-is is that not every distribution is going to have route on this same path. I was working on a different solution where I test to see if the route command exists and then if it doesn’t it will try using /sbin/route. For you though and our testing go ahead and make these two changes to your start.sh file as you are on Debian!

        I’ll bump up this on the priorities too and get it in the main branch. I’m relieved QEMU is working as that was the major obstacle! It sounds like this last fix is all you need here.

        1. Avatar for Matt

          James, Please find below:

          matt@MC-Server:~/minecraftbe/bedrock_server$ ./start.sh
          Checking for the latest version of Minecraft Bedrock server …
          –2020-12-22 23:26:56– https://minecraft.net/en-us/download/server/bedrock/
          Resolving minecraft.net (minecraft.net)… 65.8.218.37, 65.8.218.51, 65.8.218.64, …
          Connecting to minecraft.net (minecraft.net)|65.8.218.37|:443… connected.
          HTTP request sent, awaiting response… 302 Moved Temporarily
          Location: https://www.minecraft.net/en-us/download/server/bedrock/ [following]
          –2020-12-22 23:26:56– https://www.minecraft.net/en-us/download/server/bedrock/
          Resolving http://www.minecraft.net (www.minecraft.net)… 23.47.48.27, 23.47.48.22
          Connecting to http://www.minecraft.net (www.minecraft.net)|23.47.48.27|:443… connected.
          HTTP request sent, awaiting response… 301 Moved Permanently
          Location: https://www.minecraft.net/en-us/download/server/bedrock [following]
          –2020-12-22 23:26:57– https://www.minecraft.net/en-us/download/server/bedrock
          Reusing existing connection to http://www.minecraft.net:443.
          HTTP request sent, awaiting response… 200 OK
          Length: unspecified [text/html]
          Saving to: ‘downloads/version.html’

          downloads/version.html [ ] 302.88K 1.41MB/s in 0.2s

          2020-12-22 23:26:57 (1.41 MB/s) – ‘downloads/version.html’ saved [310146]

          Minecraft Bedrock server is up to date…
          Starting Minecraft server. To view window type screen -r bedrock_server
          To minimize the window and let the server run in the background, press Ctrl+A then Ctrl+D
          matt@MC-Server:~/minecraftbe/bedrock_server$ screen -r bedrock_server
          There is no screen to be resumed matching bedrock_server.
          matt@MC-Server:~/minecraftbe/bedrock_server$ ./restart.sh
          Server is not currently running!
          matt@MC-Server:~/minecraftbe/bedrock_server$

          This seems to be an IP route issue. I swear I think I need to bridge the connection from my eth (enp9s0), to a virtual LAN port that can port a virtual pipe. I could be totally wrong! I don’t know…

          The start.sh file was modified exactly as you described, and I checked the post by goodoldme. They are the same.
          Then, I tried something different. I yanked the line:
          DefaultRoute=$(/sbin/route -n | awk ‘$4 == “UG” {print $2}’)
          and replaced with:
          DefaultRoute=$ /sbin/route
          (Don’t fret, I put it back the way it was ) 🙂

          Anyway, it exposes this several times until it gives up:

          Network interface not up, will try again in 1 second
          Kernel IP routing table
          Destination Gateway Genmask Flags Metric Ref Use Iface
          default _gateway 0.0.0.0 UG 100 0 0 enp9s0
          link-local 0.0.0.0 255.255.0.0 U 1000 0 0 enp9s0
          192.168.5.0 0.0.0.0 255.255.255.0 U 100 0 0 enp9s0
          Network interface not up, will try again in 1 second
          Kernel IP routing table
          Destination Gateway Genmask Flags Metric Ref Use Iface
          default _gateway 0.0.0.0 UG 100 0 0 enp9s0
          link-local 0.0.0.0 255.255.0.0 U 1000 0 0 enp9s0
          192.168.5.0 0.0.0.0 255.255.255.0 U 100 0 0 enp9s0
          Waiting for network interface to come up timed out – starting server without network connection ..

          Debian is clunky, slow (surprisingly), and I’m not sure how to bridge the connections. Kubuntu made it easy, and it worked.
          As an aside, during Debian 10.7 setup, I was prompted to indicate which network interface was my preferred method. Of course I chose wired.
          After setup was complete I found that firmware was not installed for the wireless adapter!
          I’ve loaded up the firmware from Debian’s site, but I haven’t had any luck getting it to work.
          Maybe I should have rolled with the 10.7.0-i386 instead of the xfce i386 version. Not sure.

          I really appreciate all of the help, but I’m beyond frustrated at this point. I wouldn’t blame you if you told me to take a hike.

          1. Avatar for jamesachambers

            Hey Matt,

            No worries! It sounds like the Kubuntu network manager was bridging the connections for you through the GUI. The KDE flavor of Debian would be more like the GUI you’re used to. The K in Kubuntu is for KDE. XFCE probably isn’t using any hardware acceleration (it’s fairly barebones) so things like the menus and animations will feel a lot less snappy.

            Let’s try bridging them with this resource here: https://wiki.debian.org/BridgeNetworkConnections

            Also, I would try running the server manually again. The script is checking for an active internet connection, but really let’s just see if you can run it:

            LD_LIBRARY_PATH=. ./bedrock_server

            Run that command from your server folder at ~/minecraftbe/yourserverlabel

            What we want to check is if the server will run basically. You may still need to resolve the bridging issue or you can delete the whole check altogether if it’s just not detecting your route configuration properly but you know your networking is working!

            I’m definitely going to update the script with everything we’re learning here. This is invaluable information. I’m glad you’ve stuck through it and been so persistent! I can’t give up either if you won’t!

            1. Avatar for Matt

              matt@MC-Server:~/minecraftbe/bedrock_server$ LD_LIBRARY_PATH=. ./bedrock_server
              bash: ./bedrock_server: cannot execute binary file: Exec format error

              I won’t give up!

              1. Avatar for jamesachambers

                Hey Matt,

                That doesn’t sound like binfmt-utils is on there. That should make it run using qemu-user-static but it doesn’t seem like it is here. I’ll grab a 32 bit Debian over the Christmas break here and see what’s going on with it!

                Let’s try running it manually like this with the qemu-user-static binary:

                pi@rpi8gb:~/minecraftbe/testserver $ LD_LIBRARY_PATH=. qemu-x86_64-static bedrock_server

                This is really similar to how we tested running the server manually on the command line but instead of letting binfmt pass it to QEMU we are directly telling it to run it using QEMU with x86_64 emulation. We’re basically spoon feeding it everything it needs!

                1. Avatar for Matt

                  I’m having some issues with Debian, but I’m trudging through with this. I can’t get a screen up, but it’s gotten this far:

                  matt@MC-Server:~/minecraftbe/bedrock_server$ LD_LIBRARY_PATH=. qemu-x86_64-static bedrock_server
                  NO LOG FILE! – setting up server logging…
                  [2020-12-29 11:41:31 INFO] Starting Server
                  [2020-12-29 11:41:31 INFO] Version 1.16.201.2
                  [2020-12-29 11:41:31 INFO] Session ID 5c0fdefc-1a96-4b76-bf64-e6f18310571e
                  [2020-12-29 11:41:31 INFO] Level Name: Bedrock level
                  [2020-12-29 11:41:31 INFO] Game mode: 0 Survival
                  [2020-12-29 11:41:31 INFO] Difficulty: 1 EASY
                  [INFO] opening worlds/Bedrock level/db
                  [INFO] IPv4 supported, port: 19132
                  [INFO] IPv6 supported, port: 19133
                  [INFO] IPv4 supported, port: 56126
                  [INFO] IPv6 supported, port: 60830
                  [INFO] Server started.
                  [INFO] Player connected: Realmccoyone, xuid: 2533274924760772

                  The screen will not display on the Linux box, and after my client computer connects, it just hangs up with loading server…

                  Screen may be out of date (from separate terminal instance):

                  GNU Screen version 4.06.02 (GNU) 23-Oct-17

                  Copyright (c) 2015-2017 Juergen Weigert, Alexander Naumov, Amadeusz Slawinski
                  Copyright (c) 2010-2014 Juergen Weigert, Sadrul Habib Chowdhury
                  Copyright (c) 2008-2009 Juergen Weigert, Michael Schroeder, Micah Cowan,
                  Sadrul Habib Chowdhury
                  Copyright (c) 1993-2007 Juergen Weigert, Michael Schroeder
                  Copyright (c) 1987 Oliver Laumann

                  This program is free software; you can redistribute it and/or modify it under
                  the terms of the GNU General Public License as published by the Free Software
                  Foundation; either version 3, or (at your option) any later version.

                  This program is distributed in the hope that it will be useful, but WITHOUT
                  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
                  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

                  You should have received a copy of the GNU General Public License along with
                  this program (see the file COPYING); if not, see http://www.gnu.org/licenses/,
                  or contact Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,

                  Having issues getting it to display in order to set up server.

                  1. Avatar for jamesachambers

                    Hey Matt,

                    That is looking good. It says the server is starting and you can even see your player’s xuid connecting and joining in!

                    Usually on that “screen” menu you posted the output on you can just hit enter and it will go away and go to a command prompt inside screen. If you type “exit” in this screen/command prompt you should go back to your real command prompt. You can change it to not show the “startup message” like your used to by editing the file /etc/screenrc with nano. You’ll see something like this:

                    # ——————————————————————————
                    # SCREEN SETTINGS
                    # ------------------------------------------------------------------------------

                    #startup_message off

                    On my system the command to disable the startup message was off. You can uncomment that line to tell screen to disable it!

                    Basically the regular screen command will just open an empty command prompt. If the welcome message is all that’s different it probably is still opening a fresh command prompt.

                    You can detach from an existing screen by pressing Ctrl+A then pressing Ctrl+D. The screen should minimize if it’s working correctly. The command screen -r will list all the screens running in the background on your system. If there’s only one it will reattach to it without making you choose it.

                    Basically the way the script works is it runs screen but it executes the command to run the server inside it at launch. Otherwise screen basically will do nothing but load a terminal that you can Ctrl+A then Ctrl+D out of. You can see how I do this if you open up the start.sh script and you could adapt to run QEMU using the workaround of calling x86_64 ourselves (I haven’t got to installing Debian 32-bit yet but it’s still on my todo list) before I get it added into the main script for our testing!

  10. Avatar for Preston

    Hello James,

    I have loved using this server for almost a year now. It recently wont update to the correct server and i suspect your new code will fix this.

    Before I do that I was wondering if you would recommend having this instance in a VM or a docker container?
    I would like to have multiple server instances and run a NAS

    1. Avatar for jamesachambers

      Hey Preston,

      Welcome back! That’s awesome it has been working well for so long.

      So you’re absolutely right. Mojang made a change to their webserver that returns a not found error when you use the “–spider” parameter.

      I had to change this in the scripts to not use this parameter and just make a normal non-spider connection to download newer versions of the server. Updating to the latest one should fix it for you! Just make sure you have a backup of your server before you try upgrading the scripts just to make sure you don’t lose anything!

      1. Avatar for Preston

        I’m back an up and running!

        I made sure to back up. I need to figure out how to save it to the HDD rather than the SSD(Boat drive). I have to remember to clear out the downloads every few months cuz my boot drive is so small.

        How would I do this, and do you use Vm’s or Docker to split out a server.

  11. Avatar for Matt

    James,

    I’m having issues getting this to work, and I wonder if my 32bit Latitude D620 running Kubuntu 18.04 might be the problem. I was thinking I could repurpose some old hardware, and it’s the first time I’ve run your script.

    I’m getting this after what seems to be a good setup (the end processes of the setup and subsequent lack of start.sh, stop.sh, restart.sh, etc…):

    Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|199.232.8.133|:443… connected.
    HTTP request sent, awaiting response… 200 OK
    Length: 2865 (2.8K) [text/plain]
    Saving to: ‘start.sh’

    start.sh 100%[==============================================================================================================>] 2.80K –.-KB/s in 0.003s

    2020-12-19 20:09:22 (959 KB/s) – ‘start.sh’ saved [2865/2865]

    Grabbing stop.sh from repository…
    –2020-12-19 20:09:22– https://raw.githubusercontent.com/TheRemote/MinecraftBedrockServer/master/stop.sh
    Resolving raw.githubusercontent.com (raw.githubusercontent.com)… 199.232.8.133
    Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|199.232.8.133|:443… connected.
    HTTP request sent, awaiting response… 200 OK
    Length: 1928 (1.9K) [text/plain]
    Saving to: ‘stop.sh’

    stop.sh 100%[==============================================================================================================>] 1.88K –.-KB/s in 0.002s

    2020-12-19 20:09:22 (948 KB/s) – ‘stop.sh’ saved [1928/1928]

    Grabbing restart.sh from repository…
    –2020-12-19 20:09:23– https://raw.githubusercontent.com/TheRemote/MinecraftBedrockServer/master/restart.sh
    Resolving raw.githubusercontent.com (raw.githubusercontent.com)… 199.232.8.133
    Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|199.232.8.133|:443… connected.
    HTTP request sent, awaiting response… 200 OK
    Length: 1729 (1.7K) [text/plain]
    Saving to: ‘restart.sh’

    restart.sh 100%[==============================================================================================================>] 1.69K –.-KB/s in 0s

    2020-12-19 20:09:23 (8.53 MB/s) – ‘restart.sh’ saved [1729/1729]

    Configuring minecraft_server service…
    –2020-12-19 20:09:23– https://raw.githubusercontent.com/TheRemote/MinecraftBedrockServer/master/minecraftbe.service
    Resolving raw.githubusercontent.com (raw.githubusercontent.com)… 199.232.8.133
    Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|199.232.8.133|:443… connected.
    HTTP request sent, awaiting response… 200 OK
    Length: 351 [text/plain]
    Saving to: ‘/etc/systemd/system/minecraft_server.service’

    /etc/systemd/system/minecraft_server.service 100%[==============================================================================================================>] 351 –.-KB/s in 0s

    2020-12-19 20:09:24 (5.94 MB/s) – ‘/etc/systemd/system/minecraft_server.service’ saved [351/351]

    Start Minecraft server at startup automatically (y/n)?y
    Automatically restart and backup server at 4am daily (y/n)?y
    Daily restart scheduled. To change time or remove automatic restart type crontab -e
    Setup is complete. Starting Minecraft minecraft_server server…
    There is no screen to be resumed matching minecraft_server.
    matt@KUBUNTU-SERVER:~$ ls -al
    total 696
    drwxr-xr-x 20 matt matt 4096 Dec 19 20:07 .
    drwxr-xr-x 3 root root 4096 Dec 19 15:11 ..
    -rw——- 1 matt matt 3726 Dec 19 20:06 .bash_history
    -rw-r–r– 1 matt matt 220 Dec 19 15:11 .bash_logout
    -rw-r–r– 1 matt matt 3771 Dec 19 15:11 .bashrc
    drwxrwxr-x 15 matt matt 4096 Dec 19 19:57 .cache
    drwxr-xr-x 9 matt matt 4096 Dec 19 20:11 .config
    drwx—— 3 matt matt 4096 Dec 19 15:24 .dbus
    drwxr-xr-x 3 matt matt 4096 Dec 19 19:44 Desktop
    drwxr-xr-x 2 matt matt 4096 Dec 19 15:24 Documents
    drwxr-xr-x 2 matt matt 4096 Dec 19 17:30 Downloads
    -rw-r–r– 1 matt matt 14965 Dec 19 15:11 .face
    lrwxrwxrwx 1 matt matt 5 Dec 19 15:11 .face.icon -> .face
    drwx—— 2 matt matt 4096 Dec 19 19:40 .gconf
    drwx—— 3 matt matt 4096 Dec 19 15:23 .gnupg
    -rw-rw-r– 1 matt matt 375 Dec 19 15:24 .gtkrc-2.0
    drwxrwxr-x 3 matt matt 4096 Dec 19 15:29 .kde
    drwxrwxr-x 3 matt matt 4096 Dec 19 15:23 .local
    drwxrwxr-x 3 matt matt 4096 Dec 19 19:15 minecraftbe
    drwx—— 5 matt matt 4096 Dec 19 15:54 .mozilla
    drwxr-xr-x 2 matt matt 4096 Dec 19 15:24 Music
    drwxr-xr-x 2 matt matt 4096 Dec 19 19:19 Pictures
    drwx—— 3 matt matt 4096 Dec 19 19:34 .pki
    -rw-r–r– 1 matt matt 807 Dec 19 15:11 .profile
    drwxr-xr-x 2 matt matt 4096 Dec 19 15:24 Public
    -rwxrwxr-x 1 matt matt 11132 Dec 19 19:12 SetupMinecraft.sh
    -rw-rw-r– 1 matt matt 11132 Dec 19 20:07 SetupMinecraft.sh.1
    -rw-r–r– 1 matt matt 0 Dec 19 16:40 .sudo_as_admin_successful
    drwxr-xr-x 2 matt matt 4096 Dec 19 15:24 Templates
    drwxr-xr-x 2 matt matt 4096 Dec 19 15:24 Videos
    -rw-rw-r– 1 matt matt 260 Dec 19 20:09 .wget-hsts
    -rw——- 1 matt matt 59 Dec 19 19:40 .Xauthority
    -rw——- 1 matt matt 560382 Dec 19 20:23 .xsession-errors
    matt@KUBUNTU-SERVER:~$ cd ~/minecraftbe
    matt@KUBUNTU-SERVER:~/minecraftbe$ ./start.sh
    bash: ./start.sh: No such file or directory
    matt@KUBUNTU-SERVER:~/minecraftbe$ ./restart.sh
    bash: ./restart.sh: No such file or directory
    matt@KUBUNTU-SERVER:~/minecraftbe$ sudo
    usage: sudo -h | -K | -k | -V
    usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user]
    usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user] [command]
    usage: sudo [-AbEHknPS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p prompt] [-T timeout] [-u user] [VAR=value] [-i|-s]
    []
    usage: sudo -e [-AknS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p prompt] [-T timeout] [-u user] file …
    matt@KUBUNTU-SERVER:~/minecraftbe$ sudo systemctl start minecraftbe
    [sudo] password for matt:
    Failed to start minecraftbe.service: Unit minecraftbe.service not found.

    Anyway, I just can’t get it to run. During one attempt, it commented that it was started, but the screen was closed. Not sure wgat that was about, but I only saw that once.

    What do you think? Any help is appreciated.

    1. Avatar for jamesachambers

      Hey Matt,

      The server should be one folder deeper. It should be a subfolder inside the minecraftbe folder named what you chose as the server label. This is because it supports hosting multiple instances (except this is broken at the moment for everyone due to a bug in the current official Bedrock server). I expect everything’s there. If you chose the server label “test” for example the server folder should be named test or ~/minecraftbe/test. The scripts even run on armhf/arm64 such as the Raspberry Pi so I’m sure they’ll be there.

      There’s a couple things you can do to see what’s going wrong. There’s a log folder that will have a startup log, but I suspect in your case the binary can’t run at all and there will be no log. If we’re lucky the screen command managed to spit out a single line that will probably say binary format error or something if I were to guess. The alternative is you can run the server manually on the command line if you want to go into the previously mentioned server folder and run the Bedrock server yourself like this:

      LD_LIBRARY_PATH=. ./bedrock_server

      I’m honestly not sure if it works on 32 bit. I’m seeing mixed answers trying to look it up here but either the logs folder or running the binary yourself without help from the scripts should help! If it gives you something like can’t open/execute binary file then Mojang/Microsoft did not compile the dedicated server with 32 bit support. I think this is the likely answer here.

      You could also do a:

      ldd bedrock_server

      to see if it’s trying to link to a bunch of 64 bit libraries that don’t exist (or just flat out erroring out) or if it’s actually finding 32 bit libraries it can use!

      If it doesn’t work on 32 bit I could probably add 32 bit QEMU emulation support. This is agonizingly slow on ARM platforms but x86 to x86_64 might not be so bad. It’s not ideal since it’s still software emulation (and it will have to be to run 64 bit instructions on a 32 bit CPU unfortunately unless they release a 32 bit dedicated binary), but if this is something you’d be interested in trying I can definitely look into it and we could have you test to see if it’s fast enough on x86 to actually log in/play without lag!

      1. Avatar for Matt

        This is great information James and thank you!! You’re very kind. Let me peel back and start over by building in the subfolder, and then if I’m seeing the same thing, I’ll consult the logs/try running the binary w/o the scripts and let you know. After some more digging last night, the error I’m receiving does show up in some web conversation as an ARM support issue. So, emulation support could be tried, but only if you’d want to test it with me out of curiosity. I wouldn’t ask you to go down that rabbit hole unless your curiosity was driving you. I’m only trying to make use of an old Centrino duo w 4G of RAM and a lean front end. Thought it might drive Minecraft just fine.

        Matt

        1. Avatar for Matt

          So as we suspected (I’m sure the setup is good now) it cannot execute the binary. It’s the only comment in the log file. That’s as far as it gets.
          This time had the subfolder properly placed, and the files are all written fine. It won’t execute the 64 bit binary.

          I initially had a subfolder built yesterday when prompted for the server name, but in that last run (5th time) I was trying anything to make it happen. Sorry for the poor data and confusion.

          I’ll guinea pig the emulation if you want to write it. It may end up being helpful to others to make use of some older hardware (if it runs well).

          2 x Genuine Intel CPU T2300 @ 1.66GHz
          4GB SODIMM DDR2
          SATA 2.5″ 500GB HDD
          Kubuntu 18.04.5 LTS 32-bit

          1. Avatar for jamesachambers

            Fantastic, I’ve just uploaded this support. Can you try removing your old folder with rm -rf ~/minecraftbe and then rm SetupMinecraft.sh and download the latest one here.

            I put in the architectures to detect as i386 (probably what yours is) and i686 (I think this is barely used anymore but I put it in here just in case). Basically it should say “32 bit platform detected — installing dependencies” and install QEMU here.

            I’ll download a 32 bit OS here and create a VMware ESXI instance for testing as well here. I’m excited to see the results!

        2. Avatar for jamesachambers

          Hey Matt,

          That’s fantastic, I love it! I have all shapes and sizes of older hardware being used and repurposed at home here for all kinds of projects. It’s a lot of fun!

          The ARM emulation is really slow but ARM and x86_64 are much more different from each other than x86 and x86_64 are from each other. Given there’s still a lot of powerful 32 bit hardware out there I think this is well worth adding in. I should be able to do it today honestly because I just need to add a check in the SetupMinecraft.sh kit for the 32 bit architectures alongside the ARM architectures it detects.

          I’ve left the ARM support in there because you never know what kind of hardware people have access to. A Raspberry Pi 4 isn’t powerful enough to emulate it, but the new Surface Pro X from Microsoft runs on a new Qualcomm ARM chip. I believe Apple’s new M1 chip also uses ARM architecture but I’d have to double check on that, but the point is you never know what’s out there or what could come up in the future. These new chips are desktop grade chips when it comes to performance and are benchmarking extremely well!

          I definitely think adding 32 bit support is worth it for the same reason. Perhaps it will work on 32 bit laptops, but if it’s a little sluggish there maybe something like an old retired server or a former powerful 32 bit gaming rig would make quick work of it!

            1. Avatar for Matt

              OK:

              32 bit platform detected — installing dependencies…
              Available QEMU version is not high enough to emulate x86_64. Please update your QEMU version.

              Now I need to look at that…

              Getting closer

    2. Avatar for Jeff

      Matt,

      Look under the name of your server. If you do “ls ~/minecraftbe” I could tell you what name you choose. The scripts are under the name of the server so if you “cd ~/minecraftbe/”

      You can see they are in that directory

      James you have done a great job on the scripts.

      1. Avatar for Matt

        Attempted to update the QEMU version to 4.1.
        This took some time, mostly due to unrelated projects that had to get done today. Also had to attempt it a couple of times until I found the place (noobie) where I could enable the source apt list so that I could take in the source code.
        The “make” process took a LONG time.
        Then adding the apparmor editions, apparmor libvert and libvertd only to get this:

        Dec 20 19:53:02 KUBUNTU-SERVER apparmor[6432]: * Reloading AppArmor profiles
        Dec 20 19:53:03 KUBUNTU-SERVER apparmor[6432]: Skipping profile in /etc/apparmor.d/disable: usr.bin.firefox
        Dec 20 19:53:06 KUBUNTU-SERVER apparmor[6432]: AppArmor parser error for /etc/apparmor.d/usr.sbin.libvirtd in /etc/apparmor.d/usr.sb
        Dec 20 19:53:06 KUBUNTU-SERVER apparmor[6432]: Skipping profile in /etc/apparmor.d/disable: usr.sbin.rsyslogd
        Dec 20 19:53:06 KUBUNTU-SERVER apparmor[6432]: Skipping profile in /etc/apparmor.d/disable: usr.bin.firefox
        Dec 20 19:53:06 KUBUNTU-SERVER apparmor[6432]: AppArmor parser error for /etc/apparmor.d/usr.sbin.libvirtd in /etc/apparmor.d/usr.sb
        Dec 20 19:53:06 KUBUNTU-SERVER apparmor[6432]: Skipping profile in /etc/apparmor.d/disable: usr.sbin.rsyslogd
        Dec 20 19:53:06 KUBUNTU-SERVER apparmor[6432]: …fail!
        Dec 20 19:53:06 KUBUNTU-SERVER systemd[1]: apparmor.service: Control process exited, code=exited status=123
        Dec 20 19:53:06 KUBUNTU-SERVER systemd[1]: Reload failed for AppArmor initialization.

        Matt@KUBUNTU-SERVER:~/qemu-4.1.0$ journalctl -xe
        Dec 20 20:03:02 KUBUNTU-SERVER audit[6764]: AVC apparmor=”STATUS” operation=”profile_replace” profile=”unconfined” name=”/usr/lib/s
        Dec 20 20:03:02 KUBUNTU-SERVER audit[6764]: AVC apparmor=”STATUS” operation=”profile_replace” profile=”unconfined” name=”/usr/lib/s
        Dec 20 20:03:02 KUBUNTU-SERVER audit[6766]: AVC apparmor=”STATUS” operation=”profile_replace” info=”same as current profile, skippi
        Dec 20 20:03:02 KUBUNTU-SERVER audit[6769]: AVC apparmor=”STATUS” operation=”profile_replace” info=”same as current profile, skippi
        Dec 20 20:03:02 KUBUNTU-SERVER audit[6770]: AVC apparmor=”STATUS” operation=”profile_replace” profile=”unconfined” name=”/usr/lib/c
        Dec 20 20:03:02 KUBUNTU-SERVER audit[6770]: AVC apparmor=”STATUS” operation=”profile_replace” profile=”unconfined” name=”/usr/sbin/
        Dec 20 20:03:02 KUBUNTU-SERVER apparmor[6686]: AppArmor parser error for /etc/apparmor.d/usr.sbin.libvirtd in /etc/apparmor.d/usr.s
        Dec 20 20:03:02 KUBUNTU-SERVER audit[6770]: AVC apparmor=”STATUS” operation=”profile_replace” profile=”unconfined” name=”/usr/sbin/
        Dec 20 20:03:02 KUBUNTU-SERVER audit[6774]: AVC apparmor=”STATUS” operation=”profile_replace” profile=”unconfined” name=”/usr/sbin/
        Dec 20 20:03:02 KUBUNTU-SERVER apparmor[6686]: Skipping profile in /etc/apparmor.d/disable: usr.sbin.rsyslogd
        Dec 20 20:03:02 KUBUNTU-SERVER audit[6774]: AVC apparmor=”STATUS” operation=”profile_replace” profile=”unconfined” name=”/usr/sbin/
        Dec 20 20:03:02 KUBUNTU-SERVER audit[6778]: AVC apparmor=”STATUS” operation=”profile_replace” info=”same as current profile, skippi
        Dec 20 20:03:02 KUBUNTU-SERVER apparmor[6686]: …fail!
        Dec 20 20:03:02 KUBUNTU-SERVER systemd[1]: apparmor.service: Control process exited, code=exited status=123
        Dec 20 20:03:02 KUBUNTU-SERVER systemd[1]: Reload failed for AppArmor initialization.
        — Subject: Unit apparmor.service has finished reloading its configuration
        — Defined-By: systemd
        — Support: http://www.ubuntu.com/support

        — Unit apparmor.service has finished reloading its configuration

        — The result is RESULT.
        Dec 20 20:03:02 KUBUNTU-SERVER systemd[1]: Started Run anacron jobs.
        — Subject: Unit anacron.service has finished start-up
        — Defined-By: systemd
        — Support: http://www.ubuntu.com/support

        — Unit anacron.service has finished starting up.

        — The start-up result is RESULT.
        Dec 20 20:03:02 KUBUNTU-SERVER sudo[6678]: pam_unix(sudo:session): session closed for user root
        Dec 20 20:03:02 KUBUNTU-SERVER anacron[6780]: Anacron 2.3 started on 2020-12-20
        Dec 20 20:03:02 KUBUNTU-SERVER anacron[6780]: Normal exit (0 jobs run)
        lines 1000-1032/1032 (END)

        This is getting painful for a windows server guy out of his depth.

        Worked on this for another couple of hours…
        Still sitting @ qemu 2.11.

        1. Avatar for jamesachambers

          I was going to suggest upgrading to 20.04 but I checked and they discontinued i386 support at 19.10 it looks like.

          I wrote a guide about the “evil” way to get a later version of QEMU in this article here. Scroll down to the “Evil way to get latest QEMU” section. It’s for Raspberry Pi because it also used to have too old of packages (< 3.1) but the process is exactly the same for what you'll be doing.Basically you can head to the Debian repository at https://packages.debian.org/sid/qemu-user-static and steal their i386 package and https://packages.debian.org/sid/binfmt-support for the binfmt support package. Download these two and you can install them with sudo dpkg -i qemu-user-static-xxx.deb and sudo dpkg -i binfmt-utils-xxx.deb, but the guide goes through it a little bit more in depth step by step. This will take you all the way to 5.2 which is more than good enough.

          I’m guessing the reason the one you built didn’t seem to help is that it needs to be a “static” build for this type of emulation to work. Most build guides and the default settings are not building the static version but it can be set with a make flag to compile a static binary, but I’d just probably grab those two .deb files and install them. It’s faster, easier and unless this is a emulation machine with a bunch of other software expecting you to have a specific old QEMU version it shouldn’t hurt anything in this case.

          The reason this is “evil” is that you are bypassing the package manager which is bad practice and can cause a lot of problems. But you’re in a situation where your packages will basically never be updated as the i386 version was discontinued so they’re probably not doing anything outside security updates at this point! It’s also relatively safe with QEMU as most people don’t have this package in a critical dependency chain in their system. It’s likely you didn’t have it at all before this!

          I just wanted to make clear that this is not a good habit to get into but building QEMU, as you discovered, takes quite a while. It used to take like 36 hours to build on Raspberry Pi which is why I chose this alternative here!

          I didn’t realize it was on such an old version still or that i386 had been totally canned for Ubuntu/Kubuntu or I would have let you know this before hand. That’s the way it goes testing this sometimes unfortunately and now we know! That should be the last thing you need to do. After that you should be able to start the server!

          1. Avatar for Matt

            James, again, awesome stuff. Tons of detail and I love it. Indeed, I struggled with a couple of different QEMU packages yesterday but I’ve learned a bit. Being new to Linux, having my feet in the fire is sometimes the best way for me to learn.

            Lets try your “evil” method…

            🙂

            Matt

            1. Avatar for jamesachambers

              Hey Matt,

              Sounds great! The nice thing about this method is that Ubuntu is a derivative of Debian. It’s basically built on top of it and is an extension of core Debian which makes the packages (usually) fairly compatible between the two. Even though they’ve stopped maintaining their repositories for i386 Debian has not.

              In fact, installing Debian might be a good option to consider long term. They’re still proudly supporting i386 builds to this day, and not a lot of distros still are! You’d have a similar choice in flavors as you do with Ubuntu for a desktop environment outlined here.

              You don’t need to do this right now. I more threw out this information assuming you’re going to be successful here but that over the long term it’s going to be more and more difficult to keep an out of support Kubuntu operational here over time and to give others reading this that may be using 32 bit still some options to be able to still get up to date software straight through the repository.

              Definitely let us know how it goes. The big outstanding question will be how much does QEMU emulation slow down the 32 bit version!

            2. Avatar for Matt

              Unpacking binfmt-support (2.2.1-1) …
              dpkg: dependency problems prevent configuration of binfmt-support:
              binfmt-support depends on libc6 (>= 2.28); however:
              Version of libc6:i386 on system is 2.27-3ubuntu1.4.

              Looks like I need to look into libc6:i386.

              Sorry for the lag time in responses on this thread James. I got a call this morning about a customer network issue impeding their POS, so I had to get on the road to fix it.

              1. Avatar for Matt

                LOL!!!

                I think I’m going to scare people away from trying this .

                I’m starting to have fun now:

                matt@KUBUNTU-SERVER:~$ sudo apt-get install libc6-i386 libc6-dev-i386
                Reading package lists… Done
                Building dependency tree
                Reading state information… Done
                Package libc6-i386 is not available, but is referred to by another package.
                This may mean that the package is missing, has been obsoleted, or
                is only available from another source
                However the following packages replace it:
                libc6

                E: Package ‘libc6-i386’ has no installation candidate
                E: Unable to locate package libc6-dev-i386
                matt@KUBUNTU-SERVER:~$ sudo apt-get install libc6-dev
                Reading package lists… Done
                Building dependency tree
                Reading state information… Done
                libc6-dev is already the newest version (2.27-3ubuntu1.4).
                libc6-dev set to manually installed.
                You might want to run ‘apt –fix-broken install’ to correct these.
                The following packages have unmet dependencies:
                binfmt-support : Depends: libc6 (>= 2.28) but 2.27-3ubuntu1.4 is to be installed
                E: Unmet dependencies. Try ‘apt –fix-broken install’ with no packages (or specify a solution).
                matt@KUBUNTU-SERVER:~$ apt –fix-broken install
                E: Could not open lock file /var/lib/dpkg/lock-frontend – open (13: Permission denied)
                E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
                matt@KUBUNTU-SERVER:~$ sudo apt –fix-broken install
                Reading package lists… Done
                Building dependency tree
                Reading state information… Done
                Correcting dependencies… Done
                The following packages will be REMOVED:
                binfmt-support
                0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
                1 not fully installed or removed.
                After this operation, 226 kB disk space will be freed.
                Do you want to continue? [Y/n] n
                Abort.
                matt@KUBUNTU-SERVER:~$ wget http://ftp.us.debian.org/debian/pool/main/g/glibc/libc6_2.28-10_i386.deb
                –2020-12-21 15:08:15– http://ftp.us.debian.org/debian/pool/main/g/glibc/libc6_2.28-10_i386.deb
                Resolving http://ftp.us.debian.org (ftp.us.debian.org)… 208.80.154.15, 64.50.236.52, 64.50.233.100, …
                Connecting to http://ftp.us.debian.org (ftp.us.debian.org)|208.80.154.15|:80… connected.
                HTTP request sent, awaiting response… 200 OK
                Length: 2743020 (2.6M) [application/octet-stream]
                Saving to: ‘libc6_2.28-10_i386.deb’

                libc6_2.28-10_i386.de 100%[=========================>] 2.62M 157KB/s in 16s

                2020-12-21 15:08:31 (169 KB/s) – ‘libc6_2.28-10_i386.deb’ saved [2743020/2743020]

                matt@KUBUNTU-SERVER:~$ sudo dpkg –install libc6*.deb
                dpkg: regarding libc6_2.28-10_i386.deb containing libc6:i386:
                libc6:i386 breaks locales (<< 2.28)
                locales (version 2.27-3ubuntu1.4) is present and installed.

                dpkg: error processing archive libc6_2.28-10_i386.deb (–install):
                installing libc6:i386 would break locales, and
                deconfiguration is not permitted (–auto-deconfigure might help)
                Errors were encountered while processing:
                libc6_2.28-10_i386.deb
                matt@KUBUNTU-SERVER:~$ sudo dpkg –install libc6_2.28-10_i386.deb
                dpkg: regarding libc6_2.28-10_i386.deb containing libc6:i386:
                libc6:i386 breaks locales (<< 2.28)
                locales (version 2.27-3ubuntu1.4) is present and installed.

                dpkg: error processing archive libc6_2.28-10_i386.deb (–install):
                installing libc6:i386 would break locales, and
                deconfiguration is not permitted (–auto-deconfigure might help)
                Errors were encountered while processing:
                libc6_2.28-10_i386.deb

                Any suggestions?
                Hehehe.

                I really am laughing now.

                1. Avatar for jamesachambers

                  Yeah absolutely, libc is a critical system dependency (for basically everything) and won’t be able to be updated this way (nor will most things). Only a very self-contained package like QEMU can be done like this without essentially breaking the entire system. If anything depends on the package, like if anything had depended on QEMU for example, it would be broken in the same way and apt won’t work again until it’s repaired. Since nothing depends on QEMU, nothing cares, but *everything* depends on libc.

                  You’ll probably need to do a

                  sudo apt install --fix-broken

                  to let it remove that libc package and any other ones that break the dependency chain so the package manager works again (hopefully, this is not a dependency you want to mess with, but if the system still boots then it didn’t actually replace the real libc). It’s the dependency for the C language itself which powers all of Linux. Every program you have depends on it that isn’t a script pretty much. Your system’s libc is too old to run the sid packages apparently. It’s oh so close (2.27 is available but you need 2.28, just one short!) but we’ll have to go older.

                  https://packages.debian.org/buster/qemu-user-static is version 3.1 for Debian Buster, the minimum possible version. If that one requires a newer libc than is available for your distro then it’s not going to work. 3.1 is very old now (more than two full major revisions out of date) though so that may be the way to go here.

                  They’ve put you in a difficult position here. Reading this makes it sound like they were going to keep it going:

                  https://www.fosslinux.com/16352/canonical-rolls-back-decision-on-32-bit-i386-packages-for-ubuntu.htm

                  But then they didn’t and 20.04 has zero i386 support unfortunately. The “best” answer in this case is to ditch Ubuntu for anything else that still supports i386 and will have up to date packages, but the 3.1 package may be able to help here. From our testing so far I’m guessing when I write up the documentation for 32 bit it’s going to say switch to Debian Buster or another i386 supporting distro but will have this as a workaround if 3.1 will run.

                  1. Avatar for Matt

                    Unfortunately the dependancy is still for 2.28:

                    matt@KUBUNTU-SERVER:~$ sudo dpkg –install qemu-user-static_3.1+dfsg-8+deb10u8_i386.deb
                    [sudo] password for matt:
                    Selecting previously unselected package qemu-user-static.
                    (Reading database … 232791 files and directories currently installed.)
                    Preparing to unpack qemu-user-static_3.1+dfsg-8+deb10u8_i386.deb …
                    Unpacking qemu-user-static (1:3.1+dfsg-8+deb10u8) …
                    Setting up qemu-user-static (1:3.1+dfsg-8+deb10u8) …
                    update-binfmts: /lib/i386-linux-gnu/libc.so.6: version `GLIBC_2.28′ not found (required by update-binfmts)
                    dpkg: error processing package qemu-user-static (–install):
                    installed qemu-user-static package post-installation script subprocess returned error exit status 1
                    Processing triggers for man-db (2.8.3-2ubuntu0.1) …
                    Errors were encountered while processing:
                    qemu-user-static

                    The binfmt-support depends on libc6 being at 2.28. 🙁

                    Funny thing is that this idea all started when I realized that I couldn’t install docker on my Synology NAS (DS218play). I was going to emulate there in order to run a Minecraft server! When I found out that the hardware isn’t up to it (need 218+ to get the necessary Docker) I figured this old laptop would be a good option. I don’t have a rack in the house, or I’d unbox an old PowerEdge 1950 that I retired from our Data Center and format a couple of WD RED drives for this. Alas, it is too loud and doesn’t make a very good looking coffee table.

                    Looking like Debian for me if you think I’ll never see a 2.28 libc.

                    1. Avatar for jamesachambers

                      I like xfce because it’s really lightweight and uses the least amount of resources out of the other desktop managers. It definitely doesn’t have very many bells and whistles but it’s probably my favorite out of all of them, especially for these kind of uses!

                      I can’t believe those other packages are wanting 2.28 too. That’s crazy! I had an easier time getting it to work on a Raspberry Pi with armhf and arm64 than it has been to get it to work with Kubuntu 18.04 i386 which is pretty amazing.

                      I think you made the right decision. With a lack of up to date packages we were just going way too far down a rabbit hole here to get essentially a discontinued distro to cooperate. I found references to some more up to date packages in https://packages.ubuntu.com/search?keywords=libc6-i386 but it seems like they’re maybe for different flavors than Kubuntu.

                      Let us know how Debian looks here!

  12. Avatar for James

    Hey James,

    did something change with the SetupMinecraft.sh? i am re installing my server and i removed all my minecraftpe directories and re downloaded your setup script. now my directory doesn’t have any of the start stop or restart.sh scripts. its weird.

    here is the ls -al

    drwxrwxr-x 17 4096 Dec 19 03:27 .
    drwxrwxr-x 3 4096 Dec 19 02:43 ..
    drwxrwxr-x 2 4096 Dec 19 03:27 backups
    drwxr-xr-x 14 4096 Dec 12 00:38 behavior_packs
    -rw-r–r– 1 0 Dec 19 03:18 Dedicated_Server.txt
    drwxr-xr-x 9 4096 Dec 12 00:38 definitions
    drwxr-xr-x 2 4096 Dec 19 02:53 development_behavior_packs
    drwxr-xr-x 2 4096 Dec 19 02:53 development_resource_packs
    drwxr-xr-x 2 4096 Dec 19 02:53 development_skin_packs
    drwxrwxr-x 2 4096 Dec 19 02:43 downloads
    drwxrwxr-x 2 4096 Dec 19 03:27 logs
    drwxr-xr-x 2 4096 Dec 19 02:53 minecraftpe
    drwxr-xr-x 2 4096 Dec 19 02:53 premium_cache
    drwxr-xr-x 4 4096 Dec 12 00:38 resource_packs
    drwxr-xr-x 14 4096 Dec 12 00:38 structures
    drwxr-xr-x 3 4096 Dec 19 02:53 treatments
    drwxr-xr-x 3 4096 Dec 19 02:53 worlds
    drwxr-xr-x 2 4096 Dec 19 02:53 world_templates

    1. Avatar for jamesachambers

      That is very weird because someone else was reporting this happening and I was certain they must have a corrupt partition or a failing drive.

      I just tried downloading and installing from scratch on a Ubuntu 20.04 Server installation, used minecraftbe as the server label and left the ports as default and it fired right up. Stopped the server and everything stopped. All scripts present and accounted for, able to restart the server normally.

      The other person reporting this was Paul in this thread, but I can’t recreate it.

      What OS and version are you running on and what did you pick for the server label and ports? I have yet to be able to recreate this but now that there’s a second one it seems like something is up!

      Did you stop the server beforehand? If it’s left open it could try to overwrite some stuff but I still don’t see how it could make scripts disappear. Are they ever making it in the first place after you first install? Hopefully you also aren’t installing it as sudo, I guess I should have asked that too as that would install everything to the /root folder.

      1. Avatar for James

        i just upgraded all my software on the Ubuntu 20.04.1 LTS (GNU/Linux 5.4.0-58-generic x86_64)

        server label was Banski-Realm and everything else was default. on initial startup the server window starts but i dont believe the server ever started. i ctrl c out of the remote session and rebooted the server for good measures.

    2. Avatar for Mandar

      I just ran into exact same problem. Fresh installed Ubuntu 20.04. Downloaded the Minecraftbe Setup script.. server came up fine. My son was not able to connect, so all I did was ran the restart script and poof.. all the scripts are gone. and the directory structure is pretty much whats above. Is there anything special I need to do to reinstall from scratch?

      1. Avatar for jamesachambers

        Hey Mandar,

        You were about 10 minutes too early! I’ve just fixed this here and committed it to GitHub a few minutes ago. Go ahead and do a rm -rf ~/minecraftbe and run SetupMinecraft.sh again. The problem specifically was in start.sh not having a hard path to the backups folder so running ./start.sh or ./restart.sh was putting the scripts in a place they didn’t expect to be and then the scripts themselves got pruned instead of the backups folder. These paths have been changed to be hard coded. Can you try again and report back?

        1. Avatar for Mandar

          Yep seems issue is resolved. I was able to download setup script again reinstall and it came up fine. I was able to restart and its back up. Somehow my son still not able to connect from his laptop. We’re on the same network. I got the ip address right.. nc reporting connection succeeded. Not sure. will check what else is missing

          1. Avatar for jamesachambers

            Hey Mandar,

            Have him try closing his Minecraft client completely and then opening it again. I have this problem a lot when I’m testing and for some reason once the client decides the server isn’t up a single time it will fail to connect to it even if it comes up later. Android version does the same thing. Once I restart the client it will usually instantly connect afterward!

              1. Avatar for jamesachambers

                Hey Mandar,

                It could matter but I believe that’s correct. I had 1.16.200 but I just checked the App Store and had an update. My server is showing 1.16.201.2 here. After updating I was able to get in here and my version was showing 1.16.201. It might be worth checking the Microsoft App Store and make sure it’s the latest but it sounds correct here.

                You’re also able to netcat it, so it doesn’t seem like it’s a firewall issue like it needing a UFW allow 19132 on the Linux side. One possibility is firewall settings on Windows. It pops up that annoying window that says if you want to allow it on public networks, private networks, etc. the first time you start the client and by default a few of them are unchecked. Normally it hardly matters but with UDP traffic you often need to have the “private network” box checked since UDP is a connectionless protocol and frankly I would check all of them for Minecraft. If you have any type of third party firewall it’s definitely worth a check. It may be good to just turn the firewall off temporarily completely and if it works then you can work on correcting the configuration.

                Is the Windows machine able to ping it or netcat it? Ports are both TCP and UDP and connecting by private IP like your 192.x or 10.x is recommended but if you have the knowledge to netcat it I trust that you’ve almost certainly got your IPs and ports right.

                Did you add the server manually? Can he see the description for the server (usually just something like “Dedicated Server” by default or does it just say “Locating…”? Mine does populate and that’s a good sign that they are at least able to see each other and talk to each other. I believe the server information/description is the TCP part of the protocol but that in Bedrock almost everything else is UDP. Is there anything on your network that may affect UDP traffic?

                1. Avatar for Mandar

                  Sorry James, this is coming way late, but guess what my problem was from Windows 10 client unable to connect to Ubuntu Bedrock? The stupid WiFi network setting was causing it. You have it right there in the comment above “private network”, but the setting is buried deep inside. Here’s how to find it.

                  Right next to the Windows main menu in the “Type here to search” textbox type Network and Sharing Center
                  Choose Network and Sharing Center
                  Choose Network & Internet
                  Choose WiFi
                  Click Manage Known Network
                  Click the WiFi network you are connected to
                  Click Properties
                  Change the Public to Private

                  That’s it. After that it started working. Not sure what network settings Windoze internally changes, but I spent many hours fiddling with firewall and other network settings. Anyway.. hope this helps someone.

                  1. Avatar for jamesachambers

                    Welcome back Mandar!

                    I’m very glad you got it working! Thanks for stopping by and posting these instructions.

                    This is one of the things that comes up a lot and it is one of the more difficult things to troubleshoot without seeing the setup in person. I guarantee it will help people in the future who may be struggling with the same thing!

  13. Avatar for Paul

    Hey this is awesome!

    I do need some help though…if I edit the server.properties with nano and save it – all my scripts disappear. If I do a “ls” command none of them are there. Does anyone know why? I have recreated it a couple times. With a clean install I can connect and play…but as soon as I modify it, things are gone and because the script is gone, obviously nothing starts.

    1. Avatar for jamesachambers

      Hey Paul,

      At first when I read this I thought maybe there was a syntax error, a quote, or some other special character you might have been putting in server.properties that might make the server choke. The only problem is it doesn’t add up. This would not have any effect on the scripts or the server’s folder contents.

      The only time I’ve ever seen anything like this was when the partition was corrupt or very rarely when a drive/storage device was failing. Usually running a e2fsck on it will clean something like this up. It should find some errors if you scan your partitions with fsck (typically /dev/sda1 [boot] and /dev/sda2 [root], you can list your drives with the command ‘lsblk’). On most distros you can use:

      sudo touch /forcefsck

      to tell your distro to run a fsck check the next time you reboot before mounting the root partition.

      The best way though is to boot into recovery/rescue mode or use the live CD and run e2fsck on your partitions. You can’t fix them when your operating system is mounted/running. Typically it will find and correct some errors, then after a reboot your changes should stick!

      1. Avatar for Paul

        Yeah it is really weird. I am going to try it on unbuntu with a GUI as well. I’ll check the drive…it was an old SSD I found at work….

      2. Avatar for Paul

        Ok – I loaded it up in Ubuntu with a GUI after the drive was tested thoroughly – run the setup script with all defaults, and when the server is running I type stop and it stops.It says it stopped properly. Then I type start but I can tell it does not start properly.
        If I navigate to minecraftbe/mcserver and run ./start.sh – there is no script. There are no scripts in the mcserver folder at all – they were there before.

        All I did was type stop.

        1. Avatar for jamesachambers

          When you stop the server, or edit server.properties it is triggering a write to the disk. Stopping the server for example writes all the changes to disk since the server started up. Even if you never logged on many things still changed like the time of day, etc. Depending on what’s wrong with it’s probably doing something like partially overwriting nearby files stored next to it on the disk.

          The server zip file is extracted first, so it makes sense those would be the last to go and you’d see most of the base files in there. The scripts are pretty much the last thing it sets up, so it makes sense those are what would take the hit. They would be closest to what your drive thinks is “free space” but it sounds like it’s not finding the right place to start writing (hardware issues or corrupt partition, but if fsck is clearing it then it’s likely hardware).

          Any configuration changes you make will be immediately lost too as you originally pointed out. I’m guessing if you try to use this Ubuntu you’re going to see a whole host of problems in other areas eventually. If it’s Ubuntu Desktop browsing the web will probably be enough to start seeing problems pretty quick.

          Just to be clear, none of the scripts or the server itself can do this. The server doesn’t do any kind of rolling back, reverting, or anything like that. It doesn’t know the script files even exist. This is a hardware issue. I bet you can get it to do it just by going in the folder and creating new random files with random gibberish in them for example. Anything that writes to that area of the disk without even running the server should trigger it.

          Did fsck not find anything wrong with it? You may need to scan the hardware itself here like actually scanning for bad sectors. Here’s a guide to try for HDDs: https://www.fosslinux.com/1297/check-hard-disk-for-bad-sectors-and-errors-by-command-line-in-ubuntu-and-linux-mint.htm. There’s some commands that can help like “badblocks” in there!

          If it’s a SSD like an NVMe drive you may need to check it using smartctl like this: https://www.percona.com/blog/2017/02/09/using-nvme-command-line-tools-to-check-nvme-flash-health/

          Let us know how it turns out!

          Edit: Someone else reported this too. What is your OS, version, and what did you pick for the server ports and your server label? I can’t recreate this so far. The other thing I’ve been asking is if you are running SetupMinecraft as sudo (you aren’t supposed to, it sudos itself when it needs to and if it is then your server is actually being installed in the /root folder).

          1. Avatar for Paul

            I used ubuntu server at first – the latest one and then the normal version, again the latest one. The hard drive test I did took a couple hours and was the diagnostic that was a part of the BIOS setup. Everything(ports etc.) was default option. I may have run the script with a sudo reference. I am not sure. I could try that again making sure to watch for that. I did grab the basic bedrock ubuntu server software off the mojang website and use it and everything worked first try – then my kids were happy with what they had for now – so I didn’t re attempt yet.
            Appreciate the follow up. I will let you know what I find.

            1. Avatar for jamesachambers

              Hey Paul,

              Thank you for following up as well! I did add a sudo safety check to the latest version of the script and put it on GitHub just in case as I have done this before on accident and it ended up installing to the /root folder and things were very weird. I’m also completely open to the possibility that the script could be doing something wrong and my goal with it is for everyone to just be able to instantly set up a Bedrock instance with no issues.

              Very curious, I wonder what this is going to turn out to be and if it’s the same thing James is getting. I have not been able to reproduce it yet and it doesn’t seem to happen to most people, but everyone has been giving great feedback and follow ups and I have no doubt we’ll get to the bottom of it!

              EDIT: Right after I posted this I was able to find a problem in the log files James sent me. I think I’ve got it fixed. Thanks for your patience and followups Paul! If you could try it again when you get the chance I’d love to confirm with you that it worked the way it was supposed to this time!

              The problem occurred when you ran start.sh manually. There was a relative path to the backups folder, and instead of pruning that it was pruning your main folder since it was in a different folder than the service starts in. Doh! I was restarting the server using sudo systemctl restart minecraftbe (or your server label) so I couldn’t reproduce it because I wasn’t starting it with start.sh! I’ve now literally coded a hard path that is set when start.sh is created by SetupMinecraft.sh to fix it (and learned an embarrassing lesson frankly). Log rotation was only added 3 days ago so you pretty much found it immediately!

              Thanks again guys, it is appreciated!

              1. Avatar for Paul

                I will try again soon and report back ONLY if it is doesn’t
                work. Right now my kids are in the middle of a world and I have been working a bunch. From reading in here, I would think you got it nailed down though. Thanks again for your help on this issue and the whole project.

  14. Avatar for Ansh

    James,

    Thank you for putting this together. However, I am unable to connect due to my version being different. Is it possible to change the server version?

      1. Avatar for jamesachambers

        Hey Ansh,

        Your Minecraft Bedrock client should say 1.16.200 in the bottom right corner of the main menu screen which is the current version and the server should be the same.

        1.16.4 is the current Java version. If you are running Java you may need to check out my Minecraft Java Server Guide! It works the same as this but it will work with version 1.16.4 since you will have a matching Java server! It’s meant for Raspberry Pis but it works just fine on most distros.

        If you’re absolutely positive you have Minecraft Bedrock (the one for Android, iOS, Switch, Playstation, Xbox and the special “Windows 10” edition from the Microsoft App Store) then you probably enrolled in the RTX beta version.

        Being in the RTX beta is now absolutely pointless because NVIDIA released it on the *main* Bedrock version in 1.16.200 on December 8th.

        If you enrolled in the beta you need to go back into the Xbox Insider app, then you need to unenroll from the beta and go back to normal version. Then you need to delete your Minecraft app and redownload it from the store. This might take a few tries, I had to do it like 5 times before it finally gave me the normal version again.

        There is no dedicated server available for the beta. It was never released, so if you are on the beta all it will do now is make it so you can’t play with any of your friends that aren’t on the PC beta version and can’t host a dedicated server. Hopefully that helps!

          1. Avatar for jamesachambers

            Hey Ansh,

            That’s awesome I’m glad you got it working!

            Thanks for letting us know, I’m always super curious what these issues end up being. It helps me revise the guides/scripts to help others not experience the same problems when they try it and I learn a lot from them. Cheers!

  15. Avatar for Jim

    James,

    This is great! Thank you for putting all of this together.

    I am currently running BDS on a Windows 10 PC and will be using your solution to deploy a linux version. Do you have any information on how to import my map and how to edit the various server properties?

    On the Windows version, this would be the server.properties, permissions.json, whitelist.json, etc. Are these the same file names in linux?

    1. Avatar for jamesachambers

      Hey Jim,

      That’s a really good question that I don’t think I’ve been asked before! The server folders are completely identical other than bedrock_server.exe and bedrock_server.pdb being present on the Windows version vs the flat bedrock_server binary on Linux as well as a libCrypto.so library. My initial gut instinct when you asked this is that you could literally just copy the entire folder over verbatim and then just put the Linux bedrock_server executable and libCrypto.so in a copy of your existing Windows folder. I snagged a screenshot to show the different folder structures:

      Side-by-side Screenshot of Windows vs Linux directories

      Even with it looking so promising I didn’t dare tell you this would actually work until I tried it, so I moved my Linux server over to Windows and just dropped bedrock_server.exe and bedrock_server.pdb in there leaving everything else unchanged. And….

      Minecraft Bedrock Linux to Windows

      It’s working! I’m stranded on top of the exact same tree (which just so happened to be this world’s spawn point) in the dark as I was before I took the server down on Linux. There was a warning when I started the server that detected “corruption” and was going to automatically repair it. I closed the server and opened it again and the warning was gone, so apparently it was successfully repaired.

      I did one last test and sent the server back up to Linux after running it inside Windows. This one fired right up. I didn’t even get the corruption warning / repair going back to Linux. It was just good to go!

      So after testing this, here’s what I would try. First make sure you have backups. Lots of backups. Then install the Bedrock server on Linux using this script. Once that’s done, do a screen -r and close that server and then overwrite the entire folder with your Windows one. Let it replace everything that has a conflict. cp winbackupfolderhere ~/minecraftbe/yourserverlabel should do the trick! I actually just used WinSCP from Windows and SFTP’d into the Pi so I could drag and drop the existing server files on top of the new ones. Hopefully that helps!

      1. Avatar for Jim

        James

        You are a legend – I am going to try this tomorrow!

        I am happy to hear that WinSCP works for this too!

        I have a CIFS that I will mount to linux with the intent to maybe use along side your backup feature.

        I will keep you posted on the progress.

        1. Avatar for jamesachambers

          CIFS is very handy! I just recently added log rotation as a lot of people (including myself) would fill up the storage with backups. CIFS will be great for pulling longer term backups off periodically if you want to save historical snapshots or anything like that.

          Definitely let us know how it goes!

  16. Avatar for Adrian

    Hi there,
    I have a brand new installation but “Unable to connect to world” error from Minecraft PE on android. Any suggestions on how to troubleshoot this please?

    Thanks

    1. Avatar for jamesachambers

      So typically there isn’t too much that can go wrong in the basic setup. What do you see when you type screen -r? Do you see the server console or does it say there’s no screens available?

      Are you using a firewall on your distro? Does your distro have UFW or another firewall enabled or built-in that you have to do something like a ufw allow 19132 to open the Minecraft server port up (may vary based on distro, might have to Google to see if it has a firewall)? Did you use the default ports or put something different in? Is the distro a fresh install or is it doing other things? Are you connecting to your private IP address (something like a 192.x or 10.x) and not your public IP address?

      Is this some sort of shared internet connection like one built into an apartment complex/school/business/etc.? Can you log into the router interface or is it outside your control?

      Are you trying to connect by IP address or are you trying to let the Android server browser autodiscover the server? Can you ping the server, etc?

      It’s almost certainly going to be a configuration issue. This script is several years old at this point and all things equal on a working network with a fresh distro it will fire right up!

      I did test it on Android today just to make sure it was still working. The only trouble I had was the first time I added the server it would not connect. After I force closed Minecraft (by swiping up when you’re in app switch mode) and reloaded it it would. Maybe it’s worth a try to force close it and let it reopen with your server saved in there. This got it in for me.

  17. Avatar for RJDaPirate

    Good Morning James, Are in game chats able to be logged in the daily log file? I’m been told to the server file/logs and extract the gz files. I cannot location a chat log. Requested on your Raspberry PI document chat as well. I used both your scripts to create Java and Bedrock servers for my kids and their friends during COVID-19.

    Had an instant where another parent asked to see the chat log. So far I’m coming up blank.

    1. Avatar for jamesachambers

      Hey RJDaPirate,

      The log files can be seen by going to:

      cd ~/minecraft/logs
      ls
      nano latest.log

      This will list all the logs in the folder. There is a “latest.log” which will be the current log. Then there will be logs organized by date if you need to go back a little ways like this:

      mesh@mesh:~/minecraft$ cd logs
      mesh@mesh:~/minecraft/logs$ ls
      2020-11-06-2.log 2020-11-12-2.log.gz 2020-11-27-2.log.gz
      2020-11-12-1.log.gz 2020-11-27-1.log.gz latest.log

      The gz ones are compressed (a gzip file) and the regular .log files are just plain text. You’ll see the chat messages in those files. To get the messages out of the gz one use this command:

      gunzip 2020-11-12-2.log.gz

      And this will turn it back into a log file. You can open it using sudo nano 2020-11-12-2.log. Hopefully that helps!

      Hopefully that helps!

  18. Avatar for Davco

    Wow! Thank you so much, having no experience with the likes of linux/command line/ip adresses, etc, I actually did it!
    My 12 yo son is super impressed with me too.

    I would like to learn more about customising and adding mods assuming it’s possible

    Would appreciate it if someone could point me in right direction.

    So glad I found your site.

  19. Avatar for Hairstyles

    I’ve been absent for a while, but now I remember why I used to love this web site. Thanks, I’ll try and check back more frequently.

  20. Avatar for David Jackson

    I’ve been using your script for quite some time and it’s great, but now I’m wanting to move to using docker. I’ve been trying to get more and more efficient with my homelab over the last couple of years and I’ve recently migrated most things to a couple of minimalistic, low power, and low cost servers. I’m a beginner with docker and maybe there’s an obvious solution, but do you know of a way to “dockerize” this setup? I’m currently testing with https://hub.docker.com/r/itzg/minecraft-bedrock-server and it’s pretty simple to set up, but It would be nice to have scripts that mimic what your current scripts do. Any help would be greatly appreciated.

    BTW, this thread deserves a donate button imo 🙂

Leave a Comment

Your email address will not be published. Required fields are marked *

Type here..