EDV:FreeNX/NX-2.1.0-freenx-0.7.0

From KIP Wiki
⧼kip-jumptonavigation⧽⧼kip-jumptosearch⧽

Vorbemerkungen

Nachdem ich schon freenx-0.6.0 auf ubuntu dapper installiert habe, versuche ich mich jetzt mit freenx-0.7.0 und NX-2.1.0 auf debian etch.

Es ist zwar inzwischen schon NX-3.0.0 herausgekommen, das wird aber von freenx noch nicht sauber unterstützt.

FreeNX 0.7.0 wurde am 07.07.2007 veröffentlicht (daher auch die Versionsnummer 0.7.0). NX 3.0.0 wird dabei explizit noch nicht unterstützt.

Auf dieser Seite wird beschrieben, wie man diese Software installiert, indem man die Quellen holt und compiliert. Das ist sicher nicht bequem - funktioniert aber zumindest bei uns.

NX holen, compilieren, installieren

NX-2.1.0 - Quellen holen

mkdir /usr/NX
cd /usr/NX/
wget http://64.34.161.181/download/2.1.0/sources/nxproxy-2.1.0-3.tar.gz
wget http://64.34.161.181/download/2.1.0/sources/nxcomp-2.1.0-8.tar.gz
wget http://64.34.161.181/download/2.1.0/sources/nxcompext-2.1.0-5.tar.gz
wget http://64.34.161.181/download/2.1.0/sources/nxssh-2.1.0-2.tar.gz
wget http://64.34.161.181/download/2.1.0/sources/nxuexec-2.1.0-2.tar.gz 
wget http://64.34.161.181/download/2.1.0/sources/nxspool-2.1.0-3.tar.gz 
wget http://64.34.161.181/download/2.1.0/sources/nxsensor-2.1.0-3.tar.gz 
wget http://64.34.161.181/download/2.1.0/sources/nx-X11-2.1.0-3.tar.gz 
wget http://64.34.161.181/download/2.1.0/sources/nxwin-2.1.0-3.tar.gz 
wget http://64.34.161.181/download/2.1.0/sources/nxauth-2.1.0-2.tar.gz  
wget http://64.34.161.181/download/2.1.0/sources/nxviewer-2.1.0-12.tar.gz  
wget http://64.34.161.181/download/2.1.0/sources/nxdesktop-2.1.0-10.tar.gz
wget http://64.34.161.181/download/2.1.0/sources/nxscripts-2.1.0-5.tar.gz
wget http://64.34.161.181/download/2.1.0/sources/nxagent-2.1.0-20.tar.gz  
wget http://64.34.161.181/download/2.1.0/sources/nxesd-2.1.0-3.tar.gz
wget http://64.34.161.181/download/2.1.0/sources/nxkill-2.1.0-2.tar.gz  
wget http://64.34.161.181/download/2.1.0/sources/nxbuilder-2.1.0-5.tar.gz
wget http://64.34.161.181/download/2.1.0/sources/nxservice-2.1.0-11.tar.gz 
wget http://64.34.161.181/download/2.1.0/sources/nxcompsh-2.1.0-3.tar.gz 

oder alternativ - wenn die oben genannten Quellen nicht mehr verfügbar sein sollten - zumindest für Leute mit Zugriff auf das KIP-AFS:

