[HOW TO] run a Minecraft Server on your QNAP

Don't miss a thing. Post your questions and discussion about other uncategorized NAS features here.

[HOW TO] run a Minecraft Server on your QNAP

Postby barcode » Sat Mar 19, 2011 10:27 pm

Hi everyone,

I figured out how to make the minecraft server run on the x86 architecture NAS. It's actually quite easy to do, considering I have absolutely no knowledge of the Linux system to begin with, it only took me 3 days to figure everything out. I will not post all the things that didn't work to not confuse anyone, so here we go:

Here's what you need:
    minecraft_server.jar
    JRE QPKG
    Optware QPKG
    Putty


First of all, you need to install the Java Runtime Environment QPKG and the Optware IPKG. On my system, installing the QPKGs worked like a charm.

Next, download the minecraft_server.jar from http://www.minecraft.net and make a new share on your server (using the standard webadmin interface) called

Code: Select all
minecraft_server


and copy the minecraft_server.jar into that folder. If you have already run a server and created your own world, the files appear in a subfolder (usually called "world") of where the server was run and you can copy that to the new locationif you wish, but can do that later after making sure the server runs.

Next, you need to start putty and connect to your machine and do the following:

Code: Select all
ipkg install screen


this will install "screen", which is a small programm that allows you to close putty yet still keep the process you started running, so you can turn your PC off while the server keeps running.

The next thing we need to do is check whether the environment variable path is correct.

Code: Select all
echo $PATH


should produce a lot of bin and sbin folders, but also a reference to some JRE folder, in my case that is /share/MD0_DATA/.qpkg/jre/bin. This wasn't set by the JRE QPKG for some reason, so I had to add it manually:

Code: Select all
export PATH=/share/MD0_DATA/.qpkg/JRE/jre/bin:$PATH


Alright, almost ready! If you now check the PATH again with echo $PATH, it should include our addition. Unfortunately, I haven't figured out yet how to set this automatically after each reboot, but doing it manually works fine as well. Just to be on the safe side, I added the minecraft server path to PATH as well:

Code: Select all
export PATH=/share/minecraft_server:$PATH


I don't think it's necessary, but o well. You can now check whether the path to java has been saved by typing

Code: Select all
java -version


Finally, we now start the server for the first time:

Code: Select all
cd /share/minecraft_server


and then

Code: Select all
screen -S minecraft java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui


And voilà, here it is! You can close putty now and the server will keep running.

When you want to stop the server and have closed the putty window, just open a new one, logon and type

Code: Select all
screen -ls

which shows you the running screens. We named ours minecraft, so it will produce

There is a screen on:
123456.minecraft


so you go back to this screen by typing

Code: Select all
screen -rx minecraft


which will bring you back to the command line of the server where you can then type "stop" which will stop the server and screen as well.

Any comments or additions welcome!

Have fun!

barcode

Edit: It's been asked a few times how to update the server. It's really simple, log in to the shell via putty like explained above, type "screen -rx minecraft" and "stop" to stop the server from running.
BACKUP THE ENTIRE DIRECTORY RIGHT NOW!
Then rename "minecraft_server.jar" (so you can go back to that version just in case), I do this by just adding the version number (minecraft_server_110.jar, for example). Then download the latest "minecraft_server.jar" from the official website and either save it directly to that folder or copy it from wherever you download it to.

That's it. You can restart the server like explained above and off you mine... Version 1.2.x will convert your world save automatically, which may take a while - depending on the size of your world. This has worked on every update since beta 1.4 for me...
Last edited by barcode on Thu Mar 15, 2012 2:57 am, edited 3 times in total.
barcode
Starting out
 
Posts: 22
Joined: Wed Jul 28, 2010 4:54 pm
NAS Model: TS-239 Pro

Re: [HOT TO] run a Minecraft Server on your QNAP

Postby FoolzRailer » Mon Mar 21, 2011 3:49 am

A very nice guide you have made here, though I am having some issues when trying to actually start the minecraft server.

I installed QPKG, JRE, Putty.... I checked that java worked, and exported all the paths put when i try to use the command:

"screen -S minecraft java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui" in PuTTy this is what I get.

<-Xmx1024M -Xms1024M -jar minecraft_server.jar nogui
/var/run/utmp: No such file or directory
Cannot find termcap entry for 'xterm'.
[/share/minecraft_server] #

