<<

COVER STORY SchlagwortWindows sollte apps hierwith stehen

Wine, Crossover Office, and WATER OR WINE?

If you need to make a Windows application run on , there is no better way than Wine. We investigated the free and commercial Wine variants to see how they bear up under real-life conditions. www.sxc.hu BY BERND VILLIGER, OLIVER FROMMEL AND JÖRG LUTHER

n 1993, developed launches Windows programs, and a like to let strangers gain knowledge of a small tool designed to let users run suite of libraries that translate or emu- the internal workings of its operating IWindows applications in Solaris out late Windows API calls. systems and applications. But MS is not of the box – that is, without needing to Most of Wine’s problems reflect its the only software manufacturer that port the applications first. Just a few role as a translator between Windows likes to keep secrets; many other ven- months later, the first attempt was made applications and Linux. A translation dors have been reluctant to port their to make the tool run on BSD and Linux, can only be as good as the translator’s products to Linux. and this step marks the birth of what knowledge of the language and culture. Adobe’s Acrobat Professional is one has now become known as the Wine It is well known that does not example of this phenomenon, and this is project. The name Wine, an acronym in typical GNU tradition, stands for “Wine Box 1: Wine Remover is not an .” Whatever you do, do not attempt to run example, this would be rpm -e wine- And Wine [1] really isn’t an emulator parallel or multiple Wine installations. 20040505-1. Then remove the directories in the traditional sense. The tool neither Before you install a new release, it that Wine creates for each account: emulates a different kind of CPU, nor, makes sense to remove the previous #rm-rf /root/.wine strictly speaking, an . version. #rm-rf /home/user/.wine Instead Wine inserts itself as a trans- First of all, you need to find out which lation layer between Linux and the version is installed: [...] Windows application the user wants to # rpm -qa | grep -i wine This step should clean up the waste run. It intercepts any Windows API calls deposits, opening the way for a Wine wine-20040505-1 made by the application and attempts to upgrade. You can use the same convert them to equivalent and X11 Your system should respond with the approach to remove a Wine installation calls. From a technical point of view, version label – which you can point to as that has gone wrong. the program to be removed. In our Wine is a loader, which loads and

22 ISSUE 54 MAY 2005 WWW.LINUX- MAGAZINE.COM Figure 1: A very strange sight: launching the Windows Acrobat Installer on the Linux desktop with the Wine emulator. why we opted for Acrobat for RPM-based distributions: Pro as our test software. Our test machine was a HP laptop rpm -qa | grep -i wine with a 1.7 GHz Pentium 4 CPU and 256 Mbytes RAM. If Wine is installed, you Suse Linux 9.0 Professional should see a message such as was our choice of operating wine-20040505-1 (Suse 9.0) system. or wine-20040813-7 (Suse 9.2). As you can see, the Installing Wine release date is the version All major distributions number at the same time. include Wine as a standard Just in case, you might like component, although the to replace any older versions package is not usually you find with a recent (2005) installed by default. To find version. This is quite easy to out if Wine is already do and gives you the advan- installed on your system, tage of a useful default con- enter the following command figuration in most cases.

Box 2: Wine is not an Emulator In contrast to Wine, a real emulator creates an isolated area in which it simulates a computer. You may even need to install the operating system separately in order to use this “box in the box.” Based on the same principle, you can install and use any application written for the virtual machine’s operating system. The loss of performance due to the simulation overhead, and the license costs (the virtual machine needs a complete operating system) are the major drawbacks of this approach. Wine implements a logical alternative: instead of simulating the whole operating system, it restricts itself to faking an environ- ment that lets Windows applications feel at home. And this leads to the name used internally by Wine, “fake windows”: #ls-a/home/user/.wine dosdevices fake_windows [...] The data structure within the Wine directory is based on that of the “real thing.” However, the facsimile is a lot different, and this is the major design weakness. Applications that access specific Windows elements often run into a (virtual) wall. COVER STORY Windows apps with Wine

Figure 2: Although not officially supported by Wine, Adobe Acrobat Figure 3: The installation and configuration steps take place in the proves cooperative. main Crossover Office window.

