<?xml version='1.0' encoding="UTF-8"?>
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">

<guide link="/doc/en/ltsp.xml">
<title>Gentoo - LTSP Guide</title>
<author title="Author">
    <mail link="sysop@heinospage.de">Heinrich Wendel</mail>
</author>
<author title="Author">
    <mail link="josiah@ritchietribe.net">Josiah Ritchie</mail>
</author>
<author title="Editor">
    <mail link="swift@gentoo.org">Sven Vermeulen</mail>
</author>

<license/>

<abstract>
This guide shows you how to setup a LTSP Server with Gentoo.
</abstract>
<version>1.0</version>
<date>3rd of July 2003</date>
<chapter>
<title>Introduction</title>
<section>
<title>What is LTSP?</title>
<body>
<p>
LTSP is an abbreviation for "Linux Terminal Server Project". Installed 
on a server it can supply many workstations (so called thin-clients) 
with identical environments. All applications run on the server and 
therefore you can use old PCs and convert them into XTerminals. This 
reduces costs and maintenance especially in an environment where you 
need to have an uniform workspace on each computer you login, e.g. in 
schools or firms.
</p>
</body>
</section>
</chapter>
<chapter>
<title>Installation</title>
<section>
<title>Preliminaries</title>
<body>
<p>
All of the examples in this document presume that your server's IP is 
192.168.0.254, your domain is named yourdomain.com and your network is 
192.168.0.0/24.
</p>
</body>
</section>
<section>
<title>Installation</title>
<body>

<p>
First of all, you must have a working Gentoo system. Please read the
Gentoo Installation Manual for your architecture on <uri
link="http://www.gentoo.org/doc">Gentoo's Documentation Website</uri>.
</p>

<p>
Then lets begin with the easiest step, installing the ltsp core
utils:
</p>

<pre caption="Emerge LTSP">
# <i>emerge ltsp-core</i>
</pre>

<p>
This will install the following packages as dependencies:
</p>

<ul>
<li><b>XFree</b>: They are called XTerminals, guess why :)</li>
<li><b>DHCP</b>: DHCP is a protocol for automating the configuration of 
computers that use TCP/IP, used by ltsp to distribute IPs to the 
workstations.</li>
<li><b>NFS</b>: NFS is a protocol to allow access to harddisks through 
the network, used by ltsp to mount a base system for the 
workstations.</li>
<li><b>TFTP</b>: TFTP is a simple file transfer protocol, used by ltsp 
to transfer the kernel to the workstations.</li>
<li><b>XINETD</b>: Xinetd is a powerful replacement for inetd, with 
advanced features, used by ltsp to start tftp.</li>
</ul>

<note>
If you have the kde/gnome useflag set, it will also install a complete kde/gnome system.
</note>

</body>
</section>
</chapter>
<chapter>
<title>Configuration</title>
<body>

<p>
After the emerge process has finished all services must be configured:
</p>

</body>
<section>
<title>System Logger</title>
<body>

<p>
To analyze problems easier, the system logger must be configured to 
accept remote connections. Please read the documentation of your
system logger on how to achieve this.
</p>

</body>
</section>
<section>
<title>NFS</title>
<body>

<p>
Next step is to edit your <path>/etc/exports</path> file, in order to 
allow the workstations to mount the root filesystem. There should be at 
least two lines in it:
</p>

<pre caption="/etc/exports">
/opt/ltsp/i386             192.168.0.0/255.255.255.0(ro,no_root_squash,async)
/var/opt/ltsp/swapfiles    192.168.0.0/255.255.255.0(rw,no_root_squash,async)
</pre>

<note>
You have to alter the network/netmask to match your network/netmask 
settings.
</note>

<p>
Now start NFS.
</p>

<pre caption="Starting nfs">
# <i>rc-update add nfs default</i>
# <i>/etc/init.d/nfs start</i>
</pre>

</body>
</section>

<section>
<title>xinetd/tftp</title>
<body>

