<<

KNoW-HoW

Running Windows programs on with Wine Wine importer Shanna Korby, Fotolia

Users who move from Windows to Ubuntu often miss some of their favorite programs and games. Wouldn’t it be practical to run Windows applications on the free Ubuntu ? Time for a little taste of Wine. BY TIM SCHÜRMANN

any Ubuntu migrants miss to develop something similar for . Box or VMware, Wine does not emulate games and graphics programs A short while later, the first version of a whole PC and thus cannot be consid- Msuch as CorelDRAW or prod- Wine was released. Today, more than ered a real . This also explains ucts such as . The only 300 volunteer from all over the name Wine, which means Wine Is solution is to install Windows parallel to the world continue to contribute to the Not an Emulator. Ubuntu – or try Wine, which tricks ap- Wine project. Because of the way Wine works, it of- plications into believing they are run- fers a number of advantages. Chiefly, ning on a Windows system. What’s in a Name? you do not need an expensive Windows The history of Wine goes back to the To run Windows programs on Ubuntu, license. Programs will run almost as fast year 1993. At the time, Sun developed a Wine uses a fairly complex trick: It sits as on the Redmond operating system, small tool to run Windows applications between the Windows application and and windows behave as if they belong on its own Solaris operating system, Ubuntu like a simultaneous interpreter. to a native Ubuntu program. without the need for a Windows license If the Windows application says: “Draw An interpreter can only be as good as or other interaction. This software in- a button,” Wine passes this command its knowledge of the two languages, and spired Bob Amstadt and Eric Youngdale directly to Ubuntu. In contrast to Virtual- therein lies the problem: Because Micro-

30 ISSUE 01 UBUNTU USER Wine KNoW-HoW

program fared in tests per- formed by Wine users. The Platinum rating is only awarded if a program runs without errors and without any impairment to func- tionality on Wine. A cou- ple of older CorelDRAW versions have made Gold status; the current X4 ver- sion refuses to cooperate entirely (Garbage). Adobe Photoshop CS2 will run more or less as the makers intended, whereas the cur- rent CS3 version has reached only Bronze status. Things are even worse in the case of Adobe Illustra- tor. As a rule of thumb, the older a program is, the bet- ter your chances are of get- ting it to work.

Figure 1: The Wine database lists numerous applications that run on Wine – for example, the CorelDRAW A Wrench in the graphics package. Works Clicking on a program ver- soft refused to release details of its oper- cannot revitalize hardware with Win- sion tells you exactly what the trouble is. ating system until just recently, Wine de- dows-only driver support. A new window appears with details of velopers were forced to adopt a trial and what does and doesn’t perform as ex- error approach. Such a method involves Preparation pected. In addition, user reports at the time-consuming, painstaking work, and Before you fire up your package manager bottom and tips for talking the program considering the multiple-gigabyte operat- and launch into the Wine install, you into cooperating can be very useful. The ing system monster they were facing, it might want to take a look at the appli- steps this requires, some of which are was very much a labor of Sisyphus. On cation database on the Wine homepage very complex, are something you should top of this, some software manufacturers [1]. This database summarizes the level not attempt unless you are an experi- use some pretty nasty programming of support for various Windows tricks, and if you want to talk these ap- programs: whether or not they run plications into running on Ubuntu, Wine on Wine and, if so, how well be- needs to know these tricks. Unfortu- haved they are. To access the data- nately, most software vendors keep this base, go to the Wine homepage kind of information safely under lock and, from among the tabs at the and key. top, click AppDB. In the AppDB Despite years of work, then, Wine is area on the left, select Browse still officially under development, and Apps, go through the drop-down most of the work taking place now is list labeled Category until you find going into the fields of multimedia, the category and application you video, and 3D graphics. This said, Wine are interested in, and click on does support DirectX 8 and 9 quite well Update filter. CorelDRAW and by now. The developers started work on Photoshop are hidden below Mul- the tenth incarnation of this critical timedia | Graphics | Graphics Edit- graphics interface for games last year. ing, for example. Alternatively, An additional limitation is that Wine can use the search function to find only handle very simple 32-bit Windows your application in the database. applications, although improved support If you decide to investigate for 64-bit software is being worked on CorelDRAW, you are taken to the even now. page shown in Figure 1, where Wine has another disadvantage: It can you will find ratings for different Figure 2: This window shows you the current Wine only handle Windows applications; it versions that tell you how well the settings.

