# Guide: How to install DCS World on Linux **Date:** 2019-07-24 **Author:** Dagger98 **Version:** 1.0.0 ## Abstract This guide will show you how to install and run [DCS World](https://www.digitalcombatsimulator.com/en/products/world/) , with modules, [NaturalPoint Track IR](https://www.naturalpoint.com/trackir/) , [Thrustmaster HOTAS Warthog](http://www.thrustmaster.com/en_US/products/hotas-warthog) and [Saitek PRO Flight Combat Rudder Pedals](http://www.saitek.com/uk/prod-bak/pedals.html)[^1] , on a GNU/Linux system, in this guide represented by [Ubuntu 19.04 Disco](https://ubuntu.com/) . ## Changes 2019-07-24: First version (1.0.0) ## Guide format The guide is written in Markdown and can be converted to PDF, HTML and many other formats using [pandoc](https://pandoc.org). ## Disclaimer Things could go wrong, resulting in, but not limited to, hardware failure, software failure, unrecoverable loss of data. This is your responsibility, so make sure you are OK with that before following along. DCS World was built to run on Windows. Running on a non native platform using modified files could result in you being banned from multiplayer servers and labeled a hacker. Do not expect support from official channels. ## What was tested * Installing modules through the module manager * Free flight instant action with Su-25 * Free flight instant action with A-10C * Starting the missing editor ## What was not tested * Multiplayer ## Known issues * Could not get DCS World to run on wine 4.12.1 (used 4.11 instead) * Pressing F10 for the map crashes the program with a segfault. ## Hardware * AMD Ryzen 1700 CPU * Asus X370 Pro Motherboard * 32GB Crucial RAM * NaturalPoint TrackIR 4 Pro with trackclip * Thrustmaster HOTAS Warthog * Saitek PRO Flight Combat Rudder Pedals * Asus GeForce GTX 1080 ## Software * [Ubuntu (19.04 Disco)](https://ubuntu.com/) * [Linux mainline kernel (5.1.16-050116-generic)](https://kernel.ubuntu.com/~kernel-ppa/mainline/) * Nvidia Driver Version: 430.26 * [wine (staging 4.11)](https://www.winehq.org/) * [winetricks (20190615-next)](https://wiki.winehq.org/Winetricks) * [dxvk (1.3.1)](https://github.com/doitsujin/dxvk) * [linuxtrack (0.99.18)](https://github.com/uglyDwarf/linuxtrack) * [DCS World Open Beta (2.5.5.33552)](https://www.digitalcombatsimulator.com/en/products/world/) * DCS Updater (2.9.11.2) ## Performance With the hardware and software listed in the guide, free flight with the Su-25 gets you about 50fps with the high preset and everything on except SSAA. ## Guide steps Before starting, make sure a native Vulkan version is not released yet, as that would be preferred. ### Prerequisites You should be somewhat familiar with GNU/Linux and know basic things like sudo. ### Notation Lines starting with: * #, execute as root * $, execute as your normal user The username for the account is assumed to be myusername The name of the computer is assumed to be mycomputer ### Ubuntu The current version of the guide does not cover how to install Ubuntu. We are using the program "aptitude" as our package manager. ```bash myusername@mycomputer~# apt-get install aptitude ``` ### Nvidia drivers The current version of the guide does not cover how to install Nvidia drivers. ### Wine Wine runs Windows applications under GNU/Linux. #### Installation Follow the [Wine HQ instructions](https://wiki.winehq.org/Ubuntu) to download and install the staging branch. The latest version at the time of writing this guide is 4.12.1 and this version did not work for the setup outlined. We must therefore downgrade to an earlier working version (4.11), replacing the 4.12.1 packages. ```bash myusername@mycomputer~# aptitude install winehq-staging=4.11~disco wine-staging=4.11~disco wine-staging-amd64=4.11~disco wine-staging-i386:i386=4.11~disco ``` Verify that your wine version is wine-4.11 (Staging) ```bash myusername@mycomputer~$ wine --version ``` #### WINEPREFIX - Configure wine for DCS Create a WINEPREFIX for your DCS World installation, this WINEPREFIX is just a folder on your computer, it can also be referred to as a container or a bottle. ```bash myusername@mycomputer~$ WINEPREFIX=~/.dsc@wine-4.11 winecfg ``` A window should now be shown allowing for the configuration of this specific WINEPREFIX. Select Windows 10 in the Applications tab. It is recommended to have the actual DCS World game data outside of the WINEPREFIX to make it easier to upgrade to newer wine versions without having to reinstall DCS every time. Therefore go to the drives tab and add drive D: and point it to /home/myusername/ Click OK to close the winecfg application. #### winetricks - easy installation of dependencies winetricks can be used to install fonts, VC++ and .NET runtimes that Windows applications need. Follow the [Wine HQ instructions](https://wiki.winehq.org/Winetricks) to download and install winetricks. On Ubuntu, and other GNU/Linux distributions that use Systemd, you can move the winetricks application to ~/.local/bin which makes it available in your PATH, so you can run the application from anywhere. To install the needed fonts and runtimes for DCS World into our WINEPREFIX run ```bash myusername@mycomputer~$ WINEPREFIX=~/.dcs@wine4.11 winetricks corefonts vcrun2015 ``` ### DXVK "Vulkan-based D3D11 and D3D10 implementation for Linux / Wine" #### Installation Get version 1.3.1 from the [release page](https://github.com/doitsujin/dxvk/releases) We want the dxvk-1.3.1.tar.gz file, download it and extract the content using ```bash myusername@mycomputer~$ tar xvzf dxvk-1.3.1.tar.gz ``` #### Configure for DCS Go to the folder where we extracted the dxvk files and run ```bash myusername@mycomputer~$ WINEPREFIX=~/.dcs@wine4.11 ./setup_dxvk.sh install ``` This copies the needed files into our DCS WINEPREFIX. ### Linuxtrack for TrackIR support Head tracking for GNU/Linux and Mac OS X. #### Installation Get version 0.99.18, the Linux 64bit universal package from the [download page](https://github.com/uglyDwarf/linuxtrack/wiki/Downloads) and then follow the instructions in the [universal Linuxtrack package page](https://github.com/uglyDwarf/linuxtrack/wiki/universal-Linuxtrack-package). Below follows some notes from trying to follow the Linuxtrack instructions To check the fingerprint of the gpg key used to verify the package, simply run ```bash myusername@mycomputer~$ gpg new_pubkey.gpg ``` instead of using the option "--with-fingerprint" as it actually prevents the fingerprint from being printed. At the point in the instructions that deals with missing libraries, the following packages were installed ```bash myusername@mycomputer~# aptitude install libqtgui4 libcwiid1 libqtwebkit libqtwebkit4 liblo7 ``` Libcrypto was still missing because Ubuntu was using a new version, so the file had to be installed manually from another source. If you have Lutris or Steam installed already, then the file can be found with ```bash myusername@mycomputer~# updatedb myusername@mycomputer~# locate libcrypto.so.1.0.0 ``` This will give you the location of the file on disk and then simply copy it to the correct folder ```bash myusername@mycomputer~# cp /home/myusername/.local/share/lutris/runtime/steam/amd64/lib/x86_64-linux-gnu/libcrypto.so.1.0.0 /usr/lib/x86_64-linux-gnu/ ``` This guide was not succesful in automatically installing the TrackIR firmware that was needed to run, so this had to be done manually. Download TrackIR 5.4.2, install into a temp wineprefix, copy the TrackIR5 folder for later use and then remove the temp wineprefix. ```bash myusername@mycomputer~$ WINEPREFIX=~/.trackir wine ~/Downloads/TrackIR_5.4.2.exe myusername@mycomputer~$ cp -R ~/.trackir/drive_c/Program\ Files\ \(x86\)/NaturalPoint/TrackIR5 ~/Downloads/ myusername@mycomputer~$ rm -Rf ~/.trackir ``` Now you can setup your TrackIR by running this command and following the instructions ```bash myusername@mycomputer~$ ltr_gui ``` Select TrackIR and install firmware by locating the TrackIR5 folder previously copied from the temp wineprefix. Configure your TrackIR to your liking. Install linuxtrack-wine into the wineprefix ~/.dcs@wine4.11 using the provided gui. Setup hotkeys for center (F12) and pause (F9) ```bash myusername@mycomputer~$ WINEPREFIX=~/.dcs@wine-4.11 wine start 'C:\Program Files (x86)\Linuxtrack\Controller.exe' ``` The application reports "Unknown key" but this is OK. This window should stay open or minimized to tray to allow the hotkeys to work. Test your linuxtrack installation with ```bash myusername@mycomputer~$ WINEPREFIX=~/.dcs@wine-4.11 wine start 'C:\Program Files (x86)\Linuxtrack\Tester64.exe' ``` The application will complain about "Can't load mfc42u.dll needed by TIRViews.dll" but will work regardless of this error. After clicking start the values should be changing to match your head movements. There is no need to manually run the TrackIR.exe file like we do with Controller.exe because it launches automatically in the background when DCS starts. ## Thrustmaster HOTAS Warthog ### Test controls in Ubuntu Install joystick applications with ```bash myusername@mycomputer~# aptitude install joystick jstest-gtk ``` Run jstest-gtk, plug in your controllers and test that they work under Ubuntu. ### Control the throttle LED backlight Whenever you unplug and plugin the throttle again, the LED backlight returns to the default setting. This is controlled in Windows using the TARGET software. In Ubuntu we will instead skip the target software and rely on sending RAW data to our HID device using the driver hidraw. For hidraw to work we need to make sure that we are sending data to the correct device, i.e. the throttle, no matter in which order the Linux kernel discovers the devices after a reboot. In other words, we need persistent device names for our HOTAS. We also want to control who can access the HOTAS on the computer. Create a new group "joystick" that will have access to the HOTAS ```bash myusername@mycomputer~# groupadd --system joystick ``` Add yourself to this group ```bash myusername@mycomputer~# usermod -a -G joystick myusername ``` Logout and back in again. Verify that you are a member of the group joystick ```bash myusername@mycomputer~$ id ``` Create a udev rule for setting up persistant device names for the HOTAS ```bash myusername@mycomputer~# cat < /etc/udev/rules.d/99-persistent-hidraw-hotas-links.rules SUBSYSTEM=="input", ENV{ID_INPUT_JOYSTICK}!="?*", IMPORT{program}="input_id %p" SUBSYSTEM=="hidraw", ENV{ID_SERIAL}!="?*", IMPORT{program}="usb_id --export %p" SUBSYSTEM=="hidraw", SYMLINK+="input/hidraw/%E{ID_SERIAL}" SUBSYSTEM=="hidraw", ENV{ID_INPUT_JOYSTICK}!="0", GROUP:="joystick" EOF ``` Unplug and then plug the controllers back in again. Verify the persistent device links ```bash myusername@mycomputer~$ ls -l /dev/input/hidraw/ ``` > lrwxrwxrwx 1 root root 13 jul 23 11:49 Saitek_Saitek_Pro_Flight_Combat_Rudder_Pedals -> ../../hidraw8 > lrwxrwxrwx 1 root root 13 jul 23 11:47 Thrustmaster_Throttle_-_HOTAS_Warthog -> ../../hidraw3 > lrwxrwxrwx 1 root root 13 jul 23 11:49 Thustmaster_Joystick_-_HOTAS_Warthog -> ../../hidraw7 Verify the access given to the joystick group ```bash myusername@mycomputer~$ ls -l /dev/hidraw* ``` > crw-rw\-\-\-\- 1 root joystick 235, 3 jul 23 11:47 /dev/hidraw3 > crw-rw\-\-\-\- 1 root joystick 235, 7 jul 23 11:49 /dev/hidraw7 > crw-rw\-\-\-\- 1 root joystick 235, 8 jul 23 11:49 /dev/hidraw8 Create the throttle_LED application ```bash myusername@mycomputer~$ cat < ~/.local/bin/throttle_LED #!/bin/bash # # Controls the LED lights on your Thrustmaster HOTAS Warthog Throttle # # reference: http://members.aon.at/mfranz/warthog.html # date: 2019-07-23 if ! [ -z $1 ] && (( 0 <= $1 && $1 <= 5 )); then echo -e "\x01\x06\x5f\x0$1" >/dev/input/hidraw/Thrustmaster_Throttle_-_HOTAS_Warthog else me=`basename "$0"` echo Usage: echo $me i echo sets the LED backlight level to i, where i in 0..5 fi EOF ``` Make the application executable ```bash myusername@mycomputer~$ chmod u+x ~/.local/bin/throttle_LED ``` Set the throttle's LED backlight to the brightest setting ```bash myusername@mycomputer~$ throttle_LED 5 ``` ### Configure controls for DCS under wine If we were to launch DCS before this configuration step we would see that there are duplicate controllers in the setup. This is because Linux provides two APIs for dealing with joysticks. One is the legacy joystick API (js) and the other is the modern evdev API (event). The evdev-based API provides more detailed information about the buttons and axes available and is the one we want to use. To disable the legacy (js) controllers and only use the more modern (event) controllers, we use the wine control panel ```bash myusername@mycomputer~$ WINEPREFIX=~/.dcs@wine4.11 wine control ``` When the wine control panel has opened 1. Click on game controllers 2. Click on "Thrustmaster Joystick - HOTAS Warthog (js) 3. Click disable 4. Repeat for Throttle 5. Click OK ## DCS World ### Installation Download DCS_World_OpenBeta_web.exe Install it in your configured WINEPREFIX but make sure to choose drive D: during the installation procedure ```bash myusername@mycomputer~$ WINEPREFIX=~/.dcs@wine-4.11" wine ~/Downloads/DCS_World_OpenBeta_web.exe ``` ### Running DCS Finally we get to what really matters! Start the hotkey controller application if it's not already running ```bash myusername@mycomputer~$ WINEPREFIX=~/.dcs@wine-4.11 wine start 'C:\Program Files (x86)\Linuxtrack\Controller.exe' ``` The first time you run DCS, you should * run DCS_updater.exe and not DCS.exe * enable all logging * enable vulkan fps counter This can be accomplished with ```bash myusername@mycomputer~$ WINEPREFIX=~/.dcs@wine-4.11" DXVK_HUD=fps wine ~/Games/DCS\ World\ Openbeta/bin/DCS_updater.exe ``` Hopefully everything went well enough that you can change the excessive logging for more performance. In the future, simply run ```bash myusername@mycomputer~$ WINEPREFIX=~/.dcs@wine-4.11" WINEDEBUG=-all wine ~/Games/DCS\ World\ Openbeta/bin/DCS.exe ``` or if you prefer, you can set WINEDEBUG=fixme-all, to get rid of most log messages. ### Process cleanup after running DCS The TrackIR.exe process starts automatically when DCS starts but does not terminate when DCS terminates, leaving multiple wine processes running. Simply terminate these processes with ```bash myusername@mycomputer~$ killall TrackIR.exe ``` ## TODO * Test DCS **a lot more** * The guide does not yet cover how to create desktop icons for DCS and TrackIR. * Basic instructions for installing Ubuntu * Basic instructions for installing nvidia drivers ## Troubleshooting DCS_updater.exe shows "No versions available" - Use winecfg and make sure that the windows version is Windows 10 in the Applications tab. ## Credits * Eagle Dynamics - for a fantastic flight sim product * The Ubuntu Team - for a great OS * Wine contributors - for a superb tool * uglyDwarf - for linuxtrack * Melchior, Franz - for [the info on the Thrustmaster HOTAS Warthog in Linux](http://members.aon.at/mfranz/warthog.html) * Forum user [TASF]Overkill - for [showing that DCS on Linux was possible](https://forums.eagle.ru/showthread.php?t=229253) ## Footnotes [^1]: Link to new product, old product discontinued, checkout Newegg [^2]: http://members.aon.at/mfranz/warthog.html