Thursday, August 12, 2010

Linux Terminal Server Project (LTSP)

Now I will tell you how we can configure LTSP server for our lab with telnet, rdesktop, shell and startx ( for Linux log in).
Step1 :a. Make sure DHCP server is installed and running properly on your system
b. Now install tftp server also on your machine and you can find it’s rpm on your Redhat DVD 
(5.0)
c.
 Now install rdesktop rpm and it is also you can find on your redhat DVD (5.0)
d. Configure your windows xp system with full terminal and remote desktop support for distribute rdesktopalso over the network so that client can be run 
windows xp.
e.
 Now download ltsp-4.1.0-1_2.iso image from it’s website (
http://ltsp.mirrors.tds.net/pub/ltsp/isos/)and my package size is 100MB (apprx.).
f.
 Now I am making dir test in filesystem (/) and extract this package in test directory
g. Now open readme file from test folder and read instructions carefully on 
how to install this package.
h.
 After installation complete you need to configure ltsp server .
Step 2 :Configure tftp for ltsp server

TFTP : TFTP is a simple file transfer protocol, used by ltsp to transfer the kernel to the workstations.
XINETD : Xinetd is a powerful replacement for inetd, with advanced features, used by ltsp to start tftp.
Open the file # vim /etc/xinetd.d/tftp and make disable = no. Otherwise tftp not work.
service tftp
{
Disable = no
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /var/lib/tftpboot
per_source = 11
cps = 100 2
flags = IPv4
}

Now restart xined service#service xinetd restart
Step3 :Configure nfs for ltsp server
Open the file #vim /etc/exports and enter following lines in it./opt/ltsp 192.168.0.0/255.255.255.0(ro,no_root_squash,sync)
/var/opt/ltsp/swapfiles 192.168.0.0/255.255.255.0(rw,no_root_squash,async)

Now restart nfs service#service nfs restart
#chkconfig nfs on (for service start automatically on every bootup)
Step4 :Configure dhcpd.conf for ltsp server
Now you need to configure dhcpd.conf file and here is example of my file.#vim /etc/dhcpd.conf
ddns-update-style interim;
ignore client-updates;
subnet 192.168.0.0 netmask 255.255.255.0 {
# --- default gateway
# option routers 192.168.0.1;
# option subnet-mask 255.255.255.0;
# option nis-domain "domain.org";
option domain-name "san.com";
option domain-name-servers 192.168.0.1;
option time-offset -18000; # Eastern Standard Time
# option ntp-servers 192.168.1.1;
# option netbios-name-servers 192.168.1.1;
# --- Selects point-to-point node (default is hybrid). Don't change this unless
# -- you understand Netbios very well
# option netbios-node-type 2;
option log-servers 192.168.0.1;
option root-path "192.168.0.1:/opt/ltsp/i386";

If you use thes lines here then every system on your network can boot from #ltsp server but if you want more security then remove this line and then only #that system can boot that’s hardware address will declare in“host ws001” #section with static ip address.
filename "/lts/2.4.26-ltsp-2/pxelinux.0";
range dynamic-bootp 192.168.0.128 192.168.0.254;
default-lease-time 21600;
max-lease-time 43200;

If you want to use static IP address for your workstation the following section and modify to suit your network. Then, duplicate this section for each workstation that needs a static IP address.

host ws001 {
hardware ethernet 00:20:ED:75:9A:EC;
fixed-address 192.168.0.2;
filename "/lts/2.4.26-ltsp-2/pxelinux.0";
}
}
Step5 :Configure lts.conf for ltsp server
Now you need to configure #vim /opt/ltsp/i386/etc/lts.conf file for client.
Here is example of my 
lts.conf file
[Default]
SERVER = 192.168.0.1
RDP_SERVER = 192.168.0.50
XSERVER = auto
X_MOUSE_PROTOCOL = "PS/2"
X_MOUSE_DEVICE = "/dev/psaux"
X_MOUSE_RESOLUTION = 400
X_MOUSE_BUTTONS = 3
USE_XFS = N
X_COLOR_DEPTH = 24 # it is for xp terminal server
X_MODE_0 = 1024x768
RUNLEVEL = 5
LDM_REMOTECMD = /etc/X11/xinit/Xsession
SCREEN_01 = startx
SCREEN_02 = telnet
SCREEN_3 = shell
SCREEN_4 = rdesktop

Note : Here I will explain some options of this file.

SERVER : Here you I have to enter your ltsp server ip address.

RDP_SERVER : If you want to run remote desktop connection on xp then you have enter IP address. Of your xp terminal server. Otherwaise remove this option.
LDM_REMOTECMD :/etc/X11/xinit/XsessionWhen I was trying to running startx on client machine it was showing white screen only for solving this problem I copied this. Option from internet and paste it here and my problem solved.

Source : The LTSP client screen will still not display because LTSP expects a file /etc/X11/Xsession to exist on the server. In RHEL5 this corresponds to /etc/X11/xinit/Xsession .This can be fixed by specifying the
environment variable LDM_REMOTECMD in /opt/ltsp/i386/etc/lts.conf:[192.168.250.20]LDM_REMOTECMD = /etc/X11/xinit/Xsession.About SCREEN :The most interesting parameter here is SCREEN_01. The default is startx, which specifies that the workstation should boot up in a graphical X display, but there are a number of interesting possibilities. 

The other options are :· telnet : When the workstation boots up in this mode, it waits for you to press, then starts a TELNET session to the host. Obviously, your TELNET server must be running for this. (Many offices use SSH by default.). You have to enter your telnet server IP in /opt/ltsp/i386/etc/screen.d/telnet file.
· shell : This starts a local command shell, meaning local to the workstation, not to the server. From here, you could telnet or ssh to your server, or start a graphical login by typing startx. This mode is generally used for testing. It's also a great way to see the virtual Linux machine that gets created as part of the LTSP boot process.
· rdesktop : Setting SCREEN_01 to this fires up rdesktop, a Linux-based Windows Terminal Server Client, which means it uses RDP (remote desktop protocol) to communicate with and run remote Windows sessions from your Linux thin client.
How Many Screen's ?Ans : Of course, the fact that this last variable is labeled SCREEN_01 leads up to the obvious Question: What about SCREEN_02? Or SCREEN_03?Earlier in this chapter, I told you about running your main X session on virtual terminal session 7, while thesecond X session (started with an X -query) ran on virtual terminal 8. You can do something similar withthin-client workstations by modifying the lts.conf file to include more than one SCREEN definition. Here is the example from my own Server :
SCREEN_01 = startx.

You want to enter your telnet server IP in /opt/ltsp/i386/etc/screen.d/telnet file
SCREEN_02 = telnet
SCREEN_03 = shell
SCREEN_04 = rdesktop

The first virtual terminal (accessible by pressing ) runs the graphical login served up via XDMCP. The second virtual terminal () runs a TELNET session with a prompt saying “Screen:2 – Press to establish a connection to the server…” Finally, the third screen () sits at a shell prompt.
In a default LTSP installation, all these screen definitions can be found in the /opt/ltsp/i386/etc/screen.d directory. Each is a shell script and easy to read and understand. You could, if you so wish, create your own screen definitions to better suit your own environment.
These types of screen modifications can be done globally or on a client-by-client basis. In the next chapter, you are going to look at just what sorts of things you can do with workstations. I am also going to show you how you can run a not quite so thin, Linux thin client from a Windows desktop.
Step6 :Configure xdm-config file for ltsp server
Next, open the file /etc/X11/xdm/xdm-config and comment out the line :DisplayManager.requestPort: 0And Edit This file also because sometime it makes problem
/opt/ltsp/i386/etc/xdm/xdm-config and comment out the line :
DisplayManager.requestPort: 0Step7 :Enable Remote Login in RedHat so that client able access login screen.[root@racdb2 ~]# gdmsetup
After starting the gdmsetup utility, click the Remote tab. Under the Remote tab, change the Style pull-down menu selection from 'Remote login disabled' to 'Same as Local' :After configuring remote access to the GDM login manager, select the Security tab. Under the Security tab,

I have checked the options:· Allow local system administrator login
· Allow remote system administrator login

Exit from the gdmsetup utility and restart the GDM service :[root@racdb2 ~]# /usr/sbin/gdm-restart
OR 


Enable remote login via configure files.Use the following steps to enable the services and modify the files necessary to configure the XDMCP:1. To do this, edit the /etc/X11/xdm/Xaccess file and open the connection to hosts by un-commenting the line:
#* #any host can get a login window
or

Enter individual IP addresses of selected hosts.
SuSE users
 can do the same by editing the file 
/usr/X11R6/lib/X11/xdm/Xaccess.
2. Next, open the file /etc/X11/xdm/xdm-config and comment out the line:
DisplayManager.requestPort: 0
And this file also because sometime it makes problem
/opt/ltsp/i386/etc/xdm/xdm-config

3. Make sure to run the program xdm as the "root" user account.# xdm &
4. If the things still do not work, you may need to reboot the server or restart the xdm if it was already running. The xdm command (X Display Manager) manages a collection of X displays, which may be on the local host or remote servers. The design of the xdm command was guided by the needs of X terminals as well as the X Consortium standard XDMCP (the X Display Manager Control Protocol).
GDM Login Manager
Users running Red Hat Enterprise Linux 5, CentOS 5, or Oracle Enterprise Linux Release 5 will need to use the GDM login manager as XDM is no longer supported.
First, edit the file /etc/gdm/custom.conf and add the following two entries:
[xdmcp]
Enable=true
[security]
DisallowTCP=false
AllowRemoteRoot=true
Next, restart X Windows:
[root@racdb2 ~]# init 3
[root@racdb2 ~]# init 5
Step8 :It is an optional step because some time client show syslog error after booting it means your server is not configure for accept remote logs so you want to configure some lines for that-#vim /etc/sysconfig/syslogand add the -r option as below:SYSLOGD_OPTIONS=”-r –m 0”Now restart syslog service#service syslog restartAnd now open file /opt/ltsp/i386/etc/lts.conf and add the following line:SYSLOG_HOST = 192.168.0.1 #your syslog server ipMore Examples of configure files in different way /etc/dhcpd.conf