About Me

Once you've Installed NetBSD

Clara and I run Minecraft on our home FreeBSD server in a jail, which keeps Java and other dependencies contained in one place. It is possible to run the server from any device that supports Java and Java-related software, including Linux and possibly even NetBSD although I haven't yet tested NetBSD.

I couldn't let go of it! The good news is that you can indeed run an Minecraft server on my other favorite OS as well. This post explores how I went about it, though I'm sure there are other options.

Getting Java installed

After you've installed NetBSD and have configured networking and enabled pkgin, you require an OpenJDK to run Minecraft.

Minecraft 1.17 and up requires OpenJDK 17, but OpenJDK 16 is the latest version in the most recent snapshot as of July 2022. To confirm, search:

If it's 16 you can still pull current packages by opening the repo file.

and changing the repo URI, in my case from 9.0 to 9.0_current:

This was a fantastic project. Game blog He has done a lot of great work for the NetBSD community, and I feel I owe him at least an espresso or a drink the next time I'm able travel to Japan.

Now we can put it in, together with other tools that are useful:

Running Minecraft

This location is a good one to run Minecraft just like any Java-enabled server. I combined all my files:

Log in as my local user and start:

We can now start!

Java throws an error about a system that isn't supported, something that NetBSD users are aware of. It is safe to ignore, based on my testing.

And don't forget to accept the EULA after you have run the server the first time:

Create a launch script

I like to link the most recent version of the server to minecraft.jar:

You can reference it in launch.sh using tmux for the server to persist after disconnecting. I also like to give Minecraft more memory:

Now we're good to go!

Follow-up

The next step is to create a proper chroot environment that supports Java and Minecraft. This is similar to the FreeBSD jails. I've had a complete NetBSD exploration of chroots in the works for years; I'll tidy up and make it available soon.