FreeNX@Ubuntu (XEN)

FreeNX server _is_ part of Ubuntu (unfortunately, not part of Debian) [UPDATE 20080419] „Ubuntu 8.04.2 alias Hardy“ is similar enough to „Debian GNU/Linux 5.0 alias Lenny“ (and vice versa), so packages for Ubuntu can be used!

Sources:

Install server

Xen&LVM

Check out the LVM and XEN … good software ;-)

Install virtual machine

Lets install with apt-cacher which is setup on the main server (see „mirror“ option).

# xen-create-image --cache=no --hostname=dev01x01.maja.loc --size=8Gb --swap=512Mb --force --memory=256Mb --arch=i386 --kernel=/boot/vmlinuz-2.6.26-1-xen-686 --initrd=/boot/initrd.img-2.6.26-1-xen-686 --install-method=debootstrap --dist=hardy --mirror=http://kryten.maja.loc:3142/archive.ubuntu.com/ubuntu/ --passwd

Install FreeNX server

add FreeNX repository

# vim /etc/apt/sources.list
#
# FreeNX
#
deb http://ppa.launchpad.net/marceloshima/ubuntu hardy main
deb-src http://ppa.launchpad.net/marceloshima/ubuntu hardy main
deb http://ppa.launchpad.net/freenx-team/ubuntu hardy main
deb-src http://ppa.launchpad.net/freenx-team/ubuntu hardy main

gpg keys

# apt-key adv --recv-keys --keyserver keyserver.ubuntu.com ED649F97DE6BFD99
# apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 2A8E3034D018A4CE

install

$ apt-cache search freenx
freenx - Remote desktop/application/thin-client server
freenx-media - Remote desktop/application/thin-client server media support
freenx-rdp - Remote desktop/application/thin-client server RDP proxy
freenx-server - Remote desktop/application/thin-client server core features
freenx-session-launcher - Remote desktop/application/thin-client server ConsoleKit helper
freenx-vnc - Remote desktop/application/thin-client server VNC proxy
nxsadmin - Administrative graphic tool for FreeNX server
# aptitude install freenx-server freenx
...
The following NEW packages will be installed:
expect freenx-server freenx-session-launcher libxcomp3 libxcompext3 libxcompshad3 nxagent nxlibs tcl8.4 

change sshd

# vim /etc/ssh/sshd_config 
...
PubkeyAuthentication yes
AuthorizedKeysFile      %h/.ssh/authorized_keys2
...

.. and restart sshd server

# ln -s ~/.ssh/authorized_keys ~/.ssh/authorized_keys2

nxsetup

# /usr/lib/nx/nxsetup --install 
------> It is recommended that you use the NoMachine key for
        easier setup. If you answer "y", FreeNX creates a custom
        KeyPair and expects you to setup your clients manually. 
        "N" is default and uses the NoMachine key for installation.

 Do you want to use your own custom KeyPair? [y/N] N
Setting up /etc/nxserver ...done
Generating public/private dsa key pair.
Your identification has been saved in /etc/nxserver/users.id_dsa.
Your public key has been saved in /etc/nxserver/users.id_dsa.pub.
The key fingerprint is:
19:73:57:62:d4:dc:31:10:3f:11:73:f4:b7:7e:bc:3a root@dev01x01.maja.loc
Setting up /var/lib/nxserver/db ...done
Setting up /var/log/nxserver.log ...done
Adding user "nx" to group "utmp" ...done
Setting up known_hosts and authorized_keys2 ...done
Setting up permissions ...done
Setting up cups nxipp backend ...done

----> Testing your nxserver configuration ...
Warning: Invalid value "COMMAND_START_KDE=startkde"
         Users will not be able to request a KDE session.
Warning: Invalid value "COMMAND_START_CDE=xfce4-session"
         Users will not be able to request a CDE session.
Warning: Invalid value "COMMAND_SMBMOUNT=smbmount". You'll not be able to use SAMBA. 
Warning: Invalid value "COMMAND_SMBUMOUNT=smbumount". You'll not be able to use SAMBA.

  Warnings occured during config check.
  To enable these features please correct the configuration file.

<---- done

----> Testing your nxserver connection ...
The authenticity of host '127.0.0.1 (127.0.0.1)' can't be established.
RSA key fingerprint is 82:1e:46:43:ff:7c:e4:22:80:b5:24:7f:3c:e3:e1:50.
Are you sure you want to continue connecting (yes/no)?
Warning: Permanently added '127.0.0.1' (RSA) to the list of known hosts.
HELLO NXSERVER - Version 3.2.0-74-SVN OS (GPL, using backend: 3.3.0)
<--- done

Ok, nxserver is ready.

PAM authentication enabled:
  All users will be able to login with their normal passwords.

  PAM authentication will be done through SSH.
  Please ensure that SSHD on localhost accepts password authentication.

  You can change this behaviour in the /etc/nxserver/node.conf file.
Have Fun!

FreeNX customize

