The following works with libnx without setting up a No Machine
style NX server.
0. Get the magic cookie for your local X session
COOKIE=`xauth list | grep ${HOSTNAME}/unix:0 | \
grep MIT | cut -f5 -d' '`
also decide on a port
NX_PORT=80
and create entries for this port
xauth add localhost/unix:${NX_PORT} MIT-MAGIC-COOKIE-1 ${COOKIE}
xauth add localhost:${NX_PORT} MIT-MAGIC-COOKIE-1 ${COOKIE}
1. Log in to the remote machine and run
NX_ROOT=${HOME}/.nx
mkdir -p ${NX_ROOT}/C-${NX_PORT}
NX_HOST="nx/nx,link=adsl,stream=9,pack=16m-png-jpeg-1,nodelay=1,root=${NX_ROOT},log=session,stat=stats"
NX_DISPLAY=${NX_HOST}:${NX_PORT}
xauth add localhost/unix:${NX_PORT} MIT-MAGIC-COOKIE-1 ${COOKIE}
xauth add localhost:${NX_PORT} MIT-MAGIC-COOKIE-1 ${COOKIE}
/usr/lib/nx/nxagent -nolimit -display ${NX_DISPLAY} \
-class TrueColor -noreset -geometry 800x600+0+0 \
-auth ${HOME}/.Xauthority -name 'NX' \
-bs when_requested :${NX_PORT} &
DISPLAY=:80 fvwm &
2. Back on the local machine you run
NX_ROOT=${HOME}/.nx
mkdir -p ${NX_ROOT}/C-${NX_PORT}
NX_HOST="nx/nx,link=adsl,cache=4096k,accept=127.0.0.1,root=${NX_ROOT},log=session,stat=stats"
NX_DISPLAY=${NX_HOST}:${NX_PORT}
ssh -f -N -L 4080:localhost:4080 as82
/usr/lib/nx/nxproxy -S localhost:80 &
The No Machine screen will popup after a short while and you will get
your usual fvwm setup from the desktop.
The difference (in performance) between this and vnc was not noticable to me.