Gentoo Wiki




Counter-Strike on Linux!
Counter-Strike on Linux!

This guide aims to show you how to configure your Gentoo Linux machine to play Counter-Strike 1.6 and other similar games. It covers such things as video settings, mouse settings, WINE installation and Steam installation. The assumed setup for this guide is as follows, however the guide should be mostly universal and will hopefully be expanded to accommodate other setups:

  1. You have an nVidia graphics card.
  2. You have a Logitech mouse.
  3. You have a Steam account which has Half-Life

Installing JACK and WINE

WINE has better support for OSS than for ALSA. Often users find that it is easier to give in and use OSS than to use ALSA. However, ALSA often has widespread use throughout a Linux system. This fact will be dealt with in the final stages of installation.

We need to ensure that the jack and oss useflags are enabled as we will be using OSS via JACK as our audio daemon for whilst counter-strike is running.

emerge gentoolkit
euse -E jack oss

Or you can just add jack and oss to your /etc/make.conf in your USE= flags section.

WINE is rapidly developed and often it takes time for Gentoo to mark a WINE package as being stable. We need to tell Portage to accept testing, ~x86 versions of WINE. We will do likewise with JACK

echo "app-emulation/wine ~x86" >> /etc/portage/package.keywords
echo "media-sound/jack-audio-connection-kit ~x86" >> /etc/portage/package.keywords
emerge -pv app-emulation/wine

Now check that wine will be installed with JACK enabled and if you're satisfied:

emerge -v app-emulation/wine

Once that's complete you will need to setup WINE, to do this we will execute winecfg as the user you plan on running Counter-Strike


winecfg should allow you to select JACK as its audio driver. Do it. You'll also want to choose a place to call C:\ (WINE chooses ~/.wine/drive_c by default) and likewise setup all of your Windows drives. JACK and WINE should both now be installed.

Installing the Tahoma font

There are a few ways one may do this

cp -R /path/to/Windows/Fonts /path/to/wine/windows/

Now Steam should work to a half-decent degree once it's installed.

Downloading and installing Steam

Note: Valve has changed the steam installer to be a .msi package. No worries, just use
$ wine msiexec /i SteamInstall.msi
Note: To select a text box (i.e: for editing) in the modern Steam UI you need to use the right click

Now navigate to your new Steam directory and start Steam, log in and download Counter-Strike.

Nice extras for pro. gamers

Many of us are (maybe a little too) particular about the way our mouse behaves, or want to increase gamma for gaming so that we can see easier. Under Linux these things are easily done.

LoMoCo - a mouse tale

For slightly more control over your Logitech mouse, you should install lomoco, a fork of lmctl.

# echo "sys-apps/lomoco ~x86" >> /etc/portage/package.keywords
# emerge sys-apps/lomoco

We'll use lomoco in the script provided in the next section.

Xset - remove mouse acceleration

Often it's preferred that the mouse does not have any acceleration in-game so that a 1:1 relationship max exist between mouse movements and cursor/cross-hair movements. Xset is used to accomplish this

# emerge x11-apps/xset

We'll use xset in the script provided in the next section.

Increase the polling rate of your USB mouse

