Windows Compatibility for the Linux Desktopby David Collier-Brown, coauthor of Using Samba, 2nd Edition
In any business switching to Linux, there's at least one person who's stuck. These people need to use files from some Windows-only program, and usually have to do so by dual booting to and from Windows. Dual booting is very slow when all you really want to do is cut and paste a few screenfuls of data. Worse, because it is so slow, there is a real temptation to remain in Windows and use programs such as Outlook and Exchange, this year's favorite virus targets.
There is a better alternative: run just the necessary Windows programs under Linux. This solves the same problem we saw when DOS started to replace CP/M. There was always something that only the older operating systems' programs did, so you ran the older programs with an emulator.
What You Get
When you're done, you will have the ability to run Windows programs on your Sun Java Desktop or other Linux system. If someone mails you a Microsoft Project file, double-clicking will launch the program to edit it, even though MS Project runs only on Windows.
Yes, you can run MS Project on the Linux desktop. Our approach will let you
use the Linux command
win to run the Windows application just as
if it were a normal Unix command, passing it a slightly modified Unix
command line. Project will then appear in a normal X window on the desktop
under control of your window manager.
Figure 1. MS Project running on the Gnome desktop
Netscape can run the
win project_file command when you double-click a file in mail or on the Web. You can run the same command from the Gnome applications menu by double-clicking an icon or an MS Project file, or directly from the command line.
With this, I can have my "must-have" programs: MS Project and Visio.
Choosing a Product
There are several emulators we could use, so our first task is to find one suitable for our purposes. In this particular case, I wanted a program that was usable on two existing machines: my JDS system at home, and the departmental loaner, a three-year-old laptop.
|Linux/Unix System Administration Certification -- Would you like to polish your system administration skills online and receive credit from the University of Illinois? Learn how to administer Linux/Unix systems and gain real experience with a root access account. The four-course series covers the Unix file system, networking, Unix services, and scripting. It's all at the O'Reilly Learning Lab.|
The first good candidate was CodeWeavers' Crossover, which the Java Desktop uses to run Windows web-browser plugins. However, CodeWeavers doesn't offer support for Project. If it had, Crossover would have been a good choice: it's fast, resource-light, and inexpensive at $54.95 per person.
Related to Crossover is WINE, a free software project supported by the CodeWeavers team. Regrettably, it doesn't support Project, either. Nor do the two other well-known free projects, BOCHS and Plex86.
Next was EMC's VMware, a powerful virtual machine capable of running Windows NT, 2000, and XP; Linux; and Novell NetWare. The Samba team uses it to run multiple different Windows versions to test their SMB file server. Its only disadvantages are its preference for NT over Windows 9x, its cost ($299), and the need for a powerful PC.
Because the commonly needed programs all run under Windows 95 through 2000, the next good candidate is NeTraverse's Win4Lin. Win4Lin doesn't run NT and XP programs, so it's not as general-purpose as VMware. On the other hand, it is less expensive at $89.99 a seat, integrates particularly well with Unix, and doesn't require a powerful machine to run. I've had good results with it since I first tried it on Red Hat 7, so Win4Lin is a good choice for running Project on the Sun Java Desktop.
All of these products run locally, so they are suitable for portables and individual desktop PCs. If we were trying to provide backwards compatibility to a whole department of Unix machines, we'd also consider NeTraverse Win4Lin Terminal Server and EMC VmWare ESX server, both of which replace the Windows Citrix product.
Windows 98 will give you the fewest bugs and best performance. I used Windows 95, as it is quite fast and capable of running all the programs that I wanted, but it did have the disadvantages that installing it required a boot diskette and that it doesn't support USB.
Before you start, you'll need a licensed copy of Windows to use as your guest operating system, a copy of the Win4Lin installer, and possibly a Windows boot diskette.
From Windows, create a boot diskette, and check that you have the license
key for your copy of Windows. Then download the Win4Lin installer. You will need to run
win4lin-install as root, so a good place to save it is the
There are three steps to installing Win4Lin: installing the virtual machine module into the Linux kernel, loading a basic DOS under it, and finally installing a complete licensed Windows in the account of the user who will use it.
If you are installing Win4Lin on a pre-release version of the Sun Java Desktop, there is an extra step. You'll need to preinstall a specific kernel that supports Win4Lin and is compatible with SJD.
Installing Matching Kernel Versions
At the time of writing, SuSE version 8.1 has just come out. I used kernel
k_deflt-2.4.21-151.i586.rpm. Download the kernel to /root and install it. The command for this is:
# rpm -Uhv --nodeps --force k_deflt-2.4.21-151.i586.rpm
When the commands complete, reboot and continue.
Running the Installer
The initial step is to run the installer,
/root/win4lin-install, as root. The installer will open a window with a handy "What stage am I at?" display in the upper left and start looking for the proper modules to download, as shown in Figure 2.
Figure 2. The installer screen
After downloading and installing the kernel modules, the installer will ask you to reboot to load the Win4Lin kernel module. This is the only reboot you'll need, unlike a normal Windows installation. Linux will default to loading the Win4Lin kernel, but you can still load the previous one in case of difficulty.
After logging back in again as root, run
/usr/bin/win4lin-install. Note that this is not the installer we downloaded to /root. Instead, it's a different installer that the first installer placed in /usr/bin. You'll then come to the one place where you might strike trouble.
The Boot Floppy
As these boot disks are subject to the Windows license requirements, once you find the one you need, you should retain only the one that corresponds to your licensed copy of Windows.
Unless your Windows CD is bootable and your CD-ROM drive supports booting, Win4Lin will ask you to insert a DOS boot diskette.
If you don't have a Windows recovery floppy, or, like me, made one that didn't boot, see Bootdisk.com for a replacement. This can take a few tries: I thought I was installing Win95b, but actually had a Win95a CD. After multiple attempts, I finally succeeded with a Win95a floppy.
Once you've found or recreated your boot floppy, complete the installation. This will load a minimal DOS and the Windows installer.