How to Install Minecraft Server on Windows 8 Hyper-V Ubuntu Server in 60s

7
Install Minecraft on Hyper-V Ubuntu Start Minecraft
Install Minecraft on Hyper-V Ubuntu Start Minecraft

We have had many readers ask how to setup their own Minecraft server. For those that do not know, Minecraft is a breakout hit in gaming selling many millions of copies yet starting from an independent developer. One of the great things about Minecraft’s independent route to market is that there is no “corporate” server requirement which plagues games like recent installments of Call of Duty. That means users are free to setup their own Minecraft servers at home, colocated or elsewhere. The model is very reminiscent to the Counter-Strike scene in the 2000-2001 time frame. Today we are going to show how to install Minecraft server on Windows 8 Hyper-V Ubuntu. This is an easy setup that uses little power and is great for hosting LAN games.

Test Configuration

To make this as relevant as possible to the test case my personal workstation is going to be used.

  1. CPU(s): Intel Core i7-3930K
  2. Motherboard: ASUS P9X79 WS
  3. Memory: 32GB (8x 4GB) G.Skill Ripjaws X DDR3 1600
  4. Drives: Corsair Force3 120GBOCZ Vertex 3 120GB and 2x Samsung 840 Pro 256GB
  5. Chassis: Corsair Carbide 500R
  6. Power Supply: Corsair AX850 850w 80 Plus Gold
  7. OS: Microsoft Windows 8 Pro with Hyper-V and Ubuntu Server 12.10

One key aspect here is that the machine has a lot of very fast SSD storage. Traditional rotating disks can cause a Minecraft server to hang for players during disk access.

Prerequisite: Install Ubuntu on Windows 8 Hyper-V

Installing Ubuntu on Windows 8 Hyper-V is very easy. Hyper-V integration components are included with the major distributions making installation faster than with CentOS and many other distributions. Use the guide on how to install Ubuntu on Windows 8 Hyper-V in a few minutes. For a Minecraft server it is suggested that one uses the x64 server version. The workstation version uses more disk space and requires additional memory to run. Since Minecraft is very memory intensive, it is best to waste memory.

One major note here is that one wants the Minecraft server  Hyper-V data store to run on a SSD.

Install Minecraft Server on Windows 8 Hyper-V Ubuntu in 60 seconds

Now for the fun part, getting a basic Minecraft server running in less than 60 seconds. Of course, if one has a slow Internet connection it may take slightly longer.

The first step to install Minecraft server on Windows 8 Hyper-V is to install java. For this guide we are going to use java7. Use the following command to install java on Ubuntu:

sudo apt-get install openjdk-7-jre-headless

Here is a screenshot of what this will look like (may be slightly different if you already did sudo apt-get upgrade):

Install Minecraft on Hyper-V Ubuntu JAVA
Install Minecraft on Hyper-V Ubuntu JAVA

Now that the Ubuntu server has java installed, you can get the files needed to install Minecraft server. First you will want to create a directory. For a simple server like this, I like to use minecraft-server as my directory so that is:

mkdir ~/minecraft-server

After this one needs to get the Minecraft Server files:

wget -O ~/minecraft-server/server.jar https://s3.amazonaws.com/MinecraftDownload/launcher/minecraft_server.jar

That command is greatly simplified because it uses the same path. Bukkit includes version numbers which makes things a bit more difficult. Here is what this all looks like:

Install Minecraft on Hyper-V Ubuntu Minecraft Standard
Install Minecraft on Hyper-V Ubuntu Minecraft Standard

At this point one has installed Minecraft server on Windows 8 Hyper-V Ubuntu. One really cool thing is that by using this type of installation, you can move it to another Windows 8 Pro, Windows 8 Enterprise, Windows Server 2008 R2, Windows Server 2012 or Hyper-V server machine easily. Just import the virtual machine and you are ready to go on a dedicated server box later.

Now the next step is to launch Minecraft server after it is installed. For this I tend to use the following commands:

cd minecraft-server

java -Xmx2048M -Xms2048M -jar server.jar nogui

That launches a 2GB of RAM minecraft server which most desktops can support. If one wanted to use something like the Microsoft Surface Pro as the Hyper-V host, those numbers should be lowered to 1024M due to limitations with 4GB of RAM. An important factor here is that the more RAM the Hyper-V host has, the more it can allocate the the Ubuntu VM and the Minecraft server. Here is what that looks like:

Install Minecraft on Hyper-V Ubuntu Start Minecraft
Install Minecraft on Hyper-V Ubuntu Start Minecraft

That’s all there was and it only took about a minute to get up and running with the Minecraft server in Hyper-V on a Ubuntu VM. Of course there is a slightly better way.

Scripting the Minecraft Server Installation on Ubuntu

While entering commands is fun, we can use a simple bash script to do the installation. Just log into (using SSH or the Hyper-V console) the Ubuntu VM and fire up a text editor. I use nano a lot so the command would be:

nano minecraft-server-install.sh

Now one can just copy the following lines into the text editor and save/ write out changes.

#!/usr/local/bin/bash
sudo apt-get install openjdk-7-jre-headless
mkdir ~/minecraft-server && wget -O ~/minecraft-server/server.jar https://s3.amazonaws.com/MinecraftDownload/launcher/minecraft_server.jar

Once this is complete, one can run:

sh minecraft-server-install.sh

At which point the bash script will run, download and install java and Minecraft server. For those that want to do this on both Hyper-V and non Hyper-V Ubuntu installations, one can just download that script and complete installations in under 20 seconds each time.

Conclusion

Hopefully that helped. Always open to other suggestions and if we want, happy to do the same with bukkit or similar Minecraft server installations. The really cool thing here is that the installation is very portable since it is in Hyper-V and runs on many machines since Microsoft has brought Windows 8 Hyper-V to the masses.

Feel free to suggest other options.

7 COMMENTS

  1. Guys, I don’t get “How to do something by Captain Obvious” kind of articles. What’s happening to STH?

  2. Yuri – Sorry you are not liking the recent how-to articles. There is only so much news and products we can afford to buy & test. So sometimes we create articles based on projects we have going on or something fun we recently did. The Xen articles are a good example of this. I have been building out a public cloud prototype and am simply documenting it here for others to benefit.

    If there is something specific that you are interested in or you have ideas, we would love to hear them. Please join us on the forums. We have a sub-forum dedicated to main site article ideas.
    http://forums.servethehome.com/servethehome-com-article-suggestions/

  3. Yuri, as Stephen mentioned, feel free to suggest or contribute content that you would like to see.

    Also of significant note: Things that are obvious to one person may not be obvious to others. We get several requests each week on this topic alone.

  4. Well +1 to Yuri, same thougts here. As regular visitor of this site for 2 years I see a downward curve in quality or rather quality of choice of topics. Year-two ago we have articles about 4 sockets motheboards, raid cards test, great articles about ibm1015 for example followed great ebay auction etc… thats what make you really special and unique and you get readers around world(in my case from central eu location). With topics like minecraft or memtest you take this site so to lowend that people start checking if they really are on STH or on some of the billion hw&sw reviews junk sites. Cmon Patrick, you found this site and make it very special for people from IT ranks or highend enthusiastic folks and we was very happy with information we find on you site. But now its feel like you throw your old readers over deck and get simple stuff instead of giving us high quality food we have become accustomed to. Just few my cents…

  5. xena, thanks for the feedback. The next two days will likely have content more in-line with the older content (dual LGA2011 review and a cool projects piece.)

    I started a thread here: http://forums.servethehome.com/servethehome-com-article-suggestions/1672-sth-main-site-direction-april-2013-a.html where we can continue the discussion. Always welcome this type of feedback and is a big reason that we have a dedicated public forum to exactly this topic.

    Also, if you do have ideas for something more relevant, please feel free to join the list of contributors. Always happy for folks to get more exposure on their projects.

  6. As a note for future readers, to install Ubuntu in Hyper-V you CAN install it as a Gen 2 VM, but in order for the install to boot you must disable the “secure boot” option in the Firmware settings of the VM.

    To be clear, you simply create a new VM choosing Generation 2 as the type of VM, but before booting the VM for the first time you need to go into the settings for the VM, and U select ‘require secure boot’ (or something similar). The VM will boot, the install will find all the synthetic devices and use appropriate drivers.

    This has been tested under Hyper-V on both Server 2012 R2 and Windows 8.1 running Ubuntu 14.10.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.