Let the Bacchanalia begin! Getting your Windows apps installed and running on Linux the Wine way.
King Solomon called wine a mocker and the same can be said of Wine: The software package that runs Windows software under Linux. It mocks the way we think about platform-specific programs and applications — blurring the lines between Windows and Linux.
It mocks the way we think of interoperability and compatibility — drowning the ever-present murmurings about the lack of rich applications for Linux. It mocks the way a certain company markets itself as the only way to run its programs — decreasing the need for a costly and proprietary operating system.
Wine is a liberator, a rebel, and a mocker but it is not an emulator. Wine Is Not an Emulator is the recursive acronym that defines Wine as an implementation of the Windows API and as a translation layer capable of running Windows programs natively on Linux. The Wine developers prefer the more modern and friendly version, Wine to the older, more clever WINE.
Wine began its life in 1993 as a way to run Windows 3.1 applications in Linux. Wine may well have had the longest beta period in history at 15 years, however version 1.0 was recently released in June 2008.
In this article, I show you how to install Wine, Microsoft Office 2003, and Internet Explorer using my Red Hat derivative system (CentOS 5.1) as the host. You can give your system some Wine by compiling from source code, or by installing pre-compiled binaries from your distro’s repositories.
Your Own Label
The Wine web site is the main source of information, and you’ll find the source code at their SourceForge site at http://sourceforge.net/projects/wine.
Installing from source is the only sure way to get exactly what you want from Wine although the installer does most of the work for you. You purists can still kick it old school with
./configure, make depend, make, make install but most everyone else will want to use the recommended
tools/wineinstall script. Whichever method you choose, Wine has numerous prerequisites that are required: see Recommended_Packages for a complete list for your distribution.
The configure script, upon completion, presents you with a list of missing but non-fatal packages. I suggest that you install them all for a richer and less troublesome experience with Wine. The best message you can receive when compiling from source is “Wine build complete.” Wine is a large and complex suite of applications, dlls, and other support files so don’t be too surprised if you experience many failures along the way.
The Wine Kit
You may find it easier to make your Wine from a kit (binary package) supplied by WineHQ. You’ll find these packages on the Wine Binary Downloads page. There are packages for every major Linux distribution, FreeBSD, PC-BSD, Solaris, and, for some reason, Windows.
Whether or not the packages you download contain their necessary dependencies, depends largely on the package maintainer. Some maintainers offer a series of packages so that those with the expertise can choose specific packages for installation and they assume you can handle the dependencies. The maintainer for the Fedora packages suggests that for RedHat-related distributions normal users should use the
yum method of installation.
The Wine Store
You’ve tried solving endless dependencies with your source install, you’ve done much the same with attempting a manual installation with individual packages, and now you’re ready to try the foolproof (almost) method of using your package management system. This method is for those who would like to try Wine without first growing the grapes.
Package management software like yum, smart, and apt-get exist for a reason — they automate software download and installation. They also have some built-in intelligence, which means your dependency problems generally solve themselves during a package request. These package management systems all have the same basic syntax:
yum install wine
smart install wine
apt-get install wine
They all perform the same functions as well: Query configured repositories, download packages and dependencies, and install the dependencies and packages in the correct order. It is interesting to note that you must be root or use sudo to use these installers but you are not supposed to run Wine as root. After the initial installation of Wine, you should install all applications as a regular user. Wine applications appear in your Window Manager menus after you logout and login again.
A Tour of the Vineyard
Wine sets up an interesting hierarchy of files on your system. It installs everything under a .wine folder in your home directory. The use of the term ‘folder’ distinguishes Windows directories from Unix directories. Under the .wine folder, you will see a drive_c and dosdevices folders and three files (system.reg, userdef.reg, and user.reg). The drive_c folder contains the MSOCACHE, Program Files, and windows folders.
Figure 1 gives you a look at the files and folders under .wine from a Wine File (File Manager) perspective.
FIGURE 1: The Wine File View of Your Wine Installation
The Program Files folder houses your installed Windows applications such as Microsoft Office, Internet Explorer, Windows Media Player, and so on. Under the Windows folder, you’ll find Windows-related executables (notepad.exe, regedit.exe, winhelp.exe) and folders such as system, system32, fonts, temp, profiles, and others.
Never edit the registry directly using notepad or any other text editor. Use regedit to edit registry entries manually or
regedit filename.reg to import a .reg file into your registry.
Mulling Microsoft Office
The three main applications that most users use are an office suite, email, and an Internet browser. Of the applications in the office suite, the word processing program gets the most use. Though Linux has great offerings in each of those arenas (office suite, email, and browser), some feel that they need a particular brand of product for compatibility reasons. Read my December 2007 article “A Tour of Linux Office Suites” to find out why this is no longer true.
Still, there are those who resist Linux on the desktop stating compatibility reasons mostly centered on Microsoft Word and Outlook. To everyone’s surprise, Wine supports Microsoft Office suites all the way back to the Office 97 era. Unfortunately, Outlook doesn’t work in Wine. Access, Excel, PowerPoint, Publisher, and Word all work to varying degrees.
Word is the best supported of all the office applications. For an email client compatible with Microsoft Exchange Server or Novell GroupWise, try Novell’s Evolution 2.0 email client that installs natively into Linux.
The Office 2003 proceeds without issue in most cases but as stated in the previous section, you might have to logout and login again to your Window Manager for the Microsoft Office entries to show up under Wine in your menus as shown in Figure 3.
FIGURE 3: Microsoft Office 2003 Wine Menu
One of the problems with Microsoft Word is that when attempting to use the Spelling and Grammar features, via the menu or a hot key combination, Word crashes. Some of these advanced features don’t work yet in Wine but basic word processing and production of 100% Microsoft Office compatible documents, spreadsheets, and other files is possible through the magic of Wine.
Browsing the Grapevine
The need for Microsoft’s Internet Explorer on Linux is a bit ambiguous since there are plenty of other browsers available. If a company decides that a particular browser’s use is mandatory, then this is one way of complying with that standard. Internet Explorer isn’t officially supported by Wine according to the documentation but there is a project that makes it possible: IEs4Linux.
Before you install IEs4Linux, you need to install cabextract (http://www.cabextract.org.uk) because Microsoft packs Internet Explorer’s files as CABs (Microsoft Cabinet Files). You can install cabextract from source, manually via package files, or with your package management software.
Visit the IEs4Linux home page at http://tinyurl.com/jzykl. The IEs4Linux Project is the brainchild of a solo developer who manages the project, and his university studies, from Brazil. The project is a script that downloads specific Internet Explorer files from Microsoft and Adobe to build a usable Internet Explorer experience on Linux.
Installing IEs4Linux is straightforward. Download the tarball, extract it, then run the installation script using the following recommended method:
tar zxvf ies4linux-latest.tar.gz
The installation dialog offers you the opportunity to install IE 6, 5.5, or 5, and optionally the Adobe Flash plug-in. See Figure 4.
FIGURE 4: The IEs4Linux Installation Selections Dialog
Figure 5 shows the download process in progress.
FIGURE 5: IEs4Linux Download Process
If you receive errors during the graphical installation or a notice that the install failed, use the non-graphical version:
./ies4linux - -nogui
Figure 6 shows my Linux Desktop sporting both Microsoft Word and Internet Explorer 6.
FIGURE 6: Internet Explorer and Microsoft Word 2003 Running in Linux
Take Home a Bottle or Two
Wine isn’t perfect but it does give you the subtle bouquet and flavor of using Windows programs on Linux. To see a list of what others have tried and succeeded, or failed, at with Wine, go to http://appdb.winehq.org/appbrowse.php. Each application is rated, from Gold to Garbage, depending on how well it works.
I like Wine and it works well for a lot of applications — well enough, in fact, to somewhat silence the “Microsoft compatibility crowd.” I think now that it’s almost version 1.0 release ready, it will garner more interest, developers, and adopters. I see no reason why it shouldn’t for those who believe that they must have certain brands of apps running in their environment.
Kenneth Hess is a Linux evangelist and freelance technical writer on a variety of open source topics including Linux, SQL, databases, and web services. Ken can be reached via his website at http://www.kenhess.com
. Practical Virtualization Solutions by Kenneth Hess and Amy Newman is available now.