itblog.team-holm.net
Games tagged blogs
Index


Half-Life Dedicated Linux Server - Howto

Half-Life Dedicated Linux Server - Howto

-27th of January 2013

This short article describes how to set up an Half-Life Dedicated Server in Linux. I had trouble finding a full up to date guide on the internet, so I decided making one. I have experienced that others are better at finding these guides then I am. Nonetheless, the steps are written below.

Note: ># represents the command prompt and is not actually a part of the commands shown below:
Steps 1, 3, 4 and 5 may be skipped.
  • 1) Download the Half-Life Dedicated Server for Linux. Download it to /tmp
  • 2) As root execute:
       >#adduser hlds
  • 3) As root execute:
       >#cd /tmp && tar -xvf hlds_l_3111_full.tar.gz && chmod u+r hlds_l_3111_full.bin && ./hlds_l_3111_full.bin
  • 4) Accept and continue when prompted.
  • 5) As root execute:
       >#cp -R /tmp/hlds_l /home/hlds && chown -R hlds:users /home/hlds
  • 6) As user hlds, execute:
       >#export LD_LIBRARY_PATH=/home/hlds/:$LD_LIBRARY_PATH
       This line should also be added to /home/hlds/.bashrc
  • 7) As user hlds, execute:
       >#cd ~ && wget http://storefront.steampowered.com/download/hldsupdatetool.bin && chmod +x hldsupdatetool.bin && ./hldsupdatetool.bin
  • 8) Accept and continue when prompted.
  • 9) As user hlds, execute and follow the instructions:
       >#./steam -command update -game valve -dir . -verify_all
  • 10) As user hlds, start the server by executing:
       >#./hlds_run -game valve +ip youriphere +maxplayers 26 +map mapnamehere +coop 0 +deathmatch 1 +mp_timelimit 25 +mp_weaponstay 0


For more information, check the readme files that now are placed under /home/hlds. The file server.cfg under the valve folder should be updated before running the game. To set up a server with good performance, update server.cfg in accordance to this article. Finding a map name and your ip address(command 'ifconfig' as root or 'sudo ifconfig' on some systems) to use is not described in detail here. If the server is not directly connected to the internet, then you need to ensure that the router or NAT device wich it is behind has opened and forwarded specific ports used by the Half-life server to host the game. This is not explained here. The Half-Life server can be run as a service using screen. Example of using screen to run something as a service can be found here. I would guess such a script could be rewritten for the purpose of running an Half-Life Server on Linux as a service. You could even run multiple servers on different ports! I might write such a script and publish it at scripts.team-holm.net. When that is done, the script will be linked to from here and this article updated. The configuration for doing so is not included here, and running the game can be done with many other different options then mentioned in this article. Some can be foud at gamegate2k.

Edit 10.02.2013: Script for starting HLDS as a service can now be found in the script blog.

See also:
Relevant links:

Sources: Here and everywhere

Tagged as: LinuxGames

Main page
Security
Crypto
Microsoft
Linux
Scripts
VMWare Hyper-V
Taglist
Active Directory
Citrix
Commands
Cryptography
Hyper-V
Linux
Network
Scripts
SQL 2008
SQL 2016
Tools
VMWare
Games
HowTo
Routers