This is a read-only archive. Find the latest Linux articles, documentation, and answers at the new!


Connect to remote Unix desktops with Cygwin

By Avinash Parampalli Vasudev Aithal on July 12, 2006 (8:00:00 AM)

Share    Print    Comments   

In my work I'm expected to be on a Unix system 80% of the time, yet I also need to use office applications, a Windows-only VPN client, and some Windows-based asset management tools. That leaves me with little choice but to use a tool to connect a Windows client to a remote Unix desktop. I could use a terminal emulator or connect via a VNC server, but I've found that Cygwin, a Windows port of many GNU/Linux tools, is the best way for me to bridge the gap.

Cygwin brings a Unix-like desktop environment to a Windows PC. For example, it can be used to run a bash shell with a Unix-like terminal in Windows. It also helps to access the complete desktop environment of a remote Unix machine. To give you an example, you can customize a GNOME session, including the screensaver, and you even get those bang sounds that play when you press an invalid key in a vi session.

Installing Cygwin is pretty straightforward. Download the setup.exe program from the Cygwin Web site and run it. It will help you choose what to download, manage downloading your choices, and install all the components. A quick-and-dirty method is to choose all the components under category X11 when the script prompts you to select packages.

Once the installation is finished, you'll find a batch file named startxdmcp.bat under the $CYGWINHOME\usr\X11R6\bin directory -- $CYGWINHOME being the top-level Cygwin installation directory, which is prompted by the setup.exe script before even downloading the packages. You'll want to edit the batch file and make two changes.

First, change the REMOTE_HOST value to your server's IP address, then look for a line like run XWin -query %REMOTE_HOST% -nodecoration -lesspointer :1. Add the option -clipboard as one of the parameters (if it's not already present); this will allow you to copy text from a GNOME terminal in the Cygwin window and paste it into Windows application running locally on your PC. Make sure make sure an xdm server is running on your target host, then run the batch file to launch a connection to the remote xdmcp server. In Linux, it is as simple as typing xdm at the console. For advanced xdm options, refer to xdm's man pages. Then, log into your *nix desktop normally.

There's a lot to like about Cygwin. For one thing, it's amazingly lightweight. An instance of Cygwin takes just about 8MB of system memory on my Windows 2000 PC, a Pentium 4 with 256MB RAM. It's also stable -- I've been running it for more than six months and it's never crashed on me. And of course, it's free.

Cygwin allows a great deal of customization in installations and utilities, and it's easy for organizations to customize it to meet their needs. Folks in my organization use Cygwin as a terminal, specifically to access mainframe computers.

Cygwin is a pretty hefty download, about 150MB, but this is justified for the a package which contains the entire X server along with all the Unix tools like shells, GNU utilities, etc. Also, given network speeds these days, this may not be a big issue, but I didn't like waiting two or three hours to download and install the software over my cable Internet connection.

Cygwin has helped me get the best of both worlds -- the developer-friendly Linux environment on a user-friendly Windows laptop.

Share    Print    Comments   


on Connect to remote Unix desktops with Cygwin

Note: Comments are owned by the poster. We are not responsible for their content.

That's all well and good, but...

Posted by: Anonymous Coward on July 13, 2006 01:30 AM
The author really doesn't describe WHAT cygwin is at heart, first of which is a software layer that translates POSIX calls to Win32 calls.

What does this mean? Well, it means that most any program written for Unix/Linux, that uses POSIX standard calls, can be simply recompiled in a Cygwin environment to use said progam in Windows without modification! No longer do you need to write code to port that ultra useful Unix/Linux application (emacs, X, bash, etc.) to work in Windows, which is a completely different beast altogether.

This brings me to the second thing that Cygwin "is": Along with the POSIX to Win32 compatibility layer, it is also a large collection of Unix/Linux applications that have been compiled in the Cygwin environment to be used seamlessly in Windows. This is what gives you the capabilities that the author discusses:
- X
- bash
- ssh

While useful for what the author has explained, Cygwin comprises much more than what was stated, and started as a POSIX to Win32 software layer at its beginnings. The compilation and addition of the various applications that come with a Cygwin installation is what makes it such a useful package today.


Try using FreeNX

Posted by: Anonymous Coward on July 13, 2006 03:38 AM
Install a FreeNX server on your machine and then install the corresponding NX client from NoMachine

It is much faster, and the problem with XDMCP is that either your Cygwin machine must be on the local lan (same subnet) or should have an IP resolvable through DNS.


Another way of doing it

Posted by: Anonymous Coward on July 13, 2006 04:02 AM
This 'stray cat' <a href="" title="">Knoppix for Windows</a>will do what you want, after a fashion. Download the DVD, put it in, let it autoplay, and you get a Linux in emulation. A little slow, but you can pull up 'xterm's, do 'ssh', the whole lot.

BitTorrent link <a href="" title="">here</a>



Posted by: Anonymous Coward on July 13, 2006 05:31 AM
We had been using Cygwin/XFree for XDMCP sessions from Windows to a Linux server. It worked. It dazzled people, even though it's essentially 20 year old technology. However, we've found that it is very bandwidth-intensive on the order of Gigabytes per day. Plus Cygwin/XFree is not a trivial install for clueless Windows users (easy, but not trivial). If someone would package it up into one neat<nobr> <wbr></nobr>.exe install program, it might be easier to install; but still, we're talking 150+ MB for a glorified X Terminal. (Xming may be the alternative some people are looking for here: <a href="" title=""></a>)

We needed something simpler and smaller. We settled on XDMCP via VNC. The Windows client setup consists of just installing vncviewer or tightvncviewer. There are a few tutorials for setting up the XDMCP via VNC system, including
<a href="" title=""></a> .



