Friday, February 12, 2016

What to do with a Raspberry Pi 2?

I previously turned my raspberry pi B into a Bittorrent Sync server but I wasn't sure what to do with my Pi 2. It has been sitting idle but I heard to you could run a minecraft server on one.

I thought I'd give it a shot on my own first. I know that the official minecraft server recommends 1gb of ram but that's all the raspberry pi 2 has so I figured I should reduce that a bit. First I should free up as much ram as possible. I set the pi to boot straight to a console and I set the memory split at the minimum 16mb. Running "free -m" tells me that there is about 934mb of ram free. I figured I'd leave a bit more for good measure and I'd set the minecraft to use a max of 904mb. Why 904? Well it's evenly divisible by 8. Does that matter? I don't know but that's the way I did it.

Go to minecraft.net and download the jar file. Put that in a folder and make a script to run

"java -Xmx904M -Xms512M -jar minecraft_server.jar nogui"

Replace 'minecraft_server.jar' with the name of the file you downloaded and you should be able to fire up the server. It'll fail and tell you to accept the eula. Open eula.txt and change false to true.

Everything is great, right? No. I kept getting weird glitches in the game and "server can't keep up" errors in the console. More research was needed.

I found a great guide that suggested using the spigot minecraft server. I kind of half followed the guide but basically grab the GUI installer from spigot, run it on a windows machine, and copy the spigot.jar file it creates and put that on your pi. Modify your script to use the spigot.jar instead of the official server jar file and you're good to go. I would do this in a new empty folder since it's going to create a whole bunch of files when you first run it.

On spigot my server seems to be running ok. I edited my server.properties file to limit the users to 3 and shortened the draw distance to 4 from 10. Hopefully that'll save some RAM.

It's kind of a neat use for a pi that was just collecting dust. I'll have to see if I can find someone to try out my server with me. I'm wondering if I leave it exposed to the internet if someone will just find it and come grief it. Everyone I know that's playing minecraft lately is playing it on the console.
Post a Comment