dpkg-reconfigure freenx
# vim /etc/nxserver/node.conf

Install Commercial client

# aptitude install libxcompext3 libxcomposite1

pre-flight check

Lets connect from server to server first:

$ ssh nx@localhost
The authenticity of host 'localhost (127.0.0.1)' can't be established.
RSA key fingerprint is 82:1e:46:43:ff:7c:e4:22:80:b5:24:7f:3c:e3:e1:50.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'localhost' (RSA) to the list of known hosts.
HELLO NXSERVER - Version 3.2.0-74-SVN OS (GPL, using backend: 3.3.0)
NX> 105

Lets connect from client machine to server via „nx“ account:

$ /usr/NX/bin/nxssh nx@dev01x01.maja.loc
HELLO NXSERVER - Version 3.2.0-74-SVN OS (GPL, using backend: 3.3.0)
NX> 105

Lets try to run the „nxagent“ via „jsa“ users' account:

$ /usr/NX/bin/nxssh jsa@dev01x01.maja.loc /usr/bin/nxagent

NXAGENT - Version 3.3.0

Copyright (C) 2001, 2007 NoMachine.
See http://www.nomachine.com/ for more information.

Info: Agent running with pid '17731'.
Session: Starting session at 'Sun Apr 19 16:37:39 2009'.
Info: Using alpha channel in render extension.
Info: Not using local device configuration changes.
error opening security policy file /usr/X11R6/lib/X11/xserver/SecurityPolicy
SessionPath not defined
expected keysym, got XF86KbdLightOnOff: line 70 of pc
expected keysym, got XF86KbdBrightnessDown: line 71 of pc
expected keysym, got XF86KbdBrightnessUp: line 72 of pc
Session: Session started at 'Sun Apr 19 16:37:40 2009'.
Easy to fix little error message:
# mkdir -p /usr/X11R6/lib/X11/xserver
# touch /usr/X11R6/lib/X11/xserver/SecurityPolicy

Unresolved mystery

  1. server is running
  2. client connects ok
  3. keys are ok
  4. clients window opens with red logo
  5. .. and then closes (lasts about one second)
  6. why?
-- NX SERVER START: -c /usr/lib/nx/nxserver - ORIG_COMMAND=
-- NX SERVER START:  - ORIG_COMMAND=
Info: Using fds #4 and #3 for communication with nxnode.
HELLO NXSERVER - Version 3.2.0-74-SVN OS (GPL, using backend: 3.3.0)
NX> 105 hello NXCLIENT - Version 3.2.0
NX> 134 Accepted protocol: 3.2.0
NX> 105 SET SHELL_MODE SHELL
NX> 105 SET AUTH_MODE PASSWORD
NX> 105 login
NX> 101 User: jsa
NX> 102 Password: 
Info: Auth method: ssh jsa@127.0.0.1's password:
NX> 1000 NXNODE - Version 3.2.0-74-SVN OS (GPL, using backend: 3.3.0)
NX> 716 Slave mode started successfully.
nxnode_reader: NX> 1000 NXNODE - Version 3.2.0-74-SVN OS (GPL, using backend: 3.3.0)
nxnode_reader: NX> 716 finished
nxnode_reader: NX> 1001 Bye.

NX> 103 Welcome to: dev01x01.maja.loc user: jsa
NX> 105 listsession --user="jsa" --status="suspended,running" --geometry="1280x1024x24+render" --type="unix-gnome"
NX> 127 Sessions list of user 'jsa' for reconnect:

Display Type             Session ID                       Options  Depth Screen         Status      Session Name
------- ---------------- -------------------------------- -------- ----- -------------- ----------- ------------------------------


NX> 148 Server capacity: not reached for user: jsa
NX> 105 startsession  --link="lan" --backingstore="1" --encryption="1" --cache="16M" --images="64M" --shmem="1" --shpix="1" --strict="0" --composite="1" --media="0" --session="jsa@dev01x01.maja.loc" --type="unix-gnome" --geometry="800x600+229+212" --client="linux" --keyboard="pc102/us" --screeninfo="800x600x24+render" 

