/etc/apt/sources.list
file:
deb http://www.kalyxo.org/debian/ experimental mainThen run "
apt-get update
" followed by "apt-get
install
freenx
".nxagent
and nxproxy
. Each of them
handles a different aspect of NX's remote-access performance boosts.
nxproxy
translates back and forth between X
protocol requests and
the more efficient NX protocol. You run two copies of this, a "server"
copy which is run on or near the machine you'll be sitting in front of
and a "client" copy which is run on or
near the machine that you want to access remotely.
If that naming scheme seems backwards, just keep in mind that it's the
same as X's: the server provides display functions to the client
applications.
The NX protocol obviously can't be sent over the same TCP connection
as the
X protocol, so nxproxy
opens a secondary connection. In
my setup
this is on port 4008. The important thing to know about the secondary
connection
is that it goes in the opposite direction an X connection would go!
In a
straight remote X configuration, the client side establishes a
connection to the
server side. But in NX, it's the other way around: the server nxproxy
connects to the client
nxproxy
. This will become important when I describe how I
set
up my ssh tunneling. (And it makes the terms "server" and "client" even
more confusing than they are in the X environment, I might add.)
nxagent
is the other piece of the puzzle. If nxproxy
translates requests from one protocol to the other,
nxagent
eliminates the need for some of those requests to
be sent in the first place. It does this by acting like a miniature X
server from the applications' point of view; it can answer a lot of the
typical "give me information about the X server" requests from
applications,
so that those requests don't have to be forwarded to the real X server.
nxagent
runs on or near the remote machine (it wouldn't
make much
sense to run it on the local machine since the whole point is to reduce
the
amount of traffic between the local and remote sides!)
Here's a quick diagram of which pieces talk to which, leaving out the complexities of how they talk to each other in the presence of intermediate firewall hosts.
application --- nxagent --- nxproxy --- nxproxy --- X server
|___________ REMOTE HOST _________| |___ LOCAL HOST ___|
It is possible, by the way, to run either nxproxy
or nxagent
without the other one. But you get the most bang for your NX buck with
both of them working together.
With a firm picture of all the pieces in mind, the next thing to do is work out how they're going to talk to each other. Here's the sequence of commands I run, and what each one is for.
startx
xhost local-fw
nxproxy
couldn't forward
requests from the remote side. ssh -L 4008:remote-linux:4008 remote-fw
ssh remote-linux
nxproxy -C :8 &
DISPLAY=local-winxp:0 nxproxy -S
localhost:8 &
setenv DISPLAY local-winxp:0
"
then "nxproxy -S localhost:8 &
".) This launches the
server NX proxy and tells it to connect to localhost port 4008 which,
since we've set up an ssh tunnel, will be forwarded to port 4008 on
remote-linux. You should see some output from both of the nxagent
processes at this point, as they do some initial handshaking. xterm -display :8
nxproxy
is able to
forward X traffic properly. When I run this an xterm window appears on
local-winxp's screen. nxagent -display nx/:8 -geometry
1910x1400 :9 &
nxagent
window on local-winxp, and starts
accepting X connections from applications on remote-linux on X display
number 9. Adjust the -geometry argument as you see fit; I'm running at
1920x1440 resolution on local-winxp, so the above argument creates a
full-screen nxagent
window. This window acts as a virtual
desktop; all your X clients will run inside it. (Eventually there will
be an nxagent that doesn't require this, but it doesn't exist yet.) export DISPLAY=:9
setenv DISPLAY :9
".) Tells
subsequent X applications to connect to nxagent
to
display their windows. KDEHOME=$HOME/.kde-remote
startkde
kwin &
kwin
directly. Then I can run any applications I
need. Eclipse: For some reason Eclipse 3.0 (the GTK version) and NX
have a little trouble with one another. I've found that if I try to
launch Eclipse from the KDE start menu, or from my ssh connection to
remote-linux, I get the splash screen and nothing else. However, for
some reason if I launch a terminal window within my nxagent
window, then run Eclipse from there, it works fine.