Overview
How to run a Neotokyo server under Linux using WINE.
Requirements & Recommendations
The Windows version of the Source Dedicated Server (SRCDS) can be run with a fairly limited Linux install: Although the SRCDS console runs in X, a complete X environment is not required and all administration can be accomplished without a GUI (from your native console interface).
Items below tagged with the <(d)> should ideally be downloaded from your Linux distribution’s repositories using whatever package manager you are comfortable with — NOT directly from the links I am providing.
The last item is not required if you already have a complete X environment that you intend to use (by way of VNC or whatever).
- Vrcon[files.repeatoffender.net]
- rubycon[github.com]
- SRCDS Guardian[pastebin.com] – Remove all instances of the “&” (ampersand) character from this file before using.
- Tofrodos[www.thefreecountry.com] <(d)>
- x11vnc[www.karlrunge.com] <(d)> or the VNC server of your choice.
- Fluxbox[fluxbox.org] <(d)> or whatever window manager[en.wikipedia.org] you prefer, but lighter is better.
Install Neotokyo and SRCDS
- Download and install SteamCMD for Linux using the Valve wiki page linked above.
- Decide where you want to install your Neotokyo server and create that directory. For the purposes of this guide, the Neotokyo server install directory will be: /your/install/directory/here
- Start SteamCMD and enter the following:
@sSteamCmdForcePlatformType windows login anonymous force_install_dir /your/install/directory/here app_update 313600 validate quit
Configure, Start and Stop
- Edit the server.cfg in /your/install/directory/here/NeotokyoSource/cfg/
- Run wine winecfg to generate a WINE bottle (only needs to be done once).
- Use your server’s actual IP in place of 10.10.10.10 below and change whatever other flags you want:
cd /your/install/directory/here/ Xvfb :1 -screen 0 800x600x8 & export DISPLAY=:1 wine start srcds.exe -console -game NeotokyoSource +ip 10.10.10.10 -port 27015 +maxplayers 32 +exec server.cfg +map nt_dawn_ctg
- Give it a few seconds and check your Steam server browser or the server logs under NeotokyoSource/logs
- To shut it down:
pkill srcds.exe pkill wine pkill Xvfb
Enhancements
Because the Windows CUI version of SRCDS is not fully compatible with WINE (does not work with wineconsole[www.winehq.org]) it will still be running in X rather than your native console. Should you be running Xvfb and need to reach the actual SRCDS console (rather than using rcon) for troubleshooting or other purposes, VNC[en.wikipedia.org] is one way of doing that. For security, run the VNC server on localhost and connect to it via an SSH tunnel.
Starting VNC:
SSH tunnel (run on your local machine):
This can also be accomplished with PuTTY and other SSH clients.
Then connect to localhost:50900 with your VNC client.
This utility can be used to access rcon directly from your native shell (bash, etc.) allowing you to simplify or automate virtually any server task. Here’s a script that uses rubycon to monitor SRCDS for lock-ups (something SRCDS Guardian doesn’t do):
Command:
See warning in the first section of this guide.
An interesting fact about the WINE v1.4 cmd implementation: Anything non-Windows gets passed back to the shell. This is useful if you want a shell script to fire every time SRCDS is automatically restarted, as you can simply edit SRCDS Guardian like so:
Newer versions of WINE have eliminated this feature, but you can still accomplish the same thing by using the start command with the /unix flag:
You will (of course) need to run SourceMod for Windows, which means that if you wish to compile plugins locally it will need to be done under WINE. Happily, WINE has better support for the Pawn compiler than it does for SRCDS so you can use wineconsole for this. Create a batch file in your SourceMod scripting directory named go.bat:
Then create a shell script named go.sh and make it executable:
To compile a plugin named example.sp: ./go.sh example.sp
Troubleshooting
If you are experiencing poor performance (50% CPU use with an empty server) try this older version of SRCDS: [link]
For other issues, use these steps in order:
- Google any errors you get.
- See the Troubleshooting section of Rain’s guide and follow the instructions there:
[link]