<p>
By default TFTP won't be started, to change this edit 
<path>/etc/xinetd.d/tftp</path> and replace <c>disable=yes</c> with 
<c>disable=no</c>. Afterwards, start xinitd.
</p>

<pre caption="Starting xinetd">
# <i>rc-update add xinetd default</i>
# <i>/etc/init.d/xinetd start</i>
</pre>

</body>
</section>
<section>
<title>Name resolving</title>
<body>

<p>
In order for the workstation to reach all resources, a correct name
resolving must be available. There are several ways to achieve this. One
is to configure a DNS server for the local network, the other (and more
simple) is to have almost identical <path>/etc/hosts</path> files on all
systems. We are going to use the latter.
</p>

<p>
All workstations must be listed in <path>/etc/hosts</path>. Take a look 
at the example:
</p> 

<pre caption="/etc/hosts">
127.0.0.1        localhost
192.168.0.254    server      server.yourdomain.com
192.168.0.1      ws-1        ws-1.yourdomain.com
</pre>

</body>
</section>
<section>
<title>DHCP Config</title>
<body>

<p>
This is the most complicated step in my opinion, you have to create a 
valid DHCP Config (<path>/etc/dhcp/dhcpd.conf</path>). Here is an 
example:
</p>

<pre caption = "dhcpd.conf">
<codenote>Some general options</codenote>
default-lease-time            21600;
max-lease-time                21600;
use-host-decl-names           on;
ddns-update-style             ad-hoc;

<codenote>Bootp options</codenote>
allow booting;
allow bootp;

<codenote>Network Options</codenote>
option subnet-mask            255.255.255.0;
option broadcast-address      192.168.0.255;
option routers                192.168.0.254;
option domain-name-servers    192.168.0.254;
option log-servers            192.168.0.254;
option domain-name            "yourdomain.com";

<codenote>LTSP Path Options</codenote>
option root-path              "192.168.0.254:/opt/ltsp/i386";
filename                      "/lts/vmlinuz-2.4.19-ltsp-1";

<codenote>If your workstations have ISA NICs uncomment the following</codenote>
<codenote>lines and alter the driver and IO</codenote>
#option option-128 code 128 = string;
#option option-129 code 129 = text;
#option option-128 e4:45:74:68:00:00;
#option option-129 "NIC=ne IO=0x300";

shared-network WORKSTATIONS {
  subnet 192.168.0.0 netmask 255.255.255.0 {
    <codenote>Distribute dynamic IPs to the workstations</codenote>
    range dynamic-bootp 192.168.1.1 192.168.1.16;
    <codenote>Workstation specific configuration for PXE booting</codenote>
    #host ws001 {
    #  hardware ethernet     00:E0:06:E8:00:84;
    #  fixed-address         192.168.0.1;
    #}
  }
}
</pre>

