From: www.itworld.com
March 19, 2001 —
Death. Taxes. Microsoft Windows. No matter what the future may hold, at present you still can't avoid any of them. But there are ways to make Windows cooperate with Linux, and thus simplify our work lives until that legacy OS is no longer as ubiquitous as the Reaper or the taxman. In The Legacy Files, a new monthly LinuxWorld column, Richard Sharpe will show you how to integrate Linux and Windows and work around Windows' weak points. And if anyone knows how to beat death or taxes, be sure to tell us how in the forums. --Eds.
As I sat in front of a Windows system at a customer site recently, flustered while trying to fix a user's Internet access problem, I wished I could have access to the customer's Linux-based Internet gateway. I mean real access, with multiple xterms, not that pathetic excuse for a Telnet client Windows has. Once I had an xterm or two running on the server, I could quickly determine why the user could not access the Web. Perhaps Squid had died, or there were mistakes in the Access Control Lists in the Squid config file. Finding out from xterm would certainly be a whole heap easier than running back and forth between a user's PC and the computer room, or getting users to try things while I checked from the computer room.
The more I thought about it, the more I realized that having xterm available from a Windows PC would be very useful at other times as well. When setting up new PCs, much of the work of giving new users access to a customer's Linux servers could be done right on the PC, if only it were possible to fire up xterms. We already had file access sorted out, as we were running Samba on the Linux server. But while Samba configuration can be performed with SWAT, there are problems with SWAT, and Samba troubleshooting would be so much easier if you could watch the daemons and check the log files at the same time that you were trying to access Samba.
With the current rapid acceptance of Linux by organizations of all sizes, there are many companies around the world with environments in which Windows and Linux must coexist. As a result, there are system administrators around the world who need to deal with problems like those I detailed above. The Legacy Files will explore ways to integrate Windows and Linux. Future articles will look at running Windows applications on your Linux desktop, printing in mixed Linux/Windows environments, network troubleshooting under both Windows and Linux, and other topics. Readers are welcome to suggest Windows and Linux integration interests of their own as well.
So, getting back to the problem at hand, there I was, fired up with the need to access the customer's Linux server from a Windows box. I set about finding ways to solve my problem, and quickly came up with several approaches that had promise, which I will explore in the following sections.
Xterms from Windows
Paul Simon had it almost right when he sang about "fifty ways to leave your lover!" When I searched using Google, it seemed as if there were nearly as many ways to access Linux. While there are any number of good Telnet clients for Windows, what I wanted was to run up xterms, as well as other X Window System applications, remotely from a Windows machine. My search turned up a number of X servers for Windows, along with one surprising alternative.
The X servers were MI/X from MicroImages, X-WinPro from Labtam Finland, and X-Win32 from StarNet Communications. You can download each of them from Tucows or from the Websites of their respective companies (see Resources for links). The cost of the products varies from $25 for MI/X to $200 for X-Win32, with X-WinPro coming in at $90.
The surprising solution was VNC, or Virtual Network Computing, from AT&T Laboratories in Cambridge, England (see Resources for a link). This product is very effective and freely available; it's another example of open source software at work.
VNC
VNC looked interesting not only because it was open source software, but also because it promised to access your desktop from anywhere on the network, as long you access your desktop from a system with a VNC client.
Like most Linux networking programs, VNC is built around the client-server model. A VNC server runs on the system from which you want to export your desktop. In my case, I wanted to access my Linux environment from Windows clients, so I needed the VNC server kit for Linux. The ready-to-run download file available on the VNC site only works on systems with glibc support, so if your server is so old that it does not use glibc, you will want to download the source and build it yourself.
Because I would have to access the Linux server from Windows desktops, I downloaded the Windows zip file as well. Note that each kit contains both the client and server environments, so you could actually run the VNC server on your Windows system and gain access to it from Linux. I downloaded version 3.3.3.
The download was about 1.5 MB and the Windows files accounted for almost 1 MB of that. After a few minutes poring over the README file, I had an xterm and twm running on the Windows system. Since I find twm pretty clunky, I spent a few more minutes to figure out how to change my default VNC desktop. VNC starts up your desktop from the file $HOME/.vnc/xstartup. Simply add any additional commands to that file and change twm to Enlightenment or whatever else you want. Figure 1 shows an example of running an xterm with Enlightenment from a GNOME-based Red Hat 6.2 system.
For people who are moving around from desktop to desktop a lot, VNC represents the easiest way to access a Linux server: you do not have to wait for applications to start up on the server and you have a prestarted desktop available. Of course, VNC requires a password before you can access your desktop, and comes with a password tool in case you forget your password.
MI/X
MicroImages' MI/X implements X11R5. The company supplies MI/X for customers of its other products: software packages for geospatial analysis. Since those packages run on Unix and Linux servers as well as Windows systems, the X Window System represents an ideal way for customers to access their X-based software from Windows systems.
The MicroImages Website contains the server in an easily downloadable format, but because of the number of downloads the company experiences, you might need to use one of its mirror sites. As the download contains a complete X Window server, it is 3.6 MB. I downloaded version 2.0.
Installation was a simple process, but it did require that I restart Windows, which none of the other products mentioned in this column wanted me to do. MI/X presents you with a full-screen window with a simple background; you must launch applications using other tools, such as the Windows Telnet client.
While MI/X costs only $25, it is also pretty basic as X Window servers go.
X-WinPro
This package from Labtam International contains far more than an X Window server. There is also an NFS server and an lpd server, as well as Telnet, FTP, and TFTP clients for Windows. Because it contains so much functionality, the download file is a whopping 6.5 MB. However, my main interest in this package was its X Window server. I downloaded version 5.3.
Installation proceeded smoothly: I clicked on the downloaded .exe file and stepped through yet another Windows install. The same download file is used both as a demo version, which is limited to 30-minute sessions, and as the licensed version. You can license X-WinPro by running the license.exe program Labtam supplies after you pay the license fee.
X-WinPro is an X11R6.4 implementation with a large range of features, including XDMCP support. This last feature allows you to log in to your Linux server and run your normal GNOME or KDE desktop.
X-WinPro requires considerable configuration, which can be quite daunting for a beginner. Some configuration may be required under Linux as well, depending on the desktop environment you use. For example, you must change the default settings for GDM if you want it to accept XDMCP requests from X-WinPro. You can accomplish this by setting Enable=1 and HonorIndirect=1 in the [xdmcp] section of the file /etc/X11/gdm/gdm.conf and then restarting GDM. Press Control-Alt-Backspace to restart.
To check if the display manager on your Linux system is configured to accept XDMCP requests, simply run netstat -an on your Linux system and look for a server with UDP port 177 open.
X-WinPro is one of the better X Window servers for Microsoft Windows, and at an intermediate price it seems like a bargain as well. However, it is mainly for those who need to run X-based applications on the same Windows machine all day long.
X-Win32
StarNet's X-Win 32 consists of an X Window server along with a number of extra fonts and a remote print manager. StarNet must have really concentrated on building a good X server for Windows, as it certainly looked like the best implementation of the three discussed here. The download file was 5.5 MB, and while StarNet required a little more effort to get the download files, it wasn't too complex. I downloaded version 5.0. Again, it was an evaluation version; you can only use the product for two hours at a time until you register it.
Installation proceeded smoothly. Of the three X servers I looked at, X-Win32's installation process was the most Windows oriented.
Once installed, X-Win32 was easy to configure, and provided a wizard for the faint at heart. I quickly set it up to use XDMCP with my Red Hat 6.2 system, and only a short time later I had a GNOME login dialog box on the screen. However, after I logged in, I noticed some interesting effects. Each of the icons that normally just sit on the desktop under GNOME had its own frame, just like a normal window (see Figure 2). Apart from this, X-Win32 seemed to provide a good X Window server implementation.
If I were pressed for a recommendation, I would have to say that X-Win32 is the better X server implementation for Windows, but X-WinPro provides better value for money and more functionality (which you may or may not want).
Conclusion
We have looked at four methods for accessing your Linux server from Windows systems; each has its own advantages and disadvantages. VNC is ideal for the harried system administrator who needs to connect to a Linux desktop from multiple Windows clients while debugging. With VNC, you do not have to waste time starting up a desktop every time you switch systems. Also, you can install the Windows VNC viewer on a Samba share and access it from any Windows client in your network without going through the hassles of installing the client on each system.
On the other hand, an X Server for Windows is ideal for those users who need constant access from one Windows client to X-based applications on a Linux or Unix server. Based on price and functionality, I would suggest X-WinPro.
LinuxWorld.com