Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.

How to install Minecraft server in a jail!

Joined
Mar 25, 2012
Messages
19,154
Thanks
1,849
#42
Well, something is wrong.. it's working for everyone else but you... Somewhere you obviously missed something or did something wrong...
 
Joined
Mar 23, 2014
Messages
1
Thanks
0
#44
Hi, everything worked quite smooth until the Step 7.
buttt then

[root@freenas ~]# jexec -U root 1 sysrc mcwatchdog_enable=YES
jexec: execvp(): sysrc: No such file or directory

same goes with minecraft_enable=yes

as I understand these lines have to be located in rc.conf, but I couldnt find them there.
Im complete noob here, it doesnt seem to me that I missed some step, I tried restarting my FreeNAS and etc.

Plx halp :D
 
Joined
Mar 25, 2012
Messages
19,154
Thanks
1,849
#45
Well, since you have 2 commands in 1 line, yeah.. it's not gonna work. ;)

You do the jexec command to get into the jail. Then you do the sysrc command.
 
Joined
Sep 19, 2011
Messages
20
Thanks
0
#46
Awesome step-by-step. I have been getting my FreeNAS MC server working over the last couple of months when I had a free moment here and there. I did most of the R&D in January before this post existed and got it "mostly" working... just had time to get back to it this week and fully commission the MC server and I can say that FreeNAS makes a wonderful Minecraft server, much better than the Windows box that was doubling as a Home Theater PC.

My setup is slightly different than what the step-by-step instructions gives-- I wish these instructions had been available as I had to piece it together from a couple of other posts I found in various corners of the web. Now I need to go back and re-do some of my setup to match the instructions here as I think it'll be even a bit cleaner (I don't have the nifty "restart" feature and I haven't yet enabled SSH in my Jail so I can log in to admin it-- right now I just go to the FreeNAS GUI "jail" section and get into the jail shell that way. SSH would be much better as I could easily SSH in via my phone with an SSH client to check on the server....)

Anyway, I only just checked back since doing my R&D and basic setup and found this "new" posting on how to set up the Minecraft server-- great work, and I am really loving having my FreeNAS box double as an MC server.
I thought I should give some props to Cyberjock for putting this up there and helping out the FreeNAS community. I had planned on writing up my experiences, but it seems he's beaten me to it-- and saved me the work! (Thanks ;) )
 
Joined
Mar 25, 2012
Messages
19,154
Thanks
1,849
#48
Then you aren't accessing the jail as root.. ;)
 
