Re: [SLUG] Optimize remote X11 Session

From: Ian C. Blenke (ian@blenke.com)
Date: Tue Jan 21 2003 - 22:06:52 EST


On Tue, Jan 21, 2003 at 08:16:33PM +0000, btt@nethouse.com wrote:
> Hello,
>
> I'm trying to optimize a remote X11 session between a windows box
> running cygwin (the display) and a linux box running XFree 4.2.0 (the
> client?). I don't want to use ssh because I'm behind a nat'ing router
> and am not concerned about evildoers. The main reason for not using
> ssh is that I don't want to pay the performance hit (which seems
> unnecessarily large in my situation, even with protocol 1, blowfish
> enc.) So far, I've tried using two different ways: telnet and rsh.

Seriously folks, do not use unencrypted sessions across the Internet.
After re-reading this message a few times before sending, it became
apparent that you are talking about playing with this on your PRIVATE
NETWORK. This is fine to learn in, but I don't want to suggest
that anyone ever run X11/VNC/whatever traffic across the backbone.

> In basic terms, here's what I think needs to happen in order for the
> scenario to work:
>
> 1. X server needs to start on cygwin
> 2. something in .xinitrc needs to log me into gentoo box
> 3. display needs to be set to cygwin:0.0 in gentoo environment
> 4. command startkde need to be run on gentoo

Really, I would strongly be thinking about VNC at this point. You can do
some interesting with DXPC as well:

        http://www.vigor.nu/dxpc/

Or the project beyond that, mlview:

        http://www.medialogic.it/projects/mlview/

Then there's always LBX (Low Bandwidth X) built into X11R6.3 and newer:

        http://en.tldp.org/HOWTO/mini/LBX.html

On your local ethernet segment, native X11 is ok, but the compression
really can help bulky bitmaps/pixmaps. X11 is really not known for
efficient representation of rasterized graphics.

> At first I was using telnet... just starting the cygwin bash shell
> shortcut (the one they give you on install), telnetting over to
> gentoo, logging in manually and running startkde. It works pretty
> well, but it is kind of a hassle to do all of that every time. One
> good thing about this way is that when I log out, everything shuts
> down nicely and cleanly.

I really distain telnet. IMHO, it should be removed from every box.
Keystrokes in the clear across the backbone. Same thing for rsh. BSD
style rhost trusts are evil. On your home network though, that's up to
you.

> The method I'm using now, is _very_ convienent. I feel so decadent
> when I use it :). Here it is:
>
> On cygwin:
> 1. A startx batch file chdirs to the cygwin root and:
> bash --login /usr/X11R6/bin/startx
> that starts the x server which then reads .xinitrc on cygwin...
> 2. .xinitrc on cygwin then xhosts +gentoo to allow the back
> connection, then runs 'rsh gentoo /home/me/.rsh_login' which, from
> (gentoo #2) below sets the display and starts kde.

This is REALLY not a good idea. Seriously consider AT LEAST using xauth and
cookies for authentication. It's worth spending the time to understand
how to manage your xauth cookies. Better yet, I strongly recommend using
XDMCP.

> On gentoo:
> 1. I have rshd set up, and /etc/hosts.equiv to allow me access from
> the cygwin machine.
> 2. I have a script called .rsh_login that uses a bash login shell
> (#!/bin/bash --login) to set $DISPLAY and then run startkde. If I
> don't use --login, then my environment is not set up properly and
> my $PATH ends up being something like '/bin:/usr/bin' which doesn't
> get me very far.
>
> It works ok. I am a mere doubleclick away from having my gentoo box's
> kde desktop in a window on my windows box. Life is good. Yet, when I
> choose logout from kde, kde quits out, but the x11 server doesn't seem
> to shut down properly. So I click and close that window. Then... I'm
> left with the windows batchfile window, where the startx concoction is
> still running. So I have to close manually... but not after being
> reminded that I'm going to lose my unsaved work.

You're really making this more difficult that it needs to be. Merely
enable XDMCP in your /etc/kde2/kdmrc or /etc/X11/gdm/gdm.conf file. Then
do the following on your cygwin box:

        /usr/X11R6/bin/X :0 -broadcast
or
        /usr/X11R6/bin/X :0 -query ip_of_your_linux_box
        
> My question is... is there a better way without using ssh? I'm more
> of a windows novice than a linux novice, but I've never used rsh, so
> maybe I'm not understanding what's going on with that. The stuck
> command does seems to be rsh, as the window's batchfile titlebar says,
> "RSH"...

Yeah, seriously consider XDMCP. If what you want is a remote full
desktop of your Linux box, try the above trick.

For those of you who wish to play with this, try:

        Xnest :1 -query localhost

If you have XDMCP enabled on your display manager (kdm/gdm/xdm), this
will open up a "nested" X desktop which should have a full login banner
and let you start a full desktop.

- Ian



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 13:41:05 EDT