Wine on Debian/Ubuntu

Mar 2, 2013 00:00 · 538 words · 3 minutes read linux ppa ubuntu wine

Ever since I left the Windows world completely two years ago, there have been occasions where I had to test or temporarily use a Windows only application.

Wine is quite the awesome piece of software. It emulates both 32-bit and 64-bit Windows API, and lets you run your Windows only applications under Linux.

Installing Wine

By default Ubuntu does include a default Wine version from the stable branch of Wine. Given the steady improvements in Wine allowing you to run current Windows applications, it though is desirable to have a recent development version.

Note: if you run Debian 9 or Ubuntu 14 (or newer) skip adding the PPA!!!

There is a Ubuntu PPA available which provides up to date versions of Wine. You can install it by executing this command:

sudo add-apt-repository ppa:ubuntu-wine/ppa && sudo apt-get update

This will add the Wine PPA to your system, and ask you to accept the PPA’s signing key. Once done, you may install Wine using:

sudo apt-get install wine winetricks

Winetricks is incredibly helpful for when Wine has not implemented the complete API required by an application.

This will install Wine, and Winetricks. Winetricks is a helper which lets you install common Windows libraries and applications to improve your experience with running Windows applications.

This includes libraries such as DirectX or .NET, but also includes applications like the Internet Explorer. Executing Winetricks will

E.g. to list all options for installing original Microsoft libraries instead of Wine replacements, you can run

winetricks dlls list

You will recognize a few suspects there, such as codes, fonts, or even the Windows Script Host.

How to use Wine

One of the amazing things about Wine is the ability to create a sandboxed environment for your Windows applications.

Wine does so by supporting an environment variable named WINEPREFIX. By specifying a different prefix for each application or use-case you could separate applications from each other, and fine-tune every prefix to the applications needs.

Here is my default starting point for creating a Wine environment.

WINEARCH=win32 WINEPREFIX=$HOME/.wine winecfg
WINEPREFIX=$HOME/.wine winetricks ddr=opengl fontsmooth=rgb sound=alsa hosts
WINEPREFIX=$HOME/.wine winetricks corefonts mfc42
WINEPREFIX=$HOME/.wine winetricks msxml3 msxml6
WINEPREFIX=$HOME/.wine winetricks riched20 riched30
WINEPREFIX=$HOME/.wine winetricks vcrun2005 vcrun2008 vcrun2010

The first line will create a data directory for Wine, and open the Wine configuration utility where I usually check the Desktop Integration tab to correct the Wine mapping for the My Documents folder. It seems like Wine always sets this to your HOME directory.

The second line will set the DirectDraw renderer to OpenGL, which does help with performance. I also select font smoothing for RGB LCDs, and select the ALSA sound driver. Also, I prefer to have an empty hosts file in my Wine sandboxes since some applications check for its' existence.

Finally, the remaining lines will install the original Microsoft Windows fonts, the MFC, MS-XML, two versions of MS RichText editor, and three common Visual C++ runtime libraries.

With that you are set for most applications.

I have no sound!?

Should that happen you might want to add a few tricks:

WINEPREFIX=$HOME/.wine winetricks quartz wmp10

What else?

For newer applications that use HTML views, you may have to install Internet Explorer 8 using winetricks.

WINEPREFIX=$HOME/.wine winetricks ie8

Further hints may be added later.

Comments powered by Disqus