Joined
Aug 22, 2013
Messages
14
Thanks
1
#49
Great tutorial for refferencing on how to setup things, although i did not use it fully since i was going to do a setup of MineOS on a Debian jail on Freenas (http://minecraft.codeemo.com/ look at the wiki on how to setup on different operating systems).

It's much easier to setup new servers on MineOS.
Since me and my friends play a lot of different mods i wanted an easy to use interface to be able to setup a new server for a new set of mods or modpacks.

Although there are some problems with running it in a Debian jail with networking on the latest minecraft versions (1.7+, and do not know why it's not working might have been a java problem). but everything up to 1.6.4 works without any problems, and since many mods only support up to 1.6.4 it's not been a problem.

Would strongly recomend you give MineOS a try, even though there are some small problems with the web interface, mostly missing features but as the author is updating regularly more and more features are coming.
 
Joined
Aug 23, 2012
Messages
14
Thanks
1
#50
Thanks for the step by step. It worked nicely on 9.2.1.4.1.

As a related topic, those setting up jails that may benefit from multiple independent installations (e.g. independent minecraft servers with different server.properties, different worlds) , I started a thread with a question about the best process for jail cloning within FreeNAS:

http://forums.freenas.org/index.php?threads/what-is-the-recommended-way-to-clone-a-jail.21156/

I have some more evaluation to do with alternative processes to clone jails within FreeNAS (specifically looking at ezjail and standard ZFS snapshot options after confirming that the "warden" tool from PC-BSD, which is included in FreeNAS, worked with just 2 commands (export...import)).
 
Joined
Dec 17, 2012
Messages
85
Thanks
3
#51
I get a sysrc: command not found
newb here, what shall I do next?
EDIT: I am using 9.1.1 if it matters any. thanks.
error3.jpg


error4.jpg
 
Joined
Mar 25, 2012
Messages
19,154
Thanks
1,849
#52
I don't know but your errors are almost always indicative of screwed up permissions.

Also your last screenshot was you trying to install stuff to the FreeNAS install. That never works. ;)
 
Joined
Dec 17, 2012
Messages
85
Thanks
3
#53
when you said permissions were screwed .. set off a bell in my head. After fiddling around for a bit, I ended up deleting the jail and starting over again. It works now, I'm playing from my NAS box. Thanks much for the tutorial!!
 
Joined
Mar 25, 2012
Messages
19,154
Thanks
1,849
#54
woohoo!

Yeah, I was glad you weren't going to ask what was broken.. so much stuff could be broken there's no chance of finding it all.

Now if you are smart you'll set up zfs snapshots for your minecraft dataset so you have nightly semi-backups in case you are griefed or something.
 
Joined
Dec 17, 2012
Messages
85
Thanks
3
#55
thanks much for the advice, I set-up the snapshot.

one thing though, I'm trying to change the server.properties file. I am accessing through CIFS. It won't let me change anything through here and I've changed the permissions to the jail, but that goofs the server up when I do this (this was the problem I was having, not realizing it at first). Would there be another way to access the files, somewhat easy like CIFS, so I can change and swap files as needed w/o messing all the permissions? I saw above about accessing through FTP - but I don't have one installed on the NAS.

thanks again.
 

qwertymodo

FreeNAS Experienced
Joined
Apr 7, 2014
Messages
143
Thanks
64
#56
I followed these instructions and got it all set up and working, but now the jail's IP address is showing up on the main FreeNAS screen as an option for accessing the WebGUI, and it does, in fact, work. Not so much a problem as just strange, but any idea why I can access the WebGUI using the jail IP like that?

Edit: currently running 9.2.1.5
 
Joined
Mar 25, 2012
Messages
19,154
Thanks
1,849
#57
thanks much for the advice, I set-up the snapshot.

one thing though, I'm trying to change the server.properties file. I am accessing through CIFS. It won't let me change anything through here and I've changed the permissions to the jail, but that goofs the server up when I do this (this was the problem I was having, not realizing it at first). Would there be another way to access the files, somewhat easy like CIFS, so I can change and swap files as needed w/o messing all the permissions? I saw above about accessing through FTP - but I don't have one installed on the NAS.

thanks again.
Yeah, the best bet is to either edit the file from SSH inside the jail itself or plan to do something like FTP or SFTP. I'm doing CIFS right now with 9.2.0, but starting with 9.2.1(and in particular Samba4) there is no easy way to do what you(and I) want.

I followed these instructions and got it all set up and working, but now the jail's IP address is showing up on the main FreeNAS screen as an option for accessing the WebGUI, and it does, in fact, work. Not so much a problem as just strange, but any idea why I can access the WebGUI using the jail IP like that?

Edit: currently running 9.2.1.5
Yep. Completely normal and has to do with how the network stack works between FreeNAS and the jail(s).
 
Joined
Jul 22, 2014
Messages
6
Thanks
0
#58
Hi,

Sorry to drag this month old thread back up. It is really the only one which has detailed information within it.

I have gone through the whole installation process multiple times using 9.2.1 and 9.2.0. I am currently running 9.2.0. Installation has gone perfectly fine, no issues along the way. However, I simply cannot connect to the server through minecraft.

I am going to multiplayer within Minecraft and direct connection. My jail for this server is on 192.168.1.17. So I am putting that into the box within mine craft and I am getting this failed to connect to server message: "java.net.ConnectException: Connection refused: no further information:".

I can also ping the server from my local PC using CMD and I receive replies from the server.

Was just wondering if anyone else had this or knows a route around it?
 
Last edited:
Joined
Mar 25, 2012
Messages
19,154
Thanks
1,849
#59
I've seen this error on friend's computers. The problem is that the number of reasons why you can get that error is almost infinite. In essence, if *anything* is broken you'll get a crappy non-useful error like that one.

So you're kind of on your own unfortunately.
 
Joined
Dec 17, 2012
Messages
85
Thanks
3
#60
thepokemon kid -
If you're getting the java.net.ConnectException error, as I did, with all else you listed is "fine" (ping server ok) then it's most likely a permission thing. I simply erased the jail completely and started over, but I did not change any of the permissions after the above directions state to enter the following commands:

# chmod +x /usr/local/etc/rc.d/mcwatchdog
# chmod +x /usr/local/etc/rc.d/minecraft
# chgrp -R wheel /usr/local/etc/rc.d
# chmod -R 777 /srv
# chown -R root /srv

# chgrp -R minecraft /srv
# sysrc mcwatchdog_enable=YES
# sysrc minecraft_enable=YES
# sysrc sshd_enable=YES

This is where I was messing up and did not realize, I was changing permissions so I could read/write to the folder through CIFS. Permissions are very finicky!

I am FTP'ing into the server folder now to change and update when necessary.

I hope this helps.
 
Last edited:
Top