• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

Server Installing KF 2 Server on Linux with WINE

®omano

Grizzled Veteran
May 14, 2009
4,200
222
France
www.hellsoldiers.tk
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)


58351662fx62f.png

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


58351662fx62f.png

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


58351662fx62f.png

Follow the SteamCMD official guide for Linux, install SteamCMD to (for example) your /home/MyUser/steamcmd/ folder



58351662fx62f.png

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


58351662fx62f.png

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
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...)


58351662fx62f.png

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 did not test the following myself, but a user, Captain Hammer, posted this:
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

58351662fx62f.png


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 :p), 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:
I guess I'll have a server up and running sooner than I thought. =3

Edit:

Just went through and did this myself and got one more or less up and running (just need to config some stuff). Somethings I'd like to point out:
#1. You need 32bit and 64bit wine for this. I uninstalled wine32 via aptitude and needed to installed both versions from source (wanted both versions to be the same). Instructions can be found http://wiki.winehq.org/Wine64 I did as they said to do in the instructions (64 and then 32) and it worked for me.
#2. In Debian wheezy I found http://stackoverflow.com/questions/13780319/cant-build-32bit-wine-on-64bit-linux to be helpful with the depends.

Other than that, it's pretty straight forward and easy.
 
Last edited:
Upvote 0
this is because the console needs a graphical space to show. You can create a x server or other graphical interface. you can add a display port before the wine command line if you know the display port number, replace XXX by display port number.

DISPLAY=:XXX

@larksonguest42 I will add this information to the main post. I actually have 32 bit Wine also installed so I did not spot this problem, thanks for the feedback ;)
 
Last edited:
Upvote 0
Anyone else getting the following error(s) when trying to start the server?
Code:
Warning, Failed to load 'Texture2D FX_GORE_TEX.FX_Gore_Blend_All_D': Failed to find object 'Texture2D FX_GORE_TEX.FX_Gore_Blend_All_D'
Warning, The Outer object (Package ENG_EngineResources_TEX.Dither) for 'ENG_EngineResources_TEX.Dither.dither_pattern' couldn't be loaded [while loading package ENG_EngineResources_TEX]: Invalid linker index [couldn't load Package ENG_EngineResources_TEX.Dither]?
Warning, Failed to load 'Texture2D ENG_EngineResources_TEX.Dither.dither_pattern': Failed to find object 'Texture2D ENG_EngineResources_TEX.Dither.dither_pattern'
Server will just sit there and do nothing after these messages.

Using Wine 1.7.38 (+ the DLLs and vcrun2010) and Ubuntu 14.04.2.
However, it might also be related to vcrun2010 not being properly installed since the installation goes pretty fast. No error messages during the installation though...
 
Upvote 0
Anyone else getting the following error(s) when trying to start the server?
Code:
Warning, Failed to load 'Texture2D FX_GORE_TEX.FX_Gore_Blend_All_D': Failed to find object 'Texture2D FX_GORE_TEX.FX_Gore_Blend_All_D'
Warning, The Outer object (Package ENG_EngineResources_TEX.Dither) for 'ENG_EngineResources_TEX.Dither.dither_pattern' couldn't be loaded [while loading package ENG_EngineResources_TEX]: Invalid linker index [couldn't load Package ENG_EngineResources_TEX.Dither]?
Warning, Failed to load 'Texture2D ENG_EngineResources_TEX.Dither.dither_pattern': Failed to find object 'Texture2D ENG_EngineResources_TEX.Dither.dither_pattern'
Server will just sit there and do nothing after these messages.

Using Wine 1.7.38 (+ the DLLs and vcrun2010) and Ubuntu 14.04.2.
However, it might also be related to vcrun2010 not being properly installed since the installation goes pretty fast. No error messages during the installation though...

It is 'normal errors' don't worry. I think these errors appeared when they reduced the server files size. The put dummy files for lot of textures and sound I guess ;)

When it 'sits there' if you press CTRL+C does it shutdown the server with a success message? are the ini files created in the KFGame / Config subfolder? if yes your server is surely working. Try to activate webadmin in KFWeb.ini, restart server wait till it 'sits there', and connect to YourServerIP:8080 (or whatever port you chose in KFWeb.ini) with web browser. If you can access webadmin it's working.
 
