| « Fantasy book: Storm Glass | Book: Virginia Woolf: To the Lighthouse » |
Neatx is the new black
Needing a Gui remote login for the students
When I started working here at BINF, we were located in an old building and we had our entirely own rather primitive network. But the classrooms and our servers were on the same net - our net. And when our teachers wanted the students to connect to a KDE session on one of our Linux machines, they just told them to install an X server on their Windows or Mac laptop, and connect to one of our workstations, which had all the right programs installed.
It didn't work right out of the box for everybody but that was the situation I inherited, though only for one semester.
We have about 30 students needing to connect at the same time during our courses.
When we moved to a grand new building where the network in the class rooms are in the hands of the IT department of our institute - now our faculty - we had to find another solution.
The first year we taught people to login to one of our workstations with ssh via our login server, start a vnc server on some port, set up an ssh tunnel via our login server, and then connect with vnc. While this worked, it was complex and required a lot of support.
FreeNX nightmare
So last year we heard about FreeNX and decided to try to go with that. This was in one way a success and in one way a nightmare. It was much simpler to set up than the VNC thing since we could use the ssh port and the ssh protocol directly, and let people run on our login server.
The FreeNX server, however, was a nightmare to setup. We did manual little hacked bug fixes in the scripts, we had character set problems we couldn't resolve, but the real problem was that suspend/restore of sessions didn't work and a dead session would clutter people's home directories with large hidden files and at some point we would have to log in to the server and kill sessions manually because it couldn't handle more dead sessions.
Neatx
So this year, we wanted a solution that was basically the same but actually worked. Luckily my student aid came over Google's neatx project. It looks like those people weren't happy with FreeNX either, so they made their own implementation, in a much nicer, cleaner way.
It is not a polished, packaged easy to install project, and there are some things they haven't implemented. But it works. Now I'm risking this claim a bit early, after only 2 days with the new students on the servers, but it actually seems to work. It can suspend and resume sessions. It stores them locally on the server (this can probably be configured).
People can log in, they can work, they can log out. No nightmare at all. And after finding the trick, installing the server is not very complicated at all.
Here is my installation notes and links to documentation.
It is worth mentioning that this year, we are running on a much bigger server. This year we use our 8 core 32 GB RAM server, but it get a load of approx 1.78 at most with 30 users connected, and with a few local users, too.
When they start running heavier programs on it, off course it will be more loaded, but not because of Neatx in itself.
Installing neatx on Debian Lenny
Project page: http://code.google.com/p/neatx/
Download it by checking it out from svn:
svn checkout http://neatx.googlecode.com/svn/trunk/ neatx-read-only
Then follow the instructions in the INSTALL file for installing dependencies. Most of the dependencies comes with Debian and can be installed with apt-get / aptitude:
apt-get install python-pexpect python-simplejson python-gtk2 python-docutils python-gobject python openssh make automake autoconf gcc xauth xrdb netcat
Also install KDE and/or GNOME so people have a GUI to run with neatx.
Now comes the hard part: Install nxagent from http://www.nomachine.com/sources and get it to run.
Documentation: http://www.nomachine.com/documentation/building-components.php
Get the following packages:
- nxcompext-3.3.0-4.tar.gz
- nxcompshad-3.3.0-3.tar.gz
- nxproxy-3.3.0-2.tar.gz
- nxagent-3.3.0-13.tar.gz
- nx-X11-3.3.0-6.tar.gz
- nxauth-3.3.0-1.tar.gz
- nxcomp-3.3.0-4.tar.gz
mkdir NX
cd NX
tar xvzf ../*.tar.gz
cd nx-X11
make World
make install
Now the trick: You actually need to do with your LD_LIBRARY_PATH as it says in the documentation. Not add to your LD_LIBRARY_PATH, but replace your LD_LIBRARY_PATH. Which you would not want to do globally. So you can test by setting a new LD_LIBRARY_PATH in a shell, and start nxagent.
Now install neatx:
neatx-read-only/neatx/
./autogen.sh
./configure
make
make install
useradd --system -m -d /usr/local/var/lib/neatx/home -s /usr/local/lib/neatx/nxserver-login-wrapper nx
install -D -m 600 -o nx /usr/local/share/neatx/authorized_keys.nomachine ~nx/.ssh/authorized_keys
cp /usr/local/share/doc/neatx/neatx.conf.example /usr/local/etc/neatx.conf
In my case I set the export LD_LIBRARY_PATH="/usr/local/src/NX/nxcomp:/usr/local/src/NX/nxcompext:/usr/local/src/NX/nx-X11/exports/lib" in
/usr/local/lib/neatx/nxnode-wrapper and /usr/local/lib/neatx/nxserver-login-wrapper.
It might be smarter to do it somewhere else but this works.
After reboot of the server after a cooling system outage I had a problem: The old sessions were not deleted and NX tried to resume them instead of creating new ones. Users got “Internal error” when they tried to reconnect to a session.
Solution: Put this line in /etc/rc.local:
# Delete all NX sessions after a reboot, they're dead anyway
rm -rf /usr/local/var/lib/neatx/sessions/*
Client
Download the newest client from http://www.nomachine.com/select-package-client.php .
Starting the nx server
You don't have to start anything. If nxagent works and you have followed the instructions, and you have ssh access to the machine, it should work now.
Troubleshooting: Try to login with ssh manually and get rid of any hostkey issues in advance.
9 comments
as there isn't very much documentation on the neatx project, your post greatly helped.
neatnx runs fine... and seems to be lot easier to set up than my already running freenx.
thx
garfield
It's fast (I'm in the U.S., typing this up via NX to a UK machine), and works great.
I did have to futz around with the LD_LIBRARY_PATH a bit.
I think the problem arises when people try to be good and log out of KDE or GNOME from the K / Gnome menu, whereas if they click the x in the corner, they get to choose "Terminate", which terminates the session, or "Disconnect" which gives them a session they can restore.
Disconnect works. (And reconnecting).
Terminate does not delete the session directory, but it does kill the process, and the leftover directory is not a big problem.
Logging out from the GUI via the menu leaves the neatx related processes running. One can easily avoid making this mistake oneself, but it is difficult to prevent the students from doing it.
I don't have a solution to this problem, but I can imagine that one could perhaps modify either some neatx terminate script or some KDE and GNOME script on the machine to send some termination message to neatx. If one could bother to find out exactly which scripts are called in which order. Any suggestions are welcome.
Well after 2 days of banging my head against a wall. Anyone got any clue what so ever why I get this?
Mar 8 01:08:56 apidfm01 nxserver-login[21792]: INFO nxserver_login:253 Trying login for user 'danieli' using auth method 'su'
Mar 8 01:08:56 apidfm01 nxserver[21803]: INFO nxserver:689 Starting nxserver for user danieli
Mar 8 01:08:57 apidfm01 nxserver[21803]: INFO nxserver:377 Starting new session '69A657F0BA58A689C9BB89080606B0EB'
Mar 8 01:08:57 apidfm01 nxserver[21803]: INFO node:514 Connecting to '/usr/local/var/lib/neatx/sessions/69A657F0BA58A689C9BB89080606B0EB/nxnode.sock'
Mar 8 01:08:58 apidfm01 nxnode[21811]: INFO nxnode:266 Connection established
Mar 8 01:08:58 apidfm01 nxnode[21811]: INFO nxnode:81 Received request: 'start', {'imagecompressionlevel': '-1', 'render': '1', 'strict': '0', 'composite': '1', 'encryption': '1', 'cache': '16M', 'backingstore': '1', 'geometry': '1274x738', 'screeninfo': '1274x738x32+render', 'session': 'DFM', 'link': 'adsl', 'shmem': '1', 'media': '0', 'images': '64M', 'keyboard': 'pc102/gb', 'type': 'unix-kde', 'shpix': '1', 'imagecompressionmethod': '3', 'client': 'winnt'}
Mar 8 01:08:58 apidfm01 nxnode[21811]: INFO node:290 Starting xauth for [(':965', 'C8F26B0D0047C6BE93435D72B9A39112'), ('localhost:965', 'C8F26B0D0047C6BE93435D72B9A39112')]
Mar 8 01:08:58 apidfm01 nxnode[21811]: INFO daemon:491 Starting program, executable=None, args=['/usr/bin/xauth', '-f', '/usr/local/var/lib/neatx/sessions/69A657F0BA58A689C9BB89080606B0EB/authority']
Mar 8 01:08:58 apidfm01 nxnode[21811]: INFO daemon:519 Child /usr/bin/xauth[21814] started
Mar 8 01:08:58 apidfm01 nxserver[21803]: INFO nxserver:594 Waiting for session '69A657F0BA58A689C9BB89080606B0EB' to achieve waiting status
Mar 8 01:08:58 apidfm01 nxnode[21811]: INFO node:325 Starting nxagent
Mar 8 01:08:58 apidfm01 nxnode[21811]: INFO daemon:491 Starting program, executable=None, args=['/usr/X11R6/bin/nxagent', '-D', '-name', 'Neatx - danieli@apidfm01:965 - DFM', '-options', '/usr/local/var/lib/neatx/sessions/69A657F0BA58A689C9BB89080606B0EB/options', '-nolisten', 'tcp', ':965']
Mar 8 01:08:58 apidfm01 nxnode[21811]: INFO daemon:519 Child /usr/X11R6/bin/nxagent[21815] started
Mar 8 01:08:58 apidfm01 nxnode[21811]: INFO agent:346 Matched info agent_pid, PID 21815
Mar 8 01:08:58 apidfm01 nxnode[21811]: INFO agent:409 Nxagent changed status from 'created' to 'starting'
Mar 8 01:08:58 apidfm01 nxnode[21811]: ERROR agent:376 Agent error: Aborting session with 'Unable to open display 'nx/nx,options=/usr/local/var/lib/neatx/sessions/69A657F0BA58A689C9BB89080606B0EB/options:965''.
Mar 8 01:08:58 apidfm01 nxnode[21811]: INFO agent:409 Nxagent changed status from 'starting' to 'terminating'
Mar 8 01:08:58 apidfm01 nxnode[21811]: INFO agent:409 Nxagent changed status from 'terminating' to 'terminated'
Mar 8 01:08:58 apidfm01 nxnode[21811]: INFO agent:457 Nxagent terminated
Mar 8 01:08:58 apidfm01 nxnode[21811]: ERROR daemon:583 /usr/X11R6/bin/nxagent[21815] failed (status=1, signal=None)
Mar 8 01:08:58 apidfm01 nxnode[21811]: INFO node:345 nxagent terminated
Mar 8 01:08:58 apidfm01 nxserver[21803]: ERROR nxserver:586 Session '69A657F0BA58A689C9BB89080606B0EB' has status 'terminated'
Mar 8 01:08:58 apidfm01 nxserver-login[21792]: INFO auth:142 Waiting for authenticated program to finish
Mar 8 01:09:43 apidfm01 SQLAnywhere(monitordb): Starting checkpoint of "monitordb" (monitordb.db) at Mon Mar 08 2010 01:09
Mar 8 01:09:50 apidfm01 SQLAnywhere(monitordb): Finished checkpoint of "monitordb" (monitordb.db) at Mon Mar 08 2010 01:09
It will not work. I have completed every task in the install guides. I have built nxagent it seems to run. I just never get a session. SSH works .. everything works. If I wipe this lot out and use the NX Free forever stuff instead that works .. I just need more than 2 sessions.
FreeNX and all derivatives of it seem to suffer from the same utter lack of any useable docs. Poor error reporting and nothing in the way of support.
Not good ...
--Ian
How to Install neatx instead of Nomachine NX
Set up PPA using instructions at https://launchpad.net/~freenx-team/+archive/ppa
The instructions below are based on http://code.google.com/p/neatx/source/browse/trunk/neatx/INSTALL
First uninstall NX Nomachine then install dependencies and nxagent
sudo /usr/NX/bin/nxserver --stop
sudo dpkg -r nxserver
sudo dpkg -r nxnode
sudo dpkg -r nxclient
sudo rm -rf /usr/NX
sudo apt-get install make openssh-server python python-pexpect \
python-simplejson python-gtk2 python-gobject gcc autoconf automake \
python-docutils netcat xauth x11-xserver-utils
sudo apt-get install nxagent
Now install neatx (note, I am installing in a non-standard directory):
cd /software/neatx
svn checkout http://neatx.googlecode.com/svn/trunk/ neatx-read-only
mkdir neatx
cd neatx-read-only/neatx
./autogen.sh
./configure --prefix=/software/neatx/ --exec-prefix=/software/neatx/
make
make install
Now, do the configuration (creating an nx user etc, config files etc)
sudo useradd --system -m -d /software/neatx/var/lib/neatx/home -s /software/neatx/lib/neatx/nxserver-login-wrapper nx
sudo install -D -m 600 -o nx /software/neatx/share/neatx/authorized_keys.nomachine ~nx/.ssh/authorized_keys
mkdir /software/neatx/etc
cp /software/neatx-read-only/neatx/doc/neatx.conf.example /software/neatx/etc/neatx.conf
uncomment all commented config lines in /software/neatx/etc/neatx.conf
I found that old nxclients didn't work - so it seemed easier to reinstall those (after deleting $HOME/.nx on the client machine) and then everything worked.
apt-get install python-pexpect python-simplejson python-gtk2 python-docutils python-gobject python openssh make automake autoconf gcc xauth xrdb netcat
should be:
aptitude install python-pexpect python-simplejson python-gtk2 python-docutils python-gobject python openssh-server make automake autoconf gcc xauth netcat x11-xserver-utils
(compatible with squeeze)
With the following adjustments, I was able to get neatx working on Lubuntu 11.10 64-bit:
1. also need to apt-get install zlib1g-dev libgd2-xpm-dev as Lubuntu is really stripped down and missing some essential headers
2. sprinkle sudo here and there, as needed
3. LD_LIBRARY_PATH also needs /usr/local/src/NX/nxcompshad
4. sudo mv the NX directory to /usr/local/src/NX as make install didn't seem to install to the system directories
5. cp nxagent to /usr/bin/nxagent
HINTS: the nx build takes a long time - be patient but check on the output to make sure there are no headers missing. when starting the nx client, tail -f /var/log/syslog to see what's going on
gl
This post has 4 feedbacks awaiting moderation...