mkdir /usr/NX
cd /usr/NX/
cp /afs/kip/software/Linux/NomachineNX/src/nx-sources/*.tar.gz .

Quellen compilieren

Dafür braucht man natürlich einen compiler und so weiter:

aptitude install make g++ gcc libjpeg62-dev libpng12-dev libssl-dev autoconf xorg-dev

Bei der Gelegenheit sollte man auch gleich noch ein paar weitere benötigte Pakete installieren:

aptitude install netcat expect smbfs
aptitude install icewm icewm-themes

Letzteres, wenn man die unten aufgeführte Konfiguration verwenden möchte

Jetzt packen wir die Quell-Pakete aus und compilieren:

cd /usr/NX 
find . -name "*tar.gz" -exec tar -zxf "{}" \;  
 
cd /usr/NX/nx-X11/
make World

Das dauert eine Weile. Wenn der Prozess mit einem Fehler abschliessen sollte, dann versuchen Sie anhand der Fehlermeldung herauszubekommen, welches Paket noch fehlt. Wenn Sie das Paket ausfindig gemacht und installiert haben sollten, wieder 'make World' eingeben.

Jetzt noch ein paar zusätzliche Programme, die nicht automatisch erzeugt werden:

nxdesktop : für Windows-Terminal-Sitzungen über NX. Es scheint sich dabei um ein modifiziertes rdesktop zu handeln.

cd /usr/NX/nxdesktop/
./configure 
make
cp doc/rdesktop.1 doc/nxdesktop.1
make install

nxproxy : für 'weitergeleitete' NX-Sitzungen?

cd /usr/NX/nxproxy/
./configure 
make  

nxviewer : für VNC-Sitzungen über NX.

cd /usr/NX/nxviewer

imake -I/usr/NX/nx-X11/config/cf/
cd libvncauth
imake -I/usr/NX/nx-X11/config/cf/
cd ../nxpasswd  
imake -I/usr/NX/nx-X11/config/cf/
ln -s /usr/NX/nx-X11/config .
cd ../nxviewer  
imake -I/usr/NX/nx-X11/config/cf/
ln -s /usr/NX/nx-X11/config .
ln -s /usr/NX/nx-X11/exports exports
cd ..
make

freenx-0.7.0

cd /usr/NX
wget http://download.berlios.de/freenx/freenx-0.7.0.tar.gz   
tar -xvzf freenx-0.7.0.tar.gz  
cd freenx-0.7.0
patch <gentoo-nomachine.diff
cd ..

Installation

Diese Beschreibung stammt im Wesentlichen aus dem README von freenx

NXPREFIX=/usr/NX
mkdir -p ${NXPREFIX}/lib ${NXPREFIX}/bin
cd ${NXPREFIX}

# Libraries
cp -a nx-X11/lib/X11/libX11.so* ${NXPREFIX}/lib
cp -a nx-X11/lib/Xext/libXext.so* ${NXPREFIX}/lib
cp -a nx-X11/lib/Xrender/libXrender.so* ${NXPREFIX}/lib
cp -a nxcomp/libXcomp.so* ${NXPREFIX}/lib
cp -a nxcompext/libXcompext.so* ${NXPREFIX}/lib

# binaries
cp -a nx-X11/programs/Xserver/nxagent ${NXPREFIX}/bin
cp -a nxproxy/nxproxy ${NXPREFIX}/bin
#cp -a nxdesktop/nxdesktop ${NXPREFIX}/bin
cp -a nxviewer/nxviewer/nxviewer ${NXPREFIX}/bin

# windows-keymaps for nxdesktop RDP-sessions and keyboard layout != us
cd ${NXPREFIX}/share
ln -s keymaps-windows keymaps

# scripts
cd ${NXPREFIX}
cp -a freenx*/nxnode ${NXPREFIX}/bin
cp -a freenx*/nxserver ${NXPREFIX}/bin
cp -a freenx*/nxsetup ${NXPREFIX}/bin
cp -a freenx*/nxkeygen ${NXPREFIX}/bin
cp -a freenx*/nxnode-login ${NXPREFIX}/bin
cp -a freenx*/nxloadconfig ${NXPREFIX}/bin
cp -a freenx*/nxprint ${NXPREFIX}/bin
cp -a freenx*/nxclient ${NXPREFIX}/bin
# config file

mkdir -p ${NXPREFIX}/etc/
mkdir -p /etc/nxserver
cp -a freenx*/node.conf.sample ${NXPREFIX}/etc/
cp -a freenx*/node.conf.sample /etc/nxserver/
cd /usr/bin

ln -s /usr/NX/bin/nxdesktop nxdesktop
ln -s /usr/NX/bin/nxkeygen nxkeygen
ln -s /usr/NX/bin/nxloadconfig nxloadconfig
ln -s /usr/NX/bin/nxnode nxnode
ln -s /usr/NX/bin/nxnode-login nxnode-login
ln -s /usr/NX/bin/nxproxy nxproxy
ln -s /usr/NX/bin/nxprint nxprint
ln -s /usr/NX/bin/nxserver nxserver
ln -s /usr/NX/bin/nxsetup nxsetup
ln -s /usr/NX/bin/nxclient nxclient  
ln -s /usr/NX/bin/nxviewer nxviewer
ln -s /usr/NX/bin/nxagent nxagent

