Tuesday, 15 May 2012

Diablo 3 on Ubuntu Linux with Wine!

Be advised that there is a Blizzard Auto-banning Linux clients issue:


I used the following pages’ info to get Diablo 3 from DVD install version 1.0.0 working with Wine 1.5.4 on Ubuntu 11.10 64 bit with NVidia Optimus graphics. I do not issue any guarantee this will work for you.

Wine HQ patches for Diablo 3 here.
Wine from source with patches, info on wine prefixes here.
Some notes on running Diablo 3 beta from benV here.

Here are my steps for installation:
Remove any installed wine:
sudo apt-get remove wine

Remove any winehq repo files from your apt lists /etc/apt/sources.list.d/:
sudo rm /etc/apt/sources.list.d/winehq.list
sudo apt-get update

Install Git core:
sudo apt-get install git-core

Download the wine source from WineHQ’s GIT repo to your home folder/wine-git:
git clone git://source.winehq.org/git/wine.git ~/wine-git

Install dependencies:
sudo apt-get build-dep wine
sudo apt-get install fakeroot

Install checkinstall to manage install
sudo apt-get install checkinstall

Download WineHQ’s patches for Diablo3, where <URL> and <PATCH> is the URL and number for each patch  respectively:
mkdir ~/wine-patches
wget <URL> -O ~/wine-patches/<PATCH>
Patch each successive patch. I used patches 86102-5 and the bug patch 28201:
cd ~/wine-git
patch -p1 < ~/wine-patches/<PATCH>
./configure --prefix=/usr
make
./tools/make_requests

Install from source using checkinstall. Answer yes and make a comment if you want:
sudo checkinstall --fstrans=no --pkgversion=1.5.4

You will end up with a .deb install package in that folder for later use.
Mount Diablo 3 DVD with the unhide option. My /etc/mtab:
/dev/sr0 /media/D3C1.0.0 udf ro,nosuid,nodev,unhide,uid=1000,gid=1000,iocharset=utf8,umask=0077,dmode=0500,uhelper=udisks 0 0

Run Diablo 3 installer using Wine:
wine /media/D3C1.0.0/Diablo\ III\ Setup.exe

Wine will ask to install Gecko so that the HTML in the Diablo 3 installer will display, say yes and let it complete before you proceed with the installation. I also had to exit the installer and run wine again to start the game.

I use bumblebee graphics card drivers on my laptop because of the Nvidia hybrid graphics card so I used optirun to get Diablo 3 to use the Nvidia hardware for OpenGL:
optirun bash
wine ~/.wine/drive_c/Program\ Files/Diablo\ III/Diablo\ III.exe --opengl

Troubleshooting:
I used winetricks to install vcrun2008, which is probably needed: 
winetricks vcrun2008 

I initially had errors getting OpenGL to start with error Direct3D9 is not available without OpenGLand these packages might have helped:
sudo apt-get install --reinstall libc6-i386
sudo apt-get install ia32-libs*
sudo apt-get install libgl1-mesa-glx:i386 libc6:i386

The WineHQ page for Diablo 3 does mention game instability but it’s not bad for a day 1 release! Be sure to check for more patches and comments there. I have not had time to re-test these exact steps and because the game performance on my Dell XPS L502X isn’t great. I will try tweaks like D3D registry OffscreenRenderingMode = backbuffer some time.