How to set up a dedicated server on Linux:A little guide I made for another game, but after a few changes it still works with Bad Company 2 Server
This will allow you to run 24/7 server on your headless (command line only) Linux. If you are running it on a system with a graphical desktop environment, you don't need to install Xvfb or x11vnc and you can skip steps 4 through 7.
REQUIREMENTSOn your remote server:
Server files - if you don't have them, ask around. We won't provide them to you.
libgl1-mesa-dev - Mesa OpenGL libraries
WINE - preferably newest version you can get. If you run into problems check the output of
wine --versionXvfb - framebuffer emulator. This utility will allow you to run GUI applications on your headless server.
x11vnc - VNC server. Thanks to this utility, you will be able to interact with GUI applications on your remote server using a VNC client.
winetricks - required to easily download and install some required libraries
On your local machine:
VNC client. On Linux you can use gvncviever, on Windows tightvnc, although any other client should work just as well.
Setting up server1. Download server files and extract them:
Code: Select all
wget <link to server files>
unzip BFBC2_Server_R34_Full.zip
Then go to your extracted directory:
2. Make sure you have the lastest server hook (dinput8.dll) in your game/server directory. Look on the forums or ask on #emulatornexus IRC channel.
3. Install dinput8:
Alternatively, you can rename dinput8.dll to xinput1_3.dll
4. Start Xvfb
5. If it's the first time you are running the VNC server you need to generate a new password:
6. Now you can start your VNC server
Code: Select all
x11vnc -display :1 -bg -forever -rfbauth ~/.vnc/passwd
7. Set your DISPLAY environment variable
8. Conect to your VNC server and install Visual C++ runtime libraries:
Code: Select all
winetricks vcrun2005
winetricks vcrun2008
winetricks vcrun2010
9. Modify your server options in /Instance/ServerOptions.ini
MAKE SURE TO CHANGE YOUR ADMIN PASSWORD!10. And finally, start your server
Code: Select all
wine Frost.Game.Main_Win32_Final.exe -serverInstancePath "Instance/" -mapPack2Enabled 1 -port 19567 -timeStampLogNames -region OC -heartBeatInterval 20000
Known problems1. The server cannot be normally shut down once started, so it's best to run it in a screen session. When you want to shut it down, just kill its process:
Code: Select all
kill -9 `ps x | grep Frost | grep -v grep | gawk '{print $1}'`
2. The server crashes sometimes. You can verify wether it's working or not by checking your VNC server.
Alternatively, you can make your server not display any errors, by adding the following parameteers to your startup command:
Code: Select all
-displayErrors 0 -displayAsserts 0
If you do this, remember, that this doesn't prevent the errors from happening. It just hides them. Keep that in mind, especially if you run into some problems with your server.
3. Failed to use ICMP (network ping), this requires special permissions.
This happens if you are running the server on a limited (non-root) account. To solve it, type:
Code: Select all
sudo setcap cap_net_raw+epi /usr/bin/wine-preloader
More information can be found here:
http://wiki.winehq.org/FAQ#head-acdec64 ... 02576e6a63Thanks to Vaques for letting me know about it!
Useful linksGetting procon to work 24/7 on LinuxConfiguring your serverWhere to look for server filesWhere to find the latest hook (Download section)Discussion: viewtopic.php?f=10&t=6015