Last edited:
Upvote 0
Now you've installed, compiled and did some other things, I'm not sure how to have a clean system, but basically, remove what you installed, and follow the guide: Add the Wine repository, then install Wine1.7 https://www.winehq.org/download/ubuntu (actually follow the first post, without the quote from the Debian user)

sudo add-apt-repository ppa:ubuntu-wine/ppa
sudo apt-get update
sudo apt-get install wine1.7
 
Last edited:
Upvote 0
Now im stuck again here:


------------------------------------------------------
You are using a 64-bit WINEPREFIX. If you encounter problems, please retest in a clean 32-bit WINEPREFIX before reporting a bug.
------------------------------------------------------
Executing w_do_call vcrun2010
Executing load_vcrun2010
Current wine does not have wine bug 23427, so not applying workaround
Using native,builtin override for following DLLs: msvcp100 msvcr100 vcomp100 atl100
Executing winetricks_early_wine regedit /S C:\windows\Temp\_vcrun2010\override-dll.reg
Executing wine vcredist_x86.exe /q
Application tried to create a window, but no driver could be loaded.
Make sure that your X server is running and that $DISPLAY is set correctly.


I have no X installed its an webserver.. i hope i dont need X?
 
Upvote 0
I have bad fomart message

:~# WINEDEBUG="fixme-all" DISPLAY=:XXX wine /home/steam/kf2server/Binaries/Win64/KFServer kf-bioticslab?difficulty=0 -port=7777
err:process:create_process 64-bit application L"Z:\\home\\steam\\kf2server\\Binaries\\Win64\\KFServer.exe" not supported in 32-bit prefix
wine: Bad EXE format for Z:\home\steam\kf2server\Binaries\Win64\KFServer.exe.

ho change to 64 bit prefix ?

#### EDIT ####
Ok ok, I had a 32 biti nstalltion to delete and 64 bit installtion it works
 
Last edited:
Upvote 0
Is your system 32 bits? If yes, you must have 64bits OS

If you have 64bits OS, you can delete the default Wineprefix ~/.wine/ (be sure if you don't need to keep it) by default wine should run 64bits prefix if your OS is 64bits.
Or you can create a new wine prefix with 64bits arch next to your 32bits default prefix, run once:
Code:
WINEARCH=win64 WINEPREFIX=/home/MyUser/.wine64 wine /home/MyUser/steamcmdwin/steamcmd
and follow the tutorial again to install all you need in your new .wine64 prefix
 
Upvote 0
Server crashes after about 4 hours

Server crashes after about 4 hours

I get the errors that domistyle gets but i can connect to my server and it runs fine but after about 4h its crashes. I haven't really ever used wine unfortunately I'm looking for log that could post but i can't seem to find where it logs so i can't figure out whether KF2 is crashing or wine is causing it. Could you tell me where they log. I'm using the command at the start to supress all the fixme's does that mean it doesn't log at all?

I'm running ubuntu 14.04. LTS and wine-1.6.2 i installed the 64bit and tried to install the 32bit but it said that 32bit was installed when i installed 64bit.

Anyone else getting the following error(s) when trying to start the server?
Code:
Warning, Failed to load 'Texture2D FX_GORE_TEX.FX_Gore_Blend_All_D': Failed to find object 'Texture2D FX_GORE_TEX.FX_Gore_Blend_All_D'
Warning, The Outer object (Package ENG_EngineResources_TEX.Dither) for 'ENG_EngineResources_TEX.Dither.dither_pattern' couldn't be loaded [while loading package ENG_EngineResources_TEX]: Invalid linker index [couldn't load Package ENG_EngineResources_TEX.Dither]?
Warning, Failed to load 'Texture2D ENG_EngineResources_TEX.Dither.dither_pattern': Failed to find object 'Texture2D ENG_EngineResources_TEX.Dither.dither_pattern'
Server will just sit there and do nothing after these messages.

Using Wine 1.7.38 (+ the DLLs and vcrun2010) and Ubuntu 14.04.2.
However, it might also be related to vcrun2010 not being properly installed since the installation goes pretty fast. No error messages during the installation though...
 
Upvote 0