This is the mail archive of the cygwin-xfree@cygwin.com mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Cygwin success story: Using remote X11 session over ssh


Hello, list.

I want to take an opportunity to relay a success story and get some
feedback on how proper a success it was.

First, some background.  I have a Linux desktop system that I use for
just about everything, and its name is cleopatra.

I bought a wireless notebook system that I could use to unchain myself
from the family computer room, a notebook which of course came with
Windows XP.  I wasn't too sure about Linux compatibility with it, so I
kept Windows and put Cygwin on it, taking special care to include
OpenSSH, ESound, and X11.  The notebook's name was cleos-cat.

The purpose of this setup, which was pretty much cleos-cat's reason to
exist, was to be a wireless X11 terminal so I could use my computer in
the living room, dining room, kitchen, bedroom, and whereever else
around the house I wanted, and to free up the computer room for use by
the rest of my family.

On each computer I made sure that the other's hostname would resolve and
be reachable by name instead of just IP address.

On cleopatra, I had to install and enable ESound for sound output,
enable X11Forwarding in sshd_config, and generate a public/private
keypair in OpenSSH.  I copied the public key from cleopatra to
cleos-cat.  I also made a custom bash script for start-up from remote
login and named it ~/bin/startwmaker.  In that file I put this:

#!/bin/bash
source ~/.bashrc
export ESPEAKER=cleos-cat:16001
wmaker
exit

On cleos-cat, I had to install ESound to start up automatically with
Windows.  I don't remember how I did it, but it was done to start the
command: esd -tcp -public -noterminate -nobeeps -port 16001

I made a Windows batch file in C:\cygwin\home\arielmt\startcleopatra.bat
and gave it the following contents:

Set DISPLAY=cleos-cat:1.0
Set REMOTE_HOST=cleopatra
Set CYGWIN_ROOT=\cygwin
Set PATH=.;%CYGWIN_ROOT%\bin;%CYGWIN_ROOT%\usr\X11R6\bin;%PATH%
Set XAPPLRESDIR=/usr/X11R6/lib/X11/app-defaults
Set XCMSDB=/usr/X11R6/lib/X11/Xcms.txt
Set XKEYSYMDB=/usr/X11R6/lib/X11/XKeysymDB
Set XNLSPATH=/usr/X11R6/lib/X11/locale
run XWin :1 -once +kb -emulate3buttons 100 -fullscreen -clipboard
run ssh -CY -i ~/.ssh/cleopatra arielmt@cleopatra ~/bin/startwmaker

I chose to use :1.0 as the display so that, when I needed to, I could
run an X11 server locally on :0.0 using Windows as the window manager. 
In retrospect, was the "set remote_host" line redundant?

Finally, I made a Windows shortcut to startcleopatra.bat and put the
icon on my quicklaunch bar.  After that and a reboot on the Windows
side, I had one-click access to cleopatra from cleos-cat, regardless of
the state of the computer room.  The only consistent problem that I ever
had with it is that, after logging out of the remote session, XWin
refused to shut down until I did the X11 three-finger salute
(Ctrl+Alt+Backspace).

On cleos-cat, I used the free edition of the latest ZoneAlarm.  I put
cleopatra's and cleos-cat's IPs in ZA's "trusted" zone, which I could
safely afford to do since both were on the same LAN and behind the
router's firewall. Of course, I got ZA dialogs whenever I used Cygwin,
but I told ZA to remember that esd.exe, XWin.exe, and ssh.exe were
servers and to allow them without further complaint.  Checking the
"remember this" checkbox prevented ZA from bugging me again until the
next Cygwin update (where ZA found some "changed programs").

This setup worked for me through several Cygwin upgrades until cleos-cat
died of hardware problems.  (It was under warranty, so that's not an
issue.)  I don't use it anymore because the replacement notebook I got
uses Linux natively.

Has anyone else thought of doing what I've done?  If so, what are your
opinions, and how could I have done this better?

Thank you.

-ArielMT

-- 
"The most humbling achievement of the past millennium, I believe, is the
evolution of the simplest form of communication: the written letter.
>From courier to post to telegram to fax to email, each advancement has
made the awesome power of writing more accessible than ever before."
-Ariel Millennium Thornton, Spokesman and Mascot, Thornton 2 Productions


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]