How to Easily Install Windows Applications In Linux with q4wine

The WINE project has helped many users continue to use some of their favorite Windows programs without the hassle of dual-booting, or losing resources to a virtual machine. Setting up and running WINE isn’t the easiest feat, but fortunately the open source community has produced q4wine, a program to help manage WINE and the excellent winetricks script.

There’s two ways to get these two programs installed on a typical Ubuntu machine. Which way you choose depends on your preferences:

First Method

Ubuntu includes a version of q4wine (v0.121-4) in the Quantal repositories. This will have gone through the Ubuntu testing process prior to release, but this version appears to be a bit older.

Installing this version is as simple as selecting it in the Software Centre, or running the following at the command line:

sudo apt-get install q4wine

Second Method

There is also a PPA containing an updated version of q4wine (v0.999-rc8-0ppa2~precise1) as well as the most recent unstable (q4wine-unstable) build (v0.999-20121116-234140-3627460-0ppa1~quantal1) for the truly brave.

You can install one of these updated versions with the following:

sudo add-apt-repository ppa:tehnick/q4wine
sudo apt-get update
sudo apt-get install [q4wine|q4wine-unstable]

I’ll be using the Ubuntu repository version for this article.

Before you start up q4wine, it might be useful to start up “wineconfig” (found in the new “Applications > Wine” menu you should have now). This will enable the new WINE installation to update any preferences you might have from a previous install. Once completed, you can launch “q4wine” with that name at the command line, or in the “Applications > System” menu.

wine-startup

On first launch, q4wine will run a wizard to get things set up. The first screen is a simple welcome to the program, and the second displays a little about the authors.

Installing q4wine - part 1

Installing q4wine - part 3

The next screen will ask for paths to your WINE installation… these should be filled in for you. In the event they’re not, on an Ubuntu system the values should be as follows:

wine bin:/usr/bin/wine
wine server:/usr/bin/wineserver
wine loader:/usr/bin/wine
wine libs:/usr/lib/wine (for 32-bit systems)
/usr/lib/x86_64-linux-gnu/wine/ (for 64-bit systems)

Installing q4wine - part 3

You’ll also need to check some paths to other utilities on the following two screens, but these also should be filled in for you. You can always use “whereis” or “locate” to find the programs.

Installing q4wine - part 4

The next screen asks for proxy information for your network. You can safely leave this field as it is, unless you are using a proxy for your Internet connection. The next screen will ask how you’d like to do root-level authorization (such as to mount a CD-ROM). Select “gui sudo” here to use a graphical tool.

Installing q4wine - part 6

Installing q4wine - part 7

The last screen will inform you that setup is complete.

Using q4wine to install a number of applications is simple using the “winetricks” script. On the “Setup” tab, select the “System Software” tab, then click the wine glass button – this will launch winetricks, as shown below.

q4wine: launch winetricks

The winetricks window will display a list of applications and other software that can be installed automatically (if none appear, try the “Refresh list” button). Selecting one of these and clicking the “Install” button will install the application for you.

q4wine - install mspaint

q4wine - winetricks install mspaint

Running the application isn’t quite as intuitive, however. From the “Programs” tab, click the “Default” item, and right-click on the empty window to the right. One of the options will be “New,” and selecting this will allow you to create an icon as shown below.

q4wine - mspaint icon

In the “Program” field, you’ll need to find where winetricks installed your program (for my MSPAINT install, it was ~/.local/share/wineprefixes/mspaint/drive_c/windows/), select the .EXE, and click “OK” to create the icon.

q4wine - mspaint icon

You’ll now be able to launch your program by double-clicking this icon (you can also drag this to the desktop for an easily-accessible launch icon). Using the “Run” command, you’ll also be able to install programs not available via winetricks. So go find those old install CD’s and MSI’s and get started! (I just installed the excellent Notepad++ myself…)

q4wine-notepad-mspaint

Enjoy!