Difference between revisions of "FreeNX"

From Linuxintro
imported>ThorstenStaerk
imported>ThorstenStaerk
 
(15 intermediate revisions by 4 users not shown)
Line 1: Line 1:
The NX protocol aims at offering a stateful desktop session to remote users, like [[VNC]]. The most prominent difference is that NX requires less bandwidth. FreeNX is one implementation of the [[NX]] protocol.
+
FreeNX allows you to set up a [[terminal server]].
  
= QuickStart =
+
= How NX works =
In this chapter, the SUSE Linux [[distribution]] is used as example.
+
* You call nxclient with your user
 
+
* nxclient uses the nx user to connect to the NX server. This authentication works passwordless with a private key (the nomachine-key) in your nxclient and an authorized public key on the nx server. Private and public key must fit to each other.
* [[Install]] [[FreeNX]]
+
* nx's shell on the NX server is called nxserver which allows communication over the nx protocol
[[yast]] -i FreeNX
+
* now your user name and password is transmitted and checked
* Setup FreeNX:
+
* then nxserver establishes the display connection
nxsetup
 
: continue as advised. The NX server is started automatically.
 
* Connect to the NX server
 
nxclient
 
You can now log in.
 
 
 
= Trial 2 =
 
FreeNX server is not available with SUSE 13.1 so I
 
# yast -i expect
 
# wget http://download.opensuse.org/repositories/home:/beyerle:/NX/openSUSE_13.1/i586/NX-3.5.0-123.1.i586.rpm
 
# wget http://download.opensuse.org/repositories/home:/beyerle:/NX/openSUSE_13.1/i586/FreeNX-0.7.3-7.1.i586.rpm
 
# rpm -ivh NX-3.5.0-123.1.i586.rpm FreeNX-0.7.3-7.1.i586.rpm
 
 
 
now qtnx asks me for a password but I don't know which one
 
 
 
but ps -Hef helps:
 
root      4173  3692  3 06:17 pts/4    00:00:00      qtnx
 
root      4174  4173  0 06:17 pts/4    00:00:00        ssh -p22 -iid.key nx@localhost -x -2 -oRhostsAuthentication no -
 
 
 
cat /etc/shadow delivers
 
nx:*:16220::::::
 
 
 
= Trial 3 =
 
# wget http://download.opensuse.org/repositories/home:/beyerle:/NX/openSUSE_13.1/x86_64/FreeNX-0.7.3-7.1.x86_64.rpm http://download.opensuse.org/repositories/home:/beyerle:/NX/openSUSE_13.1/x86_64/NX-3.5.0-123.1.x86_64.rpm
 
# yast -i rdesktop libpixman-1-0-devel libpng16-devel fontconfig-devel Mesa-libEGL-devel Mesa-libEGL-devel-32bit fontconfig-devel-32bit freetype2-devel-32bit fontconfig-32bit libxrender-devel-32bit Mesa-libGL-devel-32bit libpixman-1-0-32bit libgobject-2_0-0-32bit libxcb-render-0-32bit libxcb-shm0-32bit cairo-devel cairo-tools cairo-devel-32bit
 
# nxserver --status
 
No such user name: nx
 
NX> 100 NXSERVER - Version 3.2.0-73 OS (GPL, using backend: not detected)
 
NX> 110 NX Server is stopped
 
NX> 999 Bye
 
# nxserver --start
 
No such user name: nx
 
NX> 100 NXSERVER - Version 3.2.0-73 OS (GPL, using backend: not detected)
 
mv: cannot stat ‘/var/lib/nxserver/home/.ssh/authorized_keys.disabled’: No such file or directory
 
NX> 122 Service started
 
NX> 999 Bye
 
tweedleburg:~ # mkdir -p /var/lib/nxserver
 
tweedleburg:~ # useradd -m -d /var/lib/nxserver/home/ nx
 
 
 
Now I get
 
<pre>
 
NX> 203 NXSSH running with pid: 16802
 