UBUNTU USER ISSUE 01 31 KNoW-HoW Wine

Figure 3: Start the Windows application installation file using Wine. Figure 5: Installing WinRAR with Wine. enced Ubuntu user. In some cases, pro- Launch System | Administration | Synap- The Wine Configuration tool will then grams refuse to work because Internet tic Package Manager, enter your pass- go on to create a hidden .wine directory Explorer is missing; for example, Lex- word in the resulting dialog, then type below your home directory. The soft- ware accounting software relies on Inter- wine in the search box and click Search. ware uses this directory to store the net Explorer for some operations. In the list of results, mark the wine entry basic configuration, which you can see If your application is still listed as bro- for installation. Synaptic will present a in Figure 2. Right now, do not modify ken in the database, you should check list of additionally required changes. anything here, but click Cancel to close the test date (in Test Results). If the test Now confirm these with Mark and start the tool. was a while back, you might want to ex- the installation by clicking Apply. periment yourself. Wine continues to Installing a Windows mature, and it is conceivable that your Preparations Program application has been taken care of. Wine integrates with the desktop start To take Wine for a test run, download Once you have established that your menu. To launch Wine, click on Applica- the WinRAR packer [2], then open the Windows application is likely to run on tions | Wine | Configure Wine. file manager. Next, locate the file and Wine, you need an installation disc for the Windows application. Although Wine is free of charge, you need a valid license for the Windows application. Installation Wine is included with Ubuntu and you can retrieve it from a repository. First,

Figure 4: Choose "Open With" and select "Wine Windows Program Loader" for Win- dows applications. Figure 6: The Windows application WinRAR running on the Ubuntu desktop.

32 ISSUE 01 UBUNTU USER Wine KNoW-HoW

start the installer by double-clicking on it. Alternatively, choose Open with "Wine Windows Program Loader" from the context menu, which opens after a right-click on any file (Figure 3). In WinRAR’s case, the self-extracting file wrar380.exe automatically executes the installer. In other cases, you might need to look for the installer for the Win- dows application in an archive file: It will typically be setup.exe, or autorun. exe. If Wine does not launch automatically Figure 8: Wine has a graceful approach to uninstalling Windows programs. after double-clicking on the installer, you should choose Open with Other Applica- entries as a con venient method for around: Each drive letter maps to an tion... (Figure 3), then choose Wine launching the Windows program. Ubuntu directory. Although a Windows Windows Program Loader in the window program running on Wine thinks it is shown in Figure 4. Now you just need to Tell Me Your Name storing data on drive :, it is writing to a click Open. By default, Wine stores Windows pro- subdirectory called .wine/drive_c below Wine takes over in the background grams that think they are installing on the home directory. The Wine control and launches the Windows program. drive C: in a hidden subdirectory below center shows which letter maps to which Just follow the normal steps to install your home directory. To display the hid- directory. First choose Applications | the program. Although I talk about Win- den files, select View | Show Hidden Files Wine | Configure Wine or type winecfg dows drive letters in the next section, for in the Nautilus file browser, then change in a quick launcher (Alt+F2). Then visit now, confirm the default installation di- directory to .wine in your home direc- the Drives tab (Figure 7). The list at the rectory suggested by the application tory. One level below is a drive_c subdi- top shows you which drive letter maps (Figure 5). If any installer asks you to re- rectory and below this, Program Files to which Ubuntu directory. Normally, C: boot Windows, press Alt+F2, type wine- and Windows. The former contains the maps to .wine/drive_c, and Z: lets the boot, and click Run. This tells Wine to application you just installed. After the Windows application access the whole simulate a Windows reboot. Figure 6 WinRAR installation, it will contain a directory tree because it maps to the root shows how a Windows program looks folder with this name with all the appli- directory. Here, you can Add mappings running in Wine. If Wine does not cation files. To start WinRAR, double- by defining new virtual drive letters and launch the Windows program, check out click the file WinRAR.exe in its folder. typing the Path to which the letter the “Dead as a Dodo” box. Also, you can run Windows applications should point. If the installation program creates one from a terminal window by entering or multiple entries in the start menu, wine and the executable’s file name. VistaXP 98 Ubuntu places them below Applications Some Windows programs require the | Wine | Programs. If so, you can use the Directory Jungle characteristics of a specific version of Unlike Windows, Ubuntu does not use Windows. The Applications tab can help drive letters, so Wine must use a work- you cater to this.

