1 |
<?xml version='1.0' encoding="UTF-8"?> |
2 |
<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/ltsp.xml,v 1.22 2008/09/28 20:29:25 nightmorph Exp $ --> |
3 |
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> |
4 |
|
5 |
<guide> |
6 |
<title>Gentoo - LTSP Guide</title> |
7 |
<author title="Author"> |
8 |
<mail link="lanius@gentoo.org">Heinrich Wendel</mail> |
9 |
</author> |
10 |
<author title="Author"> |
11 |
<mail link="josiah@ritchietribe.net">Josiah Ritchie</mail> |
12 |
</author> |
13 |
<author title="Editor"> |
14 |
<mail link="swift@gentoo.org">Sven Vermeulen</mail> |
15 |
</author> |
16 |
|
17 |
<abstract> |
18 |
This guide shows you how to setup a LTSP Server with Gentoo. |
19 |
</abstract> |
20 |
|
21 |
<license/> |
22 |
|
23 |
<version>1.14</version> |
24 |
<date>2008-09-28</date> |
25 |
|
26 |
<chapter> |
27 |
<title>Introduction</title> |
28 |
<section> |
29 |
<title>What is LTSP?</title> |
30 |
<body> |
31 |
|
32 |
<p> |
33 |
LTSP is an abbreviation for "Linux Terminal Server Project". Installed |
34 |
on a server it can supply many workstations (so called thin-clients) |
35 |
with identical environments. All applications run on the server and |
36 |
therefore you can use old PCs and convert them into XTerminals. This |
37 |
reduces costs and maintenance especially in an environment where you |
38 |
need to have an uniform workspace on each computer you login, e.g. in |
39 |
schools or firms. |
40 |
</p> |
41 |
|
42 |
</body> |
43 |
</section> |
44 |
</chapter> |
45 |
|
46 |
<chapter> |
47 |
<title>Installation</title> |
48 |
<section> |
49 |
<title>Preliminaries</title> |
50 |
<body> |
51 |
|
52 |
<p> |
53 |
All of the examples in this document presume that your server's IP is |
54 |
192.168.0.254, your domain is named yourdomain.com and your network is |
55 |
192.168.0.0/24. |
56 |
</p> |
57 |
|
58 |
</body> |
59 |
</section> |
60 |
<section> |
61 |
<title>Installation</title> |
62 |
<body> |
63 |
|
64 |
<p> |
65 |
First of all, you must have a working Gentoo system. Please read the |
66 |
Gentoo Installation Manual for your architecture on <uri |
67 |
link="http://www.gentoo.org/doc">Gentoo's Documentation Website</uri>. |
68 |
</p> |
69 |
|
70 |
<p> |
71 |
Then lets begin with the easiest step, installing the ltsp package: |
72 |
</p> |
73 |
|
74 |
<pre caption="Emerge LTSP"> |
75 |
# <i>emerge ltsp</i> |
76 |
</pre> |
77 |
|
78 |
<p> |
79 |
This will install the following packages as dependencies: |
80 |
</p> |
81 |
|
82 |
<ul> |
83 |
<li><b>XFree</b>: They are called XTerminals, guess why :)</li> |
84 |
<li> |
85 |
<b>DHCP</b>: DHCP is a protocol for automating the configuration of |
86 |
computers that use TCP/IP, used by ltsp to distribute IPs to the |
87 |
workstations. |
88 |
</li> |
89 |
<li> |
90 |
<b>NFS</b>: NFS is a protocol to allow access to harddisks through |
91 |
the network, used by ltsp to mount a base system for the |
92 |
workstations. |
93 |
</li> |
94 |
<li> |
95 |
<b>TFTP</b>: TFTP is a simple file transfer protocol, used by ltsp |
96 |
to transfer the kernel to the workstations. |
97 |
</li> |
98 |
<li> |
99 |
<b>XINETD</b>: Xinetd is a powerful replacement for inetd, with |
100 |
advanced features, used by ltsp to start tftp. |
101 |
</li> |
102 |
</ul> |
103 |
|
104 |
<note> |
105 |
If you have the kde/gnome useflag set, it will also install a complete kde/gnome |
106 |
system. |
107 |
</note> |
108 |
|
109 |
</body> |
110 |
</section> |
111 |
</chapter> |
112 |
|
113 |
<chapter> |
114 |
<title>Configuration</title> |
115 |
<section> |
116 |
<body> |
117 |
|
118 |
<p> |
119 |
After the emerge process has finished all services must be configured: |
120 |
</p> |
121 |
|
122 |
</body> |
123 |
</section> |
124 |
<section> |
125 |
<title>System Logger</title> |
126 |
<body> |
127 |
|
128 |
<p> |
129 |
To analyze problems easier, the system logger must be configured to |
130 |
accept remote connections. Please read the documentation of your |
131 |
system logger on how to achieve this. If, for example, you are using |
132 |
sysklogd, all you need to do is edit <path>/etc/conf.d/sysklogd</path> and add |
133 |
"-r" to the SYSLOGD line: |
134 |
</p> |
135 |
|
136 |
<pre caption="/etc/conf.d/sysklogd"> |
137 |
SYSLOGD="-m 0 -r" |
138 |
KLOGD="-c 3 -2" |
139 |
</pre> |
140 |
|
141 |
</body> |
142 |
</section> |
143 |
<section> |
144 |
<title>NFS</title> |
145 |
<body> |
146 |
|
147 |
<p> |
148 |
Next step is to edit your <path>/etc/exports</path> file, in order to |
149 |
allow the workstations to mount the root filesystem. There should be at |
150 |
least two lines in it: |
151 |
</p> |
152 |
|
153 |
<pre caption="/etc/exports"> |
154 |
/opt/ltsp-4.1/i386 192.168.0.0/255.255.255.0(ro,no_root_squash,async) |
155 |
/var/opt/ltsp/swapfiles 192.168.0.0/255.255.255.0(rw,no_root_squash,async) |
156 |
</pre> |
157 |
|
158 |
<note> |
159 |
You have to alter the network/netmask to match your network/netmask |
160 |
settings. |
161 |
</note> |
162 |
|
163 |
<p> |
164 |
Now start NFS. |
165 |
</p> |
166 |
|
167 |
<pre caption="Starting nfs"> |
168 |
# <i>rc-update add nfs default</i> |
169 |
# <i>/etc/init.d/nfs start</i> |
170 |
</pre> |
171 |
|
172 |
</body> |
173 |
</section> |
174 |
<section> |
175 |
<title>xinetd/tftp</title> |
176 |
<body> |
177 |
<p> |
178 |
TFTP requires a bit of configuring to get it to work properly. First, edit |
179 |
<path>/etc/conf.d/in.tftpd</path> to set tftpd's options and path correctly: |
180 |
</p> |
181 |
|
182 |
<pre caption="/etc/conf.d/in.tftpd"> |
183 |
INTFTPD_PATH="/tftpboot" |
184 |
INTFTPD_OPTS="-s ${INTFTPD_PATH}" |
185 |
</pre> |
186 |
|
187 |
<p> |
188 |
The -s flag specifies that TFTP is to run in secure chrooted mode |
189 |
(recommended). This means that you don't need to include the |
190 |
<path>/tftpboot</path> path for example in the DHCP configuration. |
191 |
</p> |
192 |
|
193 |
<p> |
194 |
Next, configure xinetd to run TFTP and allow remote connections. By default |
195 |
TFTP won't be started by xinetd, so edit <path>/etc/xinetd.d/tftp</path> and |
196 |
replace <c>disable=yes</c> with <c>disable=no</c>. If the file is missing just |
197 |
go ahead and create <path>/etc/xinetd.d/tftp</path> with the contents below. |
198 |
</p> |
199 |
|
200 |
<pre caption="/etc/xinetd.d/tftp"> |
201 |
service tftp |
202 |
{ |
203 |
disable = no |
204 |
socket_type = dgram |
205 |
protocol = udp |
206 |
wait = yes |
207 |
user = root |
208 |
server = /usr/sbin/in.tftpd |
209 |
server_args = -s /tftpboot |
210 |
} |
211 |
</pre> |
212 |
|
213 |
<p> |
214 |
Now edit <path>/etc/xinetd.conf</path> and comment out the line <c>only_from = |
215 |
localhost</c> by prefacing it with a <c>#</c>. Finally, start xinetd. |
216 |
</p> |
217 |
|
218 |
<pre caption="Starting xinetd"> |
219 |
# <i>rc-update add xinetd default</i> |
220 |
# <i>/etc/init.d/xinetd start</i> |
221 |
</pre> |
222 |
|
223 |
</body> |
224 |
</section> |
225 |
<section> |
226 |
<title>Name resolving</title> |
227 |
<body> |
228 |
|
229 |
<p> |
230 |
In order for the workstation to reach all resources, a correct name |
231 |
resolving must be available. There are several ways to achieve this. One |
232 |
is to configure a DNS server for the local network, the other (and more |
233 |
simple) is to have almost identical <path>/etc/hosts</path> files on all |
234 |
systems. We are going to use the latter. |
235 |
</p> |
236 |
|
237 |
<p> |
238 |
All workstations must be listed in <path>/etc/hosts</path>. Take a look |
239 |
at the example: |
240 |
</p> |
241 |
|
242 |
<pre caption="/etc/hosts"> |
243 |
127.0.0.1 localhost |
244 |
192.168.0.254 server server.yourdomain.com |
245 |
192.168.0.1 ws001 ws001.yourdomain.com |
246 |
</pre> |
247 |
|
248 |
</body> |
249 |
</section> |
250 |
<section> |
251 |
<title>DHCP Config</title> |
252 |
<body> |
253 |
|
254 |
<p> |
255 |
This is the most complicated step in my opinion, you have to create a |
256 |
valid DHCP Config (<path>/etc/dhcp/dhcpd.conf</path>). Here is an |
257 |
example: |
258 |
</p> |
259 |
|
260 |
<pre caption = "dhcpd.conf"> |
261 |
<comment>(Some general options)</comment> |
262 |
default-lease-time 21600; |
263 |
max-lease-time 21600; |
264 |
use-host-decl-names on; |
265 |
ddns-update-style ad-hoc; |
266 |
|
267 |
<comment>(Bootp options)</comment> |
268 |
allow booting; |
269 |
allow bootp; |
270 |
|
271 |
<comment>(Network Options)</comment> |
272 |
option subnet-mask 255.255.255.0; |
273 |
option broadcast-address 192.168.0.255; |
274 |
option routers 192.168.0.254; |
275 |
option domain-name-servers 192.168.0.254; |
276 |
option log-servers 192.168.0.254; |
277 |
option domain-name "yourdomain.com"; |
278 |
|
279 |
<comment>(LTSP Path Options)</comment> |
280 |
option root-path "192.168.0.254:/opt/ltsp-4.1/i386"; |
281 |
filename "/lts/vmlinuz-2.4.26-ltsp-2"; |
282 |
<comment>(Address of the tftp server to download the ltsp file from)</comment> |
283 |
next-server 192.168.0.254; |
284 |
|
285 |
<comment>(If your workstations have ISA NICs uncomment the following)</comment> |
286 |
<comment>(lines and alter the driver and IO)</comment> |
287 |
#option option-128 code 128 = string; |
288 |
#option option-129 code 129 = text; |
289 |
#option option-128 e4:45:74:68:00:00; |
290 |
#option option-129 "NIC=ne IO=0x300"; |
291 |
|
292 |
shared-network WORKSTATIONS { |
293 |
subnet 192.168.0.0 netmask 255.255.255.0 { |
294 |
<comment>(Distribute dynamic IPs to the workstations)</comment> |
295 |
range dynamic-bootp 192.168.0.1 192.168.0.16; |
296 |
<comment>(Workstation specific configuration for PXE booting)</comment> |
297 |
#host ws001 { |
298 |
# hardware ethernet 00:E0:06:E8:00:84; |
299 |
# fixed-address 192.168.0.1; |
300 |
#} |
301 |
} |
302 |
} |
303 |
</pre> |
304 |
|
305 |
<p> |
306 |
If your workstations support PXE, you should list each one of them as we |
307 |
have done with <e>host ws001</e> (don't forget to uncomment it). Don't |
308 |
give them an adress in the dynamic range, otherwise it would be possible |
309 |
that more workstations have the same IP (which is troublesome). Remember, |
310 |
if you cut-n-paste the above example, replace any "//" comments with "##", |
311 |
or else dhcp will fail to start. |
312 |
</p> |
313 |
|
314 |
<p> |
315 |
For more documentation on this item read the official dhcp handbook: |
316 |
<uri>http://www.dhcp-handbook.com/</uri> |
317 |
</p> |
318 |
|
319 |
<p> |
320 |
Now start DHCP as you did with NFS and xinetd: |
321 |
</p> |
322 |
|
323 |
<pre caption="start dhcp"> |
324 |
# <i>rc-update add dhcp default</i> |
325 |
# <i>/etc/init.d/dhcp start</i> |
326 |
</pre> |
327 |
|
328 |
<note> |
329 |
DHCPD needs CONFIG_PACKET and CONFIG_FILTER activated in the kernel to work. |
330 |
</note> |
331 |
|
332 |
</body> |
333 |
</section> |
334 |
<section> |
335 |
<title>LTSP Configuration</title> |
336 |
<body> |
337 |
|
338 |
<p> |
339 |
There are many options to configure your workstations, visit |
340 |
<uri>http://ltsp.mirrors.tds.net/pub/ltsp/docs/ltsp-4.1-en.html#AEN1190</uri> |
341 |
for a full description of <path>/opt/ltsp/i386/etc/lts.conf</path>. |
342 |
</p> |
343 |
|
344 |
<p> |
345 |
As a few suggestions to get started, you will want to first copy |
346 |
<path>/opt/ltsp/i386/etc/lts.conf.example</path> to |
347 |
<path>/opt/ltsp/i386/etc/lts.conf</path> and edit it from there. You may want |
348 |
to try changing the <c>SCREEN_01</c> option to read <c>SCREEN_01 = startx</c>. |
349 |
To use a USB mouse on the remote client, add the following MODULE lines, and |
350 |
change the X_MOUSE_* lines as follows: |
351 |
</p> |
352 |
|
353 |
<pre caption="/opt/ltsp/i386/etc/lts.conf"> |
354 |
MODULE_01 = usb-uhci |
355 |
MODULE_02 = mousedev |
356 |
MODULE_03 = usbmouse |
357 |
X_MOUSE_PROTOCOL = "IMPS/2" |
358 |
X_MOUSE_DEVICE = "/dev/input/mice" |
359 |
</pre> |
360 |
|
361 |
</body> |
362 |
</section> |
363 |
<section> |
364 |
<title>Displaymanager</title> |
365 |
<body> |
366 |
|
367 |
<p> |
368 |
Now you have to change your displaymanager's configuration to |
369 |
also accept remote connections. |
370 |
</p> |
371 |
|
372 |
<p> |
373 |
First change your <path>/etc/X11/xdm/Xaccess</path> file, |
374 |
uncomment the following line: |
375 |
</p> |
376 |
|
377 |
<pre caption="/etc/X11/xdm/Xaccess"> |
378 |
#* #any host can get a login window |
379 |
</pre> |
380 |
|
381 |
<p> |
382 |
Now change the configuration of the displaymanager you use: |
383 |
</p> |
384 |
|
385 |
<p> |
386 |
<b>XDM</b>: In <path>/etc/X11/xdm/xdm-config</path> comment out |
387 |
<c>DisplayManager.requestPort: 0</c> |
388 |
</p> |
389 |
|
390 |
<p> |
391 |
<b>KDM</b>: In <path>/usr/kde/3.1/share/config/kdm/kdmrc</path> look |
392 |
for the <c>[Xdmcp]</c> section and change <c>Enable = false</c> to |
393 |
<c>Enable = true</c>. |
394 |
</p> |
395 |
|
396 |
<p> |
397 |
<b>GDM</b>: In <path>/etc/X11/gdm/gdm.conf</path> look for the |
398 |
<c>[xdmcp]</c> section and change <c>Enable = false</c> to |
399 |
<c>Enable = True</c>. |
400 |
</p> |
401 |
|
402 |
<p> |
403 |
Then start the displaymanager: |
404 |
</p> |
405 |
|
406 |
<pre caption="Starting xdm"> |
407 |
# <i>rc-update add xdm default</i> |
408 |
# <i>/etc/init.d/xdm start</i> |
409 |
</pre> |
410 |
|
411 |
<warn> |
412 |
There seem to be problems currently with XDM and GDM. The author used |
413 |
KDM to resolve these issues. |
414 |
</warn> |
415 |
|
416 |
<p> |
417 |
Remember, if your display manager is already running, restarting the X server |
418 |
via CTRL-ALT-BACKSPACE doesn't restart the display manager. |
419 |
</p> |
420 |
|
421 |
</body> |
422 |
</section> |
423 |
<section> |
424 |
<title>Creating a bootfloppy</title> |
425 |
<body> |
426 |
|
427 |
<p> |
428 |
If your workstations don't support PXE booting, you can create a boot-floppy |
429 |
which is used to start your workstations and connect to the terminal server. |
430 |
Go to <uri>http://www.rom-o-matic.net</uri>, select the latest version, select |
431 |
your NIC, press <e>Get ROM</e> and write the image to a floppy: |
432 |
</p> |
433 |
|
434 |
<pre caption="Write floppy image"> |
435 |
# <i>cat nicfile.zdsk > /dev/fd0</i> |
436 |
</pre> |
437 |
|
438 |
</body> |
439 |
</section> |
440 |
</chapter> |
441 |
|
442 |
<chapter> |
443 |
<title>Troubleshooting</title> |
444 |
<section> |
445 |
<body> |
446 |
|
447 |
<p> |
448 |
There are a lot of things that can be the source of trouble, but there |
449 |
are also several resources around which help you solve your problems: |
450 |
</p> |
451 |
|
452 |
<ul> |
453 |
<li> |
454 |
The official documentation: |
455 |
<uri>http://wiki.ltsp.org/twiki/bin/view/Ltsp/Documentation</uri>, |
456 |
especially the |
457 |
<uri link="http://wiki.ltsp.org/twiki/bin/view/Ltsp/TroubleShooting"> |
458 |
Troubleshooting section</uri>. |
459 |
</li> |
460 |
<li> |
461 |
The gentoo IRC channel: <uri |
462 |
link="irc://irc.gentoo.org/gentoo">#gentoo</uri> |
463 |
</li> |
464 |
<li>The ltsp irc channel: irc.freenode.org #ltsp</li> |
465 |
<li> |
466 |
The ltsp mailinglists <uri>http://marc.info/?l=ltsp-discuss</uri> are full |
467 |
of some real good knowledge. |
468 |
</li> |
469 |
</ul> |
470 |
|
471 |
</body> |
472 |
</section> |
473 |
</chapter> |
474 |
|
475 |
<chapter> |
476 |
<title>FAQ</title> |
477 |
<section> |
478 |
<body> |
479 |
|
480 |
<p> |
481 |
<b>Q:</b> My workstations have Pentium II CPUs, but my server is compiled |
482 |
with <c>march=athlon-xp</c>, does this work? |
483 |
</p> |
484 |
|
485 |
<p> |
486 |
<b>A:</b> This is no problem, because all applications run on the server. |
487 |
</p> |
488 |
|
489 |
<p> |
490 |
<b>Q:</b> Which CPU and how much RAM should the server have? |
491 |
</p> |
492 |
|
493 |
<p> |
494 |
<b>A:</b> There is a good document with suggestions at |
495 |
<uri>http://wiki.ltsp.org/twiki/bin/view/Ltsp/ServerSizing</uri>. |
496 |
</p> |
497 |
|
498 |
<p> |
499 |
<b>Q:</b> Do you have more information about this PXE stuff? |
500 |
</p> |
501 |
|
502 |
<p> |
503 |
<b>A:</b> Yes, take a look at |
504 |
<uri>http://wiki.ltsp.org/twiki/bin/view/Ltsp/PXE</uri>. |
505 |
</p> |
506 |
|
507 |
<p> |
508 |
<b>Q:</b> Is it possibly to use 3D-Accelerated software on the workstations? |
509 |
</p> |
510 |
|
511 |
<p> |
512 |
<b>A:</b> If you are using NVidia cards take a look at |
513 |
<uri>http://wiki.ltsp.org/twiki/bin/view/Ltsp/NvidiaLtsp411</uri>. |
514 |
</p> |
515 |
|
516 |
<p> |
517 |
<b>Q:</b> In some applications the fonts look crappy, what to do? |
518 |
</p> |
519 |
|
520 |
<p> |
521 |
<b>A:</b> You have to setup the XFontServer, add <c>USE_XFS=Y</c> to your |
522 |
<path>lts.conf</path>, edit <path>/etc/X11/fs/config</path> and comment |
523 |
<c>no-listen: tcp</c> out, replace <c>XFS_PORT="-1"</c> with |
524 |
<c>XFS_PORT="7100"</c> in <path>/etc/conf.d/xfs</path> and start xfs: |
525 |
<c>/etc/init.d/xfs start</c>. Also doublecheck that |
526 |
<path>/etc/X11/XF86Config</path> (or <path>/etc/X11/xorg.conf</path>) contains |
527 |
<c>FontPath "unix/:7100"</c> in the Files-section. |
528 |
</p> |
529 |
|
530 |
<p> |
531 |
<b>Q: </b> How can I use the soundcard of my workstation? |
532 |
</p> |
533 |
|
534 |
<p> |
535 |
<b>A: </b> There is a ltsp-sound package in gentoo, for more instructions read |
536 |
the included <path>README</path> file. |
537 |
</p> |
538 |
|
539 |
</body> |
540 |
</section> |
541 |
</chapter> |
542 |
|
543 |
<chapter> |
544 |
<title>Glossary</title> |
545 |
<section> |
546 |
<body> |
547 |
|
548 |
<p> |
549 |
<b><uri link="http://www.ltsp.org">LTSP</uri></b> |
550 |
"The LTSP provides a simple way to utilize low cost workstations as either |
551 |
graphical or character based terminals on a GNU/Linux server." |
552 |
</p> |
553 |
|
554 |
<p> |
555 |
<b><uri link="http://www.webopedia.com/TERM/P/PXE.html">PXE</uri></b> |
556 |
"Short for Pre-Boot Execution Environment. Pronounced pixie, PXE is one of the |
557 |
components of Intel's WfM specification. It allows a workstation to boot from |
558 |
a server on a network prior to booting the operating system on the local hard |
559 |
drive. A PXE-enabled workstation connects its NIC to the LAN via a jumper, |
560 |
which keeps the workstation connected to the network even when the power is |
561 |
off." |
562 |
</p> |
563 |
|
564 |
</body> |
565 |
</section> |
566 |
</chapter> |
567 |
</guide> |