How to install MineOS-node in a jail (alternative to using the MineOS plugin)

bal0an

Explorer
Joined
Mar 2, 2012
Messages
72
This recipe still works for TrueNAS 12.2-RELEASE jails. Migration from 11.3-RELEASE using iocage upgrade -r 12.2.-RELEASE mineos-jail failed, so I decided to setup a new jail and migrate the servers.

I used the UI for creating the new jail. It should be roughly equivalent to:
Code:
iocage create -n mineos-jail -r 12.2-RELEASE
iocage set mount_procfs=1 boot=on allow_raw_sockets=1 mineos-jail
iocage start mineos-jail

The linprocfs flag does not exist but is required. It needs to be added by
Code:
mount -t linprocfs linprocfs /mnt/tank/iocage/jails/mineos-jail/root/usr/compat/linux/proc

which I added as a POSTINIT scripts of the TrueNAS host. Otherwise the WebUI fails to work properly.
I created my users using parameters (instead of interactively):
Code:
pw user add -n john -G games,wheel -m -s /usr/local/bin/bash

In the webui for a minecraft server you need to use the the group john to hide your servers from other users. Use group games in your servers if you want them visible to others. My three sons have a use case if one wants to set up a "private" server for himself and his friends.
 
Last edited:

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776

bal0an

Explorer
Joined
Mar 2, 2012
Messages
72
Setting linprocfs using iocage works on TrueNAS 12.0, it is not available through the UI, though.
Also, I wonder where mount_linprocfs actually mounts the filesystem, and whether it will be visible at /usr/compat/linux/proc?

Truenas jail properties.png
 
Joined
Jul 10, 2016
Messages
521
Hmmm... you are correct; both flags mount_procfs and mount_linprocfs do not show in the UI of TrueNAS-12.0-U1
This is a regression from FreeNAS 11.3. Use the command line as per @Patrick M. Hausen 's post above until this gets sorted out.

iocage mounts procfs on /proc and linprocfs in /compat/linux/proc in your jail.

Code:
➜  ~ mount | grep procfs | grep mineos
procfs on /mnt/ssd/iocage/jails/mineos/root/proc (procfs, local)
linprocfs on /mnt/ssd/iocage/jails/mineos/root/compat/linux/proc (linprocfs, local)


Issue logged in JIRA: https://jira.ixsystems.com/browse/NAS-108867
 
Last edited:

0nighthawk0

Dabbler
Joined
Jan 6, 2021
Messages
21
Just out of interest i've got the server working but have a couple of people on bedrock clients who would like to play.

They could do this with GeyserMC, but i'm just wondering how you handle this. I'm not up to speed enough to know if I can just create a second MC instance and forward the traffic or if GeyserMC will even run on TrueNAS.

I create a new server in the web interface - called mineos-Geyser and then in the jail shell did:

Code:
mkdir -p /usr/local/games/GeyserMC
cd /usr/local/games/GeyserMC
fetch httpsci.opencollab.dev/job/GeyserMC/job/Geyser/job/master/lastSuccessfulBuild/artifact/bootstrap/standalone/target/Geyser.jar
screen
java -jar Geyser.jar


Stop/ edit config.yml

I think I may have an issue

1) because the jail is running NAT. Will i have to translate the bedrock ports as well?

2) Now getting a cert error on the mine-os web interface. Assuming this is something to do with Geyser settings or not running very latest version of the server?

3) Assuming ponting to remote host at 127.0.0.1 in config.yml won't work?

Any help/tips appreciated.
 
Last edited:
Joined
Jul 10, 2016
Messages
521
I haven't heard about GeyserMC, but it looks like it's a proxy that allows a BedRock Minecraft client to connect to a Java Server.

DragonProxy is a very similar solution; a while ago I managed to get that one to work with MineOS, see post #107 in this thread.

You can run multiple servers/instances simultaneously, as long as you increment the port when you create additional servers so that they all listen on a different port. By default, Java servers use port 25565. The unofficial MineOS plugin and instructions in post #1 forward ports 25565 through 25570; if you have more servers and you use NAT, you'll have to add and additional ports to the nat_forwards option.

The same goes for GeyserMC/DragonProxy; you'll also have to forward that port, probably the standard BedRock port 19132.
 

maglin

Patron
Joined
Jun 20, 2015
Messages
299
I just went through this ordeal. I tried to get all the commands in order for someone else attempting to run MineOS on there TrueNAS system.

