*New 12.2 series Release:
2021-11-21: XigmaNAS 12.2.0.4.8860- released!

We really need "Your" help on XigmaNAS Language packages. Please help us today!

XigmaNAS talks on IRC https://web.libera.chat/#xigmanas, ircs://irc.libera.chat:6697 (TLS) or irc://irc.libera.chat:6667 (plain text)

[HowTo] Minecraft Server

Only Admin's or Moderators can move thread's to this sub-forum.
Nobody should start a new thread on this sub-forum.
Anybody can reply to a thread on this sub-forum.
Forum rules
Set-Up GuideFAQsForum Rules
Post Reply
Hiji56
Advanced User
Advanced User
Posts: 170
Joined: Feb 13th, '21, 11:33
Status: Offline

[HowTo] Minecraft Server

#1

Post by Hiji56 »

"
by alexey123»07 Sep 2012 18:26
Please, before you do something, make a minimum backup Procedure work on embedded and full version. I test on diskless 9.0.0.1 - Sandstorm (revision 249) x64-embedded.
Also please read nas4free""http://wiki.nas4free.org/doku.php?id=do ... owto:jails" wiki about building jail
Difference from wiki: I propose to build a cage for a pseudo device file system because some users have experienced difficulties with the removal jail from disk.
Disk - Name of shared resource. For example - data/minecraftserver/ , mounted to /mnt. Must be created before.
1. Prepare file = 6.8 GB for jail
Code: Select all

Code: Select all

dd if=/dev/zero of=/mnt/Disk/image.bin bs=1M count=6800
mdconfig -a -t vnode -f /mnt/Disk/image.bin -u 10
bsdlabel -w -A /dev/md10
newfs /dev/md10a
mkdir /jail
mount /dev/md10a /jail
Ok, file prepare and mounted into /jail folder. Next step - create jail into
Code: Select all

Code: Select all

mkdir /jail/{work,proto,conf}
cd /jail
mkdir -p conf/root/{etc/rc.d/,usr/bin,usr/sbin}
cd /jail/work
In this step check NAS4Free version. If it built on RC, (such 9.1.x.x ) please download with browser file base.txz and upload it into nas4free /jail/work folder
For x86 ""ftp://ftp.freebsd.org/pub/FreeBSD/relea ... 6/9.1-RC3/""
for x64 ""ftp://ftp.freebsd.org/pub/FreeBSD/relea ... 4/9.1-RC3/""
If NAS4Free version is 9.0.x.x may be use
Code: Select all

Code: Select all

fetch ftp://ftp.freebsd.org/pub/FreeBSD/releases/`uname -m`/`uname -r | cut -d- -f1-2`/base.txz
When files downloaded
Code: Select all

Code: Select all

tar xvf /jail/work/base.txz -C /jail/proto/
cd /jail
cp proto/etc/rc.d/jail conf/root/etc/rc.d/
cp proto/usr/sbin/{jail,jexec,jls} conf/root/usr/sbin/
cp proto/usr/bin/mktemp conf/root/usr/bin/         
cp proto/usr/sbin/{jail,jexec,jls} conf/root/usr/sbin/
cp /etc/resolv.conf /jail/proto/etc/
cp /jail/proto/usr/share/zoneinfo/AREA/TOWN /jail/proto/etc/timezone 
Repair path. /zoneinfo/AREA/TOWN
Next step
Code: Select all

Code: Select all

touch /jail/conf/fstab.proto
touch conf/rc.conf.local
Edit file /jail/conf/rc.config.local with any editor text editor.
### EXAMPLE - MODIFY TO FIT YOUR NEEDS ###
jail_enable=""YES""# enable jails YES|NO
jail_list=""proto""# name of the jails to start ""proto www, mycooljail1...""
jail_proto_rootdir=""/jail/proto"" # path to our jail
jail_proto_hostname=""proto.domain.local""# hostname
jail_proto_ip=""192.168.1.201"" # ip of the jail <------ IP jail, named proto. If NAS4free LAN IP=10.0.0.50, a jail may be have IP=10.0.0.51
jail_proto_interface=""em0"" # Network Interface to use <---- Interface name can be checked into [color=#400040"">Network|Interface Management
jail_proto_devfs_enable=""YES"" # use devfs
jail_proto_mount_enable=""YES"" # mount YES|NO
jail_proto_fstab=""/jail/conf/fstab.proto""# File with Filesystems to mount
OK, now create startup script for jail. For embedded version
Code: Select all

Code: Select all

