skip to Main Content
How To Host A Minecraft Game On A Linux Virtual Machine

How to host a Minecraft game on a Linux virtual machine

How to host a Minecraft game on a Linux virtual machine
Dedicating an entire Linux PC or server just to run a Minecraft game is a waste of resources. If you’re looking to get a quick Minecraft server running, it’s much better to host it from a Virtual machine.There are many choices for easy virtualization for modern computers. However, Oracle VM VirtualBox is the best, as it’s cross-platform, easy to use, and is free of charge. In this article, we’re going to explain how you can use Oracle’s VirtualBox to host a Minecraft game on a Linux virtual machine.Install VirtualBoxIn this section of the tutorial, we’ll be going over how to install Oracle VirtualBox. To get the app working on your Linux PC, scroll down and follow the instructions that correspond with the OS you use.Mac/WindowsInterested in hosting your virtual Linux-powered Minecraft server on a Mac or Windows PC? If so, you’ll need first to install VirtualBox.Installing VirtualBox on a Windows or Mac computer is quite easy, as both operating systems don’t require the user to interact with a terminal or anything like that. Instead, head over to the official Vbox website, find the download option for your Mac or Windows PC and download the installer file.Once the VirtualBox installer is done downloading, go through the process of installing the program to your computer and move on to the next step of the tutorial!UbuntuVirtualBox on Ubuntu is in the “Multiverse” repository. So, if you want to install it, you must enable it with:sudo apt-add-repository multiverseOnce the repo is added to your Ubuntu system, run the update command on Ubuntu.sudo apt updateFinally, install Virtualbox on Ubuntu with the apt command.sudo apt install virtualboxDebianVirtualBox on Debian is available in the Contributor repository. However, this repo isn’t available by default, so you must enable it first. Here’s how to do it.Step 1: Open up your sources file in Nano.sudo nano /etc/apt/sources.listStep 2: Find all of the lines that start with “deb.” At the end of each line, add “contrib.” You may also want to add the “non-free” line too if you require proprietary libraries and programs.Step 3: Run the update command to finalize adding the new “contrib” and “non-free” lines.sudo apt-get updateNow that “Contrib” is up and running on your Debian PC, you’ll be able to install the VirtualBox app with the following Apt-get command easily.sudo apt-get install virtualboxArch LinuxOn Arch Linux, you’ll be able to install and use Virtualbox if you have “Community” enabled in your Pacman configuration file.  Unsure about how to enable it? Follow the steps below.Step 1: Open up Pacman.conf in Nano and scroll through it to find the “Community” section.sudo nano /etc/pacman.confStep 2: Remove the # symbol from in front of “Community” and the lines below it.Step 3: Save Nano with Ctrl + O. Then, exit with Ctrl + X and return to the terminal. Once back at the terminal, resync Pacman.sudo pacman -SyyuStep 4: With “Community” up and running, you can install VirtualBox on Arch with:sudo pacman -S virtualboxFedoraFedora’s software repositories are open source, and the developers aim to keep it that way. For this reason, you won’t find the VirtualBox application. However, if you enable the RPM Fusion software source, you’ll be able to get it working.To enable RPM Fusion, run these two DNF commands.Note: replace the X with the release number of Fedora you are currently using.sudo dnf install -y
sudo dnf install -yWith RPM Fusion up and running, install Virtualbox on Fedora with:sudo dnf install VirtualBox -yOpenSUSEIf you’re a SUSE user, VirtualBox is very easy to install. Simply open up a terminal and run the following Zypper command.sudo zypper install virtualboxGeneric LinuxVirtualBox has a standalone, downloadable binary for Linux systems that do not have VirtualBox in their software sources. To install it, head over to the download page, grab the latest release and run it to start up the installation process.Ubuntu Server in VirtualBoxOnce VirtualBox is done installing, it’s time to set up Ubuntu server. The fastest way to install and set up Ubuntu server in VirtualBox is to grab a pre-setup appliance.Mac/PC download instructionsHead over to the official download page, click on the “VirtualBox” tab. From there, locate “Download” and get the latest release of Ubuntu Server 18.04.1 LTS.Please do not download Ubuntu Server 18.10 instead of 18.04.1. The networking on 18.10 doesn’t work very well in the latest OSimages release for VirtualBox.Note: you will need 7z (or a decompression tool that can handle the 7z archive format).Linux download instructionsDownload the Ubutnu server image by running the following command;wget -O 1804164.7zInstall the P7zip tool to enable your Linux system to extract 7zip files. Then, extract the archive with your file-manager by right-clicking on 181064.7z, and selecting “extract.”When you’ve extracted the files, open up VirtualBox, click “New,” type “Ubuntu Server” as the name and set the ram to 2048 MB.After setting the RAM, go to the “Hard disk” page and select “Use an existing virtual hard disk file.” From there, browse for “Ubuntu 18.04.1 Server (64bit).vdi” and click “open” to assign it to your VM.Finish the VM creation process by clicking “create.”Tweaking the network settingsRight-click on the “Ubuntu Server” VM in VirtualBox. Then, click “Settings” to open up the settings area for the machine.Once in the settings area, click on “Network.” Then, under “Adapter 1,” change it to “Bridged Adapter.”Install the Minecraft ServerThe VM is working. Now it is time to get the server running. Launch the Ubuntu Server VM (right-click and select “Start”)  and follow the step-by-step instructions below.Step 1: Log into the VM with the user details below.username: osboxespassword: osboxes.orgStep 2: Install the Java runtime environment on your Ubuntu server.sudo apt install openjdk-11-jre openjdk-11-jdkStep 3: Download the latest release of Minecraft Server (Java Edition) with Wget.wget -O server.jartouch eula.txt

echo ‘eula=true’ > eula.txtStep 4: Run your Minecraft server with:sudo ufw disablejava -Xmx1024M -Xms1024M -jar server.jar noguiEasy Minecraft Server startupTo start up your Minecraft server more easily, set up a script in the VM terminal with the commands below.touch ~/

sudo chmod +x
echo ‘#!/bin/bash/’ >>

echo ‘ ‘ >> mc-server-start.shecho ‘java -Xmx1024M -Xms1024M -jar minecraft_server.1.13.2.jar nogui’ >> mc-server-start.shThen, run the server at any time with:./mc-server-start.shConnect to your Minecraft serverTo connect to your Minecraft server VM, you’ll need to know the IP address of the machine. To figure out the IP, head over to this tutorial on IP addresses and read the terminal instruction section of the post.When you’ve got the IPv4 IP address, turn on Minecraft, ensure your PC is connected to the same network as the VM, and click “Add server” in the Multiplayer menu.Read How to host a Minecraft game on a Linux virtual machine by Derrik Diener on AddictiveTips – Tech tips to make you smarter
Source: AddictiveTips
How to host a Minecraft game on a Linux virtual machine


Web Developer

Leave a Reply

Back To Top