In-Depth

Make Room for Linux Apps

As Linux applications grow in popularity, Windows admins will need to start incorporating them into their networks. Here are five ways to do that.

Linux desktops are gaining in popularity. While it's still not too common to see shops replacing Windows desktops with their Linux counterparts, there is certainly an increased desire to interoperate.

That collaboration takes many forms. You might need to exchange data, such as Microsoft Office documents, with someone using an alternative office productivity suite. Perhaps there's a compelling Linux application you want to run on your Windows desktop. Even if you don't want the application to run on your Windows desktop, you may at least want to run it alongside your Windows desktop.

There are multiple ways to run Linux apps; the five most common are presented here. In most cases, you won't need to deploy all of these strategies. But, depending on your needs, you might need to deploy one or more of them. Here's a rundown of some ways to get Linux applications to your Windows users:

  • Use apps that are built to run on both platforms
  • Run Unix tools and commands on Windows
  • Remotely connect to a Linux machine
  • Emulate a Linux environment
  • Emulate a whole machine and run Linux inside it

Method 1: Use Apps That Call Both Windows and Linux Home
What do you do when other business units or partners are running Linux and you need to exchange files with them? You could save the documents in a common format, like a text file, but the rich features inside the document would be gone. Better to use software that can properly exchange the files you need. On the Windows side of things, you'll usually want to create documents with Office and send them off to share. But Microsoft doesn't make a Linux version of Office, so if you're a Linux user you have to make some choices.

Linux users have two main office suites to choose from: OpenOffice and StarOffice. Both suites have basic compatibility with Microsoft Office, so they can read and write native document files coming from Microsoft Office. However, the key word here is basic. My testing shows serious formatting issues with moderately complex Word docs (like a resume) and moderately complex PowerPoint files. In other words, true file interoperability isn't quite there yet for serious use.

A better option is to simply run OpenOffice or StarOffice on your Windows clients and use the native file formats of these applications. That's right: both OpenOffice and StarOffice have Windows binaries and run just fine on Windows. This may not always be possible, as your company is likely already deeply entrenched in Microsoft Office and not likely to switch anytime soon.

OpenOffice and StarOffice aren't the only popular Linux applications that run under Windows. In fact, the Linux camp has made it very easy for Windows folks to check out a range of popular Linux software, which also happens to run on Windows. It's called the OpenCD Project.

The OpenCD comes as a standard ISO file which can then be burned directly as a CD-ROM by just about all CD burning software. Once you have the final CD in hand, you'll find a little something for everyone: productivity apps (like OpenOffice); design, painting and graphic manipulation apps (like TuxPaint and GIMP); networking, browsing and remote-control tools (like TightVNC and Firefox); multimedia and sound manipulation applications (like Audacity); utilities (like 7-zip); and games (like LBreakout).

In all, it's a potpourri of free stuff that runs on Linux and Windows and is guaranteed to properly exchange native file formats.

Method 2: Run Unix Tools and Commands on Windows
One great thing about Unix and Linux is the abundant availability of command-line tools, often through batch scripts. And, while there is some variance among the different forms of Linux (and a little bit more from Unix to Linux), pretty much all the base command-line tools and their options are the same. This means you can usually take a script that is working today in Mandrake and run it on Gentoo, Red Hat or SuSE.

It turns out that you can also run it on Windows with none, or very few, changes. The magic happens when you load one of two tools that can port the Linux command-line over to Windows. They are Cygwin (pronounced sig-win) and Microsoft's Services for Unix 3.5 (SFU). You can load either (or both, if you so choose) on Windows 2000 or Windows XP clients, or your servers.

SFU 3.5 uses the Korn shell, or ksh shell. While many Linux folks still call ksh home, the Bash shell, which Cygwin relies on, is getting more common among Linux power users.

In Figure 1, you can see both Cygwin and SFU 3.5 displaying man (manual) pages for the ls (list) command.

Figure 1. Cygwin, top, and SFU 3.5 have a similar command set. Here you can see them both displaying the man (manual) pages for the ls (list) command.
Figure 1. Cygwin, top, and SFU 3.5 have a similar command set. Here you can see them both displaying the man (manual) pages for the ls (list) command. (Click image to view larger version.)

Method 3: Remotely Connect to a Linux Machine
Just as you'd use Terminal Services to remotely control a machine in the Windows world, there are ways you can remotely control a Linux machine. The two main ones are VNC and X.

