Jump to content

  • Curse Sites
Become a Premium Member! Help
Latest News Article

How to properly setup your own Server


  • Please log in to reply
1 reply to this topic

#1

zakamusthegreat

Posted 08 April 2011 - 01:24 PM

Creating your own minecraft server
By Zakamus


First and foremost, this process is not for those who are easily frustrated by technology / non-technical people. Secondly, this guide uses a wholly Windows environment. I have not experimented with a Linux server system (more complicated), although it is 100% usable as the minecraft server program is operating system unspecific (java FTW).

If you have attempted to set up your own minecraft server on any of your home machines only find that playing within the game world is impossible due to lag, this is the answer to your issue. The minecraft server application is very noisy, very memory intensive and wholly intolerant of other services running on the same machine. Hopefully some development work will be done in the future to make this guide irrelevant, but none the less the problem exists. The answer is clever engineering.
The answer that I had found to this quandary is virtualization. The reason I went down the virtualization route is the TCO (Total Cost of Ownership) of the hardware that Minecraft will run on. When I first embarked on this endeavor, I did not have a dedicated server machine, I had to take advantage of another machine on my network. If this fits your scenario please see section A. If you have a spare machine, but want to do other things than use it for a minecraft server ONLY please proceed to section B. If you would like to dedicate a hardware machine to running minecraft (large amount of connections) please see section C.

Section A.
For those of you out there without spare machines laying around with several GB of memory in them, the answer that you are looking for is Virtualization on an already setup machine. Microsoft currently publishes 2 products that are FREE to the public that can accomplish a semi-permanent to Permanent installation of a minecraft server. These Products are Virtual PC and Virtual Server 2005. For those of you who have never played around with Virtualization technologies, the following will be a crash course in virtualization technologies.

Virtualization allows you to run multiple “virtual” computers on one physical box. Using some pretty sick-ass engineering these “virtual machines” are allowed to talk to the hardware as through what is called the “hypervisor.” This allows the hardware to touch by virtual machines, without affecting the “host machine.” The interaction of minecraft within an environment where other services are running is what kills its ability to respond. This is why Virtualization is used in our deployment. Note: there are a large amount of Virtualization technologies in the market. In my experimentation, I have only used the Microsoft offerings.

Depending on the nature of the server that you want to setup will depend on what virtualization product you choose. If you only want to have the minecraft server up when you explicitly start it, and do not plan to have it up very often, Virtual PC is a preferred choice. Virtual PC can run concurrently with your desktop running minecraft (not recommended) or on another Machine. If you choose to run it on the same computer that is running the Minecraft client you MUST take memory and processing power into consideration when planning the implementation of the Server.

If you are planning on having the minecraft server run continuously, but must use a computer that cannot be dedicated to the server role, Virtual Server 2005 is the best option for this installation. Virtual Server 2005 can run concurrently with your desktop running minecraft (not recommended) or on another Machine. If you choose to run it on the same computer that is running the Minecraft client you MUST take memory and processing power into consideration when planning the implementation of the Server.

The setup and deployment time of your minecraft server will much shorter with Virtual PC than with Virtual Server 2005. Keep in mind that VMs and Virtual Hard Disks can be transported between VPC and VS2005 so if you choose to try this out on Virtual PC and later move to a more dedicated installation with Virtual Server 2005, this is pretty painless (it’s how I did it).

