Stanford farmshare with NX

Zur Navigation springenZur Suche springen

Update: NX (in particular FreeNX) is out-dated and very buggy. Successful reconnects are a matter of luck.

Found something much better:

Caveats: Little bit slower than NX (same as X forwarding).

I issued a ticket, everything needed for xpra should be installed on corn now.

Server (corn, ...)

One-Time setup

Cython is too old in raring. Solution: Download xpra-0.7.8.tar.bz2


tar xvjf xpra-0.7.8.tar.bz2
cd xpra-0.7.8
./ install --home=install
mkdir -p ~/lib ~/bin
cp -r install/bin/* ~/bin
cp -r install/lib/* ~/lib

Add to .cshrc:

setenv PYTHONPATH `ls -d ~/lib*/python`
set path=( $site_path ~/bin ~ )

Starting server

Re-login, choose a random 16 integer (e.g. 138 - this will be the virtual screen) and:

xpra start --no-daemon --socket-dir=/tmp/xpra :138
  • AFS does not allow the socket to be created, therefore socket directory is /tmp/xpra (or sth. else in tmp)

Press CTRL+ALT+N for a new screen window

Start the application you like (e.g. Cadence). The display must be set to the above value:

setenv DISPLAY :138
cd ~/EE315B/opus

Cadence starts now in a virtual screen. SSH session can be closed with CTRL+ALT+D (detaches screen) and logout.

Advanced way

Alternatively to the previous section, the server can be started as follows. Mainly, this keeps AFS/Kerberos tokens for a long time so that the server can be used for a long period of time.

Login via ssh. Then:

source /tmp/

Finally, I created a startup script for my application (Cadence) which is ~/EE315B/

setenv EE315B_WORKDIR /afs/
source /usr/class/ee315b/DOT.cshrc
cd $EE315B_WORKDIR/opus
echo Now starting virtuoso ...

Finally, the xpra server can be started:

xpra --socket-dir=/tmp/xpra --exit-with-children --no-daemon --start-child=~/EE315B/ start :138

and screen detached via CTRL+D and SSH connection can be closed.

More details on keeping AFS credentials can be found on


Need an X server (e.g. cygwin, xming, ...)

Virtual desktop can be forwarded to local screen by logging in via SSH (enable X forwarding) and:

xpra attach --socket-dir=/tmp/xpra :138

Session, network etc. can be closed/killed now, it continues to run in background. Just repeat the step to get session again.

The whole stuff can be automated using shell script on server side, batch script on client side and configure plink to use GSSAPI (incl. credential delegation). Cadence/session can then be started without entering a password!

Yaaaay! Nomachine NX combines the advantages of both VNC and F forwarding. Summarized all Features of this approach:

  1. Windows seamlessly integrate into client desktop (as if Cadence, MATLAB etc. would run locally), similar as X forwarding
  2. connection is persistent (when connection gets lost), as for VNC
  3. No problems with clipboard
  4. Access to local devices (not tried)

Awesome! Unfortunately the FreeNX package is outdated and buggy, but after 2 hours work I got it running


Client side (Windows)

Download the old (3.5) version of the NX client for Windows:


c:\Program Files (x86)\NX Client for Windows\bin\nxssh.exe


c:\Program Files (x86)\NX Client for Windows\bin\mxssh.exe

download nxssh.exe from and copy it to c:\Program Files (x86)\NX Client for Windows\bin\

Connection settings:

Port: 22
Desktop: Unix, Custom
Login: nhammler@U:/afs/ir/users/n/h/nhammler/NX4U/bin/nxserver-usermode
Password: [SUNET password]
  • The "@" in front of the host name activates the nxssh wrapper (executes FreeNX usermode)
  • The "U:" after the username executes usermode nxserver
  • The path afterwards points to the nxserver-usermode binary

See source code:

Everything should work. Cadence needs some fonts (too lazy to find out which exactly), so it's recommended to install these add-on packages from:

  • nxfonts-100dpi-3.5.0-1.exe
  • nxfonts-misc-3.5.0-1.exe
  • nxfonts-others-3.5.0-1.exe
  • nxfonts-75dpi-3.5.0-1.exe

Finally, save the complete config into an nxs file (e.g., can be found in %USERPROFILE%\.nx\*.nxs) and create a shortcut. This either starts Cadence as if it would be called locally (or resumes all windows if the connection was lost).

My example:

  • General -> Desktop Unix/Custom -> Settings -> Run the following command: /afs/ir/users/n/h/nhammler/EE315B/
  • ~/EE315B/ contains:

setenv EE315B_WORKDIR /afs/
source /usr/class/ee315b/DOT.cshrc
cd $EE315B_WORKDIR/opus

echo Now starting virtuoso ...


Important: Use a particular corn (e.g. to avoid load balancing

Server side (corn)

First steps based on

  • edit etc/node.conf:

The last line is the most important one; it causes nxserver to fail without any useful messages. Hints found in:

  • install libXpm libraries:

corn is a 64 bit system but nx requires the 32 bit version of this library. Download libxpm4_3.5.10-1_i386.deb from:

and copy (with Midnight Commander - can open deb files) CONTENTS/usr/lib/i386-linux-gnu/*.* to NX4U/lib