Running a Minecraft Server ontop of OpenWrt

Hello,

Before I begin- I know this sounds crazy, but I'm looking to do this as a proof-of-concept more than a legitimate thing, as I'm aware of the probably performance implications this is going to have.

Anyways, I'm looking to get Java installed ontop of OpenWrt in an attempt to then run the Java Minecraft Server on that, and then attempt to connect clients on the LAN to that server - even if they're able to connect and barely able to do anything I would consider that a success as I'm not expecting great performance and also come down to the device it's running on.

I went down the rabbit hole a little bit already, searching Google as well as the OpenWrt forums and came across these topics already:

From here, I became aware of the "jamvm" package, and I attempted to kickoff the ol'opkg update && opkg install jamvm to get going and see what happens. I was greeted by this error message:


Installing jamvm (2.0.0-2) to root...
Downloading http://downloads.openwrt.org/snapshots/packages/x86_64/packages/jamvm_2.0.0-2_x86_64.ipk
Collected errors:
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for jamvm:
 *      classpath *
 * opkg_install_cmd: Cannot install package jamvm.
root@OpenWrt:~#

I should also make it known that I have two different architectures I'm hoping to achieve this on. First off, I have an OpenWrt VM running in VirtualBox that is x86_64, and second I have a Linksys WRT32X which I believe is mvebu/cortexa9 if I've got that right, which after I get everything working in VirtualBox I would attempt to replicate on my device, but I'm aware that packages/etc will need to match architecture, meaning there be extra work here.

Back to the topic though, it wasn't clear to me at first but it seems that classpath is actually a package or rather set of libraries that are listed as a dependency for jamvm to work, after I did some Googling on the error and figuring out what classpath actually is.

Dependencies: libc, zlib, libpthread, librt, classpath

Now from here, I did some research on the error as well as manually try to install classpath using opkg (which obviously didn't work) and upon my research here, I found a couple of other posts on the OpenWrt forums where some users came across the similar error, but unfortunately didn't get much of a response or resolution at least as far as I was able to glean from it.

So it seemed that some suggestions were to attempt compiling this package yourself, and unfortunately this is about where my technical prowess stops, and where the tracks and tips provided by users stop. One last thing I did attempt to do, is see if I could find some precompiled IPKs, even if older versions, and attempt to install those on my architecture and pray they work. I found some old IPK archives here:

Now to be clear again, I'm running on 18.06.1 on both my VM and Linksys WRT32X and I'd like to aim for that as my target version (or whatever the current snapshot is at this time).

I attempted to get one of these older IPKs installed, thought I had it but was greeted by the following error:

root@OpenWrt:/tmp# opkg install classpath_0.99-1_x86_64.ipk
Installing classpath (0.99-1) to root...
Collected errors:
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for classpath:
 *      kernel (= 4.14.90-1-17b3c8e6b12d6d6705e1bef6a15f2223) *
 * opkg_install_cmd: Cannot install package classpath.

It seems to want a specific version of the kernel in order to run properly if I'm reading that correctly. I'm assuming the kernel of the version isn't compatible with this older classpath IPK I've found. Additionally the third link I posted which is a mirror was down and unfortunately I wasn't able to test that version, although I'm not very hopeful.

So this is where I'm currently at - if anyone could provide me some assistance or guidance on how to continue down this rabbit hole I would appreciate it! I'm thinking that I may need some help with getting classpath compiled as a package for these two architectures in order to proceed forward. Maybe I've taken a wrong turn somewhere, anywho- I would greatly appreciate any help.

Thank you!

You're on the right path, except for using the old OpenWrt archive.

You'll likely need to compile classpath.

I'd highly suggest a device like a Pi instead, or something that can take a server/mini install of a full Linux; but since you're trying to use OpenWrt specifically:

https://openwrt.org/docs/guide-developer/start

...if you're just testing, install version 15 in a VM where classpath is available. I don't suggest running this as a Minecraft production server, though.

Hope this helps.

Ah, I was assuming it may come down to compiling classpath. Might be an aside question, but is there a reason the jamvm package is provided, but a dependency package is not provided in the OpenWrt repository? A bit odd at least from a regular users perspective, but I'm sure there's more to it that I have no clue about.

Anywho- I was figuring I could probably use OpenWrt 15.05 in a VM since I was actually able to find pre-built IPKs for that in my links I provided above. But, I'd like to as proof-of-concept go all in and get it running on my actual Linksys WRT32X hardware. Unfortunately this hardware was not supported until OpenWrt 18.06.1, and I think it would also be nice to have this running on an OpenWrt 18.06.1 VM as well so that leads me down the path of looking to compile.

I've stumbled upon that link actually ( https://openwrt.org/docs/guide-developer/packages ) in my research and did a bit of reading on it but it seemed a bit of an information overload for what I'm trying to do, at least I think anyways.

If I wanted to compile / install classpath from OpenWrt itself, do you (or anyone) have any sort of guidance on some commands to get going? I think this is where I'm stuck right now, I'd like to build and get this installed but I'm a bit unfamiliar with that process and the documentation is a tad daunting :slight_smile:

Thank you for the reply and information on this!

  • Yes, you just observed why. It was available in version 15.
  • Relevant to you, it may need patching for version 18, likely its not maintained.

I already sent you the link to the developers guide. I would suggest: https://openwrt.org/docs/guide-developer/start#using_the_toolchain

Also, free free to post in the For Developers section in you run into issues compiling.

Am I able to make and compile on OpenWrt itself or do I need a build machine?

I downloaded the SDK to OpenWrt, installed perk (opkg update && opkg install perl) but I'm getting some odd errors at the make menuconfig part:

root@OpenWrt:/tmp/openwrt-sdk-x86-64_gcc-7.4.0_musl.Linux-x86_64# make menuconfig
/bin/sh: tty: not found
/bin/sh: tty: not found
make -s -C scripts/config all CC=cc: build failed. Please re-run make with -j1 V=s or V=sc for a higher verbosity level to see what's going on
make: *** [/tmp/openwrt-sdk-x86-64_gcc-7.4.0_musl.Linux-x86_64/include/toplevel.mk:103: scripts/config/mconf] Error 1
root@OpenWrt:/tmp/openwrt-sdk-x86-64_gcc-7.4.0_musl.Linux-x86_64#

Build machine

https://minecraft.gamepedia.com/Server/Requirements
In short, you're wasting your time. You need to package OpenJDK(JRE) etc and it wont simply run on a device with 512Mb RAM, even 1G is probably a stretch since it also needs a SQL server.

Just do what @lleachii suggested and run FreeBSD/Linux/* instead...

1 Like

so what if I use a Raspberry Pi? I mean, I have a Raspberry Pi 2 with OpenWRT.. I don't use it for anything else... so could it be possible then?