Wednesday 1 January 2014

Use Screen to keep Minecraft Live

in my last post I installed a Minecraft server on my linux box.   Problem is that this is created from a ssh login from the laptop, which then dies when I disconnect.  Solution : use Screen

Reference I used is https://www.digitalocean.com/community/articles/how-to-install-and-use-screen-on-an-ubuntu-cloud-server

ssh into the minecraft server (as in previous post).  Then install screen
sudo apt-get update
sudo apt-get install screen
to start a new screen session
screen
then run minecraft in it
screen -S "Minecraft server"

java -Xmx1024M -Xms1024M -jar minecraft_server.1.7.4.jar nogui
to detach from this session
ctrl-a d
then you can continue to do other things in terminal.  When you want to reconnect, ssh back in and type
screen -r
brilliant!

Minecraft Server

So the kids have really started getting into Minecraft over the last months - now installed on two laptops - paid for by Christmas money, but they cant play together.   Solution : install a minecraft server on Deb's old laptop which is currently running Ubuntu sitting on a shelf in the garage waiting for Dylan to back-up with Crashplan.

So, here we go.

Instructions I used were based on https://www.digitalocean.com/community/articles/how-to-set-up-a-minecraft-server-on-linux

ssh into the linux box from my mac Air
pauls-air:~ paulwilliams$ ssh paul@paul-linux
paul@paul-linux's password: icn.......
Install java as it is not installed by default in Ubuntu (remember to update first!)
sudo apt-get install default-jdk
Then - create a user to host minecraft, add to sudo list and make a directory for it.
useradd minecraft
sudo adduser minecraft sudo
mkdir minecraft
Now, time to download minecraft server jar.  The article recommends
wget https://s3.amazonaws.com/MinecraftDownload/launcher/minecraft_server.jar
but I found that this downloaded server version 1.5.2 which was incompatible with the kids latest minecraft version (1.7.4)  I therefore used
wget https://s3.amazonaws.com/MinecraftDownload/versions/1.7.4/minecraft_server.1.7.4.jar
and then to start the server
java -Xmx1024M -Xms1024M -jar minecraft_server.1.7.4.jar nogui
note that the server will not appear in the listing on minecraft - you have to connect directly using the ipaddress of the minecraft server.

Boom - kids are playing!