Using Hyper-V Standalone OS to setup a L2J Server

Have you created a useful tool? or Do you want to get help building one? This is the right place!
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
User avatar
mastermind007
L2j Veteran
L2j Veteran
Posts: 37
Joined: Fri Jan 20, 2006 5:49 pm
Location: Pennsylvania , USA

Using Hyper-V Standalone OS to setup a L2J Server

Post by mastermind007 »

Using Microsoft’s Free Hyper-V Standalone OS to setup a L2J server.

NOTES:
1) This will only work on the 64 Bit system as Hyper-V Server is only available in 64bit.
2) The other apps should to be 64bit as well so get the right versions when downloading.

Q: What is Hyper-V
A: This is Microsoft’s Hypervisor (Virtual Server) which is to compete with VMWare’s ESX Server

Q: Why did you do this?
A: Will just to see if I could do it and the fact that unless you are running Linux for you server OS it is not free. Microsoft’s Hyper-V Server is free and can be downloaded right from Microsoft. Hyper-V Server is a stripped down Windows 2008 Server installation. (Uses very little system resources compared to a full Windows installation.)

What you will need?

Hyper-V Server
http://www.microsoft.com/hyper-v-server ... o-get.aspx

MySQL Server
http://dev.mysql.com/downloads/mysql/

L2J Server & DP (Nightly or SNV)
http://www.l2jserver.com/nightly/

SETENV.EXE (To set the JAVA_HOME path)
http://www.codeguru.com/dbfiles/get_fil ... s=20060606

OPTIONAL:
SQLyol Community Edition (Just a GUI for working with MySQL)
http://code.google.com/p/sqlyog/


After gathering the required software, which I recommend putting on the USB key or flash drive to get it on the server as there is no browser available by default. You could install FireFox or Chrome if you wanted by I leave that up to you. For the purpose of this document I used a 2GB USB key which is drive E: on my server

Step 1: Install the OS. This is pretty straight forward. Install looks like 2008 Server or Windows7. After the install there is a simple menu system that will allow you to set the network adapter up and enable Remote Desktop. Again pretty simple stuff.

Step 2: Install JAVA. From the CMD windows that is open by default when you log in.

(If you closed it press CTRL-ALT-DELETE and open Task Manager. Click on the “Applications” tab and then the “New Task” button at the bottom. Type in CMD and click OK. You can close Task Manager now.)

Change to the drive containing the JAVA installer and run it

Code: Select all

E:\jdk-6u18-windows-x64.exe
Follow the prompts. It is the standard install.

Step 3: Use the SETENV.exe to set the JAVA_HOME environment variable.

Code: Select all

E:\SETENV.exe –m  JAVA_HOME “C:\Program Files\Java\jdk1.6.0_18”
Notes:
1) Your version of JAVA may differ so make sure you get the right path.
2) The –m mean machine variable where as –u mean user variable. We want to get this at the system level not for the logged in user only.

Step 4: Install MySQL. Since this is and MSI installer you cannot just run is like the Java install you need to use the “RUNAS” command.

Note: Your version of MySQL may be different so change the installer name to match you version.

So the syntax is:

Code: Select all

RUNAS /user:administrator “msiexec /I e:\mysql-essential-5.1.42-winx64.msi”
(You will get prompted for the password)

Follow the prompts for a typical MySQL install on the windows OS.

Step 5: Copy the L2J files and folders.

TIP: It is best to extract and put the server and datapack files and folders in a single folder called something like “L2J-Server” using another workstation. It makes for less command line work on the server.

So the syntax is:

Code: Select all

MD C:\L2J-ServerXCOPY /E  E:\L2J-Server\*.* C:\L2J-Server
If you did not extract the server and datapack files to a single folder beforehand you can run the following commands to copy them.

Code: Select all

MD C:\L2J-ServerXCOPY /E  E:\L2J_Server-unstable\*.* C:\L2J-ServerXCOPY /E  E:\L2J_DataPack-unstable\*.* C:\L2J-Server
Step 6: Register and Configure the L2J server as normal. There are many good examples for doing this in the forum and the wiki and let’s face it, if this is your first time installing and configuring an L2J server you most likely are not going to be using this guide. Run the L2JConfig.exe from the command line in both the login and gameserver directories and edit away.

Step 7: (Optional) Install SQLyog to interact with MySQL using a GUI

So the syntax is: (Change version number in file name to match yours)

Code: Select all

E:\SQLyog821Community.exe
After installation launch the application by running this command:

Code: Select all

C:\Program Files (x86)\SQLyog Communtity\SQLyogCommunity.exe
To make life easier I created a few batch files I can run from the root of the C: drive to launch the login, games and SQLyog apps. This simply saves some command line work.

Batch file Example: (StartServer.bat)

Code: Select all

ECHO *** Launch Login Server ***CD C:\L2J-Server\Login\START startLoginServer.bat ECHO *** Launch Game Server ***CD C:\L2J-Server\GameServer\START startGameServer.bat

That’s it. You now have a L2J server running on a free Windows 2008 R2 server.

Have Fun!!!

EDIT:

I almost forgot. You have to open some ports in the firewall via command line.

Here are some examples.

Code: Select all

 RUNAS /user:administrator "netsh advfirewall firewall add rule name=Telnet_LoginServer dir=in action=allow protocol=TCP localport=12345 RUNAS /user:administrator "netsh advfirewall firewall add rule name=Telnet_GameServer dir=in action=allow protocol=TCP localport=54321 RUNAS /user:administrator "netsh advfirewall firewall add rule name=LoginServer_Port dir=in action=allow protocol=TCP localport=2106 RUNAS /user:administrator "netsh advfirewall firewall add rule name=Login_Port dir=in action=allow protocol=TCP localport=9014 RUNAS /user:administrator "netsh advfirewall firewall add rule name=GameServer_Port dir=in action=allow protocol=TCP localport=7777 
"If it ain't broke....Your not trying hard enough."
User avatar
poltomb
L2j Veteran
L2j Veteran
Posts: 225
Joined: Wed Jul 13, 2005 7:13 am
Location: USA

Re: Using Hyper-V Standalone OS to setup a L2J Server

Post by poltomb »

Very nice with great detail!

I think this is worth stickying.

Thanks mastermind007
User avatar
denser
Posts: 1392
Joined: Wed May 30, 2007 9:13 pm
Location: Russia
Contact:

Re: Using Hyper-V Standalone OS to setup a L2J Server

Post by denser »

hello! nice infos) now i am using it )
in role of gui - Aston 1.9.6 (aston2 dont work), as FM - Totalcommandr,btw it has plug-in to set up variables
Tiger, once tasted human flesh, will want to taste it again
L2J - the place where glad to see you any time!
djbenny
Posts: 133
Joined: Thu Jul 05, 2007 2:43 pm

Re: Using Hyper-V Standalone OS to setup a L2J Server

Post by djbenny »

interedasting.
Raspoutine
Posts: 27
Joined: Sun Jan 30, 2011 3:18 pm

Re: Using Hyper-V Standalone OS to setup a L2J Server

Post by Raspoutine »

Ye, nice tuto !!
Post Reply