Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

cbrooks (3267)

  (email not shown publicly)

Journal of cbrooks (3267)

Thursday December 12, 2002
09:12 AM

Using XWindows remotely

[ #9411 ]
As part of my new eternal commute, I have started working a bit from home -- an hour here, an hour there. One of the annoying aspects of this is managing email. If I check company email from home, I either see the same messages twice (once from home and once at work), or I can choose to have the messages deleted from the server as soon as I delete / move them at home. Neither approach is ideal.

My new approach is to have a single mail client located at work. I fire up Cygwin on my Windows box at home, invoke ssh, and interact with Mozilla remotely using X Windows. (Actually, I'm fibbing a little. So far, I have a Linux box at work running my mail client, and I'm just shelling in from my Windows / Cygwin box across the office.) But, it's a neat trick, and it will greatly simplify any future work from home.

Here are the steps that I took, in case anyone is interested in trying something similar.
  1. Get Linux configured on the box that you are going to run your mail client on. (You could also run Cygwin on top of Windows, I suppose.) Make sure that you can use X on this box, and make sure that you have the latest openssh daemon configured and listening to port 22. I suppose you should also make sure that you can access this box remotely over ssh.
  2. Install Cygwin on the Windows box that you will use remotely. (Cygwin, BTW, is free as in speech, and free as in beer for most purposes.) The Cygwin installation process is quite straightforward, once you get used to its somewhat non-intuitive interface. You can download the setup program from I chose to install the following packages (which take up about 250 MB of disk space):
    • All: Default
    • Doc:Man and Texinfo
    • Editors: ed, mc and vim (because vi is the one true editor, okay, the two true editors, because it uses ed under the hood)
    • Net: Openssh and rsync (rsync isn't necessary for this project)
    • Text: more, less
    • XFree86: pretty much everything. Make sure you have fvwm and base
  3. Follow the instructions at I found these to be pretty good, although the script mentioned was actually in /usr/X11R6/bin/, rather than /usr/X22T6/bin/
  4. At this point, I was able to shell into the Linux box that would host my mail client. However, when I tried to invoke a utility (such as xclock) that relied on X, I got the following error: "authentication failed - cannot start X server - perhaps you do not have console ownership". I was able to fix that thanks to the following usenet post:
  5. I made a minor change to my ~/.ssh/config file (on the remote Cygwin box), setting "ForwardX11 yes". (You could also just pass the "-X" option to ssh at the command line.)
  6. From cygwin, I fire up an xterm, and invoke ssh with the following options: "ssh -n ip_addr mozilla", and lo and behold, Mozilla pops up.

I have not been able to launch startx successfully (remotely), though I can launch it on the local box directly. I think that my ssh client is configured correctly, which makes me suspect that the problem has something to do with inadequate libraries on the Cygwin box. (For example, if I shell from the local Linux box back to itself, I can run startx successfully.) I believe this suggests that if the remote box had the correct software, the X11-forwarding would work correctly. Does anyone have any brainstorms?

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • You want to start an X server on your home machine when you're at work? I don't think it works that way. What are you trying to do?

    • I'm not sure which question to answer first. Let's start with this one:

      >What are you trying to do?

      The goal is to be able to run a single mail client seamlessly from home or from work. That is, I want to have my inbox, sent mail, drafts, etc. all centralized in one place. Imagine, for example, that I used pine to manage my email, and imagine that the server on which that pine account lived was located 2000 miles away from both my work and my home. To handle my mail, I would simply shell into the r
    • Perhaps I replied too quickly to this.

      Yes, I was misunderstanding a part of the process. Essentially I was firing up a window manager (fvwm2) and then trying to forward a second window manager (sawfish -- RedHat 7.3's default window manager) onto fvwm2 by running "startx". What I need to do is run sawfish on my home machine, and then forward mozilla.

      That may, (or may not?) have been the point you were making. ;-)
      • Yeah, that sounds like the point I was making. :) If you start X on your work machine and just fire up an XTerm, you can log in to your home machine and run sawfish just as any other X client. (sawfish & should do it -- startx does a bit too much.)

  • I just stay away from the X clients all together and use mutt []. Its extremly powerful and all you need is to ssh into the box to check your mail. You can even try IMAP over SSL so all your mail stays in once place so you don't get duplicate copies and stuff.

    Just giving you some other options so you don't have to rely on getting X forwarding working just to check mail. (for example if you visit a friend on vacation and they just have windows 98 and AOL, you just need to grab a win ssh client like putty t