<p>
If your workstations support PXE, you should list each one of them as we
have done with <e>host ws001</e> (don't forget to uncomment it). Don't
give them an adress in the dynamic range, otherwise it would be possible
that more workstations have the same IP (which is troublesome).
</p>

<p>
For more documentation on this item read the official dhcp handbook: 
<uri>http://www.dhcp-handbook.com/</uri>
</p>

<p>
Now start DHCP as you did with NFS and xinetd:
</p>

<pre caption="start xinetd">
# <i>rc-update add dhcp default</i>
# <i>/etc/init.d/dhcp start</i>
</pre>

<note>
Note: DHCPD needs CONFIG_PACKET and CONFIG_FILTER activated in the kernel to work.
</note>

</body>
</section>

<section>
<title>LTSP Configuration</title>
<body>

<p>
There are many options to configure your workstations, visit 
<uri>http://www.ltsp.org/documentation/ltsp-3.0-4-en.html#AEN903</uri> 
for a full description of <path>/opt/ltsp/i386/etc/lts.conf</path>.
</p>

</body>
</section>

<section>
<title>Displaymanager</title>
<body>

<p>
Now you have to change your displaymanager's configuration to 
also accept remote connections.
</p>

<p>
<b>XDM</b>: In <path>/etc/X11/xdm/xdm-config</path> comment out <c>DisplayManager.requestPort: 0</c>
</p>

<p>
<b>KDM</b>: In <path>/usr/kde/3.1/share/config/kdm/kdmrc</path> look 
for the <c>[Xdmcp]</c> section and change <c>Enable = false</c> to 
<c>Enable = true</c>.
</p>

<p>
<b>GDM</b>: In <path>/etc/X11/gdm/gdm.conf</path> look for the 
<c>[xdmcp]</c> section and change <c>Enable = false</c> to 
<c>Enable = True</c>.
</p>

<p>
Then start the displaymanager:
</p>

<pre caption="Starting xdm">
# <i>rc-update add xdm default</i>
# <i>/etc/init.d/xdm start</i>
</pre>

<warn>
There seem to be problems currently with XDM and GDM. The author used
KDM to resolve these issues.
</warn>

</body>
</section>

<section>
<title>Creating a bootfloppy</title>
<body>

<p>
If you workstations don't support PXE booting, you must create a 
boot-floppy, which is needed to start your workstations. Go to 
<uri>http://www.rom-o-matic.net/5.0.9/</uri>, select your NIC, press 
<e>Get ROM</e> and write the image to a floppy:
</p>

<pre caption="Write floppy iamge">
# <i>cat nicfile.lzdsk > /dev/fd0</i>
</pre>

</body>
</section>
</chapter>

<chapter>
<title>Troubleshooting</title>
<body>

<p>
There are a lot of things that can be the source of trouble, but there 
are also several resources around which help you solve your problems:
</p>

<ul>
<li>The official documentation: 
<uri>http://www.ltsp.org/documentation/</uri>, especially the 
Troubleshooting section.</li>
<li>The gentoo IRC channel: irc.freenode.org #gentoo</li>
<li>The ltsp irc channel: irc.freenode.org #ltsp</li>
<li>The ltsp mailinglists <uri>http://ltsp.org/mailinglists.php</uri> 
are full of some real good knowledge.</li>
</ul>
</body>
</chapter>

<chapter>
<title>FAQ</title>
<body>
<p>
<b>Q:</b> My workstations have Pentium II CPUs, but my server is compiled 
with <c>march=athlon-xp</c>, does this work?
</p>

<p>
<b>A:</b> This is no problem, because all applications run on the server.
</p>

<p>
<b>Q:</b> Which CPU and how much RAM should the server have?
</p>

<p>
<b>A:</b> There is a good document with suggestions at 
<uri>http://ltsp.org/documentation/server_suggestions.html</uri>.
</p>

<p>
<b>Q:</b> Do you have more information about this PXE stuff?
</p>

<p>
<b>A:</b> Yes, take a look at 
<uri>http://ltsp.org/documentation/eproms.txt</uri>
and <uri>http://ltsp.org/documentation/pxe.howto.html</uri>.
</p>

<p>
<b>Q:</b> Is it possibly to use 3D-Accelerated software on the workstations?
</p>

<p>
<b>A:</b> If you are using NVidia cards take a look at 
<uri>http://ltsp.org/documentation/nvidia.txt</uri>.
</p>

<p>
<b>Q:</b> In some applications the fonts look crapy, what do to?
</p>

<p>
<b>A:</b> You have to setup the XFontServer, Add <c>USE_XFS=Y</c> to your 
<path>lts.conf</path>, edit <path>/etc/X11/fs/config</path> and comment 
<c>no-listen: tcp</c> out, replace <c>XFS_PORT="-1"</c> with 
<c>XFS_PORT="7100"</c> in <path>/etc/conf.d/xfs</path> and start xfs: 
<c>/etc/init.d/xfs start</c>.
</p>

</body>
</chapter>
</guide>
