GuidesPlaying together nicely: Windows and Linux

Playing together nicely: Windows and Linux content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More.

Linux and Microsoft Windows may be light-years apart in their design philosophies, but that doesn’t mean Windows software can’t play nice on a Linux PC. Linux developers, both commercial and open source, have created a number of systems that let the Windows OS share your PC while Linux is loaded, with both operating systems sharing the same CPU and RAM allocations and, for most practical purposes, completely unaware of each other. Open source purists (or simply the frugal) have a range of choices, including Wine, Bochs, and Plex86, as well as the venerable DOSEMU. Except for DOSEMU, each is largely a work-in-progress. That’s good news for eager developers, but not so good if you need rock-solid compatibility and reliability. In that case, you’ll probably want to turn to either VMware Inc.’s VMware or Trelos Inc.’s Win4Lin. These commercial offerings have their open source counterparts beat on most counts of functionality, and virtually all counts of ease of use.


Wine ( ) is one of the oldest, and arguably the most unusual, Windows compatibility systems for Linux. Traditional emulators and virtual machines load Windows and look and act more or less like a computer-within-a-computer, loading the Windows desktop in an X window or a separate screen. But Wine doesn’t boot Windows. Instead, a Wine session consists of one Windows program at a time. Wine inserts a Windows compatibility layer between the Win32 app and Linux/X, which (hopefully) means that the Windows program runs on your Linux desktop exactly as it would on a Windows system. Although Wine benefits from access to real Windows system DLLs, there is other, less reliable, DLL emulation available that can run some programs without any Microsoft code whatsoever. Wine also stands alone in the entire Windows emulation/virtual machine universe in that it actually has a modicum of DirectX support. It’s far from perfect, but despite its warts and often user-hostile nature, Wine is actually one of the better platforms for Windows games under Linux. The trouble with Wine is that it is still very much an alpha-grade program, with an extremely dense and imposing configuration file and a host of Windows incompatibilities. Wine cannot reliably run many important Windows applications, including Microsoft Office. It is also extremely difficult to install Windows applications using Wine alone, because some setup.exe programs will not work with the Wine compatibility layer. Wine is open source with a BSD-style license, which is why it has been adopted into commercial software like Corel WordPerfect, which skips porting some of the Windows code to Linux by simply simulating the Windows OS responses through Wine.


A more conventional choice is Bochs ( ), which provides a complete PC emulation and can run Windows 95 and Windows NT as well as DOS. Despite a semblance of a GUI, Bochs is still fairly tricky to configure, although you can boot and install Windows from a CD. Because of its built-in 486/Pentium CPU emulator, Bochs is the best (and for all practical purposes, the only) choice for non-x86 users looking for open source Windows compatibility. That CPU emulator is something of a hindrance for users on a real x86 Linux PC, however, because it cannot be disabled. All of the other Windows emulators are technically virtual machines that share the x86 processor, but Bochs suffers an unnecessary performance hit by creating another x86 CPU in software. There has not been a public update of the Bochs code since MandrakeSoft purchased the program and released it as open source under LGPL back in late March. Bochs author Kevin Lawton is instead spending his time developing Plex86, an LGPL open source virtual machine system which, when complete, will presumably be able to run all Windows variants as well as DOS, Linux, and potentially other x86 compatible operating systems as well.


Plex86 ( ) was founded to provide an open-source alternative to the commercial, closed source VMwarein fact, the original name of the project was “FreeMWare.” Plex86 looks promising, but is currently in the earliest developmental stages, and is only experimentally able to boot DOS and Linux.


Rounding out the open source options is a selection that deserves honorable mention: DOSEMU ( ). As the name suggests, you cannot run Windows (only 3.x works, and barely at that), and support for protected mode DOS applications is spotty. However, it is reasonably stable, and commonly included in Linux distributions. It’s good to have around in a pinch if you occasionally need to run DOS text-mode applications.


"For stable, reliable Windows networking programs, VMware is the better choice, and the only choice if you need to run server applications or operating systems."