Posted by: Anonymous Coward on July 13, 2006 06:00 AM
You're right. X11 can tend to be bandwidth-intensive, especially if a lot of screen updates are taking place. I noticed that with LTSP, which of course also uses X11. One "edutainment" application called TuxType can suck up 73Mb/sec across an Ethernet network! It sounds like you found a pretty good solution for that.

Of course, if you're on a switched 10/100 network, and your servers are on Gig-E (most newer ones have that built-in now), then you should be OK. That's how I run LTSP, and in this configuration, it works great (40 users on a single box). But I'm using dual NICs, so the X11 traffic is isolated from the file-server traffic (separate VLAN). A single-NIC application of this would, of course, take more careful analysis.

I should say something about "clueless Windows users" installing apps in a corporate setting. They shouldn't be. That's a job for something like SMS or the local tech person, who is supposed to have a clue. I've had to re-image more Windows boxes where the user has Admin rights than I care to count, because said clueless user tried to install, say, MS Publisher XP on top of MS Office 2000, or some similar situation. Oops....


Is Windows really needed for what you need to do?

Posted by: Anonymous Coward on July 13, 2006 05:44 AM

You mentioned that you're expected to use the following:

1.) office applications,
2.) a Windows-only VPN client, and
3.) Windows-based asset management tools.

I'm guessing that, like most businesses, you're expected to use something that speaks the Microsoft Office proprietary file formats. I'm also guessing that the "Windows-only VPN client" is an IPSec VPN client (most are, these days).

For the first two tasks, if my above assumptions are correct, a GNU/Linux desktop distribution will handle that with great aplomb. We'll start with the VPN issue. I've been using IPSec VPN clients on GNU/Linux for years--one from Cisco, and an open-source one called "vpnc". Both work very well.

As for Microsoft Office file format compatibility, I've been using since its pre-1.0 days, and, while version 1.0 was pretty darned good, and version 1.1 was (is) *really* good, version 2.0 is stellar. I work in a "Microsoft shop" and have to deal with MS Office documents of various types all the time. I have had exactly one major issue in four years, and it was with a MS Word document in 1.0 (MS Office 2000 couldn't handle it either, BTW, but 1.1 and 2.0 could). So, I can say, from four years of experience, that GNU/Linux is, and has been, at least as ready to handle these tasks as MS Windows has.

The one that remains is access to the Windows-based asset management tools. One option is using CrossOver Office, which happens to run MS Internet Exploder, as one example, rather well. If CrossOver Office won't run your asset management tools well, then here's another solution. Stand up a MS Terminal Server and install these asset management tools on it. You and others would then be able to just use TSClient on your GNU/Linux desktop (TSClient, being Free Software, comes with most distributions) to hit the MS Terminal Server and run your asset management tools.

This is exactly how I run MS Internet Exploder with Sun Java 1.4.2, because it's required by one enterprise application that we have that requires both IE and Java...on Windows only. I just "TermServ" into the Windows Terminal Server, do what I've got to do with my app, and log off when I'm finished. Meanwhile, my machines get all the benefits of GNU/Linux (Ubuntu Dapper, in my specific case, with a Slackware laptop) and avoid all of the problems with Windows.

Hopefully this helps either you or someone else in your kind of situation.


Re:Is Windows really needed for what you need to d

Posted by: Anonymous Coward on July 13, 2006 06:17 AM
you may want to try wine to run your windows based app... I to work in a windows dev shop and I run SuSE 10.1 on my laptop. I integrate fully with the Win 2003 active directory and manage to do all my work except run one proproetary app. I load up a KDE remote desktop connection to my windows server for this one thing... the rest is all Linux goodness<nobr> <wbr></nobr>:) no crashing, no viri, all smiles


Ok I don't want that guy working for me EVER.

Posted by: Anonymous Coward on July 13, 2006 07:00 AM
<a href="" title=""></a> Xming plus putty. Part install come in under 20 megs. Full install with all X11 normal fonts locally for speed still comes in under 80 megs. Basicly wasted 70 megs of harddrive better for something else.

Faster lighter on ram. Ie it wins ten was from sundy.

I never use the cygwin X11 server its too heavy and too slow. Even with cygwin I use Xming.


Re:Ok I don't want that guy working for me EVER.

Posted by: Anonymous Coward on July 13, 2006 04:01 PM
I was just going to suggest this. Cygwin is too heavy for me. I still would like something as it works in opposite way (rdesktop), but your solution is atleast a little bit closer than Cygwin.
Pixel image editor - <a href="" title=""></a>


Re:Ok I don't want that guy working for me EVER.

Posted by: Anonymous Coward on July 13, 2006 09:47 PM
I use Cygwin/X and I've tried XMing. I'm not sure what the problem is, but, for me, XMing is much slower than Cygwin/X. I'm using XDMCP and XMing takes almost a minute to connect. Once it is connected, it is still noticeable slower than Cygwin/X. I reinstalled it when the latest version came out, and got the same results.


Did you install the fonts?

Posted by: Anonymous Coward on July 14, 2006 08:48 AM
Cygwin/X installs all the normal fonts by default. The 30 meg download bit of Xming.

This makes a big speed difference. Reason if font's are not local it will download from server before displaying anything. Also any font changes have to come from server.


Re:Ok I don't want that guy working for me EVER.

Posted by: Anonymous Coward on August 01, 2006 01:10 AM
Xming fixes the XDMCP latency problem some people may have encountered


This story has been archived. Comments can no longer be posted.

Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya