架設 FreeNX server

由於 NoMachine免費版本只能支援 2 個使用者. 在家用當然是足夠. 但是要給多人用就沒辦法了. 只好自己架設免費的 FreeNX server.

在安裝 FreeNX Server 前. 請記得安裝 expect.
# yum install expect

Loaded plugins: kernel-module
sl-base | 1.1 kB 00:00
sl-security | 1.9 kB 00:00
sl-security/primary_db | 1.8 MB 00:02
Setting up Install Process
Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them.
The program yum-complete-transaction is found in the yum-utils package.
–> Running transaction check
—> Package expect.i386 0:5.43.0-5.1 set to be updated
—> Package expect.x86_64 0:5.43.0-5.1 set to be updated
–> Finished Dependency Resolution
Beginning Kernel Module Plugin
Finished Kernel Module Plugin

Dependencies Resolved

================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
expect i386 5.43.0-5.1 sl-base 158 k
expect x86_64 5.43.0-5.1 sl-base 160 k

Transaction Summary
================================================================================
Install 2 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

Total download size: 318 k
Is this ok [y/N]: y
Downloading Packages:
(1/2): expect-5.43.0-5.1.i386.rpm | 158 kB 00:01
(2/2): expect-5.43.0-5.1.x86_64.rpm | 160 kB 00:00
——————————————————————————–
Total 153 kB/s | 318 kB 00:02
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : expect 1/2
Installing : expect 2/2

Installed:
expect.i386 0:5.43.0-5.1 expect.x86_64 0:5.43.0-5.1

Complete!

之後就去下載 FreeNX 和 NoMachine Client 的套件(freenx-0.7.3-4.el5.centos.x86_64.rpm, nx-3.4.0-4.el5.centos.x86_64.rpm and nxclient-3.4.0-7.x86_64.rpm)然後安裝 :
# rpm -ivh freenx-0.7.3-4.el5.centos.x86_64.rpm nx-3.4.0-4.el5.centos.x86_64.rpm nxclient-3.4.0-7.x86_64.rpm

Preparing… ########################################### [100%]
1:nx ########################################### [ 33%]
2:freenx ########################################### [ 67%]
Stopping sshd: [ OK ]
Starting sshd: [ OK ]
Starting freenx-server: [ OK ]

3:nxclient ########################################### [100%]
Showing file: /usr/NX/share/documents/client/cups-info

CUPS Printing Backend

The NX Client set-up procedure detected that your “IPP CUPS” printing
backend doesn’t allow printing from the NX session. In order to have
printing support in your NX system, you need to set proper permissions
on the IPP backend. Please execute:

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

設定 NX server :
# nxsetup –install –setup-nomachine-key

Setting up /etc/nxserver …done
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 …
(omit)
<---- done ----> Testing your nxserver connection …
HELLO NXSERVER – Version 3.2.0-73 OS (GPL, using backend: not detected)
<--- 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!

複製 node.conf.sample 範本檔案到 node.conf :
# cp /etc/nxserver/node.conf.sample /etc/nxserver/node.conf

檢查 FreeNX Server 是否有執行 :
# nxserver –status

NX> 100 NXSERVER – Version 3.2.0-73 OS (GPL, using backend: not detected)
NX> 110 NX Server is running
NX> 999 Bye

將 /usr/bin/nxserver –start 指令放在 /etc/rc.local 內 機器每次開機都執行 FreeNX sever