Difference between revisions of "Running LFS on Linux"

From LFS Manual
Jump to navigationJump to search
 
(13 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
{{historical|This page or section might contain outdated information, but is kept for historical reasons.}}
 +
 
<!-- 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 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]].
Line 15: Line 17:
 
The steps in this article has been verified to work with:
 
The steps in this article has been verified to work with:
 
* LFS S2 6J
 
* LFS S2 6J
* Debian GNU/Linux 8.1 (x86_64) and wine-1.6.2.
+
* Kernel 3.16.7
 +
* Debian GNU/Linux 8.1 (x86_64)
 +
* Wine-1.6.2
 
* Logitech G25 Racing Wheel
 
* Logitech G25 Racing Wheel
 
* Xbox 360 Wireless Controller for Windows
 
* Xbox 360 Wireless Controller for Windows
  
=== prerequisites ===
+
=== 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 48: Line 52:
  
 
==== Enable Multiarch ====
 
==== Enable Multiarch ====
<!-- This should be a template -->
+
{{warning|This step is only required if you're running a x86_64 (ie: 64-bit) operating system!}}
<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!):
 
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!):
Line 70: Line 71:
  
 
Download LFS ([https://www.lfs.net/downloads list of mirrors]):
 
Download LFS ([https://www.lfs.net/downloads list of mirrors]):
   wget <nowiki>https://www.lfs.net/download/LFS_S2_6J_setup.exe</nowiki>
+
   wget <nowiki>https://www.lfs.net/download/LFS_S3_6V_setup.exe</nowiki>
  
 
Run the executable with Wine to install the game:
 
Run the executable with Wine to install the game:
   wine LFS_S2_6J_setup.exe
+
   wine LFS_S3_6V_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\).''
 
''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\).''
Line 85: Line 86:
 
== Configure a game controller ==
 
== Configure a game controller ==
  
Install the package that allows you to test, calibrate and alter the configuration of your joystick/wheel:
+
Install the package that allows you to test, calibrate and alter the configuration of your input device ('''joystick as well as wheel'''):
 
   sudo apt-get install joystick
 
   sudo apt-get install joystick
  
Get the handler for your joystick device:
+
Get the handler for your input device:
 
   cat /proc/bus/input/devices | grep js
 
   cat /proc/bus/input/devices | grep js
  
Line 94: Line 95:
 
   H: Handlers=event12 js0
 
   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.''
''Make note of the '''eventX'' data <br />If you have multiple joysticks connected it might be easier to manually read the file to find the handler for your wheel.''
 
  
 
If you like, you may test the force feedback of your device:
 
If you like, you may test the force feedback of your device:
Line 113: Line 113:
 
   [16568.948617] logitech 0003:046D:C299.000F: Force feedback support for Logitech Gaming Wheels
 
   [16568.948617] logitech 0003:046D:C299.000F: Force feedback support for Logitech Gaming Wheels
  
'' Make not if the ID ("0003:046D:C299.000D").''
+
'' 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'''
 
Then change the value in the corresponding "range" file, for example: '''/sys/module/hid_logitech/drivers/hid\:logitech/0003:046D:C299.000F/range'''
Line 123: Line 123:
 
=== No sound ===
 
=== No sound ===
  
If you are not getting any sound in LFS, trying installing the Advanced Linux Sound Architecture (ALSA):
+
If you are not getting any sound in LFS, trying installing the Advanced Linux Sound Architecture (ALSA) (a [https://www.lfs.net/forum/thread/98260 thread] suggests, on Manjaro kernel, to install the 32-bit version of ALSA and OpenAL to make sound work):
   apt-get install alsa-base alsa-utils  
+
   sudo apt-get install alsa-base alsa-utils  
  
 
Then run the configuration utility to make sure the ouput devices are configured correctly:
 
Then run the configuration utility to make sure the ouput devices are configured correctly:
Line 131: Line 131:
 
''Use left/right arrow keys to select the Master item and up/down to change gain. <br />
 
''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").''
 
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 ===
 
=== The program has encountered a serious problem ===
Line 136: Line 141:
 
I ran into issues after switching from software rendering to NVIDIA's driver package.
 
I ran into issues after switching from software rendering to NVIDIA's driver package.
  
If you encounter an error message similar (or identical to):
+
If you encounter an error message similar (or identical) to:
  
 
   Unhandled exception: page fault on write access to 0x7bf02fe8 in 32-bit code [...]
 
   Unhandled exception: page fault on write access to 0x7bf02fe8 in 32-bit code [...]
Line 146: Line 151:
  
 
   /usr/bin/wine-development LFS.exe
 
   /usr/bin/wine-development LFS.exe
 +
 +
=== Momentary Stuttering ===
 +
 +
A LFS community forum member have [https://www.lfs.net/forum/post/1898818 reported] experiencing momentary sound + graphic pauses when launching LFS from the (Wine) desktop shortcut created by the installer.
 +
 +
Launching the game from a terminal or configuring the shortcut to 'Run in terminal' appears to resolve the issue.
 +
 +
This has yet to be confirmed by another user.
 +
  
 
== Advanced topics ==
 
== Advanced topics ==
Line 156: Line 170:
 
   nice -10 wine LFS.exe
 
   nice -10 wine LFS.exe
  
''Niceness values range from -10 (most favorable) to 19 (least favorable).''
+
''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:
 
To change the priority of an already running process, first get the PID (process id) of LFS:
Line 191: Line 205:
  
 
Run the installer:
 
Run the installer:
   ./NVIDIA-Linux-x86_64-352.30.run
+
   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.''
 
''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 11:48, 13 March 2024

TemplateIconHistorical.png This page or section might contain outdated information, but is kept for historical reasons.

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.

Intro

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. 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 make efforts to make sure that LFS runs on Linux and maintains comparability with older versions of Windows.

The Demo and S1/S2 versions should work equally well.

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).
  • 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

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:

 deb http://ftp.se.debian.org/debian/ jessie main contrib

Obviously you do not need to change the mirror. Also, it is not necessary to add contrib to the deb-src entry.
ctrl+o to save, ctrl+x to exit.

Enable Multiarch

Caution.png This step is only required if you're running a x86_64 (ie: 64-bit) operating system!

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

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):

 sudo apt-get install wine wine32 winetricks

Then install the Windows DLLs required to run LFS properly (source):

 winetricks d3dcompiler_43 d3dx9_43

Note that we do NOT issue this command as root!

Install LFS

Download LFS (list of mirrors):

 wget https://www.lfs.net/download/LFS_S3_6V_setup.exe

Run the executable with Wine to install the game:

 wine LFS_S3_6V_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.
Follow the on-screen instructions. This guide assumes that you install LFS to the default location (C:\LFS\).

Change to directory where LFS was installed and run LFS:

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

That's it!

Configure a game controller

Install the package that allows you to test, calibrate and alter the configuration of your input device (joystick as well as wheel):

 sudo apt-get install joystick

Get the handler for your input device:

 cat /proc/bus/input/devices | grep js

The command should output something like:

 H: Handlers=event12 js0

Make note of the eventX data
If you have multiple input devices connected it might be easier to manually read the file to find the correct handler.

If you like, you may test the force feedback of your device:

 ffcfstress -d /dev/input/event12

Replace event12 with whatever data you noted in the previous step.

To adjust the gain and autocenter 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/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) (a thread suggests, on Manjaro kernel, to install the 32-bit version of ALSA and OpenAL to make sound work):

 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.
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

Momentary Stuttering

A LFS community forum member have reported experiencing momentary sound + graphic pauses when launching LFS from the (Wine) desktop shortcut created by the installer.

Launching the game from a terminal or configuring the shortcut to 'Run in terminal' appears to resolve the issue.

This has yet to be confirmed by another user.


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.

Then "renice" the process:

 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.

Launch LFS from a headless environment

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:

 sudo apt-get install xserver-xorg xinit

Then use xinit to launch wine (and LFS):

 xinit "/usr/bin/wine32" "LFS.exe" -- :1

Manually install NVIDIA's driver package

First install the packages required to successfully run NVIDIA's installer package:

 sudo aptitude install binutils gcc make linux-headers-$(uname -r)

Note that $(uname -r) will be reassigned to your kernel version. This is called command substitution and is, in this case, pretty safe.

Download your desired NVIDIA driver:

 wget http://uk.download.nvidia.com/XFree86/Linux-x86_64/352.30/NVIDIA-Linux-x86_64-352.30.run

Make the binary file executable:

 chmod +x NVIDIA-Linux-x86_64-352.30.run

Run the installer:

 sudo ./NVIDIA-Linux-x86_64-352.30.run

Choose to install NVIDIA's 32-bit compatability libraries when asked.
Choose to automatically update the X configuration file when asked.