| Grabber Softwares : Enhance Your Computing |
| WINE: The Windows Emulator For
Linux Run your Windows apps on Linux In the legendary world of True Unix Wizards, there are certain rules to be followed. You have to be a GUI hater. You have to maintain that Microsoft (note the $) is the Computer Gods last curse upon earthlingsyou can hate it, you can curse it, whatever, but you can NOT ignore it. Moreover, you absolutely never call it MS DOS... it necessarily has to be called MS DOG. Then there is Windoze, the ultimate living hell for your computer. In fact, for a change, I love to refer to these in a non-Unix-ish manner, in spite of all the thrashing they have had at the hands of countless people all the world over. Its a pity that their user base is simply too large to do away with them. While the commercial computer giants fight the traditional
battle for supremacy, there is the incredible community of hackers (this is a
much misinterpreted word, see the glossary for the context in which I use this term here)
that keeps surprising the computer world with its achievements. For instance, the impact
of the now legendary GNU Project on the development and promotion of computer science is
too colossal to be narrated here. These often unknown super-heroes (demi-gods to those who
know them) are responsible for feats that may seem magical to most of the users. This
article discusses one such wonderful example of freewareWINE (the WINdows Emulator;
however, WINE is not an emulator). Consider running X on a Linux workstation, with mwm (Motif) managing the X Windows (take a look at the screenshot on this page). Do you see anything abnormal? Well, see the Borland Turbo C IDE running inside the X Windows titled dos. This IDE was fired after using DOSEmu (see PCQ May 1997, page 98) to boot Windows 95 in non-GUI mode. Apart from the familiar xclock and xterm clients, we also have the setup program for Microsoft Visual Basic 3.0 running here. Even if running MS Windows apps, MS DOS stuff, and X applications simultaneously on a single X Display doesnt sound too useful to you, it sure is fun. Users of Sun workstations may be familiar with running Win 3.x applets under Unix using WABI. With WINE and DOSEmu, it is possible to attain a reasonable degree of OS transparency on a Linux machine. What the heck is WINE? It is a cool program that can run MS Windows programs under X11. From the most macro point of view, it comprises a program loader, a formidable piece of code that loads and executes a MS Windows binary. The Windows API calls that the program makes are translated to their Unix/X11 counterparts by an emulation library that sits in-between. There is NO machine level emulation of program instructions. It is also possible to compile MS Windows source code under Unix (running on an Intel x86 platform), using WINElib.
Getting Started
WINE-970415.tar.gz where the cryptic 970415 denotes the release date for the distributionApril 4, 1997, in this case. Now to get your WINE up and running, lets assume that youve a file called WINE-<version-number>.tar.gz in /tmp. Ill use the version number 970415 as an example, which is the current version of WINE available as I write this. The sequence of commands would be like this: % cd /tmp Unless you have an insanely fast machine (say, a Pentium Pro with tons of RAM), go and have a nap. Because thiss going to take really loooooooong.If everything went alright, you now have a "WINE" binary in the source directory. Note that it is a huge binary (more than 8 MB for 970415) because theres lots of debugging info in the binary. If you do not intend to run a debugger on WINE, by all means you should run a strip WINE, which will get rid of a lot of symbols you wont normally need in the binary. This reduces the binary size significantly (to about 1.45 MB for 970415). CAUTION: You may need as much as 35 MB space just for compiling WINE. If you are tight on disk space, plan out the compilation carefully. I compiled it on a machine with only about 20 MB free disk space, managing the megabyte crunch by altering the Makefile to remove the object files after they had been linked to generate an intermediate module. Once WINE has compiled, however, you need just the space for the binary and the config files. Running WINE So, you are ready to start sailing now. I shall suggest a
simple setup hereyou may be as adventurous as you like. WINE expects a config
file/usr/local/etc/WINE.conf, but it is generally a good idea to use a .WINErc file
in your home directory instead. We shall set up a simple ~/.WINErc to get WINE running.
The format of this file is like a MS Windows .INI file. For the purposes of experimenting with WINE, put all WINE stuff (except .WINErc) in the directory /tmp/WINE. This wont clutter your disk, and you can remove all traces of WINE from your system should it happen to give you nightmares. I present here a brief but hopefully complete description of setting up WINE to run on your system, now that you have the WINE executable: 1. Create the following directories: WINE has many of the MS Windows DLLs built-in. When an app doesnt run with the error message that it cannot find a DLL, you will have to get hold of that DLL from your _real_ Win 3.x directory and place it in /tmp/WINE/windows or /tmp/WINE/windows/system wherever you find appropriate. WINE prints warning messages indicating which of the built-in DLLs are being used. When some app crashes or doesnt run at all, try placing the _real_ DLL in the right place (/tmp/WINE/<...>), so that WINE uses that instead of the built-in -there ones where there is half a chance that the app will run. 2. Copy the WINE binary to the /tmp/WINE directory. Also, append /tmp/WINE to the PATH variable: % cp <wherever-WINE-binary-is> /tmp/WINE 3. There would be a file called "WINE.sym" in the WINE source directory, which was generated when you compiled WINE. This file is a symbol table that the built-in debugger uses. Copy this over to /tmp/WINE: % cp <wherever-WINE.sym-is> /tmp/WINE 4. Create a file .WINErc in your home directory. The contents of this file should be as in the box The .WINErc Source Code. These are pretty generic, and should work with little or no change. Either put this stuff in .WINErc, or look for a sample "WINE.ini" file in the source tree, which you copy as $HOME/.WINErc, and edit it accordingly:
Firing Win Apps In WINE Now WINE should be able to run a MS Windows applet on your system. Try something small at first, like the calculator, calendar and the clock apps, etc. Once you are convinced that it works, graduate to larger apps such as notepad.exe, pbrush.exe etc. Then winfile.exe, winhelp.exe and so on. Running an app is simple, but there can be some syntactical
variations. The command will be: Enough for this time to enjoy with? You will feel happier as you successfully run yet another programthe larger the merrier. It is possible to run many of the Microsoft heavy-weights (such as Word), but results will widely differ. And even if you cannot get WINE to work at all, there is every possibility that your attempts will lead you towards becoming a Wizard. |