June 3rd, 2012
Fab explains how to install and run Diablo III under Wine in Linux
Diablo III runs almost perfectly in Wine under Linux. The problem is that as of Wine 1.5.5, neither the game’s launcher nor the installer work. This means that if you already have an installed version of the game, maybe obtained by copying it over from a Windows installation, you can run it directly with
wine Diablo\ III.exe -launch. Otherwise, however, you are out of luck with stock Wine and need to compile it yourself with a few specific patches. Luckily, if you are running Ubuntu (or an Ubuntu-based distribution like Linux Mint), there is a PPA that already includes a patched version of Wine that you can install. The PPA installs Wine 1.5.3 but that should be fine. By the time the next Wine version or two roll around, these patches should have hit the regular version anyway which will mean Diablo III support in vanilla Wine.
This tutorial will explain how to install Wine from the PPA in Linux Mint 13 (and by extension other distributions based on Ubuntu 12.04) and how to configure it to install and run Diablo III. Additionally, I will show how to compile Wine with the needed patches in case you are running another flavour of Linux or can’t use the PPA for other reasons. The installation of the actual game is explained for the retail DVD version. If you are using a digitally purchased version, your mileage may vary.
The first thing we need to do is add this PPA to our system. The only file it includes is the patched wine package that makes the launcher and installer work. The following command will permanently add the PPA to our repositories and install the accompanying encryption key:
sudo add-apt-repository "deb http://ppa.launchpad.net/cheako/packages4diabloiii/ubuntu precise main"
Now we will refresh our package information and install the wine package. Since we have added the PPA, we will automatically install Wine from there. Execute the following command to do this:
sudo apt-get update && sudo apt-get install wine
Installing Diablo III
We are now ready to install Diablo III using our patched version of Wine. It turns out, however, that in order to install from the game DVD, we need to mount it with a special parameter. Otherwise, the installer will not be able to find some files and will refuse to install the game. First of all, please create the D3C1.0.0 directory in /media like this:
sudo mkdir /media/D3C1.0.0
Next, mount the DVD with this command (assuming your system’s CD/DVD drive is /dev/sr0):
sudo mount -o unhide /dev/sr0 /media/D3C1.0.0
We can now finally start the Diablo III install:
wine /media/D3C1.0.0/Diablo\ III\ Setup.exe
Since this is a fresh instance of Wine, we are most likely missing some of the Gecko packages which Wine needs in order to show HTML content. This is needed in almost all game installers and launchers and Diablo III is no an exception. When Wine asks you to install these Gecko components, please click “Install”.
The next thing you should see is the game’s installer and a big button labelled “INSTALL”. Click the button. From now on, the setup should run just like it does natively under Windows. You might as well make yourself a pot of coffee now as this will take a while. Or you could just sit there and read the backstory while looking at the pretty pictures. I went for the coffee option, myself. After the install has finished, you should see an option to launch the game. The installer should now close and the main game launch screen will come up.
Running Diablo III
The game is now installed and everything should work. Chances are, however, that you will not be able to log into Battle.net and thus you will be unable to play the game. If you try to log in, authentication of your credentials will always fail with “Error 3007″. This is due to security policies in newer versions of the Linux kernel. To fix this, quit the game and issue the following command:
echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
You will have to do this after every system restart, prior to playing the game. Therefore, you might as well include it in a startup script for the game, if you use such things. Restart the game, log into Battle.net and you will finally be ready to play.
After playing for a few hours, I can indeed confirm that the game runs perfectly in Linux. Just like WoW, I actually have a feeling that it runs slightly better (once you manage to set it up, of course) due to the lower resource usage of the underlying system. In any case, it is very playable and worth a purchase to run it exclusively in Linux, I think.
Patching Wine yourself
In case you aren’t running on a distribution compatible with the PPA we used so far, you will need to patch and compile Wine for yourself. This is a lot less scary than it sounds, trust me. The first thing you need to patch Wine is Git. if you haven’t installed it yet — and you should, it is the best version control system ever invented by man — you can do so by issuing
sudo apt-get install git in a terminal.
Please note: Since I am on a 64-bit system, I had to do all of these steps in a 32-bit Ubuntu VM. If you use a 64-bit version of Mint or Ubuntu, you might have to do the same. See the explanation under “Compiling Wine”.
Now download the Wine source code from their repository (have some patience, Wine is a big project and this will take a while):
git clone http://source.winehq.org/git/wine.git wine-git
You will now need to download four patches. Stick them into your newly created wine-git directory. These patches are:
- server: Move completion from async object to async queue
- server: Update stored completion information even after an async IO is queued (try 3)
- server: STATUS_MORE_PROCESSING_REQUIRED does not indicate that an async operation is complete (try 3)
- ws2_32: Use STATUS_MORE_PROCESSING_REQUIRED to indicate that the AcceptEx async is incomplete (try 3, resend)
Thanks to Erich E. Hoover for doing all of the actual heavy lifting in writing these. If you have downloaded the patches to the right directory, we can take advantage of his hard work and patch the Wine source:
patch -p1 < 86603
patch -p1 < 86604
patch -p1 < 86605
patch -p1 < 86606
That’s it. We now have the source code in place.
In order to compile your patched version of Wine, make sure that you have the necessary packages installed to compile software and everything you need to get Wine assembled correctly. On Ubuntu and Mint, installing the following should do the trick:
sudo apt-get install build-essential checkinstall flex bison xorg-dev libgl1-mesa-dev libpng12-dev libjpeg-dev libssl-dev libpulse-dev libglu1-mesa-dev libhal-dev libtiff4-dev libncurses5-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libmpg123
If you are using another distribution, please consult their documentation on how to get the necessary packages set up. This tutorial might be useful if you are on Gentoo.
In my case, since I am on a 64-bit system and Wine is essentially a 32-bit program, I could not find an easy way to actually compile Wine on my machine. What I did was set up a 32-bit installation of Ubuntu 12.04 in a VirtualBox VM and compiled there. This is far from ideal but sadly the only working solution I could find. I basically did everything in the VM and then copied over the result to my native machine. You can of course do the same thing on another 32-bit box, if you happen to have one. To compile in a way that makes it easy to copy the result, tell the configure script where you want the compile to happen (I’ve chosen a sub-folder of my home directory) and then copy that directory over to your native machine:
If you are on a 32-bit machine, just ignore this and simply run
./configure as usual. After that, you are ready to start compiling in earnest. If you haven’t gotten any fatal errors during the configure part, everything should be smooth sailing from here on out. You better get some Jaffa Cakes and lots of coffee, though. This is going to take ages (especially in a VM). Wine is a pretty big piece of code. Just make sure you execute these commands one after the other and otherwise relax and watch the Matrix fly by:
sudo make install
After all of that, you should be ready to install and play Diablo III (see above). If you are running another distribution, things might need a bit of tweaking and you will have to find the development libraries needed yourself, as their names will most likely be slightly different. If you have tips in that regard, or if you run into trouble, let me know in the comments. I will update this article with any useful information that I’ll come across or if the patches to support this game reach the Wine mainline.
Update — 7 June 2012 ¶
It looks like Patch 1.0.2b (released on 6 June) breaks the ability to join games (even local ones) for Wine users. You can fix this by prepending the following before starting your game:
setarch i386 -3
You can do this either in the .desktop file you start Diablo III with or directly from the command line. I now start the game from the command line like this:
setarch i386 -3 wine ~/.wine/dosdevices/c\:/Program\ Files\ \(x86\)/Diablo\ III/Diablo\ III\ Launcher.exe
For more information on this issue and other problems with running the game on Wine under Linux, see this thread on the Diablo III forum.