cp /usr/lib/cups/backend/ipp /usr/lib/cups/backend/nxipp
chmod 755 /usr/lib/cups/backend/nxipp

nxclient installieren

Das nxclient-Paket bekommt man unter http://www.nomachine.com/download-client-linux.php

dpkg -i nxclient_2.1.0-17_i386.deb
rm /usr/bin/nxclient
cp /usr/NX/bin/nxclient /usr/bin/nxclient
cp -a /usr/NX/freenx*/nxclient /usr/NX/bin/

Auf diese Weise kann man den nxclient von NomachineNX benutzen und bei der suspend/terminate - Frage wird nxclient von freenx verwendet. Der nxclient von NomachineNX macht bei mir und der suspend/terminate - Frage manchmal Probleme mit Fonts, was zu unleserlichen Texten führt.

Aufräumen

Wenn Sie nach der Installation die Quelldateien nicht mehr benötigen:

cd /usr/NX
/bin/rm *.tgz *.tar.gz *.deb
/bin/rm /usr/NX/lib/libjpeg* /usr/NX/lib/libpng* /usr/NX/lib/libcrypto*
/bin/rm -rf freenx-0.* ./nx*

Konfiguration und Initialisierung

Konfiguration vorbereiten

/etc/nxserver/node.conf aus /etc/nxserver/node.conf.sample erzeugen. Ich selbst habe die folgenden Variablen hinzugefügt/gesetzt:

ENABLE_PASSDB_AUTHENTICATION="0"
NX_LOG_LEVEL=6
NOMACHINE_NX_HOME_DIR="/var/lib/nxserver/home"
NX_HOME_DIR="/var/lib/nxserver/home"
NX_SESS_DIR="/var/lib/nxserver/db"
USER_FAKE_HOME=/data/home/nx/$USER
DEFAULT_X_SESSION=/etc/X11/xdm/Xsession
COMMAND_START_KDE=/usr/bin/icewm-session
COMMAND_START_CDE=/usr/bin/icewm-session
COMMAND_XAUTH=/usr/bin/xauth
DEFAULT_FONT_PATH=$(echo $(grep -v '^ *#' /etc/X11/xorg.conf | grep FontPath | awk '{print $2}' | sed -r "s/^[\"']|[\"']$//g") | sed 's/ /,/g')
AGENT_EXTRA_OPTIONS_X=" -noshmem +kb -xkbdir /etc/X11/xkb -fp $DEFAULT_FONT_PATH"
AGENT_LIBRARY_PATH=/usr/NX/lib/
PROXY_LIBRARY_PATH=/usr/NX/lib/
APPLICATION_LIBRARY_PRELOAD="/usr/NX/lib/libXft.so.2.1:/usr/NX/lib/libX11.so:/usr/NX/lib/libXext.so:/usr/NX/lib/libXcomp.so:/usr/NX/lib/libXcompext.so:/usr/NX/lib/libXrender.so"

Dass /usr/NX/lib/libXft.so.2.1 aufgelistet ist, liegt bei dem Rechner, von dem ich hier die Konfiguration aufliste, daran, dass der sonst Probleme mit den fonts unter Qt hat.

Manchmal muss man die Konfiguration unter /usr/NX/etc/ anbieten. Mit Hilfe von

ln -s /etc/nxserver/node.conf /usr/NX/etc/node.conf

werden beide Möglichkeiten angeboten.

Konfiguration prüfen

Sie können auf einfache Weise prüfen, ob die Konfiguration OK ist:

nxloadconfig --check

Wenn alles OK ist, dann gibt dieses Skript nichts aus. Im Fehlerfall wird aufgelistet, welche Variable falsch gesetzt ist oder welcher Dienst nicht verfügbar ist.

Das können Sie auch jederzeit später (z.B. nach einer Konfigurationsänderung) aufrufen.

Eventuell muss man erst 'nxsetup' (siehe nächsten Punkt) aufrufen, um manche der Fehlermeldungen verschwinden zu lassen.

Server initialisieren

nxsetup --install --setup-nomachine-key --clean --purge
nxserver --status 

Letzteres sollte diese Meldung hervorrufen:

# nxserver --status
NX> 100 NXSERVER - Version 1.5.0-70 OS (GPL)
NX> 110 NX Server is running
NX> 999 Bye