NX> 285 Enabling check on switch command
 
NX> 285 Enabling skip of SSH config files
 
NX> 285 Setting the preferred NX options
 
NX> 200 Connected to address: 127.0.0.1 on port: 22
 
NX> 202 Authenticating user: nx
 
NX> 208 Using auth method: publickey
 
NX> 204 Authentication failed.
 
</pre>
 
 
 
Quickly installed everything so nxssh does not return an error.
 
 
 
Now in /root/.nx/temp/3397 I find the logs. runlog says
 
[Tue Jul 15 14:59:52 2014]: LoginDialog::connectHost() nxsshline=/usr/NX/bin/nxssh -nx -p 22 -i /root/.nx/temp/3397/keylog nx@localhost -x -2 -4 -o RhostsAuthentication no -o PasswordAuthentication no -o RSAAuthentication no -o RhostsRSAAuthentication no -o PubkeyAuthentication yes -B -E
 
 
 
<pre>
 
tweedleburg:~/.nx/temp/10416 # /usr/NX/bin/nxssh -nx -p 22 -i /root/.nx/temp/10416/keylog nx@localhost -x -2 -4 -o RhostsAuthentication no -o PasswordAuthentication no -o RSAAuthentication no -o RhostsRSAAuthentication no -o PubkeyAuthentication yes -B -E
 
NX> 203 NXSSH running with pid: 10937
 
NX> 200 Connected to address: 127.0.0.1 on port: 22
 
NX> 202 Authenticating user: nx
 
NX> 208 Using auth method: publickey
 
NX> 204 Authentication failed.
 
tweedleburg:~/.nx/temp/10416 # /usr/NX/bin/nxssh -nx -p 22 nx@localhost -x -2 -4 -o RhostsAuthentication no -o PasswordAuthentication no -o RSAAuthentication no -o RhostsRSAAuthentication no -o PubkeyAuthentication yes -B -E
 
NX> 203 NXSSH running with pid: 10942
 
NX> 200 Connected to address: 127.0.0.1 on port: 22
 
NX> 202 Authenticating user: nx
 
NX> 208 Using auth method: publickey
 
HELLO NXSERVER - Version 3.2.0-73 OS (GPL, using backend: 3.5.0)
 
NX> 105
 
</pre>
 
 
 
 
 
 
 
cp /root/.ssh/id_dsa /usr/NX/share/keys/server.id_dsa.key
 
 
 
= Trial 4: SUSE 12.3 =
 
* download all files from http://download.opensuse.org/repositories/home:/beyerle:/NX/openSUSE_12.3/x86_64/
 
# rpm -Uvh cairo-devel-1.12.14-5.1.x86_64.rpm libcairo-gobject2-1.12.14-5.1.x86_64.rpm libcairo-script-interpreter2-1.12.14-5.1.x86_64.rpm libcairo2-1.12.14-5.1.x86_64.rpm
 
# rpm -Uvh NX-3.5.0-123.1.x86_64.rpm FreeNX-0.7.3-7.1.x86_64.rpm
 
 
 
/var/lib/nxserver/home/.ssh # cat /var/NX/nx/.ssh/default.id_dsa.pub >> authorized_keys
 
  
 
+
= SUSE 13.1 =
 
