Using current Wine on Ubuntu is easy!
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.
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.
There is a Ubuntu PPA available which provides up to date versions of Wine. You can install it by executing this command:
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:
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
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
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.
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.
For newer applications that use HTML views, you may have to install Internet Explorer 8 using winetricks.
Further hints may be added later.
All code snippets in this post are made available to use under the MIT Licence.