Making Linux Run Windows Applications

Linux is gaining application support. That is, there are more and more native applications that you can just load on Linux and be as productive as you are when running them on Windows.

However, there are still tons more applications on Windows than Linux. Therefore, you might find yourself in a situation where you want to run a Windows application while on your Linux machine. In this section, we'll explore ways to get your Linux machine running Windows applications. There are multiple techniques to make that magic happen, so, let's discuss what they are.

Wholesale PC Emulation within Linux

As you saw on the Windows side, there are several applications that will basically present a whole "fake" virtual environment for you to play in. There are three main options that allow Linux to have Windows virtual machines: VMware, Bochs and Win4Lin.

Note that there are plenty of other virtual machine software options for Linux. However, only the three noted here can specifically also run Windows. The rest seem only to allow additional Linux instances and instances of other open source operating systems to run within Linux. That's because they rely on the fact that very small modifications to a guest operating system's kernel can make it vastly easier to virtualize . A keen observation but not helpful when you don't have the source code of the guest operating system at your disposal. For more information, see the sidebar "Other Virtual Machine Technologies for Linux."

Note 
image from book
Other Virtual Machine Technologies for Linux

There are other virtual machine technologies available for Linux. However, most of the others we've encountered will run Windows. That is, many of them are only capable of running Linux and other flavors of Unix within Linux, and that's a subject for another day. However, here are some of those others for your perusal:

  • Plex86: www.plex86.org/

  • FreeOSZoo: www.freeoszoo.org/download.php

  • XEN: www.cl.cam.ac.uk/Research/SRG/netos/xen/and www.xensource.com

  • UML ( User Mode Linux): http://user-mode-linux. sourceforge .net/

The XEN project in particular is interesting because Microsoft Research was one of the original supporters of the project. At one point, XEN was capable of running Windows. However, since XEN's design relies on the idea that the guest operating system actively cooperates with XEN, and Microsoft has withdrawn from the project, XEN is unfortunately not an option today that runs Windows.

image from book
 

VMware

You already saw VMware running on Windows to provide a running Linux machine. VMware also has packages for many Linux distributions that will allow you to run Windows within Linux. This is an excellent option because Windows never knows it's running under Linux at all; it just thinks it's running on its own machine. This is in contrast to what you'll see a bit later when we demonstrate solutions that try to intercept each application's API calls and execute them in a Linux context.

Don't forget one important element when using VMware. Obviously, VMware costs a bit of money ($199 U.S.). More importantly, each instance of Windows you run (or commercial Linux distribution) requires a license. Other solutions (like WINE, described later) don't require a license because they're simply emulating Windows. However, with VMware, you really are running Windows, and hence, need a Windows license. Of course, you could use a free evaluation version of Windows and pay no licensing fee. However, evaluation editions of Windows usually expire within 180 days.

Bochs

As we described earlier, Bochs is a simulated PC, and Bochs can be hosted by Linux, so you might be interested in running Windows XP under Bochs. As it turns out, that is possible. However, Windows XP is extremely slow under Bochs. Again, that's because Bochs simulates the entire PC, including the processor itself, instead of executing the actual application code directly on the processor. The resulting performance is orders of magnitude slower than a real machine.

If you are running Linux or another flavor of Unix on a non-Intel-compatible platform, such as a Sun workstation, Bochs is your best option because it can simulate the entire processor. For such systems, VMware is not an option. But for any conventional PC, Bochs is a very slow choice. You can find more information about Bochs at http://bochs.sourceforge.net/ .

The Bochs home page does not mention Windows XP compatibility. However, we did find confirmation of it and a suggestion regarding necessary settings in the Bochs documentation at bochs.sourceforge.net/doc/docbook/user/guest-winxp.html .

Win4Lin

Win4Lin is a commercial package that lets you run a full instance of Windows on top of Linux. Most interesting for our purposes, at a price tag of about $120, is the recently released Win4Lin Pro version of the product. This version can run Windows 2000 or XP. What makes it different from VMware is that the hardware isn't fully virtualized in the same way. VMware emulates a whole computer; Win4Lin emulates just enough to get Windows up and running and supplies Windows with special device drivers to get the rest of the services it needs from the host Linux operating system. Win4Lin is currently also a bit cheaper than VMware. In Figure 7.5 you can see Win4Lin actively loading Windows XP.

image from book
Figure 7.5: Win4Lin is a commercial application capable of running Windows XP within Linux.

Binary-Compatible Windows Emulation on Linux

In the Linux world there are a crop of solutions that, in essence, do the same thing. That is, they allow for a Windows application to run, unchanged, on a Linux client. Of course, you need a license for each application you want to install. But actually running the application as if it were running within Windows is really very neat. And, since there's no real Windows running, there's no Windows license to buy.

The next few sections run down the solutions that make this magic happen.

WINE

WINE stands for "WINE Is Not [an] Emulator." It intercepts the Windows API calls made by an application. The rest of the application code runs natively on the processor. WINE is part of Fedora Core 3, which makes it very easy to use. In Figure 7.6, we simply copied Windows XP's sol.exe program over to our Fedora Core 3 machine. Then we simply ran wine sol.exe and up popped Windows XP's Solitaire.

image from book
Figure 7.6: WINE is part of Fedora Core 3, which makes it handy for running simple Windows applications.

WINE is being improved all the time, but it does have some shortcomings. Specifically, it's quite hard to get applications like MS Office installed. However, there are several options to make that easier. One option is to use a free add-on called Winetools, which is basically a menudriven installer to get a gaggle of popular applications easily loaded. It prepares your Linux system with a myriad of must-haves including the right Windows system font, a "fake" Windows drive, and more. For instance, applications running under WINE can be configured to see Linux file systems easily, unlike instances of Windows running under VMware. Note that when we ran Winetools on our Fedora Core 3 installation, it said our version of Linux wasn't "recognized" but seemed to work nonetheless.

As we mentioned, WINE is being updated all the time so, even though it's part of Fedora Core 3, you might wish to update it with the latest available download especially if you plan to really take advantage of Winetools. You can download WINE and Winetools from www.winehq.com/site/download .

WINE can also be used as a tool for porting Windows applications to Linux as native applications. That's an option open to developers with access to the Win32 source code of the applications.

CrossOver Office by Codeweavers

Admittedly, WINE is a bit rough around the edges. It works as advertised, but installation of applications could be improved. Winetools helps, but things could still be better.

To that end, a commercial product called CrossOver Office is available from a company named Codeweavers. In fact, they have three versions:

  • CrossOver Office Standard The basic package. Allows for MS Office and a whole lot of other Windows applications to run right on Linux.

  • CrossOver Office Professional Same as Standard but has Enterprise-level deployment ability (so you won't have to run around manually installing the software on every desktop).

  • CrossOver Office Server Helps make a Linux server act like a Windows terminal server and serve up Windows applications. (There'll be more on terminal servers in the next chapter, but we won't be able to specifically explore this product.)

We tested the Professional version, at a cost of about $75. CrossOver Office Professional has three main ways to run: you can allow applications to run only for the root user, allow the users on the system to set up their own applications, or have the root user install the applications for specific users on the system.

CrossOver Office excels in installation of Windows software. In Figure 7.7, you can see a partial list of the supported software. Once selected, the process is entirely wizard driven. In our tests, we ran the Office XP installation (Office 2003 was not supported at this writing). The wizard performed some downloads, found the CD-ROM, and bing-bang-boom, installed Office XP.

image from book
Figure 7.7: CrossOver Office makes it easy to install all sorts of Microsoft and non- Microsoft applications.
image from book
Genuine Microsoft Software Program May Thwart Efforts of WINE, CrossOver Office, Win4Lin and Others

Microsoft has a major problem with piracy, so they want to be sure that the people who get updates to their software are legitimate users of those systems. To that end, Microsoft started the Genuine Microsoft Software program, which you can read about at www.microsoft.com/genuine/ .

For some downloads, Microsoft asks that you execute a little piece of code on your Windows machine. Out pops a little validation code that you paste into the Window to demonstrate your authenticity.

The point of this is to keep the bad guys out the loopthat is, prevent the bad guys from getting access to Microsoft's free updates. Makes sense. However, the Genuine Microsoft Software Program also has the potential for knocking out the efforts of WINE, CrossOver Office, and Win4Lin.

Specifically, in an article at WineHQ.com ( http://tinyurl.com/3v3ny ) the author specifically demonstrates how Windows products running on WINE are prevented from being eligible for the Genuine Windows download service.

image from book
 

Cedega by transgaming.Com

CrossOver Office builds on WINE to make easy installation and runtime for productivity applications. Similarly, Cedega by transgaming.com does the same thing for games. That is, Windows games run 100 percent unchanged. A huge list of supported Windows games is available from the transgaming community site at ( transgaming.org/gamesdb (yes, . org ).



Windows and Linux Integration. Hands-on Solutions for a Mixed Environment
Windows And Linux Integration Hands-on Solutions for a Mixed Environment - 2005 publication.
ISBN: B003JFRFG0
EAN: N/A
Year: 2005
Pages: 71

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net