Steam, linux and wine

Thu 11 September 2014

This isn't about my worshiping of Bacchus whilst using linux in a sauna, but instead about getting a windows-only steam game to work on a recent 64 bit linux distro. I'm using slackware, but I suspect the pitfalls and solutions I encountered would be similar on other distros.

This article was originally written on 1 August 2014, and an audio version was released on Hacker Public Radio on 11 September 2014. Be warned, it gets a little technical!

My 9 year old son loves the game Ace of Spades (AoS). His computer runs slackware linux 14.1 with KDE and he uses it for you tube, games, writing documents with libre office and listening to music, and he's quite comfortable with it. But, since Ace of Spades is only available for windows, I kept his computer dual booting with Windows XP. On the boot menu that selects between operating systems the label reads "FailXP", and without any irony, that's what he calls it. I don't usually approve of such childish name-calling, but my excuse here is that my son is actually a child. Anyway, post-April 2014, when XP finally stopped being supported by Microsoft, I said no more FailXP. My son accepted my reasons, but we agreed that I'd find a way to let him play Ace of Spades again.

Despite AoS being exclusive to steam, and steam going all linuxy of late, there's no linux version of Ace of Spades (boo to you Jagex, the developer company), and I didn't want to have to install Fail7, sorry, Windows 7, and definitely not 8, so my remaining option was to get steam and so AoS working in wine. A look at the steam page on wineHQ encouraged me.

My first step was to install wine which allows windows programs to run in linux (in a way that's perfect legal). It was straightforward enough. I just downloaded a slackware package provided by slackware guru Alien Bob and installed it. Non-slackers can do yum or apt-get install wine and such like, or use a fancy-pants GUI installer. The computer's running 64 bit Slackware, but I'd previously added multilib capabilities (thanks to that generous Alien Bob chap), i.e. installed essential 32 bit libraries in the system so 32 bit applications could be run. Now, here's a slightly confusing point. I installed wine compiled for a 64 bit system, but wine itself will run 32 bit windows binaries, which is what I want because Steam is only available in 32 bit. This fact is worth bearing in mind, as we'll see.

Next I installed steam using the "Download" link given in the aforementioned wineHQ page, and then, as my normal user, I ran

wine msiexec /i SteamInstall.msi

and steam installed just fine after a few clicks on some ugly dialog windows. I then found the executable hiding away in my home dir: .wine/drive_C/Program Files/Steam/Steam.exe. I cd'd to that dir and then did

wine Steam.exe

and it started up, but there was no text in the pretty window that popped up. Hmmm, a quick scan of the wineHQ page led me to the solution:

wine Steam.exe -no-dwrite

and now I could see the text, but it seemed to know that my user name was mcnalu. Eek! How did it know that? The only thing I could think of is that steam recognised the mac address of my network card. Creepy. Anyway, the steam client seemed to work just fine. I then tried to launch of Ace of Spades. It seemed to install it OK, but any attempt to run it ended in failure with no GUI message at all and the most generic of inscrutable error messages in the terminal where I'd launched it.

After a bit of reading around I came across winetricks and decided that I should 've used that to install steam. It's actually just a perl script that automates various irritating wine configuration tasks, and it has a special steam option. Before doing this, I ran the SteamInstall.msi using the same command as above, but this time clicked the button to remove the steam installation. Next, I downloaded and installed winetricks (in my case using sbopkg, but your linux's package manager might have it, and if not, it's just a script which you can download and run anywhere you like). Next, as a regular user, I did

winetricks steam

and it downloaded a steam installer but then stopped and complained that the sha1sum didn't match. A quick look at the winetricks script revealed that an sha1sum from March 2011 is hardcoded into it (very odd, IMHO), so I used the sha1sum command to generate the sha1sum of the installer I'd downloaded and replaced the sha1sum in script with that (a bit naughty). Then winetricks steam worked perfectly. To my surprise the installer was not the same as the one I had run previously. Amongst other things, it had different dialog windows. But this encouraged me - perhaps the previous installer was old or perhaps misconfigured.

Once steam was installed I had to log in (no creepy auto-username detection this time!) and, as before, the client worked well. I then tried to launch AoS and... it didn't work. I was slightly heartened to see the terminal window was full of much more verbose errors than before, and after a few minutes poring over it, I decided the problem was that steam wanted access to the audio library OpenAL and wine was trying to oblige but couldn't find libopenal.so. Strangely, OpenAL was actually installed, but only the 64 bit version, so I guessed wine was after the 32 bit version so it could fool AoS into using it disguised as a windows DLL.

OpenAL is not part of stock slackware, and so libopenal does not come with multilib 32 bit stuff I had previously installed. It wasn't hard to create the necessary package though. I downloaded the 32 bit OpenAL package from AlienBob's site and, as root, ran

convertpkg-compat32 -i OpenAL-1.15.1-i486-2alien.tgz

and this generated the package OpenAL-compat32-1.15.1-x86_64-2aliencompat32.txz in the /tmp directory. I then did

installpkg /tmp/OpenAL-compat32-1.15.1-x86_64-2aliencompat32.txz

and 32 bit OpenAL was installed in my system, specifically libopenal.so was now present in /usr/lib, whereas before it was only in /usr/lib64.

I then started AoS again from Steam and it worked! Happy Ending. Well, almost, after happily playing it for a while, my son was kicked from the server by other players. It's not the first time he's been accused of cheating when, in fact, he's just very good at the game!