Take some time to learn and explore whatever program you choose to use.
Virtual PC Download Link (http://www.microsoft...a2-2dc0b40a73b6)
Virtual Server 2005 Download Link (http://www.microsoft...c4-1e6e218acce4)

Note: A snag that I ran into when working with virtual machines and connecting them to the network was Virtual Machine Network Services not being installed on my network adapter. Once your offering of choice is installed, make sure that is listed on your adapter settings and checked. If not, install it and check the checkbox.

The following will be a brief explanation on what virtual Machine Settings to use when creating a VM. There are a large amount of settings that can be created and used, but are not explained here. Google is your friend.
Create a new Virtual Machine; Assign it ATLEAST 1.5 GB of ram. If you are not able to assign this much ram, stop here, your server will not function properly. I chose to play it safe with 2GB of ram for my VM. This leaves enough room for the Minecraft server to run and the OS to support it without incident. For your VHD, a Dynamically Expanding Disk is fine. If you choose to go the route of a Fixed Disk, 10GB will be enough space to support both the OS and any number of Minecraft worlds that you choose to create. If you are using VS2005 you will be able to choose to connect your VM to a network. Choose the one that connects directly to your LAN, not any internal NAT.

In VPC you will need to edit your VM settings after it is created to properly setup the network.
Once your VM is setup you will need to install a guest OS. For the methods described in this section, you do NOT have the ability to install 64-bit OS offerings. In this method I chose to install Windows Server 2003. You can use an evaluation copy of Windows Server 2003 for a limited amount of time as a fully functional OS. You can use windows XP/Vista/7 as well for this, but unless you want to spend a few hours turning EVERY SINGLE THING OFF in them, a server OS is by far the best choice.

The installation for Windows server 2003 is fairly straightforward. The only thing that I will note here is to ENSURE that you assign it a static IP OUTSIDE the range of your DHCP scope. Failure to do this will result in NOOB branding. This is the IP that you will be forwarding ports to in your router.

Once Windows server 2003 is installed follow the instructions and update the HELL out of it. There are a large amount of updates available for a fresh windows server 2003 installation and these will take quite a while to install.
In order for minecraft to be accessible on your network or over the internet you will need to allow the port in the firewall. Make a new rule in the windows Firewall setup to allow whatever port you choose to use.
Once the firewall is update, you will need to install Java. (http://Java.com).

Once java is installed, Download and execute the server executable from http://minecraft.net. If all is configured correctly, you should be able to connect from any computer on your LAN to the Minecraft server and access it.
Once this is complete, forward the ports on your router to the corresponding IP address and port that you have selected. This will make your computer internet Accessible. If you don’t know how to complete this, I really don’t know why you read this far.

Note: While I haven’t yet implemented this, a small snippet of code can be used to execute the server as a Windows Service, allowing automation in the face of an unexpected server restart.

Section B.  
IF you have a server that you use for other things like file sharing / other game servers, but want to host a minecraft server and are having trouble getting it to not lag, Microsoft Server 2008 Hyper-V technology may be the answer to this. Hyper-V is the next generation of virtualization technologies from Microsoft. Before you fill up this thread with VMware vs. Hyper-V, that discussion belongs elsewhere. Hyper-V is an enterprise class technology far superior to VPC and Windows server 2005. The increased power of Hyper-V comes at a cost. A Hyper-V host must be installed with Windows Server 2008 and is not recommended for a PC that is a daily use PC. For those of you who have never played around with Virtualization technologies, the following will be a crash course in virtualization technologies.

Virtualization allows you to run multiple “virtual” computers on one physical box. Using some pretty sick-ass engineering these “virtual machines” are allowed to talk to the hardware as through what is called the “hypervisor.” This allows the hardware to touch by virtual machines, without affecting the “host machine.” The interaction of minecraft within an environment where other services are running is what kills its ability to respond. This is why Virtualization is used in our deployment. Note: there are a large amount of Virtualization technologies in the market. In my experimentation, I have only used the Microsoft offerings.

Before going forward the setup of Hyper-V is for advanced users. There is a large amount of configurations available for this; I am simply sharing my setup.

Firstly we will cover system requirements / recommendations.

The point of using a hyper v setup is that you will be doing other things with your sever than allowing your friends to punch dirt with you. When deploying your virtual environment, figure out what you are going to be doing with it. Remember that each virtual machine will require an OS so partitioning each role is not effective for the average home user. Most people are going to be serving files (music / video) in addition to the Minecraft server. My recommendation is to use the HOST instance for all your normal apps and sandbox the Minecraft server into its own VM. This setup has worked best for me.

My recommendations are using at least a Dual Core processor computer 2.0 GHZ or faster with 3+ GB of DDR2. Machines slower than this will experience poor performance. It is recommended for this setup to use 2 hard disks for performance.

For this setup we will be using Windows Server 2008 R2. One of the neat features of 2008 is its ability to be installed in a CORE configuration for maximum density. THIS IS A FEATURE DESIGNED FOR DATACENTERS, NOT HOME USERS. UNLESS YOU’RE ALREADY AN EXPERT WITH WINDOWS SERVER ADMINISTRATION DO NOT USE THIS INSTALLATION MODE. THIS ROLE IS UNSUPPORTED BY MOST APPLICATIONS AND DOES NOT INCLUDE A GUI. For my setup I chose to run the Host machine with a full installation of windows server 2008 and a VM of Windows server 2008 core for the Minecraft.

Note: Microsoft has published a version of Hyper-V Server that does not require a License for Windows Server 2008; however it does not provide the ability to use the Host method of providing services. This product was never tried in my environment.

Once Windows Server is installed, you will need to finish the configuration (activation, computer name, IP ADDRESS)
Once this step is completed, you will need to install the Hyper-V role. Installing this role requires multiple restarts and reconfigures the OS to sit on top and support the Hypervisor.  Once the Hypervisor role is fully installed you can use the Hyper-V manager in the Administrative Tools to setup and create your virtual Machine. The New Virtual Machine Wizard will walk you through creating a new VM with a new VHD. The system requirements for the WS 2008 VM are slightly different than in VS 2005. If using a full installation of Windows Server 2008 (not a Core Install) the image is GIGANTIC. My recommendations for VM specifications are 2048 MB of ram and a 40GB dynamically expanding drive.
Once the VM is created you will need to install Server 2008 on it.

Once Windows Server is installed, you will need to finish the configuration (activation, computer name, IP ADDRESS)
In order for minecraft to be accessible on your network or over the internet you will need to allow the port in the firewall. Make a new rule in the windows Firewall setup to allow whatever port you choose to use.

Once the firewall is update, you will need to install Java. (http://Java.com).

Once java is installed, Download and execute the server executable from http://minecraft.net. If all is configured correctly, you should be able to connect from any computer on your LAN to the Minecraft server and access it.

Once this is complete, forward the ports on your router to the corresponding IP address and port that you have selected. This will make your computer internet Accessible. If you don’t know how to complete this, I really don’t know why you read this far.
Note: While I haven’t yet implemented this, a small snippet of code can be used to execute the server as a Windows Service, allowing automation in the face of an unexpected server restart.

Once you have tested that your server is working on both the LAN and over the internet (Phone a friend). I recommend changing the server to ALWAYS start in the Virtual Machine Settings.

That’s all there is to it, you have a working minecraft server without the bottleneck of interfering programs.


Section C.
You have dedicated hardware, Install Windows Server 2008. Install Minecraft Server.

Register or log in to remove.

#2

OlDrunk
    OlDrunk

    Coal Miner

  • Members
  • 145 posts
  • Location: Wastelands
  • Minecraft: OlDrunk

Posted 08 April 2011 - 02:17 PM

Section D:
Get a real server platform and run linux, even under virtual machine in windows it's 100 times more stable, secure  and less OS resource hungry then any thing MS has to offer and linux just handles priority  processes so much better and faster. Plus most distros are free oppose to shelling out hundreds for an MS server OS . Yes the down side is linux does have a learning curve but it's well worth it and there is tons of free online help and guides. I gave up on anything MS couple of years go and happy that I learned how to use linux and still learning new stuff every day.

Not trying to diss ya dude and seriously no disrespect to you, you did take your time to write up a guide to help people out but winblows is only good for gaming on a client side and thats about it. I've yet to see Mycrowsoft offer any thing that wasn't half baked and half finished.
Posted Image