Hosting Minecraft on Hyper-V in Windows 8.1 Pro

Just got a new computer which I hoped would be powerful enough to run both a Minecraft Server and the Minecraft game. And, turns out it is!

Managing servers and stuff tend to be easier in unix though, so I figured I’d try to run it in a virtual machine. First thought of VirtualBox, but then I stumbled upon the fact that Windows 8.1 Pro comes with a Hyper-V Platform built-in. Decided to check it out, and it works fantastic.

At least after I swapped out the virtual hard drive with the SSD from my old computer. Not sure if I set it up wrong, or if Minecraft just really don’t like being inside a virtual hard drive on a regular HDD…

Anyways, here’s what I’ve done for future reference in case I need to set it up again, or if anyone else would like to check it out. Depending on your comfort with command lines, unix, etc, you might need to use some google-fu. Or leave a comment, and I’ll try to help 🙂

Here’s what I use and try to cover here:

Add Hyper-V

  1. Go to Control Panel\Programs\Programs and Features.
  2. Click on Turn Windows features on or off, select the Hyper-V node and everything below it, hit OK and reboot (which I think it’ll ask you to do).

    Windows Features window

Setup Hyper-V

  1. Find the Hyper-V Manager.
    Searching for hyper-v

  2. And open it up for this fun stuff.
    Hyper-V Manager window

  3. Open Hyper-V Settings and change the default folders for Virtual Machines and Virtual Hard Disks (if you want them somewhere else).
  4. Open Virtual Switch Manager and create a new virtual switch of type external and make sure Allow management operating system to share this network adapter is checked. This will briefly cut your network connection, but it comes right back up. Also note that Windows uses slightly longer to connect to your network when booting up because this virtual thing has to boot up too.
    Virtual Switch Manager window

Setup the Virtual Machine

  1. Create a new Virtual Machine, choose Generation 1, at least 5 GB of non-dynamic startup memory, the Virtual Switch you created earlier and Attach a virtual hard disk later..
    (Tried to use 512 MB startup memory and the dynamic memory option, but got weird sporadic kernel hickups and after running the Minecraft Server for a while, it crashed because of lack of memory. Might have been doing it wrong 😛 )

  2. Open up the Settings of the VM.
  3. Make sure that BIOS has CD at the top of the Startup order.
  4. Set Number of virtual processors to 2, or whatever you want.
  5. Add a Hard Drive to IDE Controller 0 and select the Physical hard disk you want to use, which in my case was an unused SSD. Make sure to make the disk offline through Disk Management first, or it won’t show up in the dropdown list.
  6. Download the Ubuntu Server and set it as the Image file of the IDE Controller 1, which should already be a DVD Drive.
  7. Make sure Automatic Start Action is set to Automatically start if it was running when the service stopped, and Automatic Stop Action is set to Save the virtual machine state. This means you can safely restart your computer and your VM with your Minecraft server should come right back up where it was left off.
  8. Hit Ok, connect to the VM and start it up!
    Settings for VM

Install Ubuntu and stuff

  1. Install Ubuntu Server. Just follow the instructions and Google if you need help.
  2. Install Java and Screen.
    $ sudo apt-get install openjdk-7-jre-headless screen

Setup port forwarding

  1. Shut down the VM.
    $ sudo shutdown -h now
  2. Open the Settings for the VM again and go to Advanced Features under Network Adapter.
  3. Switch the MAC Address to Static and hit OK.
  4. Go to your router (or whatever functions as your DHCP server) and make sure the VM has a reserved IP (which is what we needed the static MAC address for)
  5. Forward whatever port you’re going to use for the Minecraft server to the VM, think default is 25565, and apply/reboot router as needed.
  6. If you haven’t already, you might also want to set up some sort of DDNS so your friends don’t need to deal with an unstable IP address when connecting to you from the outside.

Setup your Minecraft Server

  1. Either download the vanilla server, or create one through the ATLauncher and copy it to the VM through SFTP or something. I used the Yogscast Complete Pack and extracted it to /opt/minecraft/yogpack-<i>version</i>.
    Create Server in ATLauncher

  2. Adjust, ops.txt and white-list.txt as needed.
  3. Create with, in the case of current Yogpack version, something like the following command. This will start the server in screen using the current directory name as screen name and giving it 5 GB of memory.
    screen -dmS ${PWD##*/} java -Xmx5G -XX:MaxPermSize=512M -jar cauldron-1.6.4-1.965.21.174-server.jar nogui
  4. Make executable and start it up.
    $ chmod u+x
    $ ./
  5. See my Notes on Minecraft hosting post on how to connect to the screen and make sure it starts up all good. Also try to connect to it with your Minecraft client.


  1. Install Git and Rsync.
    $ sudo apt-get install git rsync
  2. Get, put it somewhere and make it executable.
    $ mkdir -p /opt/backup && cd /opt/backup
    $ git clone minebackup
    $ chmod +x
    $ sudo ln -s /opt/backup/minebackup/ /usr/bin/minebackup
  3. Create ~/.minebackup.conf with something like the following.
    SERVERNAME="Minecraft Server"
    RDIFF_EXCLUDES=(server.log plugins/dynmap/web/tiles/)
  • Check that it works by triggering a backup manually and adjust config as needed if it doesn’t.
    $ minebackup backup
  • If it did, set up a cronjob to do it automatically by running crontab -e. The following will create an incremental backup every 15 minutes and a complete one every Monday at 5 in the morning.
    */15 * * * * /usr/bin/minebackup backup
    0 5 * * 1 /usr/bin/minebackup backup full

    And you’re done!

    Think that should be it anyways? There should now be a Minecraft server running on Hyper-V ready for fun. And it should be backing itself up in case of… not fun. And if you close the Virtual Machine Connection and the Hyper-V Manager, it should still be running in the background. Just reconnect later if you need to do something.

    Definitely room for improvement though:

    • The server doesn’t start up by itself with Ubuntu boots up, but since the VM “lives” through computer reboots that doesn’t really happen unless I make it. In which case I might as well start the Minecraft server too.
    • The backup covers anything going wrong with the server, griefing, et cetera, but the backup should really be going to a different hard drive, a cloud thing or whatever in case the whole VM and it’s drive explodes. Might be possible to change the script to target an external somewhere and I might look into that at some point. I’ll blog if I do. And if you already have a good solution for this, please do leave a comment!
    • There’s no security, grief protection or anything on the Minecraft server in my case. So you might want to think about that. In my case I only give the address to people I know well and the white-list is a handy thing. With a backup every 15 minutes it should be fine either way 🙂

    Questions? Suggestions for improvements? Anything? Don’t be a stranger; leave a comment 🙂