General guidelines: dedicated server on Linux

Discussion in 'Hosting Help' started by Ricardo Diz, Jun 25, 2020.

  1. Ricardo Diz

    Ricardo Diz Registered

    Joined:
    Mar 28, 2019
    Messages:
    46
    Likes Received:
    48
    For those of you interested, here is a short guideline to install a rFactor 2 dedicated server on Linux.

    To run rFactor 2 on Linux requires a Windows compatibility layer, as there is no compiled version of it for Linux. You can either run it through Steam Proton, or use Wine. Proton is done by Steam, forked from Wine source code, where some specific developments for Steam are being addressed more quickly. In general terms, both solutions should work for rFactor 2. I'm using Wine for the guidelines below.

    1. Have a linux distribution properly set up
    In this example I'm using Debian 10 Buster.
    A. As a starting point, make sure you have the proper sources in place to look for the general packages you may need to install in your Debian machine. Here are the contents of a working /etc/apt/sources.list file, which controls the sources:
    deb http://debian-archive.trafficmanager.net/debian buster main contrib non-free
    deb http://debian-archive.trafficmanager.net/debian-security buster/updates main contrib non-free
    deb http://debian-archive.trafficmanager.net/debian buster-updates main contrib non-free
    deb http://debian-archive.trafficmanager.net/debian buster-backports main contrib non-free
    B. Update packages index after editing the file above: "sudo apt-get update".
    C. (Optional): Upgrade all installed packages to the latest version: "sudo apt-get upgrade".
    D. Ensure wget package is installed, to easily download files: "sudo apt-get install wget".
    E. You need to add repositories for Wine and dependent packages. Don't add the repository from WineHQ, but one that includes and simplifies installation of dependencies (e.g., libfaudio0). To do this, start by downloading this authentication key: "wget -nc https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/Debian_10/Release.key"
    F. Add the following new line with new repository info to the file /etc/apt/sources.list mentioned above: "deb https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/Debian_10 ./"
    G. Make sure to enable i386 architecture packages, as WineHQ packages do not support ARM: "sudo dpkg --add-architecture i386"
    H. Update packages index after editing the sources.list file: "sudo apt-get update"
    2. Install Wine and dependencies
    A. Install FAudio package for DirectX Audio runtime libraries: "sudo apt-get install libfaudio0 -y"
    B. Install Wine i386 support package: "sudo apt-get install wine-devel-i386 -y"
    C. Install Wine development branch as its latest version has some relevant fixes and seems stable: "sudo apt-get install --install-recommends winehq-devel"​

    3. Install and configure graphical interface, if you haven't yet (wouldn't we all love a command line version of rf2 dedicated server? Not here yet!)
    A. Install a graphical interface of your choice, in this case I'm using Xfce Desktop Environment, but there are certainly lighter interfaces (e.g., Tinywm, dwm, Blackbox, etc): "sudo install xfce4"
    B. Tell what desktop to use in the initial startup script for your user: "echo xfce4-session >~/.xsession"​

    4. Install rFactor 2 dedicated server on the machine
    The instructions pointed out in the Users Guide are here. If you have paid content, you also need to look here. You should follow them for linux as well, taking into account the following notes:
    • Easily get SteamCMD with wget: "wget -nc http://media.steampowered.com/installer/steamcmd.zip"
    • Make sure to have unzip installed: "sudo apt-get install unzip"
    • Wine see a virtual computer file hierarchy starting with "~/.wine/drive_c/" acting as "C:\", so instructions like creating a "C:\Racing\" folder can be though of as: "mkdir ~/.wine/drive_c/Racing"
    • To install rFactor 2 dedicated server, just use the command "wine" prior to the command suggested in the documentation
    • After downloading the content as per the documentation, and in graphical environment, run ModMgr to install packages by going into the folder where the executable is and execute "wine ModMgr.exe"
    • If you have issues setting the working and packages dir (I did), you can run winecfg in the graphical environment and set up a virtual D:\ drive, pointing directly to ~/.wine/drive_c/Racing/rfactor2-dedicated"; then just select D:\ as working dir and D:\Packages as Packages dir
    • Run MAS2.exe the same way as ModMgr, in order to create the Race Event, and then follow the instructions from here
    • If while running MAS2.exe you aren't able to see any content in steps 4 or 5 of the respective documentation, then the working directory is likely incorrect; use the solution above on creating virtual drives to help, or you can just copy the race event mod from another computer into the Packages folder and run ModMgr.exe to install it
    • After proper installation of components and mods, you can double check if installation seems okay by verifying the respective files are in subfolders of ~/.wine/drive_c/Racing/rfactor2-dedicated/Installed; e.g., Race Event file should be under rFM sub-folder
    • You can run the server by going into the folder ~./wine/drive_c/Racing/rfactor2-dedicated/Bin32/ and execute: wine ./rFactor2\ Dedicated.exe +path=".."
    For reference in terms of resources used, it seems the server is using up ~450MB of memory, excluding the graphical environment, which in my case with Xfce is around ~200MB. When the server launches, peak memory needs seem to go to 1GB.

    Hope this is helpful to someone.

    Regards
     
    Last edited: Jun 25, 2020
    ThomasJohansen, leillo1975 and lagg like this.
  2. peppe56

    peppe56 Registered

    Joined:
    Mar 11, 2021
    Messages:
    3
    Likes Received:
    0
    Hello,
    here Wine 3.0 on Ubuntu 18.04. I had no fortune, running server:

    wine 'rFactor2 Dedicated.exe'

    result is

    wine: Unhandled exception 0x40000015 in thread 2c at address 0x140277966 (thread 002c), starting debugger...
    0032:fixme:dbghelp:elf_search_auxv can't find symbol in module
    0032:fixme:dbghelp:elf_search_auxv can't find symbol in module
    ...
     
  3. Ricardo Diz

    Ricardo Diz Registered

    Joined:
    Mar 28, 2019
    Messages:
    46
    Likes Received:
    48
    Hi there peppe56,

    Is wine working with other apps? For example, if you open notepad ("wine notepad"), does it work?

    Regards
     
  4. peppe56

    peppe56 Registered

    Joined:
    Mar 11, 2021
    Messages:
    3
    Likes Received:
    0
    Hello, Atm is happily running rf1 server.

    Thx for your reply
     
  5. Sim7b

    Sim7b Registered

    Joined:
    Apr 26, 2020
    Messages:
    11
    Likes Received:
    2
    Hi !
    I'm able to run server and choose options but when I start, I'm stuck on error.
    I've join backtrace

    EDIT: Problem fixed = Debian 10.9 => Ubuntu 20.04
     

    Attached Files:

    Last edited: Apr 26, 2021

Share This Page