Trouble with the New X11 server in Cygwin

I recently upgraded my Cygwin install and noticed that Cygwin has switched it’s X server XWin.exe from the XFree86 codebase to the Xorg codebase. Besides an updated logo, it also has some other side-effects.

The first one I noticed is that the xterm now has a menu turned on by default. If this annoys you (like it did me), you can turn it off by adding the following to your ~/.Xdefaults:

XTerm*toolBar: off

The next side-effect I haven’t yet solved. I use the XWin menu to define some links to the servers I look after at work. I use plink.exe (part of PuTTY) to launch an xterm on the remote host, displayed locally, and using pagent.exe to do the authentication. For example:

    "Content Server" exec "D:/Programs/PuTTY/plink.exe -ssh -X -C -load someserverdef /usr/openwin/bin/xterm -name greenbackground -ls"

This used to work, but now nothing happens.  Interestingly, the command will work if you execute it directly from a bash shell. If anyone has an idea, I’d be grateful for their help 🙂

UPDATE: – 20081217 — Use Xming, maybe

I haven’t yet figured out ssh-agent. However one work-around that I tried earlier and added in the comments was no good: the X clients started in a terminal that is forked off this way don’t come through for some reason, to do with the way the X packets are tunnelled I think. So, I was motivated to try Xming.

Xming is being used quite successfully by my work colleagues who don’t have a whole Cygwin stack on their machines. It’s a lightweight X11 server for Windows, and it even uses Microsoft’s OpenGL apparently. I’ll have to try out some 3D clients from home soon to see what that gets me, but it could be good.

Anyway, for work, it seems to integrate very well with PuTTY. There’s even a stand-alone putty you can download that’s pre-integrated, though it seems to also require the Xming server.

I also found that it’ll serve my local X clients quite well. The most important of these is my emacs, of course. For that to work well, I had to download the extra fonts since emacs uses servers-side fonts. But it works and is indistinguishable from the X11 server that’s built into Cygwin.

I haven’t yet un-installed Cygwin’s X server: I fear it could also remove clients and libraries, and I don’t want the hastle just now of figuring that out.

A final note: It’s menu config file is Xmingrc (no dot), which lives in Window’s HOME %USERPROFILE%. Also, because it’s got no Cygwin dependency, you can’t launch local Cygwin X clients from this menu. At least, not without wrapping them in calls to Cygwin’s run.exe, e.g.

d:\cygwin\bin\run.exe -p /usr/X11R6/bin emacs -display --debug-init


2 thoughts on “Trouble with the New X11 server in Cygwin

  1. I had similar effects once when I executed a ssh command on an rxvt that was NOT under Cygwin/X, to display a remote app under Cygwin/X. If used a terminal that was started ‘inside’ Cygwin/X all was good. Does that make sense? Anyway, could be a similar issue. Does the Xwin menu execute in the context of the X server? Is it some artefact of ssh tunneling and the relationship between processes/groups?

  2. Thanks Alec. This could be on the right track.

    For now, a simple fix is to run the plink.exe from an xterm like so:

    “Content Server” exec “xterm -geom 0x0 -iconic -e d:/Programs/PuTTY/plink.exe …”

    Which works but leaves a lot of little “plink.exe” windows cluttering my desktop :(. It’s enough for me to get by and get some work done, I’ll just flick the plink windows to another desktop (Virtual Dimension is useful at times)

    The real answer might be to figure out ssh-agent and use that instead of PuTTY/pagent/plink

Comments are closed.