+
This is how I installed a FreeNX server on SUSE 13.1 on 2014-07-19:
<pre>
+
* [[open a console]] and enter
ls3523:/var/lib/nxserver/home/.ssh # nxserver --stop
+
# yast -i expect rdesktop
No processes found.
+
# wget http://download.opensuse.org/repositories/home:/beyerle:/NX/openSUSE_13.1/$(uname -i)/NX-3.5.0-123.1.x86_64.rpm
NX> 100 NXSERVER - Version 3.2.0-73 OS (GPL, using backend: 3.5.0)
+
# wget http://download.opensuse.org/repositories/home:/beyerle:/NX/openSUSE_13.1/x86_64/FreeNX-0.7.3-7.1.$(uname -i).rpm
NX> 123 Service stopped
+
# rpm -ivh NX-3.5.0-123.1.*.rpm FreeNX-0.7.3-7.1.*.rpm
NX> 999 Bye
+
* read how to set it up
ls3523:/var/lib/nxserver/home/.ssh # nxserver --status
+
# cat /usr/share/doc/packages/FreeNX/README.SuSE
No processes found.
+
* set it up
NX> 100 NXSERVER - Version 3.2.0-73 OS (GPL, using backend: 3.5.0)
+
# nxsetup --setup-nomachine-key
NX> 110 NX Server is stopped
+
* Now connect with any NX client to the NX server. The connection does not work for me, I get an error message
NX> 999 Bye
+
The NX service is not available or the NX access
ls3523:/var/lib/nxserver/home/.ssh # cp /root/.ssh/id_dsa /usr/NX/share/keys/server.id_dsa.key
+
was
ls3523:/var/lib/nxserver/home/.ssh # ssh -i /usr/NX/share/keys/server.id_dsa.key nx@localhost
+
disabled on host ...
Password:
+
* To solve this problem, you need a private/public key pair. Generate one with the command
 
+
ssh-keygen -t dsa
ls3523:/var/lib/nxserver/home/.ssh # cat /root/.ssh/id_dsa.pub > /home/nx/.ssh/authorized_keys
+
The command will ask where to put the key pair. The private key will be named id_dsa and the public key will be named id_dsa.pub. Add the public key to /var/lib/nxserver/home/.ssh/authorized_keys and import the private key into your NX client. The re-login using your NX client.
ls3523:/var/lib/nxserver/home/.ssh # nxserver --start
 
No processes found.
 
NX> 100 NXSERVER - Version 3.2.0-73 OS (GPL, using backend: 3.5.0)
 
NX> 122 Service started
 
NX> 999 Bye
 
ls3523:/var/lib/nxserver/home/.ssh # nxserver --status
 
No processes found.
 
NX> 100 NXSERVER - Version 3.2.0-73 OS (GPL, using backend: 3.5.0)
 
NX> 110 NX Server is running
 
NX> 999 Bye
 
ls3523:/var/lib/nxserver/home/.ssh # ssh -i /usr/NX/share/keys/server.id_dsa.key nx@localhost
 
Last failed login: Wed Jul 16 17:47:40 CEST 2014 from localhost on ssh:notty
 
There were 23 failed login attempts since the last successful login.
 
Have a lot of fun...
 
/usr/bin/xauth:  file /home/nx/.Xauthority does not exist
 
nx@ls3523:~> exit
 
logout
 
Connection to localhost closed.
 
ls3523:/var/lib/nxserver/home/.ssh # /usr/NX/bin/nxssh -nx -p 22 -i /root/.nx/temp/10398/keylog nx@localhost -x -2 -4 -o RhostsAuthentication no -o PasswordAuthentication no -o RSAAuthentication no -o RhostsRSAAuthentication no -o PubkeyAuthentication yes -B -E
 
NX> 203 NXSSH running with pid: 11380
 
NX> 200 Connected to address: 127.0.0.1 on port: 22
 
NX> 202 Authenticating user: nx
 
NX> 208 Using auth method: publickey
 
bash: no: command not found
 
</pre>
 
  
 
= TroubleShooting =
 
= TroubleShooting =
 
* starting the nxagent, you get
 
* starting the nxagent, you get
 
  /usr/NX/bin/nxagent: error while loading shared libraries: libXcomp.so.3: cannot open shared object file: No such file or directory
 
  /usr/NX/bin/nxagent: error while loading shared libraries: libXcomp.so.3: cannot open shared object file: No such file or directory
: Download nxcomp from http://software.opensuse.org/package/libXcomp3 and [[install]] it.
+
: Download nxcomp from http://software.opensuse.org/package/libXcomp3 and [[install]] it. Copy libXcomp.* to /usr/lib.
  
 
* during nxsetup, you get
 
* during nxsetup, you get
Line 152: Line 45:
 
  Can't open /var/lib/nxserver/db/running/sessionId{CBE6C1DE8281C9A77A5F72F05947EE1F}: No such file or directory.
 
  Can't open /var/lib/nxserver/db/running/sessionId{CBE6C1DE8281C9A77A5F72F05947EE1F}: No such file or directory.
 
  mv: cannot stat `/var/lib/nxserver/db/running/sessionId{CBE6C1DE8281C9A77A5F72F05947EE1F}': No such file or directory
 
  mv: cannot stat `/var/lib/nxserver/db/running/sessionId{CBE6C1DE8281C9A77A5F72F05947EE1F}': No such file or directory
: Possible workaround: re-install the NX server
+
: Possible workaround: re-install the NX server using the command
 +
nxsetup
  
 
* You get an error when logging in
 
* You get an error when logging in

Latest revision as of 06:46, 10 August 2014

FreeNX allows you to set up a terminal server.

How NX works

  • You call nxclient with your user
  • nxclient uses the nx user to connect to the NX server. This authentication works passwordless with a private key (the nomachine-key) in your nxclient and an authorized public key on the nx server. Private and public key must fit to each other.
  • nx's shell on the NX server is called nxserver which allows communication over the nx protocol
  • now your user name and password is transmitted and checked
  • then nxserver establishes the display connection

SUSE 13.1

This is how I installed a FreeNX server on SUSE 13.1 on 2014-07-19:

# yast -i expect rdesktop
# wget http://download.opensuse.org/repositories/home:/beyerle:/NX/openSUSE_13.1/$(uname -i)/NX-3.5.0-123.1.x86_64.rpm
# wget http://download.opensuse.org/repositories/home:/beyerle:/NX/openSUSE_13.1/x86_64/FreeNX-0.7.3-7.1.$(uname -i).rpm
# rpm -ivh NX-3.5.0-123.1.*.rpm FreeNX-0.7.3-7.1.*.rpm
  • read how to set it up
# cat /usr/share/doc/packages/FreeNX/README.SuSE
  • set it up
# nxsetup --setup-nomachine-key
  • Now connect with any NX client to the NX server. The connection does not work for me, I get an error message
The NX service is not available or the NX access
was
disabled on host ...
  • To solve this problem, you need a private/public key pair. Generate one with the command
ssh-keygen -t dsa

The command will ask where to put the key pair. The private key will be named id_dsa and the public key will be named id_dsa.pub. Add the public key to /var/lib/nxserver/home/.ssh/authorized_keys and import the private key into your NX client. The re-login using your NX client.

TroubleShooting

  • starting the nxagent, you get
/usr/NX/bin/nxagent: error while loading shared libraries: libXcomp.so.3: cannot open shared object file: No such file or directory
Download nxcomp from http://software.opensuse.org/package/libXcomp3 and install it. Copy libXcomp.* to /usr/lib.
  • during nxsetup, you get
strings: '/usr/bin/nxagent': No such file
Error: Could not find 1.5.0 or 2.[01].0 version string in nxagent. NX 1.5.0 or 2.[01].0 backend is needed for this version of FreeNX.
copy /usr/NX/bin/nxagent to /usr/bin
  • The connection fails during the "Negotiating link parameters" step.
Stop the fireWall on the target computer.
  • The connection fails after the "Authentication completed" step.

you get an error message like that:

NX> 1004 Error: NX Agent exited with exit status 1.
Can't open /var/lib/nxserver/db/running/sessionId{CBE6C1DE8281C9A77A5F72F05947EE1F}: No such file or directory.
mv: cannot stat `/var/lib/nxserver/db/running/sessionId{CBE6C1DE8281C9A77A5F72F05947EE1F}': No such file or directory
Possible workaround: re-install the NX server using the command
nxsetup
  • You get an error when logging in
Test the connection using ssh, there may be no lines of text sent when logging in. So, e.g. not
hello world
$