Wednesday, May 2, 2012

Diablo 3 with wine under Linux x86_64

Hello everybody. 

Holiday in Japan: fiancée flew back to France a few days ago, and low on money.
3 days like a gremlin in its cave, my back really makes me suffer.
I switch chairs; geek again until late night. 

A noble goal. 
Have that long-awaited Diablo III run under my freshly-installed Precise Pangolin, 64-bit. 
Here are the steps. 

1. Precise Pangolin 

Unity now works great. 
It pleases power users too: no more clicks. Almost never.
Better than Mint, which had awful bugs from time to time.

2.  Diablo III - Beta

 

a) Get Wine to work
$ sudo apt-get build-dep wine1.4
$ tar xjvf wine-1.5.3.tar.bz2 
$ cd ~/wine-1.5.3
$ patch -p1 < 0001-AcceptEX-patch.patch
$ patch -p1 < reset.patch
$ ./configure
$ make
  • Compress the wine-1.5.3 folder, copy it to your x64 machine.
  • Download winetricks. 
  • Install Visual Studio runtime.
$ env WINE=$HOME/wine-1.5.3/wine sh $HOME/wine-1.5.3/winetricks vcrun2010

b. Get Diablo 3
$ ~/wine-1.5.3/wine Diablo-III-Beta-enUS-Setup.exe


If that does not work, install it in a Windows virtual machine and copy its whole installation folder back to your Linux box.

If you have a Battle.Net account at that point, or an open beta key, you're good to go.

$ ~/wine-1.5.3/wine ~/d3beta/Diablo\ III.exe -launch

If you want to play the beta without a key, or if you want to enjoy the game by yourself in offline mode, follow the rest.


 c. Get Mooege & Patcher  

Mooege is a Battle.Net emulator for Diablo 3.
It does suffer a few bugs, but works already quite well.
There are different ways to install it.
You can pick a precompiled version here, or compile it yourself.
Since it's C#, you can compile it for Mono or .NET4.
All the steps for this are detailed there.
From what I tried, the bugs are the same with both compilation modes...
It does crash randomly because of garbage collection issues under Wine.

The best choice is still to make Mooege run in a VirtualBox.
  • Install Windows in a virtual machine.
  • Add a bridge network adapter.
Bridge adapter attached to the Wifi interface
  • You'll see the network address of it when running the virtual machine.
Here is the IP of this machine on my LAN.
  • Mooege: there is an Assets\MPQ folder in your Mooege root folder (or the one you built with VS2010 or Mono). Copy all the files and folders from your C:\Program Files\Diablo III Beta\Data_D3\PC\MPQs folder into Assets\MPQ.
  • Run Mooege afterwards.
Mooege in background.
  • Now run Diablo with that command line:
$ ~/wine-1.5.3/wine ~/d3beta/Diablo\ III.exe -launch -auroraaddress 192.168.11.112:1345


When you get to the login screen, stop. You can go to video settings in D3 to make it windowed.
Login screen on my computer.

There is an issue in the latest versions of the Beta that force us to patch the Battle.net library in order to continue.
That may be fixed in the future versions of Mooege though, but nothing for sure.

There's an in-memory patcher (Egris BNet Patcher) that does that job.
Unfortunately it has been designed for people under Windows.
I have had some feedback that said it may work under Linux, once compiled against .NET2.0 .
Didn't work out for me though.

So there's a C code that does the same job under Linux.
Not well refined, you have to use sudo under Ubuntu to make it work (new policies...) and it does not detect by itself Diablo 3 process.

If that topic becomes hot, I'll maybe improve the stuff.

Last lines then:
  • Compile and run the patcher, login screen still on. 
$ git clone git@github.com:vperron/linux_bnet_patcher.git
$ cd linux_bnet_patcher
$ make linux_bnet_patcher
$ ps aux              [get the Diablo3 process ID]
$ sudo ./linux_bnet_patcher <Diablo3_PID>
  • Once the job's done, enter the Mooege credentials.
Login: test@
Password: what you want.

Click play. Choose a character. Enjoy.

Final setup.

References

Thread on WineHQ
Thread on OwnedCore
...information from too many places to be listed.




1 comment:

  1. Hi Victor,
    i tried your linux patcher on client 10057 it didn't work. is there any way to fix it for client version 1.0.3.10057?
    on my virtual winxp mooege + ponypatcher + d3 works fine. communication between d3 and mooege(virtual) also fine.
    i have ubuntu precise 32bit and wine 1.5.9

    ReplyDelete