Skip to content

Automatic installation and management of Dedicated DCS World Server w/ SRS on Linux

License

Notifications You must be signed in to change notification settings

ActiumDev/dcs-server-wine

Repository files navigation

Dedicated DCS Server w/ SRS on Linux

Currently experimental distribution of configs and scripts intended to automatically install and manage multiple DCS and SRS server instances on a single headless Linux server. Has been running reliably since DCS v2.9.9. Still under active development without any backwards compatibility guarantees.

Features

  • Ready for takeoff: Zero configuration required. Runs out of the box.
    • Pre-configured with reasonable defaults. Auto-starts a default mission (Caucasus with dynamic spawns).
    • Server-side Tacview with per-instance *.acmi file directory. Optional. Enable with: systemctl --user enable --now tacview@serverN
    • Continuous performance monitoring: FPSmon.lua warns clients about low server simulation frame rate or frame time spikes.
    • Mitigates security vulnerabilities and defuses footguns that lack fixes from upstream developers.
  • Minimal overhead: ~250M RAM on Debian 13.0 (kernel + user-space)
    • Built for headless (non-GUI) Linux servers without desktop environment.
    • Runs Caucasus and Marianas on servers with 8G RAM (more for other terrains)
  • Convenient management of all server processes through systemd user services: systemctl --user start|stop|status (dcs-server|srs-server)@serverN
  • Automatic restart of crashed or stalled services (including detection and forced restart of frozen DCS server with an unresponsive WebGUI).
  • Supports multiple server instances (DCS_server.exe -w DCS.*) through systemd unit instances.
  • Auto-configured webserver for hassle-free, browser-based VNC, WebGUI and file access (work in progress).

