|
Setting Up Your Own Diskless Workstations with LTSP
The Whys and Wherefores of LTSPIt is no news flash that local computer networks are very prevalent and widely used nowdays. The most common solution, is the ubiquitous PC-as-workstations model. But once you start adding in the costs for servers plus all of the headaches of the client-server model into the mix, some organizations may be wondering if this is truly the best solution. One alternative, particularly for companies where employees work in few sessions, could be diskless workstations (X-terminals). Right away, the advantages of this model are clear. IT departments can economize on hard drives and on RAM. They will also not need the most powerful CPUs for each PC, since all applications will be executed on server. Beyond that, any user will be able to use his or her own configured window environment without any regard for the actual workstation on which they will be working. There are, of course, shortcomings, too. Diskless workstation networks have rather tough requirements for bandwidth (at least 100Mbps to start), workstations might be sub-par (though a nicely recycled video card will do wonders for performance), and there will be the need to spend money on a pretty high-end network server. There are a few popular software solutions for organization of diskless workstations in the Linux environment, but from my point of view, a good choice is the Linux Terminal Server Project (LTSP). Readers of this article won't be getting a complete documentation of LTSP, but hopefully you will be able to take away enough of the basics to get you interested.
Installing and Configuring an LTSP ServerFirst of all, we need to download the software from the developer's site. Minimum packages include:
If you are planning to use very old PCs, you may need to download a few additional packages with X-Windows 3.3.6 with optimization for our existing video cards. For sound support on the workstations we will need the package ltsp_sound-3.0.1i386.tgz. But, personally, I do not recommend turning sound on unless you absolutely have to--sound will quickly chew up network bandwidth. Also, before installing LTSP we need to pre-install dhcp, tftp-server, and nfs-utils. So, let's begin: rpm -ihv ltsp_kernel-3.0.4-0.i386.rpm ltsp_core-3.0.5-0.i386.rpm ltsp_xcore-3.0.1-1.i386.rpm If you do not have GNOME pre-installed (or, to be more exact, the gdm manager), you may see the next error message: chmod: getting attributes of '/opt/ltsp/templates/gdm_Init_Default.tmpl': no such file or directory This is normal and you can ignore it. Before the next step in the process, check the value of the environment variable PATH. You must have /sbin and /usr/sbin be included in it. If these values are not there, run the following command: export PATH=$PATH:/sbin:/usr/sbin Now you can execute the LTSP setup: cd /opt/ltsp/templates ./ltsp_initialize The following message will appear: The Linux Terminal Server Project (http://www.LTSP.org) About to update important system files. If you would like to stop and review the changes that are about to be made, you can cancel now and look at the replacement files that are about to be installed. Press Press Enter. The program will display a file list, in which you make neccessary changes: The following files will be created/modified: /etc/X11/xdm/Xaccess The config file to allow remote xdm log [Y] /etc/X11/xdm/Xservers Config file for xdm to launch local Xse [Y] /etc/X11/xdm/Xsetup_workstation Sets the logo of your login window [Y] /etc/dhcpd.conf.example Example config file for dhcp [Y] /etc/exports The config file for nfs [Y] /etc/hosts.allow Configuration file for tcp wrappers [Y] /etc/inittab Config file for init [Y] /etc/X11/xdm/ltsp.gif The background logo for your login [Y] /etc/rc.d/rc5.d/S60nfs Startup links for nfs [Y] /etc/rc.d/rc5.d/S13portmap Startup links for portmapper [Y] /etc/sysconfig/syslog Startup info for syslogd [Y] /etc/xinetd.d/tftp Enable the tftp daemon [Y] /etc/X11/xdm/xdm-config The main config file for xdm/kdm [Y] Ready to apply the changes? ( R-Review, A-Apply, C-Cancel ) Pressing A and Enter will get you this displayed message: The Linux Terminal Server Project (http://www.LTSP.org) Doing the update Xaccess.tmpl Saving old /etc/X11/xdm/Xaccess as /etc/X11/xdm/Xaccess.1 Xservers.tmpl Saving old /etc/X11/xdm/Xservers as /etc/X11/xdm/Xservers.1 Xsetup_workstation.tmpl Saving old /etc/X11/xdm/Xsetup_workstation as /etc/X11/xdm/Xsetup_workstation.1 dhcpd.tmpl Saving old /etc/dhcpd.conf.example as /etc/dhcpd.conf.example.1 exports.tmpl Saving old /etc/exports as /etc/exports.1 hosts.allow.tmpl Saving old /etc/hosts.allow as /etc/hosts.allow.1 inittab.tmpl Saving old /etc/inittab as /etc/inittab.1 ltsplogo.tmpl Saving old /etc/X11/xdm/ltsp.gif as /etc/X11/xdm/ltsp.gif.1 nfs.tmpl portmap.tmpl syslog.tmpl Saving old /etc/sysconfig/syslog as /etc/sysconfig/syslog.1 tftpd.tmpl xdm-config.tmpl Saving old /etc/X11/xdm/xdm-config as /etc/X11/xdm/xdm-config.1 The startup configuration of this package is now complete. Let's configure the DHCP server now. First, using your preferred text editor, edit the file /etc/dhcpd.conf.example. In this configuration file you will see an example of configuration for network 192.168.0.0/255.255.255.0. You need to change these examples to actual values used in your own network. In the line If you already have a DHCP server in your network, you will need to modify its configuration like in the example file above. An important argument in this configuration is You will also need to pay attention to the argument Next, set the IP address of each workstation, along with the file name of the kernel for each unit. For instance, the ltsp_kernel-3.0.4-0.i386.rpm package value of the file name will be Now, execute the DHCP server with the command: service dhcpd start The configuration of the syslog has already been done by the script ltsp_initialize. We just need to reload it: service syslog reload An important and necessary requirement is a properly configured /etc/hosts file (and/or a good configuration of DNS). IP addresses, which will be allocated for each workstation, should be associated with domain names. Otherwise we will have problems with NFS, which is used for supporting access from the workstation to the central network server. It's time to configure xfs (X-Windows font server). One could argue that each station could have its own package with fonts, but from my point of view, the proper solution will be a centralized font server. To accomplish this, comment out the line service xfs start Make sure you perform an actual restart, not a reload, or xfs will not handle network requests properly. Also, we need to finish configuring NFS. In file /etc/exports fix these lines: /opt/ltsp/i386 192.168.0.0/255.255.255.0(ro,no_root_squash) /var/opt/ltsp/swapfiles 192.168.0.0/255.255.255.0(rw,no_root_squash) by correctly setting your own network addresses. In the next step, you will configure /opt/ltsp/i386/etc/lts.conf. In this file all of the settings for the workstations are stored. In the first block of arguments are the default settings. [Default]
SERVER = 192.168.0.254
XSERVER = auto
X_MOUSE_PROTOCOL = "PS/2"
X_MOUSE_DEVICE = "/dev/psaux"
X_MOUSE_RESOLUTION = 400
X_MOUSE_BUTTONS = 3
USE_XFS = Y
LOCAL_APPS = N
RUNLEVEL = 5
All of these arguments are understandable by their names, but here's a brief explanation:
The next blocks consist of individual descriptions and detailed settings for specific workstations and are named after the workstations. Everything inside these blocks will override all default values. [ws001]
XSERVER = auto
LOCAL_APPS = N
USE_NFS_SWAP = N
SWAPFILE_SIZE = 48m
RUNLEVEL = 5
Notice there are two new lines here, as compared to the default settings.
In the case of a workstation, on which we do not have anything except the kernel and X-server and nothing more will be executed--we will not need a lot of memory. That's why you will only need swap only if the workstation's RAM is very small or some applications are executed locally. I suggest not using swap; it works too slowly, and it overloads network a lot. We also have a few very useful arguments, X_MODE_0 = 800x600
X_MODE_1 = 1024x768
This will set the screen resolution to 800x600 during boot process, and will set the resolution to 1024x768 by pressing Ctrl-Alt-Plus. A full list of arguments you can use in lts.conf are described in the file lts.conf.readme, which I recommend you peruse. If you are using X Window on the server we need to modify the file /etc/X11/xdm/Xservers and uncomment the line :0 local /usr/X11R6/bin/X And, to crown it all, do not forget to set the X server to runlevel 5. This way NFS and xdm (gdm, kdm) will both be started.
Prepping the WorkstationsFirst of all, visit Rom-o-matic and create a boot program for your network cards. On this site, you can get this program in two variants: for hard-coding into the network card for diskette booting. The second variant can be used for debugging or checking procedures. Write the image (about 32kb) onto a diskette (don't forget to insert it!) and type: dd if=eb-5.0.7-netcard.lzdsk of=/dev/fd0 where eb-5.0.7-netcard.lzdsk is the file downloaded from the Rom-o-matic site. Now the bootable diskette is ready. Boot from it on the workstation and after the boot process is finished X Window will appear ready to login.
Configuring Sound on LTSPTo support multimedia applications on the workstation, yopu will have to configure sound support. This brings up a rather thorny problem because in reality all the applications are executed not on the local station, but rather on the main server. This means that we need to transfer all sound streams from the server to workstation via the network. Initially, this seems to be a difficult task, but such software already exists to handle it--a special package called ltsp_sound can do all of these things, which can easily be downloaded from the LTSP developers site. This package isn't available as an RPM, so after downloading, we need to unpack the archive file into a temporary directory and execute script included in the package as superuser (root). Remember, make sure, the PATH statement contains /sbin and /usr/sbin: export PATH=$PATH:/sbin:/usr/sbin
./install.sh
LTSP Sound v3.0.1 by Andrew Williams (mistik1@geeksinthehood.net)
Originally created by Boris Reisig (boris@microtrader.com)
Bash Version=2.05a.0(1)-release
Installing Base package.
Please make sure to unset LD_PRELOAD before you use this
if have a previous ltsp Sound package installed
About to install the libs, Are you sure you want to continue? [Y/N]:
Confirm (Y):
Putting files in /opt/ltsp
Setting up Environment variables adding ltsp-sound.sh
Would you like to install the nasd sound utilities package? [Y/N]:
Confirm (Y). Nasd - it's special sound server:
Putting files in /opt/ltsp
Setting up Environment variables adding ltsp-sound.sh
Would you like to install the nasd sound utilities package? [Y/N]:y
Putting files in /opt/ltsp
Setting up Environment variables adding ltsp-sound.sh
Would you like to install the nasd sound utilities package? [Y/N]:y
Installation *Complete*
!!NOTE: Please read "/opt/ltsp/i386/etc/lts.conf.sound" for more info
You *SHOULD* turn down your workstation speakers as this
package is installed default to ramp the sound volume
on loading of the sound daemon
Have Fun!!!
We now just have to modify the configuration of the network's workstations. In the lts.conf file, in the settings section, we will add these lines: SOUND = Y
SOUND_DAEMON = nasd # This can be 'nasd', or 'esd' at this time
VOLUME = 100 # Speaker & WAVE volume pecentage
MIC_VOLUME = 100 # Microphone volume
CD_VOLUME = 75 # CD Audio volume
SMODULE_01 = auto # sound chip auto detect
Nasd - it's special daemon, which receives/send media data over network.
VOLUME - software settings for volume range.
MIC_VOLUME - software settings for microphone sensivity.
CD_VOLUME - software settings for CD audion input sensivity.
SMODULE_01 - name of loadable module of soundcard or auto for autodetect.
If your soundcard cannot be autodetected, you can configure it manually: SMODULE_01 = soundcore
SMODULE_02 = uart401
SMODULE_03 = sb io=0x220 irq=5 dma=1
In this example, by the way, we are configuring a Sound Blaster-compatible card. After the workstation reloads, we can use xmms and many other multimedia applications.
A Few Notes About SecuritySystem administrators, when finished configuring the diskless workstations, need to take care about security. Services used in such networks (NFS, X Window) are rather weak, and they have rather insecure tools for restricted access. This is why a aystem administrator needs:
This last requirement is handled in the /etc/X11/xdm/Xaccess file, where you can define a list of local diskless workstations and allow access only for them by commenting out the lines: * #any host can get a login window
* CHOOSER BROADCAST #any indirect host can get a chooser
and creating a list of actual workstations: ws001
ws002
%hostlist ws001 ws002
* CHOOSER %hostlist
Wrapping UpIn this article we have not discussed a big picture of LTSP software abilities, such as local application execution, text mode, print to local printer, working with local devices (floppy, disks), NIS, and many others. This is more in the scope of the excellent LTSP documentation that's out there today. But even from this short article you will understand that diskless workstations (X-terminals) allow us to economize on hardware, they are generally safer, and are easier to manage from a system administrator's point of view. Once IT managers will pay for some of the time to create network with diskless workstations, they will ultimately save a good chunk of change for their companies.
|