[CLUE-Tech] Newbie help on X windows

Adam Bultman adamb at glaven.org
Wed Jun 26 11:29:58 MDT 2002


First off, please set your line wrap...

>
> 1) I think I need to disable the automatic startup on Dick (workstation) to avoid going directly into KDE (maintaining the option of opening manually).
>
Um, not quite.  linux is pretty capable of running multiple X servers,
although that's not quite what you need (I've run 4 X servers on linux
before: Gnome, KDE, and two Windowmakers at different resolutions on
Alt-F7 thru ALT-F10).

Essentially, what you need to do is this:

1. Check to make sure SSH is on both computers (likely).
2. Make sure that X-forwarding is set on both computers (on the 'server'
is most important).

3.  SSH into the server from your workstation. You may or may not need to
use the -X option. I personally don't.

4. type 'echo $DISPLAY'. If it says your local workstation, you are set.
If it says 'remote:0.0' then you need this:
export DISPLAY=<local ip>:0

That will tell that computer "If I start up an X app, use the X server at
this address".

5. Try running a simple X app.  If you get something like, "Connection
refused", type 'xhost +<remote ip>' at a command line. That allows that
other machine to connect to your X server. On some computers this is
required; on others, it's not.  On my home machine, it's not required, on
my work computer, it is.  Then, try another X app that's tiny. It should
think for a bit, then show up on your screen.

You can pretty much forward from any linux box to any other machine with
an X server (i.e. another linux machine, or a windows machine running
Xwinpro, or Cygwin, etc).  Usually, this is what I do:

local$ xhost +192.168.0.200
local$ ssh 192.168.0.200
remote$ export DISPLAY=192.168.0.37:0
remote$ gkrellm &
remote$

Then, I get a gkrell app on my local workstation running from the remote
one.  At home, I have vmware on one box, and export it to my main box. So,
it uses the processor on the 'headless' machine, and use it on my local
display. This does NOT work for rather intensive items, graphics wise.
Don't play tuxracer, or anything, or run realplayer. That will saturate
your bandwidth.

Anyway, hope that gets you started. Here's something a little more
advanced:

1. Pop to a shell (ALT-F2, whatever)

2. Type:  X :1 &
3. Switch back to your old console.
3.5 type export DISPLAY=:1
3.7 type 'xterm'
3.8 Switch to new Xserver, and type in 'xhost +<remote ip>' in the xterm

4. SSH to your remote machine.
5. on the remote machine, type export DISPLAY=<ip>:1
6. type 'exec <windowmanager>'

That should start up a window manager accessible via ALT-F<n> and will let
you swtich back and forth. Woo!  That's a bit more useless than just
hosting an X app, but it's sometimes VERY useful.

I just did that right now, it's pretty cool.  I've a fully functional
gnome session running from that box. Woo!

http://www.glaven.org/images/bg2.jpg  Shows two gkrellm items running from
my firewall, and file server, respectively at work.  hotline and uter are
the remote machines, and the two small windows in the upper right corner
are the terminals they were launched from, which at the time were just
tailing access logs.

Adam




More information about the clue-tech mailing list