Difference between revisions of "Running LFS on Linux"

From LFS Manual
Jump to navigationJump to search
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
<!-- See: https://www.lfs.net/forum/post/1893089 -->
 
<!-- See: https://www.lfs.net/forum/post/1893089 -->
This document will guide you through the process of installing and configuring Wine and LFS to allow you to run LFS's game client in Linux. We'll also touch on the subjects of configuring your wheel and solving common problems. For Instructions on how to run a dedicated host see [[Hosting#Linux_with_WINE|Hosting - Linux with Wine]].
+
This document will guide you through the process of installing and configuring Wine and LFS to allow you to run the LFS game client in Linux. We'll also touch on the subjects of configuring your wheel and solving common problems.
  
 
== Intro ==
 
== Intro ==
Line 6: Line 6:
 
=== What to expect ===
 
=== What to expect ===
  
Users have reported that LFS runs great on Linux. It's however likely that performance will be a bit worse compared to Windows, and the Force Feedback is not as detailed.
+
Users have reported that LFS runs great on Linux. Force Feedback should be the only point that may cause issues.
 
Graphics and audio appears to be at par with the native environment, and gamepads should work out of the box (although you may have to map the buttons manually).
 
Graphics and audio appears to be at par with the native environment, and gamepads should work out of the box (although you may have to map the buttons manually).
  
Although LFS is intended to run on Windows the LFS developers [https://www.lfs.net/forum/thread/85904 make efforts] to make sure that LFS runs on Linux and maintains comparability with older versions of Windows.  
+
This article was updated in June 2025; I ([[user:Bokujishin|Bokujishin]]) have been playing LFS on Manjaro Linux (KDE Plasma Wayland) for about 2 years now, and it works just fine. The steps in this article were updated and verified to work on both Manjaro Linux and Ubuntu 24.04 (running in virtual machines), and so should work for most Arch-based and Ubuntu-based distributions.
  
The Demo and S1/S2 versions should work equally well.
+
=== Prerequisites ===
 
 
The steps in this article has been verified to work with:
 
* LFS S2 6J
 
* Kernel 3.16.7
 
* Debian GNU/Linux 8.1 (x86_64)
 
* Wine-1.6.2
 
* Logitech G25 Racing Wheel
 
* Xbox 360 Wireless Controller for Windows
 
 
 
=== prerequisites ===
 
 
* Basic knowledge of Linux and your distribution (shell, package manager).
 
* Basic knowledge of Linux and your distribution (shell, package manager).
 
* A recent version of the Linux Kernel.
 
* A recent version of the Linux Kernel.
Line 27: Line 17:
  
 
== Basic setup ==
 
== Basic setup ==
 
=== Prepare your system ===
 
 
==== sudo ====
 
Let's become root, install sudo and add our primary user to the sudoers group:
 
  su -
 
  apt-get install sudo
 
  usermod -a G sudo username
 
  exit
 
 
''Replace username with the username of your primary user. After exiting, you may have to re-login for the group changes to take effect.''
 
 
==== Contrib archive area ====
 
 
The winetricks package is not available in the default Debian repo. We must therefore enable the contrib archive area. Open '''/etc/apt/sources.list''' with nano:
 
  sudo nano /etc/apt/sources.list
 
 
Add contrib to the very first deb entry so that the file reads:
 
  <nowiki>deb http://ftp.se.debian.org/debian/ jessie main contrib</nowiki>
 
 
''Obviously you do not need to change the mirror. Also, it is not necessary to add contrib to the deb-src entry. <br /> ctrl+o to save, ctrl+x to exit.''
 
 
==== Enable Multiarch ====
 
<!-- This should be a template -->
 
<div style="border: 1px #ebccd1 solid; background-color: #f2dede; color: #a94442; padding: 0.5em">
 
This step is only required if you're running a x86_64 (ie: 64-bit) operating system!
 
</div>
 
 
In case you are running a x86_64 (ie: a 64-bit) operating system, you need to enable Multiarch support in order to run 32-bit software (such as LFS!):
 
  sudo dpkg --add-architecture i386 && sudo apt-get update
 
  
 
=== Install and configure Wine ===
 
=== Install and configure Wine ===
  
Now let's install Wine (the compatibility layer capable of running Windows applications on Linux) and winetricks (a helper script to download and install various redistributable runtime libraries):
+
LFS, like any other Windows software, runs on Linux through wine (or Proton, the Valve-developed fork that runs Steam games). LFS can be run using either of those, but wine is quite simple to setup, and lets you run LFS without launching Steam.
  
  sudo apt-get install wine wine32 winetricks
+
==== Ubuntu ====
  
Then install the Windows DLLs required to run LFS properly ([https://www.lfs.net/forum/post/1875477#post1875477 source]):
+
On Ubuntu, you can install wine with the following command:
  winetricks d3dcompiler_43 d3dx9_43
 
  
''Note that we do NOT issue this command as root!''
+
  sudo apt install wine
  
=== Install LFS ===
+
Note that LFS is still a 32-bit program, and Ubuntu will only install the 64-bit version of wine, so you need to enable support for the 32-bit architecture, and install wine32:
  
Download LFS ([https://www.lfs.net/downloads list of mirrors]):
+
   sudo dpkg --add-architecture i386 && sudo apt update && sudo apt install wine32:i386
   wget <nowiki>https://www.lfs.net/download/LFS_S2_6J_setup.exe</nowiki>
 
  
Run the executable with Wine to install the game:
+
==== Manjaro ====
  wine LFS_S2_6J_setup.exe
 
  
''Wine may ask you to install mono (a cross platform, open source .NET framework), go ahead if you like but it's not required. <br /> Follow the on-screen instructions. This guide assumes that you install LFS to the default location (C:\LFS\).''
+
Manjaro makes things easier for us: you can open the GUI software center/updater to look for "wine" and install it (or use the pamac command, or more generally for Arch, pacman).
 +
You don't need to manually add support for the 32-bit architecture or install wine32.
  
Change to directory where LFS was installed and run LFS:
+
=== winetricks for Vulkan and other tweaks ===
  cd ~/.wine/drive_c/LFS
 
  wine LFS.exe
 
  
That's it!
+
If your GPU supports Vulkan, you should enable dxvk (Vulkan renderer for DirectX) for better performance (in my case, it also prevented crashes from full grids of cars, and properly showed my GPU in the game's options).
  
== Configure a game controller ==
+
Install it from the GUI (Manjaro) or with the following command (Ubuntu):
  
Install the package that allows you to test, calibrate and alter the configuration of your input device ('''joystick as well as wheel'''):
+
   sudo apt install winetricks
   sudo apt-get install joystick
 
  
Get the handler for your input device:
+
Of course, you can also use an equivalent command for your distribution, including pacman for Arch and Manjaro.
  cat /proc/bus/input/devices | grep js
 
  
The command should output something like:
+
From the terminal, execute winetricks, you will be greeted with a simple GUI. From there, choose '''Select the default prefix''' > '''Install a Windows DLL or component''' > '''dxvk'''.
  H: Handlers=event12 js0
 
  
''Make note of the '''eventX''' data <br />If you have multiple input devices connected it might be easier to manually read the file to find the correct handler.''
+
During installation, you may see warning about the wine prefix being 64 bits, you can ignore those warnings. On Ubuntu, you will be prompted to install multiple Microsoft redistributables.
  
If you like, you may test the force feedback of your device:
+
=== Install LFS ===
  ffcfstress -d /dev/input/event12
 
 
 
''Replace event12 with whatever data you noted in the previous step.''
 
 
 
To adjust the '''g'''ain and '''a'''utocenter strength:
 
  ffset /dev/input/event12 -g 100 -a 50
 
 
 
''Again, replace event12.''
 
 
 
To adjust the range (wheel turn), first get the ID of your device:
 
  dmesg | grep "Force feedback" | tail -n1
 
 
 
The command should output something like:
 
  [16568.948617] logitech 0003:046D:C299.000F: Force feedback support for Logitech Gaming Wheels
 
 
 
'' Make not if the ID (in this case "0003:046D:C299.000F").''
 
 
 
Then change the value in the corresponding "range" file, for example: '''/sys/module/hid_logitech/drivers/hid\:logitech/0003:046D:C299.000F/range'''
 
 
 
Finally configure the wheel from within LFS. See [[Options#Wheel.2FJoystick|Options - Wheel/Joystick]] for more information. Please not that changing the "Force Strength" ingame does not work. See '''gain''' in the previous step.''
 
 
 
== Troubleshooting ==
 
 
 
=== No sound ===
 
 
 
If you are not getting any sound in LFS, trying installing the Advanced Linux Sound Architecture (ALSA):
 
  sudo apt-get install alsa-base alsa-utils
 
 
 
Then run the configuration utility to make sure the ouput devices are configured correctly:
 
  alsamixer
 
 
 
''Use left/right arrow keys to select the Master item and up/down to change gain. <br />
 
Press "M" to unmute the item ("MM" should change to "OO").''
 
 
 
If you are still not getting any sound, make sure that your primary user is a member of the audio group:
 
  sudo usermod -a -G audio username
 
 
 
''Replace username with the username of your primary user. You may have to re-login for the group changes to take effect.''
 
 
 
=== The program has encountered a serious problem ===
 
 
 
I ran into issues after switching from software rendering to NVIDIA's driver package.
 
 
 
If you encounter an error message similar (or identical) to:
 
 
 
  Unhandled exception: page fault on write access to 0x7bf02fe8 in 32-bit code [...]
 
 
 
You may want to try the development branch of wine. To do this, install:
 
  sudo apt-get install wine-development wine32-development
 
 
 
And run LFS with the development binary:
 
 
 
  /usr/bin/wine-development LFS.exe
 
 
 
== Advanced topics ==
 
 
 
=== Increase process priority ===
 
 
 
In Linux you may change the priority of a process by using the '''nice''' program. This comes in handy if you'd like to make sure that no background processes steals cpu time from LFS.
 
 
 
To launch LFS with higher priority, use:
 
  nice -10 wine LFS.exe
 
 
 
''Niceness values range from -20 (most favorable) to 19 (least favorable).''
 
 
 
To change the priority of an already running process, first get the PID (process id) of LFS:
 
  pidof LFS.exe
 
  
''Take note of the number.''
+
If you haven't done so already, download the game from https://www.lfs.net, then open a terminal and execute the setup with wine:
  
Then "renice" the process:
+
   wine LFS_S3_7F_setup.exe
   renice -p 12345 -n -10
 
  
''Replace 12345 with the PID noted in the previous step and -10 with whatever priority you'd like to assign.'' 
+
If wine fails to execute with the error ''wine: could not load kernel32.dll'', simply delete the configuration folder in ~/.wine and try again. This error is especially likely to occur on Ubuntu, since we added 32-bit support manually.
  
=== Launch LFS from a headless environment ===
+
Once the game is installed, you can launch it from the app launcher like any other app, or double-click the desktop icon (on Ubuntu, you will first need to allow executing it).
 +
You can also go the manual way and launch it through wine:
  
So you just completed a minimal netboot installation of Linux without a graphical environment? What a coincidence! To be able to run LFS, first you will need to install the X server and the X Window System initializer:
+
  wine ~/.wine/drive_c/LFS/LFS.exe
  sudo apt-get install xserver-xorg xinit
 
  
Then use xinit to launch wine (and LFS):
+
This can be useful to get logs in the terminal, if you have issues.
  
  xinit "/usr/bin/wine32" "LFS.exe" -- :1
+
== Controllers and force feedback ==
  
=== Manually install NVIDIA's driver package ===
+
All controllers should work out of the box, as far as ''input'' is concerned. You will likely need to assign all axes and buttons to your preferences.
  
First install the packages required to successfully run NVIDIA's installer package:
+
The main issue on Linux has to do with FFB, or rather the lack thereof: steering wheel manufacturers typically provide their drivers for Windows only, and getting FFB to work on Linux has historically proven challenging.
  sudo aptitude install binutils gcc make linux-headers-$(uname -r)
+
However, things are much better today than they used to be, and we have several options, even for direct drive wheels and the multiple brands that sell them:
  
''Note that $(uname -r) will be reassigned to your kernel version. This is called command substitution and is, in this case, pretty safe.''
+
* [https://github.com/berarma/oversteer Oversteer] is a generic steering wheel manager for Linux. Some distributions provide packages for it. The github repository also provides links to projects for specific drivers, so you should test FFB with Oversteer first (especially if you have a Logitech or Thrustmaster wheel), and then look for those specific drivers; for direct drive wheels, you can directly check the specific drivers, chances are you will not have FFB out of the box.
 +
* Logitech and Thrustmaster drivers are available in recent Linux kernels, those wheels should therefore work without much trouble.
 +
* Fanatec: A driver specific to Fanatec wheels [https://github.com/gotzl/hid-fanatecff/ is being developed]. I am myself using a Clubsport DD and driving with this.
 +
* Moza, Asetek, and likely many others: [https://github.com/JacKeTUs/universal-pidff A more universal option], which should work with at least Moza wheels, is available. The repository also claims support for Asetek and other brands (user feedback would be appreciated for those).
  
Download your desired NVIDIA driver:
+
Note that wine 10 includes support for raw PID communication, which also helps directly translate FFB to Linux, and additionally allows games to make use of a wheel's advanced features, for instance using the FanatecSDK to communicate with the wheel's LEDs; LFS does not seem to be affected by this. Do also note that at the time of this writing, the wine version packaged with Ubuntu 24.04 is still 9.x.
  <nowiki>wget http://uk.download.nvidia.com/XFree86/Linux-x86_64/352.30/NVIDIA-Linux-x86_64-352.30.run</nowiki>
 
  
Make the binary file executable:
+
=== Firmware updates ===
  chmod +x NVIDIA-Linux-x86_64-352.30.run
 
  
Run the installer:
+
While wine allows running all sorts of software on Linux, with various success, firmware updates for your wheel base and other devices are still better left for a Windows OS. If you do not have a Windows PC available, you should try running a virtual machine. Or maybe we can petition manufacturers to provide Linux drivers and software...
  sudo ./NVIDIA-Linux-x86_64-352.30.run
 
  
''Choose to install NVIDIA's 32-bit compatability libraries when asked. <br /> Choose to automatically update the X configuration file when asked.''
+
[[Category:Guides]]
 +
[[Category:Platforms]]

Latest revision as of 09:00, 7 June 2025

This document will guide you through the process of installing and configuring Wine and LFS to allow you to run the LFS game client in Linux. We'll also touch on the subjects of configuring your wheel and solving common problems.

Intro

What to expect

Users have reported that LFS runs great on Linux. Force Feedback should be the only point that may cause issues. Graphics and audio appears to be at par with the native environment, and gamepads should work out of the box (although you may have to map the buttons manually).

This article was updated in June 2025; I (Bokujishin) have been playing LFS on Manjaro Linux (KDE Plasma Wayland) for about 2 years now, and it works just fine. The steps in this article were updated and verified to work on both Manjaro Linux and Ubuntu 24.04 (running in virtual machines), and so should work for most Arch-based and Ubuntu-based distributions.

Prerequisites

  • Basic knowledge of Linux and your distribution (shell, package manager).
  • A recent version of the Linux Kernel.
  • Willingness to spend a little time setting things up (probably less time than I spent writing this article!)

Basic setup

Install and configure Wine

LFS, like any other Windows software, runs on Linux through wine (or Proton, the Valve-developed fork that runs Steam games). LFS can be run using either of those, but wine is quite simple to setup, and lets you run LFS without launching Steam.

Ubuntu

On Ubuntu, you can install wine with the following command:

 sudo apt install wine

Note that LFS is still a 32-bit program, and Ubuntu will only install the 64-bit version of wine, so you need to enable support for the 32-bit architecture, and install wine32:

 sudo dpkg --add-architecture i386 && sudo apt update && sudo apt install wine32:i386

Manjaro

Manjaro makes things easier for us: you can open the GUI software center/updater to look for "wine" and install it (or use the pamac command, or more generally for Arch, pacman). You don't need to manually add support for the 32-bit architecture or install wine32.

winetricks for Vulkan and other tweaks

If your GPU supports Vulkan, you should enable dxvk (Vulkan renderer for DirectX) for better performance (in my case, it also prevented crashes from full grids of cars, and properly showed my GPU in the game's options).

Install it from the GUI (Manjaro) or with the following command (Ubuntu):

 sudo apt install winetricks

Of course, you can also use an equivalent command for your distribution, including pacman for Arch and Manjaro.

From the terminal, execute winetricks, you will be greeted with a simple GUI. From there, choose Select the default prefix > Install a Windows DLL or component > dxvk.

During installation, you may see warning about the wine prefix being 64 bits, you can ignore those warnings. On Ubuntu, you will be prompted to install multiple Microsoft redistributables.

Install LFS

If you haven't done so already, download the game from https://www.lfs.net, then open a terminal and execute the setup with wine:

 wine LFS_S3_7F_setup.exe

If wine fails to execute with the error wine: could not load kernel32.dll, simply delete the configuration folder in ~/.wine and try again. This error is especially likely to occur on Ubuntu, since we added 32-bit support manually.

Once the game is installed, you can launch it from the app launcher like any other app, or double-click the desktop icon (on Ubuntu, you will first need to allow executing it). You can also go the manual way and launch it through wine:

 wine ~/.wine/drive_c/LFS/LFS.exe

This can be useful to get logs in the terminal, if you have issues.

Controllers and force feedback

All controllers should work out of the box, as far as input is concerned. You will likely need to assign all axes and buttons to your preferences.

The main issue on Linux has to do with FFB, or rather the lack thereof: steering wheel manufacturers typically provide their drivers for Windows only, and getting FFB to work on Linux has historically proven challenging. However, things are much better today than they used to be, and we have several options, even for direct drive wheels and the multiple brands that sell them:

  • Oversteer is a generic steering wheel manager for Linux. Some distributions provide packages for it. The github repository also provides links to projects for specific drivers, so you should test FFB with Oversteer first (especially if you have a Logitech or Thrustmaster wheel), and then look for those specific drivers; for direct drive wheels, you can directly check the specific drivers, chances are you will not have FFB out of the box.
  • Logitech and Thrustmaster drivers are available in recent Linux kernels, those wheels should therefore work without much trouble.
  • Fanatec: A driver specific to Fanatec wheels is being developed. I am myself using a Clubsport DD and driving with this.
  • Moza, Asetek, and likely many others: A more universal option, which should work with at least Moza wheels, is available. The repository also claims support for Asetek and other brands (user feedback would be appreciated for those).

Note that wine 10 includes support for raw PID communication, which also helps directly translate FFB to Linux, and additionally allows games to make use of a wheel's advanced features, for instance using the FanatecSDK to communicate with the wheel's LEDs; LFS does not seem to be affected by this. Do also note that at the time of this writing, the wine version packaged with Ubuntu 24.04 is still 9.x.

Firmware updates

While wine allows running all sorts of software on Linux, with various success, firmware updates for your wheel base and other devices are still better left for a Windows OS. If you do not have a Windows PC available, you should try running a virtual machine. Or maybe we can petition manufacturers to provide Linux drivers and software...