Planned Features

  • Olympus support: Currently blocked by Issue #9. Help welcome.
  • Performance parity with Windows: Requires ntsync support. Work in progress (expected with Wine Stable 11.0 in Q1/26, but breaks DCS_updater.exe, see Issue #8).
  • Encrypted and password-protected access to DCS WebGUI via webserver to delegate server-administration without providing SSH access.
  • WebDAV access to DCS_configs folder to facilitate remote file access via Windows' Map network drive.

Requirements

You must be familiar with Linux command line usage and server administration. Do not attempt the installation if you lack the required fundamentals!

Server Hardware

  • CPU: Depends. DCS_server.exe is multi-threaded but heavily bottlenecked by its primary thread. Almost any CPU will do for basic missions, but its single-thread performance is of utmost importance to maximize the performance ceiling. The included FPSmon.lua script will warn about performance issues in global chat by default.
  • RAM: 8G or more. 8G should suffice for a single server instance without mods on Caucasus. The sky is the limit once multiple instances, mods, and larger terrains are involved. Do not use a disk-backed swap partition, use zram instead.
  • Disk: NVMe SSD with >40 GB usable space for a Caucasus-only install. Additional terrains will need more space. If you're disk space constrained, transparent file compression may be an option.
  • Network: 1 Gbps link in a datacenter. At least 100 Mbps at home.

Dedicated server module names and respective installed and download sizes as of DCS 2.9.23.18431. Note that to install a module, you will temporarily need free disk space for the sum of both sizes as DCS_updater.exe will first download all files and then unpack the module.

Module ID Installed (GB) Download (GB)
AFGHANISTAN_terrain 59.7 20.7
CAUCASUS_terrain 11.1 4.0
FALKLANDS_terrain 37.7 10.8
GERMANYCW_terrain 92.1 30.5
IRAQ_terrain 69.3 22.8
KOLA_terrain 66.7 19.1
MARIANAISLANDSWWII_terrain 6.5 2.2
MARIANAISLANDS_terrain 9.8 2.8
NEVADA_terrain 7.1 2.3
NORMANDY_terrain 38.4 12.7
PERSIANGULF_terrain 22.7 7.9
SINAIMAP_terrain 45.3 15.5
SUPERCARRIER 0.2 0.1
SYRIA_terrain 37.3 12.5
THECHANNEL_terrain 18.0 6.6
WORLD 19.8 10.7
WWII-ARMOUR 1.1 0.5
Σ 543.0 181.8

Operating System

This has been developed and tested on a Debian 13 "Trixie" server install. Most Linux distributions that use systemd should work as well, but changes to accomodate the respective package manager, package names, etc. may be required.

Usage Instructions

For brevity, the following instructions rely on these conventions:

  • root@server is either the root user of the target Linux server or a user account with sudo proviliges. Substitute root and server as required.
  • dcs@server is a non-privileged user account on the target Linux server that will be used to run the DCS and SRS servers. Substitute dcs and server.

Local Requirements (for Windows users)

First, install the following software on your local computer (the applications are suggestions; any program implementing the respective protocol should work):

  • Terminal: Do not use the legacy command prompt. Install the official Windows Terminal App.
  • SSH client: Recent versions of Windows 10/11 include a built-in SSH client. Use it. Do not install PuTTY or other 3rd-party SSH clients.
  • SFTP client: Required to transfer files (e.g., missions). Windows includes scp as a command line client.

Linux Server Prerequisites (root/sudo privileges required)

Run via ssh root@server:

# Activate i386 architecture (required by Wine) and install dependencies
# TODO: adjust this if your server does not run Debian
sudo dpkg --add-architecture i386 && sudo apt update
sudo apt install --no-install-recommends \
	curl git git-lfs lighttpd python3-minimal sway unzip wayvnc wine wine32:i386 wine64
sudo systemctl disable --now lighttpd
# Create a separate user account for the DCS server and enable persistent
# systemd user services for it (exemplary user name, change at will)
sudo useradd -m -s /bin/bash -G render,video dcs
sudo loginctl enable-linger dcs

Installation

Run via ssh -L 8080:127.0.0.1:8080 dcs@server (see below for meaning of -L):

# use Git to download all scripts and config files into the home directory
cd ~
git init -b main ~
git remote add origin https://github.com/ActiumDev/dcs-server-wine.git
git pull origin main
git submodule update --init --recursive
# start basic services: minimal GUI, VNC server, webserver
# TODO: create ~/ENVIRONMENT.txt to change VNC and webserver ports
systemctl --user daemon-reload
systemctl --user enable --now sway wayvnc webserver

dcs@server now runs the minimal, headless GUI, a VNC server, and a webserver that provides straightforward VNC and DCS WebGUI access. The connection is securely authenticated and encrypted via SSH static port forwarding (-L). Open http://127.0.0.1:8080/vnc/ in a webbrowser to access the VNC server that should now show an empty desktop with a clock in the top right corner.

Everything is ready for the actual installation. First, decide which terrains to install from above module table or this list. Then, adjust the export DCS_TERRAINS= in below code snippet to contain a space-separated list of Install/Uninstall id from the list, e.g., export DCS_TERRAINS="CAUCASUS_terrain MARIANAISLANDS_terrain". The updater will show an error message popup if the available disk space is insufficient. Now run via the already open SSH session (dcs@server):

# install DCS
# TODO: set DCS_TERRAINS to space separated list of terrains to install
export DCS_TERRAINS="CAUCASUS_terrain"
~/.wine/drive_c/install_dcs.sh
# optional: install SRS
~/.wine/drive_c/install_srs.sh

Via VNC: Watch the DCS updater progress through the installation and confirm the final success message. The DCS server will start automatically. When shown the "DCS Login" window, enter your credentials (best practice: use separate server account with purchases restricted) and check both "Save password" and "Auto login" options to enable the DCS server to start non-interactively in the future.

The VNC session should now show the DCS splash screen. The SRS server should run as a windowless background service. The DCS server defaults to port 10308 and SRS defaults to port 5002. The server is unlisted (not public) by default.

You can connect to the server by IP address and port. The default mission will start automatically once the first player connects.

Access to DCS WebGUI

The webserver also provides remote access to the DCS WebGUI. Simply open http://127.0.0.1:8080/DCS.server1/WebGUI/ in your browser.

Optional: Configuration and Tacview

Modify ~/.wine/drive_c/DCS_configs/DCS.server1/Config/autoexec.cfg to suit your requirements. Additionally, use the WebGUI to conveniently configure the server settings.

Tacview's DCS2ACMI plugin is redistributed with this git repo. However, server-side Tacview *.acmi file generation may have a minor impact on the dedicated server performance, so it is disabled by default.

You can enable Tacview on a per-instance basis before starting the respective server instance as follows (example for instance/writedir DCS.serverN): systemctl --user enable --now tacview@serverN

Finally, restart the server for all changes to take effect:

systemctl --user restart dcs-server@server1

Optional: Additional Server Instances

Multiple server instances are supported via systemd unit instances. By default, only the instance server1, which corresponding to the DCS writedir named DCS.server1 is configured. Before additional instances can be started via above systemctl --user ... commands, the respective configuration directories must be created.

First, copy the configuration template DCS_defaults to a new instance directory:

cp -a ~/.wine/drive_c/DCS_configs/DCS_defaults/ ~/.wine/drive_c/DCS_configs/DCS.serverN/

Then, manually edit the following config files to set unique ports:

  • ["port"] in Config/serverSettings.lua
  • webgui_port in Config/autoexec.cfg
  • SERVER_PORT in SRS/server.cfg

Finally, reload the webserver and enable the services for the new instance:

systemctl --user reload webserver
systemctl --user enable --now tacview@serverN
systemctl --user enable --now srs-server@serverN
systemctl --user enable --now dcs-server@serverN

Known Issues and Troubleshooting

Installation fails with wine: could not load kernel32.dll, status c0000135

The WINEPREFIX directory ~/.wine is broken. Reinitialize and then re-run the installer as follows:

export $(systemctl --user show-environment | grep -m1 ^WAYLAND_DISPLAY=)
rm ~/.wine/.update-timestamp
wineboot --init
~/.wine/drive_c/install_dcs.sh

About

Automatic installation and management of Dedicated DCS World Server w/ SRS on Linux

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages