12.3. Running MS-DOS and Windows Applications on Linux
When you are running Windows mainly for its ability to support a specific peripheral or hardware device, the best approach is usually to set up a dual-boot system or run Windows on a separate computer, to allow it direct access to hardware resources. But when your objective is to run Windows software, the ideal solution would be to have the applications run happily on Linux, without requiring you to reboot into Windows or move to another computer.
A number of attempts have been made by different groups of developers, both Open Source and commercial, to achieve this goal. The simplest is Dosemu (http://www.dosemu.org), which emulates PC hardware well enough for MS-DOS (or compatible system such as PC-DOS or DR-DOS) to run. It is still necessary to install DOS in the emulator, but since DOS is actually running inside the emulator, good application compatibility is assured. To a limited extent, it is even possible to run Windows 3.1.
Wine (http://www.winehq.com) is a more ambitious project, with the goal of reimplementing Microsoft's Win32 API, to allow Windows applications to run directly on Linux without the overhead of an emulator. This means you don't have to have a copy of Windows to run Windows applications. However, while the Wine development team has made amazing progress, considering the difficulty of their task, the number of applications that will run under Wine is very limited.
Another Open Source project is Bochs (http://bochs.sf.net), which emulates PC hardware well enough for it to run Windows and other operating systems. However, since every 386 instruction is emulated in software, performance is reduced to a small percent of what it would be if the operating system were running directly on the same hardware.
The plex86 project (http://savannah.nongnu.org/projects/plex86) takes yet another approach, and implements a virtualized environment in which Windows or other operating systems (and their applications) can run. Software running in the virtual machine runs at full speed, except for when it attempts to access the hardware. It is very much like Dosemu, except the implementation is much more robust, and not limited to running just DOS.
At the time this book was written, all of the projects discussed so far in this section were fairly immature, and significantly limited. To put it bluntly, the sayings, "Your mileage may vary," and, "You get what you pay for," go a long way here.
You may have better luck with a commercial product, such as VMware (http://www.vmware.com) or Win4Lin (http://www.win4lin.com). Both of these work by implementing a virtual machine environment (in the same manner as plex86), so you will need to install a copy of Windows before you can run Windows applications. The good news is that with VMware, at least, the degree of compatibility is very high. VMware supports versions of DOS/Windows ranging from MS-DOS to .NET, including every version in between. You can even install some of the more popular Linux distributions, to run more than one copy of Linux on the same computer. To varying extents, other operating systems, including FreeBSD, Netware and Solaris, can also be run. Although there is some overhead involved, modern multi-gigahertz CPUs are able yield acceptable performance levels for most common applications, such as office automation software.
Win4Lin is a more recent release than VMware. At the time of this writing, it ran Windows and applications faster than VMware, but was able to support only Windows 95/98/ME, and not Windows NT/2000/XP. As with other projects described in this section, we suggest keeping up to date with the product's development, and check once in a while to see if it is mature enough to meet your needs.
Copyright © 2003 O'Reilly & Associates. All rights reserved.