Wine
Or, running Windows apps without Windows 

(C) Dan Kegel
July 2008

Contents

1. Background (migrating to linux; virtualization not always appropriate)
2. Basics (what is Wine)
3. Installing Wine
4. Installing and running Windows applications
5. What to do when apps don't work with Wine
6. Graphical front ends for Wine
7. Commercially supported Wine derivatives
8. How the Wine developers stabilized Wine for the 1.0 release
9. How Windows app developers can use Wine to help find bugs in their apps
10. Conclusion

1. Background (migrating to linux; virtualization not always appropriate)

If you try to migrate a bunch of users from Windows to Linux,
you may be dismayed to discover that they need to continue
running a few Windows applications.  For instance, they
might be unwilling to switch from Photoshop to Gimp, or from
Microsoft Office to OpenOffice.  Worse, they might need to
run applications that have no Linux equivalent.  What to do?

Many people in this situation turn to virtualization,
i.e. they continue running real Microsoft Windows inside
a virtual machine like VMWare or KVM.  This works reasonably
well, but has the drawback that it requires a Windows license.
This is fine for workstations that came with one, but
if you're trying to avoid paying the Microsoft tax,
it's not really an option.

The only legal way to run Windows apps without a licensed copy
of Microsoft Windows is to use an independent implementation
of the win32 API.  For that, one must turn to the
the Wine Project (http://winehq.org).  

2. Basics (what is Wine)

Wine is a very good, but still incomplete, implementation of the Windows APIs.
It generally pleases early adopters who are willing to accept
a few limitations in return for freedom from Windows licenses,
but infuriates users who like Windows and simply want to be able 
to run their favorite twenty Windows app without fail.

Wine's progress has been both rapid and achingly slow --
rapid in that the number of smaller applications that install
and run perfectly has exploded in the last year or two,
and achingly slow in that even after fifteen years, it still
can't run the latest applications from Adobe, Autodesk, or Intuit.

3. Installing Wine

If you're interested in a stable version, visit http://codeweavers.com 
and purchase a copy of Crossover (see below).  Or, if your Linux distribution
is new enough to already be shipping Wine 1.0, you can try that.

But Wine's progress can be rapid, and the stable version might not
be able to handle your application as well as the bleeding edge public WineHQ
builds.  To try them, follow the instructions at the Download page at 
http://winehq.org.

For instance, if you're running Ubuntu 8.04 (Hardy), you would paste
the following three magic commands into a terminal window to get
access to the WineHQ repository:

wget -q http://wine.budgetdedicated.com/apt/387EE263.gpg \
    -O- | sudo apt-key add -
sudo wget http://wine.budgetdedicated.com/apt/sources.list.d/hardy.list \
    -O /etc/apt/sources.list.d/winehq.list
sudo apt-get update

Then do 'sudo apt-get install wine', or alternately,
click on 'Applications / Add..." and choose Wine, then click 'OK'.

To check that a fresh copy of Wine is installed, open a terminal
window and type 'wine --version'.  If it prints wine-1.1.0 or higher,
you're all set.  

4. Installing and running Windows applications

Newcomers to Wine sometimes expect it to look like vmware,
i.e. they expect Wine to start up a virtual desktop where 
you can run Windows applications.
While you can use Wine that way, it's not how one usually does it.

Instead, Wine is fully integrated into the normal Linux desktop.
You should be able to install Windows applications by doubleclicking 
on their installer, and run them by choosing 
Applications / Wine / Programs / yourapp from the menu.  

For instance, try editing a text file in Wine's notepad.
To start Notepad, click Applications / Wine / Programs / Accessories / Notepad.
Type a file lines, then click File / Save.  
Click on the Save dialog's Home icon to browse to your Desktop directory.
Then type a filename and click Save; you should see the file's icon 
pop up on your desktop.

For another example: my four year old son likes the old Tonka Construction 2
cd-rom that I picked up for him at Half-Price Books.  Wine 1.1.0 can
handle it easily; insert the disc, doubleclick on its autorun.exe or
setup.exe file, and follow the prompts to install.  To run, click on
Applications / Wine / Programs / Hasbro Interactive / Tonka Construction 2 
/ Tonka Construction 2.  The game runs as expected; even the splash
screens, movies, and yodeling music seem to work fine.

In other words, it's pretty much just like in real windows, except that
cd-roms don't autoplay when you insert them yet.

5. What to do when apps don't work with Wine

As described above, running apps in Wine is as easy as running them in Windows.
Except when it's not.  Wine is not yet complete, so it's likely you'll
run into an app that doesn't run right.  When that happens, take a deep
breath, say "maybe I've run into a wine bug", and check for tips from
other wine users about the situation you're in.  Often the answer will
simply be "Wine does not support your application yet", but if you're
lucky, somebody knows a workaround.

The best places to go for tips (or to share tips with others) are:
- the Wine FAQ (http://wiki.winehq.org/FAQ)
- the Wine Application Database (http://appdb.winehq.org)
- the Wine forum (http://forum.winehq.org)

If an app just exits silently when you try to run it, 
you might need to look at Wine's debugging log for clues.  
For how to do that, see "How can I get a debugging log?" in the Wine FAQ.

One particularly common problem is applications that don't bundle
all the needed runtime libraries.  You can tell this is happening 
either because the application puts up a dialog saying a particular
library is missing, or the Wine debugging log contains a line like
  err:module:import_dll Library MSVCR71.dll not found

For tips on how to safely install the most common missing libraries, see
"My application says some DLL or font is missing. What do I do?" in the
Wine FAQ.  It points you to a tool called winetricks which can
install many common redistributable libraries.

For instance, if you need MSVCR71.dll, the FAQ advises you 
to run winetricks and choose the vcrun2003 option.

6. Graphical front ends for Wine

There are also several open source front ends to Wine which make
life a little easier.  One of them, Winetricks, was mentioned above;
another popular one is called PlayOnLinux (http://playonlinux.com).
A very specialized one is called ies4linux (http://www.tatanka.com.br);
it lets you install and run Internet Explorer on Wine.

Many of the Wine front ends share ideas; if one of the front end
projects comes up with a good idea, it's likely to be picked up by
others eventually.  Some of their features are there to work around
shortcomings in Wine, and as Wine improves over time, the front ends
may grow less important.

7. Commercially supported Wine derivatives

There are two commercially supported Wine derivatives
that extend its capabilities.  If you depend on Microsoft Office
or a few other very popular applications, these commercial
Wine derivatives can save you a lot of fiddling and heartache.

The unquestionable star is Crossover (http://codeweavers.com).  
They employ Wine's maintainer and several other key Wine developers, and 
as they note at http://www.codeweavers.com/about/philosophy,
"Every single product and service we have ever offered has returned all
of the changes and improvements made to Wine back to the Wine Project."
Crossover consists of Wine, plus a few custom tweaks to get popular apps
working well, plus a nice GUI front end.  (The source for the custom tweaks
is online at http://www.codeweavers.com/products/source for the curious;
they are like previews of changes that will eventually land in the public
wine tree, but have only been tested to work well with Crossover's target apps.)

Another commercially-supported Wine derivative is Cedega
from Transgaming.com.  This is a fork of a very old version
of Wine with a large number of proprietary enhancements which
are not open source.  (The fact that Cedega does not generally
contribute its key enhancements back to Wine has generated some
hard feelings, and is the reason Wine changed its license from
the X License to the LGPL.)

...