Dead as a Dodo If a Windows program fails to launch when need (in WinRAR’s case, this is /programs/ you click it, some manual attention might other/ winrar). When you get there, type make it see reason. To start, open a termi- wine file nal window. Then, select Application | Ac- cessories | Terminal in the start menu. Now replacing file with the name of the appli- type cation you want to run, say, setup.exe. Make sure you stick to the exact spelling, cd directory remembering that upper- and lowercase where directory represents the full path to letters are vital. To tell Wine to run the your installation program. If the setup.exe Windows program, press Enter again. file is on a DVD, you can access the DVD via the /media/ path. The command line If you experience difficulty launching looks like this: the program, check the terminal window cd /media/DVD_name for error messages – you should not close the terminal window or you will In this command, replace DVD_name with terminate the Windows program running the entry in your media directory, then in it. If the Windows program crashes, climb down the directory tree until you Figure 7: The Drives tab lets you map Linux you can try relaunching it. find the directory with the .exe file you directories to drive letters.

UBUNTU USER ISSUE 01 33 KNoW-HoW Wine

tions | Wine | Uninstall Wine Software or press Alt+F2 and type uninstaller. Now you should see the window in Fig- ure 8. When you get there, select the software you want to delete and click Uninstall. Conclusions Wine is not a panacea, and many major programs still refuse to cooperate. Your best chances are with games (see Fig- ures 9 and 10), but you might need to do without popular accounting packages, CorelDRAW, the latest version of Photo- shop, or iTunes, for example. A better alternative might be to look around for an Ubuntu program that pro- vides similar functionality. In the case of Photoshop, why not try GIMP or Krita? And OpenOffice has long been a more than adequate replacement for Micro- soft’s Office suite. If you check out the list of packages in your distribution’s Figure 9: Some Windows games, such as Adventure Runaway, … package manager, you might be sur- prised at the number of comparable pro- For each application, you can individ- applications, unless you define an grams, or even programs with superior ually define the Windows version that exception. features, that Ubuntu offers. n Wine should emulate. To do so, click Add application and look for the execut- Garbage Collection Apps Gone Bad able for your application (in .wine/ To get rid of a Windows application you The Wine MIT license gives users many drive_c). have installed on Ubuntu, you might privileges, a fact that has helped Trans- Now click Open, select the application think it would suffice to delete the corre- Gaming generate huge profits. Trans- in the list, and then select the required sponding directory below .wine/drive_c/ Gaming just grabbed the package, version of Windows in the Windows Ver- Program Files. added DirectX capabilities, which are sion drop-down list. The configuration in However, Wine will still list the appli- required for gaming, and started to sell Default Settings is valid for all Windows cation as installed. Instead, run Applica- the results as [3] (formerly WineX). The Wine developers were un- happy about this, and thus changed the licensing terms to the LGPL in March 2002. The LGPL ensures that you can continue to use Wine for commercial purposes, but that changes and addi- tions must be given back to the project. CodeWeavers is exemplary in this re- spect; the company bundled Wine with its own commercial components to create the CrossOver [4] package, while actively promoting the ongoing devel- opment of Wine.

INFO [1] Wine Project homepage: http:// www. winehq. org [2] WinRAR archiver homepage: http:// www. rarsoft. com [3] Cedega website: http:// www.cedega.com [4] CrossOver Linux: http:// www. .com/ products/ cxlinux/ Figure 10: … run on Linux thanks to Wine.

34 ISSUE 01 UBUNTU USER