umount /cf
mount /dev/da0a /cf
touch /cf/jail_start 
Edit /cf/jail_start
Code: Select all

Code: Select all

#!/bin/tcsh -x
#mounting to /jail
mkdir /jail
# mount md - device
mdconfig -a -t vnode -f /mnt/Disk/image.bin -u 10
mount /dev/md10a /jail
# copy jail binaries to /usr
cp -r /jail/conf/root/ /
# link config files to /etc
ln -s /jail/conf/rc.conf.local /etc
#start all jails
/etc/rc.d/jail start
Make it executable
Code: Select all

Code: Select all

chmod 755 /cf/jail_start
Last edited by alexey123 on 07 Sep 2012 18:57, edited 3 times in total.
"
"
by alexey123»07 Sep 2012 18:48
For full version start up file may be placed into any place, such /mnt/data. Create jail_start here with content
Code: Select all

Code: Select all

#!/bin/tcsh -x
mdconfig -a -t vnode -f /mnt/Disk/image.bin -u 10
mount /dev/md10a /jail
cp -r /jail/conf/root/ /
/etc/rc.d/jail start
Make executable
Code: Select all

Code: Select all

chmod 755 /mnt/data/jail_start
copy file
Code: Select all

Code: Select all

cp /jail/conf/rc.conf.local /etc
Now place into System|Advanced|Command scripts menu postinit script
For embedded - /cf/jail_start
For full - /mnt/data/jail_start
Reboot now NAS4Free and check how jail work. If work, then continue.
Go into jail and install ports
Code: Select all

Code: Select all

mount -t devfs devfs /jail/proto/dev
jexec 1 csh
portsnap fetch extract 
freebsd-update fetch install
Cap coffee.. and whet ports will installed install Java
Code: Select all

Code: Select all

cd /usr/ports/sysutils/screen
make install clean
cd /usr/ports/java/jdk16
make install clean
Installation will stopped, by Java license.. Read message about install , just need download with browser some files (4) and upload its into /jail/proto/usr/ports/distfiles folder.
Code: Select all

Code: Select all

make instal clean
It will stopped for download with browser diablo - file. diablo -----> distfiles folder also.
Code: Select all

Code: Select all

make instal clean
When install ended, test java
Code: Select all

Code: Select all

proto# java
Must be output as java help. Next step create folder for server
Code: Select all

Code: Select all

proto#   mkdir /server
proto#  cd /server
Download bukkit.jar from ""http://wiki.bukkit.org/Setting_up_a_server"" or any another place, any another .jar server and upload into nas /jail/proto/server folder. Rename it as craftbukkit.jar. Create into [color=#0000BF}>/jail/proto/server craftbukkit.sh file and make it executable.
I test file content as an wiki
Code: Select all

Code: Select all

#!/bin/sh
 BINDIR=$(dirname ""$(readlink -fn ""$0"")"")
 cd ""$BINDIR""
 java -Xmx1024M -Xms1024M -jar craftbukkit.jar
But may be usefull file from ""http://tapalla.wordpress.com/2012/08/18 ... s/"Tapalla - page
Not copy-paste from this wordpress page, only read, characters is broken
Make sure your router is forwarding port 25565 (TCP) to your NAS4free server
Now exit from jailCode: Select all

Code: Select all

proto# exit
And test building
Code: Select all

Code: Select all

chroot /jail/proto
cd /server
./craftbukkit.sh
Enjoy.
PS.
Freenas8 guide not working!
Last edited by alexey123 on 20 Sep 2012 10:58, edited 1 time in total.
"
"
by raulfg3»07 Sep 2012 21:59
thanks, good work, I do not need to install, but I apreciate your efforts, and probably others users too.
"
"
by alexey123»07 Sep 2012 22:58
raulfg3 wrote:thanks, good work, I do not need to install, but I apreciate your efforts, and probably others users too.
you would not believe, I ran it on a diskless machine. Only 1 Gig USB-flash.
""http://forums.nas4free.org/viewtopic.ph ... #p4195"See it
I have an idea - I'll do from Java plugin. To work by copy-paste
"
"
by MrPilipo»27 Sep 2012 21:31
any way to make it launch automatically with a way to connect remotely to bukkit console?
Edit:
""http://wiki.bukkit.org/Server_Remote_Toolkit"" -gives the ability to acces bukkit console remotely, works like a charm
Only thing left is to make it start automatically in the bg.
"
"
by UnwiseYoda»18 Feb 2013 05:02
I found this but haven't tested it yet.
""http://www.minecraftwiki.net/wiki/Tutor ... tup_script""
"
Post Reply