However, you will need to deinstall the Make sure you use Windows-style drive Fusion (another program which is not previous version to avoid issues (see and path names. Also use quotes (‘) or officially supported) demonstrates the “Box 1: Wine Remover”). double quotes (“) for the program path. typical pitfalls. The application cannot The installation is just as unspectacu- Failure to do so would cause the Linux be installed without installing Internet lar. First, download the current package shell to mangle the command, the gaps, Explorer first. (which weighs in at about 12MB) from and the text that follows. WineHQ [2]. Then become root, and Installing Adobe Acrobat (Figure 1) Alternative: Crossover install on Suse 9.0, for example: took about 15 minutes in our lab, and Office this was just a single application. But it If you are really interested in using Wine #rpm -ivh wine-20050111-U was worth the wait; after completing the in a production environment, you SuSELinux90.i586.rpm setup, the following command should take a look at the Crossover Preparing... U Office package by CodeWeavers [3], a ######################## [100%] wine ':\Program Files\AdobeU commercial Wine product that costs 1:wine... U \Acrobat.exe' between US$ 39.95 (standard version) ######################## [100%] and US$ 69 (multiuser-capable profes- gave us a working instance of Adobe sional version). Crossover Office pro- This actually completes the configura- Acrobat, as you can see from Figure 2. vides a GUI and more user friendly han- tion at one fell swoop, as the current Admittedly, not all program installa- dling. However, Crossover Office does version comes preconfigured. If you tions are as smooth as this. Attempting not remove the general issue that Wine want to view or modify the configura- to install any version of NetObjects faces (see “Box 2: Wine is not an emula- tion, simply launch the winecfg tool, which allows you to view or change the virtual drive letter assignments for your devices (Figure 4). Installing Windows Applications You can now move on to installing your first Windows applications. For our test, we opted for a popular application that is not officially supported by Wine: Adobe Acrobat 5. The installation source is the program CD and the CD ROM drive in our lab has an alias of “Z:”; so we can launch the install by typing:

wine 'Z:\media\cdrom\Acrobat U 5\Setup.exe' Figure 4:The winecfg program helps configuring the Wine installation.

24 ISSUE 54 MAY 2005 WWW.LINUX- MAGAZINE.COM COVER STORY Windows apps with Wine

tor”). Thus, Crossover Office Standard install--standardU main window has done the preparatory is basically a box designed to make it -demo-4.1.sh work for you so that you can remove the easier for you to use Wine. issue simply by downloading the First, let’s see how Crossover handles The installation is unspectacular and the required fonts. an Acrobat installation. This should results are self-explanatory (Figure 3). In Again, our test starts with an attempt allow us to test the program’s qualities most cases, you can simply accept the to install Adobe Acrobat Professional in a real-life scenario. We used the default configuration. When you are fin- 5.0. To do so, we simply clicked on Crossover demo package, which will run ished, you should see the main window, Install in the Add/Remove tab. In the for a month after downloading, although as shown in Figure 6. window that then appeared, we selected you do need to register to access the We only found one point to criticize: Unsupported Software and then pointed download. to avoid conflicts at a later stage, you to the installation source. The unusual but effective install need to install the fonts that Windows After installing an application, you can process is based on a shell script: typically installs. The Fonts tab in the either use the Menus tab in the main