Many gamers like to get the most of everything they use (that way they can't blame it so much when they lose.) For information on making Linux poll the mouse for it's position faster, see X11 Mouse/Change Mouse Resolution

nVidia-settings for the slightly vision impaired

We can use nVidia's nvidia-settings utility to facilitate scripted alterations to display settings.

Warning: nVidia-drivers version 1.0.9742 (beta drivers) contains a bug which will not allow Counter-Strike to work under WINE. Don't use it!
# emerge nvidia-settings
Note: If you're using a testing (~x86) version of the nvidia-drivers package, you may want to do the same for nvidia-settings.

Tying it all together

We have everything installed and configured to a degree. Now we just need to make everything work properly. To do this, we write a script, and a few supporting configuration files.

Note: The following configuration file will need to be edited to work with your system. Pay particular attention to the Steam installation directory.

Place the following file somewhere in your home directory (perhaps ~/cs/ It will start JACK, reduce mouse sensitivity for playing, remove mouse acceleration and then start Counter-Strike. When you close Steam it will kill JACK and increase mouse sensitivity.

Code: Code
# Start the JACK sound daemon
killall jackd
jackd -d oss & 
# Some use a low sensitivity ingame, higher in X. So we reduce the CPI of the mouse.
lomoco -4
# Disable mouse acceleration
xset m 0 0
# Set gamma correctly
nvidia-settings -l --config="~/cs/cs-nv-settings"
# Start Counter-Strike
wine "C:\Steam\steam.exe" -applaunch 10

# Undo all of that
lomoco -8
nvidia-settings -l --config="~/cs/Xorg-nv-settings"
killall jackd

You'll also need to create the nvidia-settings files which are loaded before and after Counter-Strike. You can do this by executing nvidia-settings and configuring your display (for example, increasing gamma), then copying the created ~/.nvidia-settings-rc file to the required file (in the given example, ~/cs/cs-nv-settings or ~/cs/Xorg-nv-settings)

$ chmod +x ~/cs/

Now everything is complete. Simply run the script to start Steam and Counter-Strike

Final notes

I hope that you've found this HowTo article useful in making Counter-Strike work under WINE on Gentoo. Please keep the article up-to-date, add to it and expand it so that it becomes glorious. I would like to see adaptations of the scripts in this system to ATI cards, or perhaps a universal script. Also, it would be fantastic if someone could make ALSA work (well) with Counter-Strike under WINE and also add mouse configurations for non-logitech mice.


Since a recent version, a clean install of Steam it will enable their in-game friend management client. At the time of testing, up to wine 0.9.52 will crash everytime you try to load Counter-Strike (or any other steam game) if this is enabled. The error you will receive is similar to the one below:

fixme:win:SetLayeredWindowAttributes (0x700be,0x00000000,26,2): stub!
fixme:win:SetLayeredWindowAttributes (0x700be,0x00000000,26,2): stub!
fixme:win:SetLayeredWindowAttributes (0x700be,0x00000000,26,2): stub!
fixme:win:SetLayeredWindowAttributes (0x700be,0x00000000,241,2): stub!
fixme:win:SetLayeredWindowAttributes (0x700be,0x00000000,241,2): stub!
err:seh:raise_exception Unhandled exception code c0000005 flags 0 addr 0x7ee42d50
fixme:win:SetLayeredWindowAttributes (0x700be,0x00000000,218,2): stub!
fixme:win:SetLayeredWindowAttributes (0x700be,0x00000000,157,2): stub!
fixme:win:SetLayeredWindowAttributes (0x700be,0x00000000,157,2): stub!
fixme:win:SetLayeredWindowAttributes (0x700be,0x00000000,16,2): stub!
fixme:win:SetLayeredWindowAttributes (0x700be,0x00000000,0,2): stub!
fixme:shdocvw:OleInPlaceObject_InPlaceDeactivate (0x10754190)
fixme:shdocvw:OleInPlaceObject_UIDeactivate (0x10754190)
fixme:shdocvw:OleObject_Close (0x10754190)->(1)

To disable it, in the Steam client go to: File -> Settings -> In-Game (tab) -> Uncheck the box for "Enable Steam Community In-Game".

On newer versions of Wine you get no errors - the game just won't start after the "Launching game" -dialog. The solution applies also for this case.

ATI (X700 for me, X1400 for a friend) users may have difficulty with the game crashing very soon after you have joined a server. This for us has been solved by adding to xorg.conf in the device section:

File: /etc/X11/xorg.conf
Option "Capabilities" "0x00000800"
Option "KernelModuleParm" "locked-userpages=0"
Retrieved from ""

Last modified: Mon, 15 Sep 2008 03:53:00 +0000 Hits: 20,321