Info: Using /etc/nxserver/nxacl to change session parameters or deny session.
&link=lan&backingstore=1&encryption=1&cache=16M&images=64M&shmem=1&shpix=1&strict=0&composite=1&media=0&session=jsa@dev01x01.maja.loc&type=unix-gnome&geometry=800x600+229+212&client=linux&keyboard=pc102/us&screeninfo=800x600x24+render&clientproto=3.2.0&login_method=SSH&user=jsa&userip=172.28.7.52&uniqueid=891A28C95BBFDF8D8D2949F8F4AA0915&display=1000&host=127.0.0.1 
nxnode_reader: NX> 1000 NXNODE - Version 3.2.0-74-SVN OS (GPL, using backend: 3.3.0)
NX> 1000 NXNODE - Version 3.2.0-74-SVN OS (GPL, using backend: 3.3.0)
server_nxnode_echo: NX> 1000 NXNODE - Version 3.2.0-74-SVN OS (GPL, using backend: 3.3.0)
nxnode_reader: NX> 700 Session id: dev01x01.maja.loc-1000-891A28C95BBFDF8D8D2949F8F4AA0915
nxnode_reader: NX> 705 Session display: 1000
nxnode_reader: NX> 703 Session type: unix-gnome
nxnode_reader: NX> 701 Proxy cookie: 80bb2a87f68905968e5ff0c06d601238
nxnode_reader: NX> 702 Proxy IP: 172.28.7.57
nxnode_reader: NX> 706 Agent cookie: 80bb2a87f68905968e5ff0c06d601238
nxnode_reader: NX> 704 Session cache: unix-gnome
server_nxnode_echo: NX> 700 Session id: dev01x01.maja.loc-1000-891A28C95BBFDF8D8D2949F8F4AA0915
server_nxnode_echo: NX> 705 Session display: 1000
server_nxnode_echo: NX> 703 Session type: unix-gnome
server_nxnode_echo: NX> 701 Proxy cookie: 80bb2a87f68905968e5ff0c06d601238
server_nxnode_echo: NX> 702 Proxy IP: 172.28.7.57
server_nxnode_echo: NX> 706 Agent cookie: 80bb2a87f68905968e5ff0c06d601238
server_nxnode_echo: NX> 704 Session cache: unix-gnome
NX> 700 Session id: dev01x01.maja.loc-1000-891A28C95BBFDF8D8D2949F8F4AA0915
NX> 705 Session display: 1000
NX> 703 Session type: unix-gnome
NX> 701 Proxy cookie: 80bb2a87f68905968e5ff0c06d601238
NX> 702 Proxy IP: 172.28.7.57
NX> 706 Agent cookie: 80bb2a87f68905968e5ff0c06d601238
NX> 704 Session cache: unix-gnome
nxnode_reader: NX> 707 SSL tunneling: 1
NX> 707 SSL tunneling: 1
server_nxnode_echo: NX> 707 SSL tunneling: 1
nxnode_reader: NX> 1009 Session status: starting
NX> 1009 Session status: starting
server_nxnode_echo: NX> 1009 Session status: starting
nxnode_reader: NX> 710 Session status: running
NX> 710 Session status: running
server_nxnode_echo: NX> 710 Session status: running
nxnode_reader: NX> 1002 Commit
NX> 1002 Commit
server_nxnode_echo: NX> 1002 Commit
nxnode_reader: NX> 1006 Session status: running
NX> 1006 Session status: running
session_status 891A28C95BBFDF8D8D2949F8F4AA0915 Running
NX> 105 bye
Bye
NX> 999 Bye
server_nxnode_echo: NX> 1006 Session status: running
nxnode_reader: NX> 1009 Session status: terminating
NX> 1009 Session status: terminating
session_status 891A28C95BBFDF8D8D2949F8F4AA0915 Terminating
server_nxnode_echo: NX> 1009 Session status: terminating
Info: Closing connection to slave with pid 19947.
nxnode_reader: 1001 Bye.
1001 Bye.
nxnode_reader: NX> 1006 Session status: closed
NX> 1006 Session status: closed
session_close 891A28C95BBFDF8D8D2949F8F4AA0915
server_nxnode_echo: NX> 1006 Session status: closed
nxnode_reader: NX> 1001 Bye.
NX> 1001 Bye.
server_nxnode_echo: NX> 1001 Bye.
Info: Closing connection to slave with pid 19947.

Solution

Edit the “/etc/nxserver/node.conf“ accordingly:

# vim /etc/nxserver/node.conf
# This is the bloody line:
BOOTSTRAP_X_SESSION="0"
# Gather more information just in case:
NX_LOGFILE=/var/log/nxserver.log
NX_LOG_LEVEL="7"
  • Bookmark "FreeNX@Ubuntu (XEN)" at del.icio.us
  • Bookmark "FreeNX@Ubuntu (XEN)" at Digg
  • Bookmark "FreeNX@Ubuntu (XEN)" at Reddit
  • Bookmark "FreeNX@Ubuntu (XEN)" at blogmarks
  • Bookmark "FreeNX@Ubuntu (XEN)" at Google
  • Bookmark "FreeNX@Ubuntu (XEN)" at Technorati
  • Bookmark "FreeNX@Ubuntu (XEN)" at Live Bookmarks
  • Bookmark "FreeNX@Ubuntu (XEN)" at Yahoo! Myweb
  • Bookmark "FreeNX@Ubuntu (XEN)" at Facebook
  • Bookmark "FreeNX@Ubuntu (XEN)" at Yahoo! Bookmarks
technologie/freenx_debian.txt · Poslední úprava: 2009/04/19 23:09 autor: jsa
Valid Robots.txt chimeric.de = chi`s home Creative Commons License Valid CSS Driven by DokuWiki Valid XHTML 1.0