Playing with Cedega If you want to run Windows games on tory. The build follows the normal steps, You may need to add an entry for your Linux, you need Cedega by Transgaming although Fedora Core 3 requires some CD ROM drive to the configuration file. [4]. Cedega is a version of the Wine API additional options: The entry for the first IDE hard disk drive emulator to which the developers have ./configure --enable- U is as follows: added DirectX multimedia func- --enable-pthreads [Drive H] tions. Cedega even supports current Windows games with complex graphics The make command launches the com- "Path" = "/media/cdrom" such as Half Life 2 or Far Cry. piler and su -c 'make install' puts the pro- "Type" = "cdrom" gram in the right directories on your However, this kind of performance is not disk. You can then copy the sample con- "Label" = "CD-ROM" for free: Transgaming charges USD/EUR figuration file to the right location: "Filesystem" = "win95" 5 per month with a minimal subscription of three months. cp documentation/samples/U "Device" = "/dev/hdc" If you are just interested in taking a look config ~/.wine/config You can now go on to install a Windows at Cedega, you can download and com- Before you start, you first need to create game. We used the winter edition of the pile most of the software yourself; how- a few files and directories. Cedega Moorhuhn game that is very popular in ever, the download lacks a Europe. With Cedega, you need to few critical components, launch wine to install the game: which means that many wine moorhuhn_we.exe copy-protected games will not load. Complete the required steps to put the Moorhuhn program on your Cedega Cedega from the CVS “disk,” that is, your Without a subscription the .transgaming/c_drive directory, which is sources are only available the equivalent of C: in Windows. via the CVS version control To ensure that the game will find its files, system, and you will need change to the installation directory and the cvs program to down- launch it from there: load them. Assuming you have cvs on your machine, cd .transgaming/c_drive/Program\ U you first need to log on to Files/Phenomedia\ AG/Moorhuhn\ U the server: Winter-Edition cvs -d:pserver:cvs@U Figure 5: The Moorhuhn game running on Cedega. wine MoorhuhnWinter.exe cvs.transgaming.U org:/cvsroot login expects parts of the The game runs without any hitches and at normal speed (see Figure 5). The If you are asked for a password, simply to resemble Windows. The sample file other games we tested all installed type cvs. If this works, the program assumes you have a directory called under Cedega, but they issued error will not give you any reply, but it ~/.transgaming. Create a directory with messages and crashed when we tried to will complain if things go wrong. this name, or change this to ~/.wine/con- launch them because they all suspected Then download the files to your fig; if you do so, use this directory for the Cedega of attempting to undermine the machine: following steps. Add the required subdi- rectories as follows: copy protection scheme. cvs -z3 U The commercial Cedega version has -d:pserver:[email protected] mkdir -p ~/.transgaming/c_drive U code that prevents this from happening. /windows/system32 org:/cvsroot co winex If you want to run current, copy-protec- After a while, you should have the com- mkdir ~/.transgaming/c_drive/U ted games, you thus have no alternative plete in your winex direc- windows/fonts but to opt for the commercial version.

26 ISSUE 54 MAY 2005 WWW.LINUX- MAGAZINE.COM Windows apps with Wine COVER STORY

Crossover window or the legacy com- simple approach to rebooting Windows. power of Wine. Before buying it, you mand line approach to launch the Win- To do so, type the following command at should test the Crossover Trial Version to dows application: the command line: make sure the Windows application you need really runs. If an application ~/cxoffice/bin/acrobat ./cxoffice/bin/cxreboot refuses to run on Wine or Crossover, your only alternative may be to switch to It does not make much sense to specify a Figure 7 shows a screenshot of the mes- a virtual machine, such as the commer- Windows version as your environment. sage that then appears. Of course, the cial VMware or the free Qemu. ■ Windows programs will tend to run bet- message can easily be misunderstood … ter if you keep the defaults. Windows applications that explicitly need Win- Conclusion dows NT 4 or NT 5 (), Wine is a very ambitious attempt to run will not normally run (or at least not run Windows applications natively on Unix- smoothly) under Wine, as our test with like systems. As a minimalist applica- Adobe Acrobat 6 went on to prove: the tion, Wine restricts itself to providing a Figure 7: Who knows whether the reboot icon Installer crashed immediately. In con- translation service between the operat- means a Crossover bootstrap or something trast to Wine, Crossover Office has a ing system and the application. The sim- more drastic? plicity of both the software and the INFO hardware support [1] WineHQ: http://www.winehq.org/ is one of the major [2] Wine packages: http://www.winehq. advantages of org/site/download Wine. CrossOver [3] Codeweavers: http://www.codeweavers.com/ Office helps non- Figure 6: After completing the simple install, you can configure technical Linux [4] Transgaming: http://www.transgaming.com/ Crossover Office directly. users access the