VMware ( ) is currently the biggest name in commercial-grade Windows compatibility for Linux. In addition to full support for all versions of Windows since 95 (including NT4 and 2000, as well as experimental support for Windows ME), VMware also allows emulation of most major versions of Linux as well as FreeBSD and Novell NetWare. DOS and Windows 3.1 are partially supported, and some users have even successfully booted Solaris in a VMware window. VMware makes a very conscious design decision to shield as much of the real Linux PC’s resources from the emulation sessions as possible. For example, it is not possible to directly mount your Linux filesystem, or any disk partition currently mounted by Linux, in a VMware session. You need to use a network file system protocol like NFS or SMB over a virtual Ethernet link created in software instead. On the plus side, this helps shield your main Linux session from any unhealthy activities that the emulated OS might be asked to perform (like a trojan horse that tries to delete every file it can see.) However, this can be remarkably inconvenient at times. Unless you’re a Samba wizard, you need to install VMware’s customized Samba server in order to swap files between Linux and a live VMware Windows session–and the Samba server tends to interfere with any other SMB activity you may be running with real Windows PCs on the outside network. VMware charges $299 for a commercial license (or $99 for noncommercial users.) A full-featured 30-day trial license is available. The program can be downloaded from the company’s Web site, or purchased on a CD-Rom from Linux distributor SuSe Inc.


Win4Lin ( ) is easier on the budget, with developer Trelos charging just $49 for a license after a 15-day trial period. Trelos squarely targets the consumer segment, supporting only Windows 95 and Windows 98 (including Second Edition.) Win4Lin does not rigidly try to emulate every single nuance of a Windows PC’s hardware. This makes it considerably faster and easier to install. Mounting portions of your Linux filesystem (or, indeed, the entire thing) in the Windows emulation is as easy as tweaking a Win4Lin GUI settingno virtual networking required. When a new Windows session is configured, Win4Lin’s setup program automatically installs a custom WinSock networking emulation that can piggyback a Linux PC’s LAN and Internet connection, as well as a video driver that supports full color in an X-window. VMware uses a special virtual Ethernet card and authentic AMD Ethernet driver, and a custom Windows video card driver, respectively, to achieve the same results, but those take longer to install. These convenient shortcuts come with a price, however. If you accidentally install a Windows VxD driver in a Win4Lin session, or even allow a program to install real Windows networking components, you can cripple Win4Lin’s networking capabilities or even put the emulation in a state where it won’t boot properly until you manually remove the offending driver. Also, Win4Lin cannot run network server applications, and some clients, such as Netscape SmartDownload, seem to have a difficult time operating through the emulated WinSock.


Neither VMware nor Win4Lin can perfectly replicate a true DOS/Windows environment, and sometimes the lack of feature overlap is bitterly ironic. For example, VMware offers restricted VGA graphics capabilities in DOS mode, and cannot support EMS memory, making it difficult at best to run many advanced programs outside of Windows. Win4Lin has EMS support, but lacks sound support and has even more limited video support in DOS, hampering its potential as a DOS/Windows gaming platform. And neither system supports DirectX under Windows. Despite the drawbacks, both are excellent choices for general Windows productivity software, with configuration GUIs far superior to the cluttered .config files employed by their open-source rivals. For stable, reliable Windows networking programs, VMware is the better choice, and the only choice if you need to run server applications or operating systems. Nothing runs Windows programs as well as a dedicated computer running Windows alone. Dual-booting, while enormously inconvenient, is still the best, if not the most interactive, way to share a single computer between two operating systems. But if you find the time you waste on shutdown/reboot cycles mounting, or you simply want the best of both worlds, gaining Windows compatibility without leaving the confines of Linux, relief is just a download away. Jason Compton is an Evanston, IL-based technology journalist, and the author of the forthcoming book ” VMware for Linux .” He is a regular contributor to the Chicago Tribune, Linux Magazine, and Smart Business.

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends & analysis

Latest Posts

Related Stories