VNC is the closest cousin to Terminal Services. With both VNC and Terminal Services (which uses the RDP protocol), you're really seeing "screens" of information come across, and you can move the mouse and keyboard and have those sent along through the pipe as well. VNC is nice because a) it's free and b) additional services allow it to run on Linux, Windows, Mac and more, making it a great multiplatform remote control and remote computing solution. Because you're just sending over screen, keyboard and mouse information, VNC works with just about every Linux application, with one big exception—those using sound, which isn't supported in VNC yet.

The other way to remotely connect to a Linux machine is via "X". X is the original way to display graphics remotely from "over there" to "over here." The idea was simple: a computer "over there" with a lot of horsepower does all the heavy computing. The computer "over here" doesn't have to have a lot of horsepower; all it needs to do is actually output the display. Because of this, X terminology became a little wacky. The machine you're sitting at is the X server. The machine you're connecting to is called the X client. The client (the machine you're connecting to) is the one telling the server (the machine you're on) what to display. This separation of X server and X client made a lot of sense in the olden days, when buying a Unix machine with enough horsepower to perform both X client and X server functions was very expensive.

But today, buying a PC with enough horsepower isn't beyond most peoples' budgets. That allows the client and server to run on the same machine. The X client can be running "over there" but you can be "over here." To that end, if you can run an X server on your Windows machine "over here," you'll be able to connect to machines "over there." This is handy for apps that have both client and server components.

Microsoft has partnered with StartNet Communications to offer a free version of X server. The constraint with this version, however, is that it only works if the X client application you want to use is on the same box. Cygwin, discussed earlier, also has add-on X server compatibility, and no restrictions as to where the X client is running.

Method 4: Emulate a Linux Environment
One way to get Windows machines to run Linux is to feed it a bunch of Windows executables that simply run Linux. That's the idea behind coLinux.

CoLinux (short for "Cooperative Linux") is a cleverly modified Linux kernel that runs as a Windows application. Once it's running, it produces a display like the one in Figure 2, below. The advantage here is that once coLinux is running, you can use basically any Linux program you like.

Figure 2. CoLinux is an implementation of Linux that runs right within Windows.
Figure 2. CoLinux is an implementation of Linux that runs right within Windows. (Click image to view larger version.)

The drawbacks are that coLinux is fairly clunky to set up, and it's limited to only two specific Linux distributions: Debian or Gentoo. If your application doesn't play well with either of these Linux distributions, coLinux probably isn't a good candidate for you.

CoLinux is an interesting piece of software. By default, it runs GUI-less, but it's possible for coLinux to successfully run a full GUI environment. It also has fairly good networking support, allowing you to use the network card already inside your machine. It also has several tricks up its sleeve, like accessing the C:\ drive of the host machine to pass files back and forth between Windows and coLinux. CoLinux is well worth a look if you need to run the occasional Linux application.

Method 5: Emulate a Whole Machine and Run Linux Inside It
The best way to maintain a true Linux environment inside your Windows machine is to emulate an entire machine, then run Linux inside it. That's how VMware Workstation, VMware's GSX and ESX servers and Microsoft's Virtual PC and Virtual Server work. In Figure 3 (opposite page), VMware Workstation 5.0 is booting up Fedora Core 3 as a guest.

With Virtual Server 2005 SP1 (currently in beta), Microsoft will support Linux guest machines when the host machine runs Virtual Server 2005. While that might help you in the lab with application compatibility testing, it won't help your users directly. That is, Virtual Server 2005 only runs on Windows 2003—and it's unlikely your desktop or laptop users have Windows 2003.

Loading a Linux guest inside Virtual PC 2004 will work, but be aware that it's not supported. And unfortunately, Microsoft's latest announcement about Virtual Server 2005 with SP1 doesn't apply to Virtual PC 2004. So if you're considering running a virtualized Linux guest under Windows, VMware Workstation is really the best choice.

Figure 3. VMware Workstation can run many Linux distributions as a guest within  Windows; in this case, it's running Fedora Core 3.
Figure 3. VMware Workstation can run many Linux distributions as a guest within Windows; in this case, it's running Fedora Core 3. (Click image to view larger version.)

Finding Harmony
You never know when you'll need to start running Linux applications. Sometimes it's easy—just find an application that also runs on Windows, and you're in business. Sometimes, getting there is a bit harder—you'll have to find a way to run that Linux application remotely, or bring that Linux application to you.

However, one thing's for certain: Linux is here to stay, and it's a good thing there are options for Windows and Linux to play nicely together.

Featured

comments powered by Disqus

Subscribe on YouTube