Code:
iocage create -n mineos-jail -r 12.2-RELEASE
iocage set mount_procfs=1 boot=on allow_raw_sockets=1 mineos-jail
iocage set mount_linprocfs=1 mineos
iocage start mineos-jail
iocage console mineos

pkg
y

pkg update
pkg upgrade -y
pkg install -y py37-rdiff-backup rsync gmake screen git-lite python37 py37-supervisor node npm openjdk8-jre wget bash nano

mkdir -p /usr/compat/linux/proc
mkdir -p /usr/local/games
cd /usr/local/games
git clone git://github.com/hexparrot/mineos-node minecraft
cd minecraft
chmod +x *.sh
./generate-sslcert.sh
cp mineos.conf /etc/mineos.conf
npm install jsegaert/node-userid
echo "CXX=c++ npm install" | sh

cat /usr/local/games/minecraft/init/supervisor_conf.bsd >> /usr/local/etc/supervisord.conf
sysrc supervisord_enable="YES"
service supervisord start

pw user add -n user -G games,wheel -m -s /usr/local/bin/bash

exit
mount -t linprocfs linprocfs /mnt/Tank/iocage/jails/mineos-jail/root/usr/compat/linux/proc
 

0nighthawk0

Dabbler
Joined
Jan 6, 2021
Messages
21
I just went through this ordeal. I tried to get all the commands in order for someone else attempting to run MineOS on there TrueNAS system.

Code:
iocage create -n mineos-jail -r 12.2-RELEASE
iocage set mount_procfs=1 boot=on allow_raw_sockets=1 mineos-jail
iocage set mount_linprocfs=1 mineos
iocage start mineos-jail
iocage console mineos

pkg
y

pkg update
pkg upgrade -y
pkg install -y py37-rdiff-backup rsync gmake screen git-lite python37 py37-supervisor node npm openjdk8-jre wget bash nano

mkdir -p /usr/compat/linux/proc
mkdir -p /usr/local/games
cd /usr/local/games
git clone git://github.com/hexparrot/mineos-node minecraft
cd minecraft
chmod +x *.sh
./generate-sslcert.sh
cp mineos.conf /etc/mineos.conf
npm install jsegaert/node-userid
echo "CXX=c++ npm install" | sh

cat /usr/local/games/minecraft/init/supervisor_conf.bsd >> /usr/local/etc/supervisord.conf
sysrc supervisord_enable="YES"
service supervisord start

pw user add -n user -G games,wheel -m -s /usr/local/bin/bash

exit
mount -t linprocfs linprocfs /mnt/Tank/iocage/jails/mineos-jail/root/usr/compat/linux/proc

Will give it a shot over the weekend on a blank dev box. Thanks!
 
Joined
Apr 16, 2016
Messages
18
I made a new 12.2 jail with MineOs as the latest and greatest code would not build in the older jail, but MineOs will not list my old Minecraft servers.

Everything under /var/games/minecraft/ is owned by mcserver:games

# id mcserver
uid=199(mcserver) gid=199(mcserver) groups=199(mcserver),13(games)

”Refresh Server List” does nothing. “Create New server” had an old Server join the list. “Create New server” again had the new server join the list. If I log off and back in the server list is empty.

Something is also wrong with the “Profiles" as it only list three sources, and sometimes when hitting “Refresh Profile List” it adds another source to the list that it in the log had issues with. If I log off and back in the list is again three sources.

“Import a Server” list everything as expected though.

I have tried to figure out how I did solve these familiar issues in the past but I can’t remember, or if I never knew how it was fixed.

I do not think the log is saying anything useful.
{"level":"info","message":"[test] autostart = false","timestamp":"2021-05-19T19:23:09.166Z"}

{"level":"error","message":"[test] Aborted server startup; condition not met: true","timestamp":"2021-05-19T19:23:09.166Z"}

{"level":"info","message":"[test2] autostart = false","timestamp":"2021-05-19T19:23:09.167Z"}

{"level":"error","message":"[test2] Aborted server startup; condition not met: true","timestamp":"2021-05-19T19:23:09.167Z"}

...
{"level":"error","message":"Unable to retrieve profile: mojang. The definition for this profile may be improperly formed or is pointing to an invalid URI.","timestamp":"2021-05-19T19:25:21.279Z"}

