For those in need of a server under Linux, here is a guide to run KF 2 server with WINE (I know, it's dirty and crap and double crap, but hey, if you don't want to wait..):
WARNING: This tutorial may contain AIDS, destroy your system and kill your pet. I will not take any responsibility if something bad happens (only for your knowledge, do it at your own risk.. but I think you will have no problems at all)
My system is Ubuntu 14.04 LTS 64 bits (but might work on other OS). Update the system:
Install WINE 2.9 staging
Go to https://www.winehq.org/download/ for other OS procedures. For Ubuntu follow this:
Follow the SteamCMD official guide for Linux, install SteamCMD to (for example) your /home/MyUser/steamcmd/ folder
Install KF 2 Server
You can save this command line to a script file, make it executable, and keep it for later file validation (or just server update if you remove 'validate' at the end of the command)
Now you have a folder /home/MyUser/steamcmd/kf2server/ were the server files are installed
You should now be able to start the server with WINE
Run the server once to generate INI files
As for the update script, you can create an executable script file with the command line for later use.
Stop the server with CTRL+C (once or twice if it does not return to console) and you can follow normal server configurations (edit KFGAme.ini and other files to change server name, set an admin password, activate webadmin and change its port... and so on...)
Note that I used a graphical interface when I made this guide if you don't, you may need to use an X server, or other trick and adapt command line by for example adding DISPLAY=:yourdisplayhere before WINE command lines
I did not test the following myself, but a user, Captain Hammer, posted this:
I hope we'll have KF 2 Server binaries for LINUX soon, but in the meantime Enjoy your Wine crapy server
If you have problems with this guide, maybe me or other people on the forum can help. If you notice something wrong in this tutorial (that's not impossible ), please reply to the topic and advise me, thank you.
WARNING: This tutorial may contain AIDS, destroy your system and kill your pet. I will not take any responsibility if something bad happens (only for your knowledge, do it at your own risk.. but I think you will have no problems at all)
My system is Ubuntu 14.04 LTS 64 bits (but might work on other OS). Update the system:
Code:
sudo apt-get update
sudo apt-get upgrade
Install WINE 2.9 staging
Go to https://www.winehq.org/download/ for other OS procedures. For Ubuntu follow this:
Code:
sudo dpkg --add-architecture i386
wget -nc [B][URL="https://dl.winehq.org/wine-builds/Release.key"][COLOR=#FFD700]https://dl.winehq.org/wine-builds/Release.key[/COLOR][/URL][/B]
sudo apt-key add Release.key
sudo apt-add-repository [B][URL="https://dl.winehq.org/wine-builds/ubuntu/"][COLOR=#FFD700]https://dl.winehq.org/wine-builds/ubuntu/[/COLOR][/URL][/B]
sudo apt-get update
sudo apt-get install --install-recommends winehq-staging
Follow the SteamCMD official guide for Linux, install SteamCMD to (for example) your /home/MyUser/steamcmd/ folder
Install KF 2 Server
Code:
cd /home/MyUser/steamcmd/
./steamcmd +@sSteamCmdForcePlatformType windows +login anonymous +force_install_dir ./kf2server +app_update 232130 validate +quit
You can save this command line to a script file, make it executable, and keep it for later file validation (or just server update if you remove 'validate' at the end of the command)
Now you have a folder /home/MyUser/steamcmd/kf2server/ were the server files are installed
You should now be able to start the server with WINE
Run the server once to generate INI files
Code:
wine /home/MyUser/steamcmd/kf2server/Binaries/Win64/KFServer kf-bioticslab?difficulty=0 -port=7777
Stop the server with CTRL+C (once or twice if it does not return to console) and you can follow normal server configurations (edit KFGAme.ini and other files to change server name, set an admin password, activate webadmin and change its port... and so on...)
Note that I used a graphical interface when I made this guide if you don't, you may need to use an X server, or other trick and adapt command line by for example adding DISPLAY=:yourdisplayhere before WINE command lines
Code:
WINEDEBUG="fixme-all" DISPLAY=:[COLOR=Red]XXX[/COLOR] wine /home/MyUser/steamcmd/kf2server/Binaries/Win64/KFServer kf-bioticslab?difficulty=0 -port=7777
I found out why an X server and the DISPLAY environment variable is needed: Apparently the server checks if it's connected to a TTY on startup. If it is not, it starts its own graphical console window, which requires a usable X server. If it fails to open the console, it crashes. I suppose it makes sense in the Windows world, because then people get a console when they double-click the EXE.
You can work around this by running wine using unbuffer (from expect, see also Ubuntu packages), which creates a fake TTY. Like this:
Code:/usr/bin/unbuffer /usr/bin/wine "C:/steamcmd/kf2server/Binaries/Win64/KFServer.exe"
I hope we'll have KF 2 Server binaries for LINUX soon, but in the meantime Enjoy your Wine crapy server
If you have problems with this guide, maybe me or other people on the forum can help. If you notice something wrong in this tutorial (that's not impossible ), please reply to the topic and advise me, thank you.
BONUS:
Here is an example script to find an already runing server on specific port, kill it if it is running, then start the server:
Code:#!/bin/bash # # find PID of running KFServer process on 7777 port PIDKF2=`ps -ef | grep KFServer | grep 7777 | awk '{print $2}'` # and kill the server before starting it again to avoid starting multiple servers on the same port kill $PIDKF2 # then start the server on port 7777 WINEDEBUG="fixme-all" wine /home/MyUser/steamcmd/kf2server/Binaries/Win64/KFServer kf-bioticslab?difficulty=0 -port=7777 &
Here is the same but just to stop this specific server:
Code:#!/bin/bash # # find PID of running KFServer process on 7777 port PIDKF2=`ps -ef | grep KFServer | grep 7777 | awk '{print $2}'` # and kill the server kill $PIDKF2
and the update script:
Code:#!/bin/bash # # find PID of running KFServer process on 7777 port PIDKF2=`ps -ef | grep KFServer | grep 7777 | awk '{print $2}'` # and kill the server kill $PIDKF2 # start the update on the server cd /home/MyUser/steamcmd/ ./steamcmd +@sSteamCmdForcePlatformType windows +login anonymous +force_install_dir ./kf2server +app_update 232130 +quit echo Update job finished!
Last edited: