Running Microsoft Windows Applications Using Wine

Even the most rabid Linux fanatic has to recognize that there are times when you must run Microsoft Windows applications for compatibility reasons with other applications or your co-workers. As discussed elsewhere in this chapter, one solution is to run software such as VMWare that emulates an entire Windows system. Within the context of this virtual machine, you can then install and execute the

Windows applications that you need to run because the virtual machine looks like an actual Windows system to the software. However, that seems like overkill when all you need to do is to edit a Word document that contains complex macros or tweak someone's n-dimensional Excel spreadsheet. Wouldn't it be nice to simply be able to run the one or two Windows applications that you need without the overhead and associated storage of a completely emulated Windows system?

Providing the ability to run Microsoft Windows applications natively on Linux and other Unix-like systems is the precise goal of the Wine (Wine Is Not an Emulator) Project (www.winehq.com). Wine is an open source implementation of the application programming interface (API) provided by Microsoft Windows and used by all Microsoft Windows applications. Wine runs in the X Window system environment on Linux and Unix. SUSE Linux includes a stable and tested version of Wine to enable many Microsoft Windows applications to install and execute normally on SUSE Linux systems.

Wine is one of the most popular and most misunderstood open source projects. Unlike emulators, which simulate the behavior of a given operating system or graphical environment and support its applications within that environment, Wine is a complete re-implementation of the API used by Windows applications. It therefore does not need to translate Windows API calls into equivalent Linux or X Window system calls on the fly. For example, Windows applications running under WINE call the same graphical APIs that they always called, but the implementation of those APIs immediately performs specific X Window system functions rather than the Windows functions that one would see if the application was running on a Microsoft Windows system. Very cool!

Wine is installed on SUSE Linux as part of the Office applications package. To install a Windows software package on Linux, execute the wine command, followed by the name of the installer for that package. For example, to install the Windows NX Client package on your Linux system, you would execute the following command:

$ wine nxclient-1.4.0-92.exe

Figure 28-3 shows a Windows installer running on a SUSE system under Wine. The first time that you run it on your Linux system, Wine creates a mock Windows directory hierarchy, as indicated by the message in the Konsole window in Figure 28-3. This mock Windows directory structure is located in the directory ~/.wine, and contains a configuration directory, a dosdevices directory that provides DOS/Windows drive letter mappings, a drive_c directory that mirrors the directory structure that Windows expects to find on its boot drive, and three files that contain various system and user information and represent the Windows registry.

After you have installed a software package under Wine, you can execute any of the applications that it contains by specifying the wine command followed by the full pathname of the program that you want to run, as in the following example:

$ wine ~/.wine/drive_c/Program\ Files/NX\ Client\ for\ Windows\nxclient.exe

Figure 28-3: A Windows installer running under Wine

Due to the complexity and size of the Windows API, Wine is always a work in progress, and all Windows packages do not run correctly under Wine. For information about which Windows applications run correctly under Wine, see http:// appdb.winehq.org.

No,e A commercially supported version of Wine known as Crossover Office is available from CodeWeavers (www.codeweavers.com). This version of Wine provides enhancements and bug fixes that enable it to run many more applications, such as the complete Microsoft Office suite, than the free version of Wine. The CodeWeavers folks are very good about working directly with the Wine community, are the leading commercial sponsor of the Wine project, and push all of their fixes into the open source version of Wine. CrossOver Office is an excellent investment if you need to run Office or other resource-intensive software packages on your Linux system. As a matter of fact, this section of this chapter was written in Word running under CodeWeavers' Wine implementation.

Was this article helpful?

0 0

Post a comment