Though these two operating systems are sometimes pitted as adversaries, they really can play together quite nicely, provided you know what tools to use.
Face it, it’s a Windows world. Whether you use Linux on your home system or at your job, the chances are that you have to work with Windows users and their systems, and, more important, that you exchange data with them on a regular basis. Or maybe you’d like to use Linux in your work environment, but you’re facing the dual obstacles of convincing the powers that be to let you ditch Windows and of figuring out exactly what to do once you get permission. Or perhaps you just want to switch your home system over to Linux, and you’re wondering if it will create problems with the Windows documents you bring home every week…
Philosophy Is (Almost) Everything
Total World Domination for Linux would certainly make things easier for everyone using Linux, but the simple fact is that that won’t happen any time soon. There are many operating systems out there, and 90 percent of the desktops are running Windows.
There are basically four main areas where Linux can interoperate with Windows. You may have to exchange files, share resources, run alien apps, or perhaps create new programs. With any luck you’ll have to deal with only one or two of these at a time, but on large, long-term projects expect to see all four. Let’s examine them one at a time.
The Holy Grail: Exchanging Files Between Linux and Windows
Sharing files between Linux and Windows will probably consume most of your energy. It’s easy to overlook simple solutions here, particularly if you forget that not everyone will need access to all files on a project all the time. Think of exchanging files in three stages: gaining physical access to the files, ensuring your operating system can work with the filesystem (such as ext2, MS DOS, VFAT, or NTFS), and having a way to use the document files in their native format or convert them to something your applications can use.
The obvious choice for accessing files on another filesystem is sharing disk space over a network. But, while setting up a network is often the most convenient way of sharing files, don’t forget simpler, less glamorous solutions such as simply e-mailing files. This eliminates the filesystem issue. You can also simply hand-transport the files on removable media, affectionately known as “sneaker net.”
Sneaker net is a far less limiting option than it used to be, thanks to the continuing proliferation of 100 MB and 250 MB Zip drives, as well as the exploding popularity and declining costs of CD-R/W drives and media. Even in an age of nearly ubiquitous double-digit GB hard drives, you can still fit quite a lot into a few hundred megabytes.
Once you get access to the file space, your concern becomes
filesystem compatibility. Windows is, to no one’s surprise, annoyingly
myopic when it comes to supporting non-Redmondian filesystems. Luckily,
Linux more than makes up the difference and is quite adept at handling
Windows’ MS-DOS and VFAT filesystems.
Nearly all Linux distributions today install a kernel with MS-DOS
and VFAT support by default, so you should be able to read
Microsoft-formatted floppies on your Linux machine without too much
trouble. For removable-media drives all you have to do is specify the
right filesystem type, as in the command (to mount a VFAT-formatted
mount -t vfat /dev/fd0 /mnt/floppy
You can then copy files, unmount the drive, and give the disk to a
Windows user who will simply be able to use it.
Picking The Right Files Format
By comparison, selecting a file format for the documents you’ll
exchange is far trickier. If you just need to give someone read- or
print-only access to a document and preserve its formatting, you have
several options. You can send the document in a format that you know the
other person’s software can import, even if its formatting will be
File exchange gets far more complicated when you’re collaborating on
a project and you and at least one other person using another operating
system will be updating the same documents. Now you have to worry about
conversions and re-conversions, which often result in lost data or
The most perverse problems that arise from exchanging files involve
Microsoft Word. Word’s file format is only slightly less complex than
the human brain, which explains why many programs that claim to import
or export Word files don’t do such a terrific job. Often the best
solution when dealing with Word is to depend on a more standard format,
like RTF (Rich Text Format), that will support all your formatting
requirements and avoid conversion problems entirely. In a pinch, you can
always send plain ASCII text.
If you’re still forced to use complex documents that can’t be
handled by any of the techniques mentioned above, you can look for the
same program that is available for both Linux and Windows, such as
Applixware Office, StarOffice, or WordPerfect Office, which will often
solve the problem, since both versions will use the same native format,
eliminating the need for any conversions.
Working with file formats will likely expose you to an education
problem as well. Many mainstream computer users are blissfully unaware
that different file formats even exist for things like word-processing
files, spreadsheets, and databases, and they think that you can convert
a file from one format to another simply by saving it with a different
name. This is another area where software producers are increasing
support. WordPerfect 2000 for Linux will automatically detect that a
document is in Word format and convert it on the fly.
Thought: Nothing Succeeds
Don’t scare everyone off by broadcasting the fact that you’ll be using Linux. Downplay the technical hurdles a mixed-OS environment entails (assuming you’re confident that all the issues are nonissues), and even delay telling other people you’re not running Windows until the project is well under way and working fine. Nothing will impress them more and improve Linux in their estimation than seeing it work flawlessly and seamlessly on a real project.
Beyond Sneaker Net: Samba, VMware, AND WINE
Exchanging files is really just a special case of the more general need to share resources, such as disk space and printers, on a continual basis. This is where Samba really shines. Samba is open source software that lets a Linux system masquerade as a Windows server and provide disk space and printer-sharing services. It does this by using the Microsoft SMB (Server Message Block) communication protocol. In other words, Windows client systems networked to the Linux-plus-Samba system literally don’t know they’re talking to anything except another Windows box.
You can also use a utility that comes with Samba to mount disk space that’s available from another SMB server as part of your local filesystem, in effect completing the circle and letting an alien SMB resource masquerade as a local Linux one. Samba is probably the purest example available of how Linux can and does go the extra mile to interoperate with Windows. (For more on Samba, see this month’s Newbies column on pg. 28.)
Running Alien Applications
So what if the program you need doesn’t run on Linux? This is another area where the interoperability picture is improving dramatically, and it’s nowhere near the issue it once was for Linux users.
If you need to run Windows and Linux applications at the same time, you can use VMware to host a full copy of either Linux or Windows and its applications under the other operating system. VMware is amazingly adept at running an entire operating system “in a box,” which makes it almost too easy to host your one or two critical applications on an “alien” platform.
VMware is expensive in terms of system resources, since it requires you to commit a chunk of disk space to be used as the filesystem for the hosted operating system, which includes the free space in the hosted filesystem. As dramatically as hard drive capacity has increased over the last year, this will seldom be a major problem, but it’s still worth keeping in mind.
This approach of encapsulating the entire hosted operating system into a single file also has some interesting and less obvious benefits, though, since you can create multiple virtual machines on a single system and run different ones for different tasks. You can even take the entire alien operating system, in the form of that single huge file, and use it on another system, assuming it has the same hardware configuration.
For example, you can build a Windows system on a Linux desktop computer, and then transfer one large file to your laptop and take your entire Windows environment on the road. You can then use it, and then transfer it and all the changes you made to its documents and programs back to your desktop in a single transfer. Yet another option is to preconfigure a Windows environment and then roll it out via LAN or CD-ROM to numerous Linux users, who merely have to drop it into place in their VMware-capable systems.
The Right Time For WINE
Another option for concurrent execution of Linux and Windows programs is to use WINE. WINE is a free implementation of Windows for Unix platforms that lets you run 16- and 32-bit Windows applications directly under Linux. The WINE programmers are tackling an immensely complicated job, so you’re likely to run into some surprises and limitations when using it. See the WINE database (see Weblinks, pg. 52) for user reports of how various programs work with WINE.
The good news is that WINE is progressing rapidly and has become quite capable. In fact, Corel will use it to run its upcoming WordPerfect Office 2000 suite on Linux. Still, before relying on WINE to run a Windows program in a production environment, you should test it yourself, using the closest thing possible to the exact Linux configuration, Windows application, and documents.
Larger organizations can also benefit from application portals, software that lets you run a program remotely from a different operating system. These commercial packages include SCO’s Tarantella, GraphOn’s Bridges, and Citrix’s MetaFrame. While the details of the products differ in terms of capabilities and the exact configurations supported, the basic idea is the same — you can run an application program that’s on a server running a different operating system from your desktop system and make it look as if it’s running directly on your computer. (Think of it as a cross-platform version of remotely running an X program.) This solution requires more planning and a significantly higher logistical commitment than running VMware, but for many businesses it will likely be a very valuable option as Linux spreads onto the mainstream desktop.
If you don’t have to run Linux and Windows at the same time, you can always use a dual-boot configuration so that you have the option of selecting Linux or Windows at boot time. Caldera OpenLinux is just one of the distributions that is quite adept at converting an existing Windows system to a dual Windows/Linux configuration (and saving you from having to repartition your hard drive manually), via an included copy of PowerQuest’s friendly BootMagic program.
Thought: No Surprises, Thank You
Verify that everything works as expected. Test the software and configurations you’ll be using, especially all relevant format conversions, before using them for real work. And don’t forget to test conversion “round trips”: program A exports a document to a file format native to program B; program B then reads the document and saves the user’s changes in a format native to program A; program A then reads the document B created. This is the surest way to make sure your data comes through fully intact. The bottom line is that you don’t want to promise more than you and Linux can deliver. Don’t take the word of someone on the Internet or a generalized comment from the software’s creator.
Getting In The Loopback
If you don’t want to or can’t convert your system to a dual-boot configuration, you can also use a loopback distribution, like Macmillan’s Linux for Windows or Phat Linux. These distributions let you simply copy about a dozen files into a directory on an existing Windows system, then shut down Windows to DOS mode and start Linux. This gives you all the capability of a Linux operating system without the hassles or risks of playing with disk partitions.
Because loopback distributions store an entire Linux system in a single file, they also have the same ability to transfer, switch between, and clone systems mentioned above for VMware. When Linux is the “alien” operating system, you can transfer your entire Linux environment to any compatible Windows system in a few minutes, then remove it as needed.
Cross-platform program development has traditionally been an art form in itself, one that borders on alchemy, but an art nonetheless. While you can write programs for one operating system and then use them from the other via the methods described above, there is still value in being able to create native versions of applications for both operating systems. If nothing else, it can greatly simplify distribution of the program throughout your organization.
The traditional way to approach cross-platform development is by writing C/C++ code that uses different headers, conditional compilation sections, and libraries to tailor the program to the different operating systems. Even when using as many common components as possible, such as the Qt library (which is the basis for KDE), this can be quite hard to accomplish, since Windows and Linux present such different environments from a program’s view.
As with other interoperability issues, the cross-platform development picture has brightened significantly lately. You can write programs in Java, which now has considerably more support for JVMs (Java Virtual Machines) and tools under Linux, thanks to the Blackdown project, IBM, Corel/Inprise/Borland, and Sun, among others.
C/C++programmers have yet another option in MainWin from MainSoft, or Bristol Technology’s Wind/U to build and run native versions of their programs under both Windows and Linux. This is more complicated than developing nonportable programs, but less so if you plan for it in advance.
Finally, if you want to write cross-platform scripts, check out Edmond Breen’s EiC (http://www.pobox.com/~eic), an open source, full-featured C interpreter that supports 32-bit Windows and Linux, as well as several other platforms. (See review, pg 24. – Ed.)
Making it Happen
OK, so it’s still a Windows world, and bridging Linux and Windows can entail a lot of planning, trial and error, and just plain frustration until you get the kinks worked out. But the tools are there to make it happen, and not only will you benefit from using Linux, but you can also help accelerate Linux’s adoption beyond the server room.
Thought: Keep It Simple Stupid (KISS)
As valuable as the principle of KISS may be to the world at large, there are few places where it’s more applicable than working in a mixed-operating system environment. Simplify workflows and tools wherever possible, but remember that some people will be very hesitant to make any change whatsoever in their procedures to accommodate you or Linux. If people are willing to change, though, there might be a simple way to change workflow, such as moving ownership of a document or tool from one person to another. KISS also has implications for how you use your applications. Minimize the use of less portable or convertible features in your documents, like fancy fonts or formatting, or embedded graphics.
Step 1: Installing VMware
|Take Two, They’re Virtual: Part of the configuration wizard for VMware that helps you create a new virtual machine|
Installing the shrink-wrapped version of VMware (we used version 1.1) is very straightforward. You mount the distribution CD, go to the vmware-distrib directory on the CD, and then (while logged in as root) run the script vmware-install.pl. The script will ask you several questions about where to place various components, and then finish the installation. The first time you run VMware you will have to configure it for a new virtual machine. The program includes a wizard that walks you through the process of selecting which guest operating system you’ll run inside of the VMware virtual machine, how much memory and disk space to allocate to it, whether the system’s floppy disk and CD-ROM drive are visible to the virtual machine, and other settings.
|It’s Alive! VMware creates a virtual machine, right down to the BIOS and boot-screen level.||Microsoft Really Is Everywhere, Even Under Linux. The Windows installation requires all the normal steps, including approving of the licensing agreement.|
Step 2: Installing Windows
When you load the configured virtual machine and click the Power On button, VMware starts the machine in its window and tries to boot from a floppy disk. To install Windows, you would typically boot from a DOS disk that has a CD-ROM driver and basic system tools. You then have to use DOS’ fdisk to partition the virtual disk and the FORMAT command to format it. Finally you can run the setup program from the Windows installation CD, and the rest of the process is exactly as if you were running on a real Windows PC.
|Final Step: Adding the VMware tools|
significantly improves the “user experience” when running Windows.
|Windows to Go: Windows 95|
running in a VMware virtual machine under Linux and the KDE environment.
Step 3: Making Things Nice
Once you have Windows installed, you should download the “tools” package from VMware’s Web site. This package contains a special Windows video driver that will greatly improve the responsiveness of the virtual machine’s user interface, as well as allow you to set a screen resolution larger than the default of 640 x 480. This file is a self-extracting and self-installing program that you run from within the Windows virtual machine. VMware highly recommends you use this driver, and we agree; it makes your copy of Windows far more usable.
MAKING IT WORK: ONE PHAT DISTRIBUTION
|Phat Linux: Installed under Windows and ready to go.|
Step 1: Installing Phat Linux
There are quite a few loopback distributions available, but they all work similarly to Phat Linux. Because they’re meant to be installed from within DOS or Windows, loopback distributions are normally made available as a zip file or as loose files on a CD. Since it contains an entire Linux filesystem preinstalled and configured, this zip file can be quite large, more than the bandwidth-challenged might want to download. The Phat Linux 3.2 zip file weighs in at about 190 MB, for example.
To install Phat Linux, simply unzip the files and store them in the directory c:phat under DOS or Windows. You’ll get a list of files as shown here.
|Phat is where it’s at!|
Step 2: Making it Run
To run Phat Linux you must shut down Windows and restart it in DOS mode (or boot from a DOS floppy), switch to the c:phat directory, and run the linux.bat file. This will start Phat Linux, and from that point on you’re in a normal Linux distribution that works and acts exactly as you would expect, despite the fact that the entire filesystem is housed in a single file in the underlying DOS/Windows partition and file space.
|Watching Me Watching You: Accessing the DOS partition that houses the Linux system itself.|
Step 3: Getting at your Windows Partition
Almost everyone who uses a loopback distribution quickly wonders how to gain access to the rest of the system’s C: partition (in DOS terminology), since you normally get a filesystem of “only” a few hundred megabytes from within Linux. Loopback distributions differ in this respect, but Phat Linux provides a nice plus, in that it automatically mounts the volume, normally /dev/hda1, at /dos, so it’s available as just more normal disk space, as shown here.
TERMS AND ACRONYMS USED IN THIS ARTICLE
|A group of developers who are porting Java to Linux|
|Second Extended Filesystem — the most common Linux filesystem|
|The K Desktop Environment|
|MainSoft’s tool for compiling Windows applications to run in Linux|
|Software that lets you access a Linux application from a Windows machine. SCO’s Tarantella, Graphon’s Bridges, and Citrix’s MetaFrame all fall into this category.|
|toolkit used to create GUI programs for Linux.|
|Rich Text Format, a Microsoft standard for formatting documents and graphics|
|Free software that makes a Linux box look like a Windows NT file and print server|
|Server Message Block — Microsoft’s protocol for sharing files over a network|
|Virtual File Allocation Table — the filesystem for Windows 9X|
|Software that lets you run more than one OS at the same time|
|Bristol Technology’s tool for compiling Windows applications to run in Linux|
|Wine Is Not an Emulator — Emulation software that lets you run Windows apps on Linux|
Lou Grinzo is Reviews Editor for Linux Magazine. He can be reached at email@example.com.