I created an Ubuntu 24.04 VM inside Windows 2022 Standard Hyper-V. I am consolidating minecraft games we play as a family onto one Ubuntu server. The address is 10.10.10.9 currently. A new server has replaced it. Notes are still the same. IPv4 and IPv6 changed. I created systemd service files to launch Java Minecraft on boot of Ubuntu. The screen instances stay up for about a minute and crash. I can’t find the reason why. I gave up for now.
Hyper-V configuration of Ubuntu Server for Minecraft
Protecting the minecraft games from outside attacks
The Fortinet Firewall blocks all outside access from these minecraft servers. I made sure no virtual IPs or policies exist. My next plan is to get IPv4 and IPv6 configured on the server. The Fortinet DNS Server will have entries for IPv4 and IPv6. The server has UFW installed on it.
My wife, son, daughter and I play minecraft. I researched the best configuration for 4 players. Currently, I have it set for only IPv4. It is set for 2 vCPUs only per game. Only our Folia multicore server is allowed more vCPUs. Most Java Minecraft games use 1 vCPU for most of the processing.
view-distance: 6 Reduces the number of rendered chunks per player. simulation-distance: 6 Limits the number of chunks that are actively simulated. max-players: 4 Sets the maximum number of players allowed on the server. allow-flight: true Enables flight for players using mods in Survival mode. sync-chunk-writes: false Allows asynchronous chunk saving, reducing server load.
The Ubuntu servers have IPv4 and IPv6 running on them. Java Minecraft has issues with IPv6. I am looking at upgrading the network to 2.5G with adapters that fully support IPv6. Java Micnecraft authentication servers are having IPv6 issues. I added the commands for IPv4. Check out the section above on Install Oracle Java 25 . I spun up a new Java Master Server with 50 GB of root space and 16GB swap partition. It is using Oracle Java 25 (OJ25). All the instances below are working on OJ25. I did this to start upgrading Java Minecraft to 26.1.2. To get OJ25 working, I added to the run.sh /usr/jvm/jdk-25/bin before java. See the Java notes.
sudo useradd -r -m -d /opt/minecraft mcserver
The user that was created for Java Minecraft is mcserver. It is a normal user. No root or sudoers. I set its home to /opt/minecraft. The group is mcserver:mcserver. I boot up this user for setting the screens for 6 instances.
Commands to create the session skyblock and load the fourth Java Minecraft Server
screen -dmS skyblock screen -r skyblock cd /opt/minecraft/skyblock sudo ./run.sh
java_oneblock
10.10.10.9:25585 minecraft_server_1.21.11.jar
Commands to create the session java_oneblock and load the fifth Java Minecraft Server
screen -dmS java-oneblock screen -r java-oneblock cd /opt/minecraft/java-oneblock sudo ./run.sh
A quick backup script for my Hyper-V VMs.
# Import the Hyper-V module Import-Module Hyper-V
# Define parameters $BackupDriveLetter = "E" # Change to your backup drive $VMHost = "localhost" # Change if backing up from a different host $VMNames = @("Bedrock2404_10.10.10.3", "Bedrock2404_10.10.10.4", "Bedrock2404_10.10.10.5", "Java2404_10.10.10.6", "Java2404_10.10.10.7", "Java2404_10.10.10.9", "PaperMC_10.10.10.8" ) # List of VMs to back up
Remove-Item -Path E:\VMBackups -Recurse -Force
# Function to back up VMs function Backup-VMs { param ( [string]$BackupDriveLetter, [string]$VMHost, [string[]]$VMNames )
foreach ($VMName in $VMNames) { # Export the VM Export-VM -Name $VMName -Path "E:\VMBackups\$VMName" } }
# Call the backup function Backup-VMs -BackupDriveLetter E -VMHost $VMHost -VMNames $VMNames