{"level":"error","message":"Unable to retrieve profile: ftb. The definition forthis profile may be improperly formed or is pointing to an invalid URI.","timestamp":"2021-05-19T19:25:21.279Z"}

{"level":"info","message":"[test] Discovered server","timestamp":"2021-05-20T09:50:29.934Z"}
{"level":"error","message":"[test] Create tail on logs/latest.log failed","timestamp":"2021-05-20T09:50:29.934Z"}
{"level":"info","message":"[test] Watching for file generation: logs/latest.log","timestamp":"2021-05-20T09:50:29.934Z"}
{"level":"error","message":"[test] Create tail on server.log failed","timestamp":"2021-05-20T09:50:29.935Z"}
{"level":"info","message":"[test] Watching for file generation: server.log","timestamp":"2021-05-20T09:50:29.935Z"}
{"level":"error","message":"[test] Create tail on proxy.log.0 failed","timestamp":"2021-05-20T09:50:29.935Z"}
{"level":"info","message":"[test] Watching for file generation: proxy.log.0","timestamp":"2021-05-20T09:50:29.935Z"}
{"level":"error","message":"[test] Create tail on logs/fml-server-latest.log failed","timestamp":"2021-05-20T09:50:29.935Z"}
{"level":"info","message":"[test] Watching for file generation: logs/fml-server-latest.log","timestamp":"2021-05-20T09:50:29.935Z"}
{"level":"info","message":"[test] Using skipDirEntryPatterns: world,world_the_end,world_nether,dynmap,plugins,web,region,playerdata,stats,data","timestamp":"2021-05-20T09:50:29
...
{"level":"info","message":"Starting up server, using commit: 603d9c5 fixed forge json profiles list from 404\n","timestamp":"2021-05-20T09:50:30.003Z"}
...
{"level":"info","message":"[WEBUI] mcserver connected from 192.168.1.99","timestamp":"2021-05-19T19:25:21.166Z"}

{"command":"create","server_name":"CreateNewServerTest","properties":{"generate-structures":true},"level":"info","message":"[WEBUI] Received emit command from 192.168.1.99:mcserver","timestamp":"2021-05-20T09:52:28.880Z"}
{"level":"info","message":"[CreateNewServerTest] Discovered server","timestamp":"2021-05-20T09:52:28.886Z"}
{"level":"error","message":"[CreateNewServerTest] Create tail on logs/latest.log failed","timestamp":"2021-05-20T09:52:28.887Z"}
{"level":"info","message":"[CreateNewServerTest] Watching for file generation: logs/latest.log","timestamp":"2021-05-20T09:52:28.887Z"}
{"level":"error","message":"[CreateNewServerTest] Create tail on server.log failed","timestamp":"2021-05-20T09:52:28.888Z"}
{"level":"info","message":"[CreateNewServerTest] Watching for file generation: server.log","timestamp":"2021-05-20T09:52:28.889Z"}
{"level":"error","message":"[CreateNewServerTest] Create tail on proxy.log.0 failed","timestamp":"2021-05-20T09:52:28.889Z"}
{"level":"info","message":"[CreateNewServerTest] Watching for file generation: proxy.log.0","timestamp":"2021-05-20T09:52:28.889Z"}
{"level":"error","message":"[CreateNewServerTest] Create tail on logs/fml-server-latest.log failed","timestamp":"2021-05-20T09:52:28.890Z"}
{"level":"info","message":"[CreateNewServerTest] Watching for file generation: logs/fml-server-latest.log","timestamp":"2021-05-20T09:52:28.890Z"}
{"level":"info","message":"[CreateNewServerTest] Using skipDirEntryPatterns: world,world_the_end,world_nether,dynmap,plugins,web,region,playerdata,stats,data","timestamp":"2021-05-20T09:52:28.890Z"}
{"level":"info","message":"[CreateNewServerTest] Server created in filesystem.","timestamp":"2021-05-20T09:52:28.899Z"}
….
 
Last edited:
Joined
Apr 16, 2016
Messages
18
made a new 12.2 freebsd jail with MineOs in as the latest and greatest code ( fixed forge json profiles list from 404 · hexparrot/mineos-node@603d9c5 · GitHub) would not build in the older jail.

The mcserver user started getting issues with the Web-UI already in the old jail when adding new servers, Web-UI would not list my old Minecraft servers, or the new one, anymore, so I tried to get them back by updating the code, but got other issues aswell with the new code.

I made a new 12.2 jail with MineOs as the latest and greatest code would not build in the older jail, but MineOs will not list my old Minecraft servers.

Everything under /var/games/minecraft/ is owned by mcserver:games

# id mcserver
uid=199(mcserver) gid=199(mcserver) groups=199(mcserver),13(games)

”Refresh Server List” does nothing. “Create New server” had an old Server join the list. “Create New server” again had the new server join the list. If I log off and back in the server list is empty.

Something is also wrong with the “Profiles" as it only list three sources, and sometimes when hitting “Refresh Profile List” it adds another source to the list that it in the log had issues with. If I log off and back in the list is again three sources.

“Import a Server” list everything as expected though.

I have tried to figure out how I did solve these familiar issues in the past but I can’t remember, or if I never knew how it was fixed.

I do not think the log is saying anything useful.
{"level":"info","message":"[test] autostart = false","timestamp":"2021-05-19T19:23:09.166Z"}

{"level":"error","message":"[test] Aborted server startup; condition not met: true","timestamp":"2021-05-19T19:23:09.166Z"}

{"level":"info","message":"[test2] autostart = false","timestamp":"2021-05-19T19:23:09.167Z"}

{"level":"error","message":"[test2] Aborted server startup; condition not met: true","timestamp":"2021-05-19T19:23:09.167Z"}

...
{"level":"error","message":"Unable to retrieve profile: mojang. The definition for this profile may be improperly formed or is pointing to an invalid URI.","timestamp":"2021-05-19T19:25:21.279Z"}

{"level":"error","message":"Unable to retrieve profile: ftb. The definition forthis profile may be improperly formed or is pointing to an invalid URI.","timestamp":"2021-05-19T19:25:21.279Z"}

{"level":"info","message":"[test] Discovered server","timestamp":"2021-05-20T09:50:29.934Z"}
{"level":"error","message":"[test] Create tail on logs/latest.log failed","timestamp":"2021-05-20T09:50:29.934Z"}
{"level":"info","message":"[test] Watching for file generation: logs/latest.log","timestamp":"2021-05-20T09:50:29.934Z"}
{"level":"error","message":"[test] Create tail on server.log failed","timestamp":"2021-05-20T09:50:29.935Z"}
{"level":"info","message":"[test] Watching for file generation: server.log","timestamp":"2021-05-20T09:50:29.935Z"}
{"level":"error","message":"[test] Create tail on proxy.log.0 failed","timestamp":"2021-05-20T09:50:29.935Z"}
{"level":"info","message":"[test] Watching for file generation: proxy.log.0","timestamp":"2021-05-20T09:50:29.935Z"}
{"level":"error","message":"[test] Create tail on logs/fml-server-latest.log failed","timestamp":"2021-05-20T09:50:29.935Z"}
{"level":"info","message":"[test] Watching for file generation: logs/fml-server-latest.log","timestamp":"2021-05-20T09:50:29.935Z"}
{"level":"info","message":"[test] Using skipDirEntryPatterns: world,world_the_end,world_nether,dynmap,plugins,web,region,playerdata,stats,data","timestamp":"2021-05-20T09:50:29
...
{"level":"info","message":"Starting up server, using commit: 603d9c5 fixed forge json profiles list from 404\n","timestamp":"2021-05-20T09:50:30.003Z"}
...
{"level":"info","message":"[WEBUI] mcserver connected from 192.168.1.99","timestamp":"2021-05-19T19:25:21.166Z"}

{"command":"create","server_name":"CreateNewServerTest","properties":{"generate-structures":true},"level":"info","message":"[WEBUI] Received emit command from 192.168.1.99:mcserver","timestamp":"2021-05-20T09:52:28.880Z"}
{"level":"info","message":"[CreateNewServerTest] Discovered server","timestamp":"2021-05-20T09:52:28.886Z"}
{"level":"error","message":"[CreateNewServerTest] Create tail on logs/latest.log failed","timestamp":"2021-05-20T09:52:28.887Z"}
{"level":"info","message":"[CreateNewServerTest] Watching for file generation: logs/latest.log","timestamp":"2021-05-20T09:52:28.887Z"}
{"level":"error","message":"[CreateNewServerTest] Create tail on server.log failed","timestamp":"2021-05-20T09:52:28.888Z"}
{"level":"info","message":"[CreateNewServerTest] Watching for file generation: server.log","timestamp":"2021-05-20T09:52:28.889Z"}
{"level":"error","message":"[CreateNewServerTest] Create tail on proxy.log.0 failed","timestamp":"2021-05-20T09:52:28.889Z"}
{"level":"info","message":"[CreateNewServerTest] Watching for file generation: proxy.log.0","timestamp":"2021-05-20T09:52:28.889Z"}
{"level":"error","message":"[CreateNewServerTest] Create tail on logs/fml-server-latest.log failed","timestamp":"2021-05-20T09:52:28.890Z"}
{"level":"info","message":"[CreateNewServerTest] Watching for file generation: logs/fml-server-latest.log","timestamp":"2021-05-20T09:52:28.890Z"}
{"level":"info","message":"[CreateNewServerTest] Using skipDirEntryPatterns: world,world_the_end,world_nether,dynmap,plugins,web,region,playerdata,stats,data","timestamp":"2021-05-20T09:52:28.890Z"}
{"level":"info","message":"[CreateNewServerTest] Server created in filesystem.","timestamp":"2021-05-20T09:52:28.899Z"}
….

I was able to fix my issues on my old servers in the new jail by simply
Code:
chown -R jimstein:mcserver /var/games/minecraft/* 
This is counter intuitive and the reverse of what I want (mcserver:games) but this allows me personally edit files through a SMB share and mcserver can be used to login and manage the list of Minecraft servers. This setup do not allow me to have anyone else log in to MineOS or anyone else edit the files on the SMB share. This is not needed but I want it to be setup to allow that.

The problem with the Profiles was also solved by doing this.

But still:
* I can not start my old server even if they now are listed in the webgui.
* I can create a new server from import and run it but it will not start on reboot.
* The problems remains with the new servers that never was started that they are not listed in gui. I had one join the server list but it was lost again after restarting the webgui.

The stupidity of computers…
 
Last edited:
Joined
Apr 16, 2016
Messages
18
As an alternative to the ordeal, you can just install the community plugin.
My problem with the MineOs community plugin has always been this:
Error: mineos-plugin-jail had a failure Exception: RuntimeError Message: pkg error: - py37-rdiff-backup : Refusing to fetch artifact and run post_install.sh! Partial plugin destroyed
 
Joined
Jul 10, 2016
Messages
521
This just started a while ago, as the default version of Python switched from 3.7 to 3.8. See the post below.

 
Joined
Apr 16, 2016
Messages
18
That is not the only thing that has updated. The cause of all pain was that Java was updated to openjdk11.

Check your java version.
Code:
java -version

openjdk version "11.0.10" 2021-01-19
OpenJDK Runtime Environment (build 11.0.10+9-1)
OpenJDK 64-Bit Server VM (build 11.0.10+9-1, mixed mode)


To fix that one needs to downgrade:
Code:
pkg delete -y openjdk11-jre
pkg install -y openjdk8-jre


If your jail is v12 you should also do some mounting from the host.
Code:
mount -t fdescfs null /mnt/red/iocage/jails/mineos-12-jail/dev/fd
mount -t procfs null /mnt/red/iocage/jails/mineos-12-jail/proc


The mounting needs to be done permanent by adding it to fstab or as a postinit script
 
Joined
Jul 10, 2016
Messages
521
Most of the profiles now require Java 11. The issue isn't Forge itself, I just tested that, but some of the mods you use or install may be fussier than others. There is another thread in this forum also pointing this out; if I remember correctly that related to a mod that was using sqlite/sqlitejdbc and that pkg is build for Java 8.
 
Joined
Apr 16, 2016
Messages
18
That is good to know. I can keep mineos-jails around for the different needs depending on the age of the profiles used. I mainly is dealing with Forge profiles for 1.12.2 and 1.14.4 btw.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
If your jail is v12 you should also do some mounting from the host.
Code:
mount -t fdescfs null /mnt/red/iocage/jails/mineos-12-jail/dev/fd
mount -t procfs null /mnt/red/iocage/jails/mineos-12-jail/proc

The mounting needs to be done permanent by adding it to fstab or as a postinit script
These are easily available in the jail settings in the UI. No need to script it on the host.
 
Joined
Apr 16, 2016
Messages
18
Actually, the fdescfs flag does not exist in gui. It can be set by
iocage set mount_fdescfs=1 mineos-jail
You can just aswell do when your at it
iocage set mount_procfs=1 mineos-jail
I did also need to create the folders /dev/fd and /proc in the jail before I could mount, ofc.
 
Top