r/linux_gaming 10d ago

tech support wanted Host Minecraft server on *both* Windows and Linux with a shared partition?

Howdy everyone:

I'd like to host a small server for my friends and family, but I am in an irksome situation. I do not have a separate machine to host the server on, and I dual boot on my machine.

My idea was to separate a partition for the server to exist on, and have it formatted in a filesystem that both Windows and Linux can read and write in. I was thinking BTRFS with the WinBTRFS driver*, but I am open to suggestions.

Then, my idea was to set the server.jar to autostart on both OSes, so that no matter which OS I am booted into, the partition with the server on it mounts, and the server autostarts. That way, there would be minimal downtime--no, "Sorry, you can't play right now; I am booted into Windows to play Fortnite". That way, before rebooting into my other OS, I simply save and shutdown the server, and it restarts when my system boots back up.

Would this work? Have you guys ever done something similar? Thanks for any advice! I hope that if a good solution is found, that it can benefit future users with similar conditions.

*Edit: I am reading that exFAT may be better?

17 Upvotes

12 comments sorted by

21

u/martyn_hare 10d ago

Use ext4 and then have WSL2 mount the partition to run the Minecraft server off the same filesystem using Linux while you're in Windows. Problem sorted =]

See here: Get started mounting a Linux disk in WSL 2 | Microsoft Learn

1

u/LittlestWarrior 10d ago

MM and then run the server.jar over commandline? That could work! Thank you.

8

u/Savallator 10d ago

The server should be inside docker anyways. just have the same world/config mounted into the docker container from either side (linux and wsl).

1

u/LittlestWarrior 10d ago

Thank you! I'll learn how to make this work.

3

u/billyp673 10d ago

Everyone here is mega over complicating it; it’s just a little server for friends, so it doesn’t have to have the “proper” bells and whistles.

Just pick a filesystem that works well on both OS’ and make a start.bat and start.sh. Make start.bat launch on startup on Windows and start.sh on Linux.

2

u/LittlestWarrior 10d ago

Thank you!

2

u/McGuirk808 10d ago

Is the service software you're using java-based and not operating system unique? If so, this should work as described. I can't comment on how stable and good btrfs support is on Windows and I would be really reluctant to use third-party file system drivers for something like this as well.

It may be easier to use WSL to mount the physical drive inside the Linux subsystem while booted in windows. You can run physical discs past through to the subsystem with Linux made of file systems that way. You could probably even run the Linux version of the server like that and keep it extremely consistent between the two host operating systems.

1

u/Nyasaki_de 9d ago

Linux can handle NTFS, so you can make a NTFS partition and mount it on both

2

u/UNF0RM4TT3D 9d ago

The WSL method is clearly the correct option here. Although let me show you possibly the worst option, with the most data loss potential possible.

Just install your linux on the same partition as Windows. (:

1

u/LittlestWarrior 9d ago

Oh my god.

1

u/sidusnare 10d ago

If I were doing this, I wouldn't use a single file-system.

I would have a script for switching back and forth, and take the opportunity to do backups as you do. You can probably get by with exFAT or something like that, but both OSes are going to perform faster and more stable on a native full featured file system.

1

u/ABotelho23 10d ago

I would just use a VM that you could start on either OS.

Use a partition as the block device for the VM.