Any help would be much appreciated!

EDIT: Got it to open the server now, but i keep getting a " Can't keep up! Did the system time change, or is the server overloaded?"


~Jens :)
FoolzRailer
New here
 
Posts: 3
Joined: Thu Feb 04, 2010 3:08 am
NAS Model: TS-210

Re: [HOT TO] run a Minecraft Server on your QNAP

Postby boss302 » Mon Mar 21, 2011 5:06 am

wee it works thx.
boss302
New here
 
Posts: 3
Joined: Thu Dec 10, 2009 6:06 am
NAS Model: TS-410

Re: [HOT TO] run a Minecraft Server on your QNAP

Postby barcode » Mon Mar 21, 2011 4:20 pm

Hi, I'm glad it worked for you guys as well.

I have had the time-change-errors as well, maybe it has to do with the system updating the time automatically over the internet which I believe is set on mine. Since it didn't seem to effect anything noticably I just ignored it. :)

After stopping the server, I couldn't restart it since somehow the PATH was reset and didn't include the PATH I had exported. There might be a way to put all this in a script, but - again - I'm new to all this linux stuff. Again, suggestions are welcome! :D

Cheerz

barcode
barcode
Starting out
 
Posts: 22
Joined: Wed Jul 28, 2010 4:54 pm
NAS Model: TS-239 Pro

Re: [HOW TO] run a Minecraft Server on your QNAP

Postby krstffr » Tue Mar 29, 2011 5:24 pm

Does it run well? Lag much?

When looking around at the http://www.minecraftforum.net/ most people seem to think it's impossible, :( but would be amazing if not!

Oh, and will it run on a 419P?

Thank you.
krstffr
New here
 
Posts: 8
Joined: Thu Oct 01, 2009 2:35 pm
NAS Model: TS-401T

Re: [HOW TO] run a Minecraft Server on your QNAP

Postby FoolzRailer » Tue Mar 29, 2011 8:17 pm

I only have a TS-110 and that is NOT powerful enough to run a Minecraft server. I have a 53/53 connection, so that's not the problem. I just don't think the CPU/RAM are good enough in the TS-110. Don't know about a 419P though.
FoolzRailer
New here
 
Posts: 3
Joined: Thu Feb 04, 2010 3:08 am
NAS Model: TS-210

Re: [HOW TO] run a Minecraft Server on your QNAP

Postby SneakersOToole » Tue Mar 29, 2011 9:46 pm

@krstffr I do not believe it will run on the 419 as the JRE6 QPKG only runs on the intel x86 processor based qnap. Just checked on the QNAP Home page -> Resources -> QPKG it confirms that the JRE is only for intel based NAS'.

Regards,

Sneakers O Toole

PS. Nice work to the OP author on getting minecraft to run on the QNAP! : )
SneakersOToole
New here
 
Posts: 7
Joined: Wed Feb 09, 2011 6:13 am
NAS Model: TS-401T

Re: [HOW TO] run a Minecraft Server on your QNAP

Postby krstffr » Tue Mar 29, 2011 10:20 pm

OK thank you!
krstffr
New here
 
Posts: 8
Joined: Thu Oct 01, 2009 2:35 pm
NAS Model: TS-401T

Re: [HOW TO] run a Minecraft Server on your QNAP

Postby FoolzRailer » Sun Apr 03, 2011 7:47 am

SneakersOToole wrote:@krstffr I do not believe it will run on the 419 as the JRE6 QPKG only runs on the intel x86 processor based qnap. Just checked on the QNAP Home page -> Resources -> QPKG it confirms that the JRE is only for intel based NAS'.

Regards,

Sneakers O Toole

PS. Nice work to the OP author on getting minecraft to run on the QNAP! : )


My TS-110 is not using the intel based JRE, managed to find a working JRE for mine, though it did take some time to find. (Unfortunatly i deleted the files i had, so i can't tell which one i used that worked :/) All i can see if i click it under my QPKG tab is:

Maintainer: Ad'Novea, QNAPAndy
FoolzRailer
New here
 
Posts: 3
Joined: Thu Feb 04, 2010 3:08 am
NAS Model: TS-210

Re: [HOW TO] run a Minecraft Server on your QNAP

Postby barcode » Wed Apr 20, 2011 8:19 pm

krstffr wrote:Does it run well? Lag much?

When looking around at the http://www.minecraftforum.net/ most people seem to think it's impossible, :( but would be amazing if not!

Oh, and will it run on a 419P?

Thank you.

I've only had 4 ppl connected at the same time, but that still worked fine. There is a calculator that estimates how many ppl you can have on your server, which takes into account your bandwidth and memory found here. It said I can run the server for 8 users with my machine. [edit: Just tried it with 2GB RAM and it said I can host for 15 ppl! Doing that makes my connection speed the bottleneck, although I think the CPU would be running on its limit......] There is no lag for me beyond the usual minecraft issues and it still runs like a charm, no one complained about lags so far, so I guess I'm still good. I am contemplating, however, to upgrade my RAM to 2GB sometime soon to stop the NAS from swapping, which I think it does right now. I think I can prevent this by reducing the RAM assigned to the server as well, but haven't played around with that option too much yet, considering the prices for a 2GB I don't think I will, either. Since I don't know when it will stop swapping and how to know that I just run it with 1GB. I tested it with 768 and it still worked, but as a precaution went back to the 1024 setting. I think it swapped in both cases.

As for other NAS models, I don't have the opportunity to test that since I only have one NAS, which now properly fufills all my needs :D I would assume that the smaller ones might have problems with both processing power and RAM, but I am only guessing. Since I literally started with ZERO knowledge of Linux (I didn't even know how to list the files in a directory!) I am glad I got it to work at all after a couple of days and am quite happy to have it working so well...

I have started experimenting with a server wrapper, which hasn't worked yet, but I think that was due to an incompatibility in version history. Even modding the server shouldn't be much of a problem, although I haven't bothered looking into that too much yet.

For all of you who are successfully running the server: Craft on :mrgreen: and beware of the creepers!

barcode
barcode
Starting out
 
Posts: 22
Joined: Wed Jul 28, 2010 4:54 pm
NAS Model: TS-239 Pro

Re: [HOT TO] run a Minecraft Server on your QNAP

Postby jonnymo » Mon May 02, 2011 9:40 am

FoolzRailer wrote:A very nice guide you have made here, though I am having some issues when trying to actually start the minecraft server.

I installed QPKG, JRE, Putty.... I checked that java worked, and exported all the paths put when i try to use the command:

"screen -S minecraft java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui" in PuTTy this is what I get.

<-Xmx1024M -Xms1024M -jar minecraft_server.jar nogui
/var/run/utmp: No such file or directory
Cannot find termcap entry for 'xterm'.
[/share/minecraft_server] #

Any help would be much appreciated!

EDIT: Got it to open the server now, but i keep getting a " Can't keep up! Did the system time change, or is the server overloaded?"


~Jens :)



What did you change to get it running the server - I got the exact same message :(
jonnymo
First post
 
Posts: 1
Joined: Mon May 02, 2011 3:16 am
NAS Model: TS-239 Pro II

Re: [HOW TO] run a Minecraft Server on your QNAP

Postby homenas » Tue May 17, 2011 12:28 pm

I have the same problem. Worked once and then this error is consistently blocking the screen command.
homenas
New here
 
Posts: 3
Joined: Tue May 17, 2011 12:18 pm
NAS Model: TS-259 Pro

Re: [HOW TO] run a Minecraft Server on your QNAP

Postby homenas » Tue May 17, 2011 12:49 pm

Solved it with

ipkg update
ipkg install screen
ipkg install ncurses
export TERMINFO=/opt/share/terminfo
homenas
New here
 
Posts: 3
Joined: Tue May 17, 2011 12:18 pm
NAS Model: TS-259 Pro

Re: [HOW TO] run a Minecraft Server on your QNAP

Postby StarWolf » Sat May 21, 2011 10:11 am

I got it up and running. However I cannot delete the world folder, and copy over my files. What can I do!?
StarWolf
New here
 
Posts: 3
Joined: Tue Apr 21, 2009 11:58 am
NAS Model: TS-439 Pro II

Re: [HOW TO] run a Minecraft Server on your QNAP

Postby barcode » Mon May 23, 2011 2:48 pm

Try using WinSCP to copy files to the QNAP....
barcode
Starting out
 
Posts: 22
Joined: Wed Jul 28, 2010 4:54 pm
NAS Model: TS-239 Pro

Next

Return to Miscellaneous

Who is online

Users browsing this forum: No registered users and 0 guests