aboutsummaryrefslogtreecommitdiff
path: root/en_US.ISO8859-1/articles/diskless-x/article.sgml
blob: e2e1707d8df5aa045c0ff64f848ea8916fbc9454 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
<?xml version="1.0" encoding="ISO8859-1" standalone="no"?>
<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook XML V4.2-Based Extension//EN"
	"../../../share/sgml/freebsd42.dtd" [
<!ENTITY % entities PUBLIC "-//FreeBSD//ENTITIES DocBook FreeBSD Entity Set//EN" "../../share/sgml/entities.ent">
%entities;
]>

<!--
     The FreeBSD Documentation Project

     $FreeBSD$
-->

<article lang='en'>
  <articleinfo>
    <title>Diskless X Server: a how to guide</title>
    
    <authorgroup>
      <author>
	<firstname>Jerry</firstname>
	<surname>Kendall</surname>
	<affiliation>
	  <address>
	    <email>jerry@kcis.com</email>
	  </address>
	</affiliation>
      </author></authorgroup>
    
    <pubdate>28-December-1996</pubdate>

    <releaseinfo>$FreeBSD$</releaseinfo>
    
    <copyright>
      <year>1996</year>
      <holder>Jerry Kendall</holder>
    </copyright>
    
    <legalnotice id="trademarks" role="trademarks">
      &tm-attrib.freebsd;
      &tm-attrib.3com;
      &tm-attrib.microsoft;
      &tm-attrib.sun;
      &tm-attrib.general;
    </legalnotice>

    <abstract>
      <para>With the help of some friends on the FreeBSD-hackers list, I have
	been able to create a diskless X terminal.  The creation of the X
	terminal required first creating a diskless system with minimal
	utilities mounted via NFS.  These same steps were used to create 2
	separate diskless systems.  The first is <hostid
	  role="fqdn">altair.example.com</hostid>.  A diskless X terminal that I
	run on my old 386DX-40.  It has a 340Meg hard disk but, I did not want
	to change it.  So, it boots from <hostid
	  role="fqdn">antares.example.com</hostid> across a Ethernet.  The second
	system is a 486DX2-66.  I set up a diskless FreeBSD (complete) that
	uses no local disk.  The server in that case is a Sun 670MP running
	&sunos; 4.1.3.  The same setup configuration was needed for both.</para>
      
      <para>I am sure that there is stuff that needs to be added
	to this.  Please send me any comments.</para>
    </abstract>
  </articleinfo>
  
  <sect1>
    <title>Creating the boot floppy (On the diskless system)</title>
    
    <para>Since the network boot loaders will not work with some of the TSR's
      and such that &ms-dos; uses, it is best to create a dedicated boot floppy
      or, if you can, create an &ms-dos; menu that will (via the
      <filename>config.sys</filename>/<filename>autoexec.bat</filename> files)
      ask what configuration to load when the system starts.  The later is the
      method that I use and it works great. My &ms-dos; (6.x) menu is
      below.</para>
    
    <example>
      <title><filename>config.sys</filename></title>

      <programlisting>[menu]
menuitem=normal, normal
menuitem=unix, unix
[normal]
....
normal config.sys stuff
...
[unix]</programlisting>
    </example>

    <example>
      <title><filename>autoexec.bat</filename></title>

      <programlisting>@ECHO OFF
goto %config%

:normal
...
normal autoexec.bat stuff
...
goto end

:unix
cd \netboot
nb8390.com

:end</programlisting>
    </example>
  </sect1>
  
  <sect1>
    <title>Getting the network boot programs (On the server)</title>
    
    <para>Compile the <quote>net-boot</quote> programs that are located in
      <filename>/usr/src/sys/i386/boot/netboot</filename>.  You should read
      the comments at the top of the <filename>Makefile</filename>.  Adjust as
      required.  Make a backup of the original in case something goes wrong.  When
      the build is done, there should be 2 &ms-dos; executables,
      <filename>nb8390.com</filename> and <filename>nb3c509.com</filename>.
      One of these two programs will be what you need to run on the diskless
      server.  It will load the kernel from the boot server.  At this point,
      put both programs on the &ms-dos; boot floppy created earlier.</para>
  </sect1>
  
  <sect1>
    <title>Determine which program to run (On the diskless system)</title>
    
    <para>If you know the chipset that your Ethernet adapter uses, this is
      easy.  If you have the NS8390 chipset, or a NS8390 based chipset, use
      <filename>nb8390.com</filename>.  If you have a &tm.3com; 509 based chipset,
      use the <filename>nb3C509.com</filename> boot program.  If you are not
      sure which you have, try using one, if it says <errorname>No adapter
	found</errorname>, try the other.  Beyond that, you are pretty much on
      your own.</para>
  </sect1>

  <sect1>
    <title>Booting across the network</title>
    
    <para>Boot the diskless system with out any config.sys/autoexec.bat
      files.  Try running the boot program for your Ethernet adapter.</para>

    <para>My Ethernet adapter is running in WD8013 16bit mode so I run
      <filename>nb8390.com</filename></para>
    
    <screen><prompt>C:&gt;</prompt> <userinput>cd \netboot</userinput>
<prompt>C:&gt;</prompt> <userinput>nb8390</userinput>

<prompt>Boot from Network (Y/N) ?</prompt>  <userinput>Y</userinput>

BOOTP/TFTP/NFS bootstrap loader     ESC for menu

Searching for adapter..
WD8013EBT base 0x0300, memory 0x000D8000, addr 00:40:01:43:26:66

Searching for server...</screen>

    <para>At this point, my diskless system is trying to find a machine to act
      as a boot server.  Make note of the <literal>addr</literal> line above,
      you will need this number later.  Reset the diskless system and modify
      your <filename>config.sys</filename> and
      <filename>autoexec.bat</filename> files to do these steps automatically
      for you.  Perhaps in a menu.  If you had to run
      <command>nb3c509.com</command> instead of <command>nb8390.com</command>
      the output is the same as above.  If you got <errorname>No adapter
	found</errorname> at the <literal>Searching for adapter...</literal>
      message, verify that you did indeed set the compile time defines in the
      <filename>Makefile</filename> correctly.</para>
  </sect1>
  
  <sect1>
    <title>Allowing systems to boot across the network (On the server)</title>
    
    <para>Make sure the <filename>/etc/inetd.conf</filename> file has entries
      for tftp and bootps. Mine are listed below:</para>
    
    <programlisting>tftp	dgram	udp	wait	nobody	/usr/libexec/tftpd	tftpd /tftpboot
#
# Additions by who ever you are
bootps  dgram  udp  wait  root  /usr/libexec/bootpd bootpd /etc/bootptab</programlisting>
    
    <para>If you have to change the <filename>/etc/inetd.conf</filename> file,
      send a <literal>HUP</literal> signal to &man.inetd.8;.  To do this, get the
      process ID of <command>inetd</command> with <command>ps -ax | grep inetd | grep -v
	grep</command>.  Once you have it, send it a <literal>HUP</literal> signal.  Do this by
      <command>kill -HUP &lt;pid&gt;</command>.  This will force <command>inetd</command> to
      re-read its config file.</para>

    <para>Did you remember to note the <literal>addr</literal> line from the
      output of the boot loader on the diskless system? Guess what, here is
      where you need it.</para>

    <para>Add an entry to <filename>/etc/bootptab</filename> (maybe creating the
      file).  It should be laid out identical to this:</para>

    <programlisting>altair:\
        :ht=ether:\
        :ha=004001432666:\
        :sm=255.255.255.0:\
        :hn:\
        :ds=199.246.76.1:\
        :ip=199.246.76.2:\
        :gw=199.246.76.1:\
        :vm=rfc1048:</programlisting>
    
    <para>The lines are as follows:</para>

    <informaltable frame="none" pgwide="1">
      <tgroup cols="2">
	<tbody>
	  <row>
	    <entry><literal>altair</literal></entry>
	    <entry>the diskless systems name without the domain name.</entry>
	  </row>

	  <row>
	    <entry><literal>ht=ether</literal></entry>
	    <entry>the hardware type of <quote>ethernet</quote>.</entry>
	  </row>

	  <row>
	    <entry><literal>ha=004001432666</literal></entry>
	    <entry>the hardware address (the number noted above).</entry>
	  </row>

	  <row>
	    <entry><literal>sm=255.255.255.0</literal></entry>
	    <entry>the subnet mask.</entry>
	  </row>

	  <row>
	    <entry><literal>hn</literal></entry>
	    <entry>tells server to send client's hostname to the
	      client.</entry>
	  </row>

	  <row>
	    <entry><literal>ds=199.246.76.1</literal></entry>
	    <entry>tells the client who the domain server is.</entry>
	  </row>

	  <row>
	    <entry><literal>ip=199.246.76.2</literal></entry>
	    <entry>tells the client what its IP address is.</entry>
	  </row>

	  <row>
	    <entry><literal>gw=199.246.76.1</literal></entry>
	    <entry>tells the client what the default gateway is.</entry>
	  </row>

	  <row>
	    <entry><literal>vm=...</literal></entry>
	    <entry>just leave it there.</entry>
	  </row>
	</tbody>
      </tgroup>
    </informaltable>

    <note>
      <para>Be sure to set up the IP addresses correctly, the addresses above
	are my own.</para>
    </note>

    <para>Create the directory <filename>/tftpboot</filename> on the server it will contain the
      configuration files for the diskless systems that the server will serve.
      These files will be named <filename>cfg.<replaceable>ip</replaceable></filename> where <replaceable>ip</replaceable> is the IP
      address of the diskless system.  The config file for <hostid>altair</hostid> is
      <filename>/tftpboot/cfg.199.246.76.2</filename>.  The contents is:</para>

    <programlisting>rootfs 199.246.76.1:/DiskLess/rootfs/altair
hostname altair.example.com</programlisting>

    <para>The line <literal>hostname altair.example.com</literal> simply tells
      the diskless system what its fully qualified domain name is.</para>

    <para>The line <literal>rootfs
	199.246.76.1:/DiskLess/rootfs/altair</literal> tells the diskless
      system where its NFS mountable root filesystem is located.</para>

    <note>
      <para>The NFS mounted root filesystem will be mounted <emphasis>read
	  only</emphasis>.</para>
    </note>
    
    <para>The hierarchy for the diskless system can be re-mounted allowing
      read-write operations if required.</para>
    
    <para>I use my spare 386DX-40 as a dedicated X terminal.</para>

    <para>The hierarchy for <hostid>altair</hostid> is:</para>

    <literallayout>/
/bin
/etc
/tmp
/sbin
/dev
/dev/fd
/usr
/var
/var/run</literallayout>

    <para>The actual list of files is:</para>

    <screen>-r-xr-xr-x  1 root  wheel  779984 Dec 11 23:44 ./kernel
-r-xr-xr-x  1 root    bin  299008 Dec 12 00:22 ./bin/sh
-rw-r--r--  1 root  wheel     499 Dec 15 15:54 ./etc/rc
-rw-r--r--  1 root  wheel    1411 Dec 11 23:19 ./etc/ttys
-rw-r--r--  1 root  wheel     157 Dec 15 15:42 ./etc/hosts
-rw-r--r--  1 root    bin    1569 Dec 15 15:26 ./etc/XF86Config.altair
-r-x------  1 bin     bin  151552 Jun 10  1995 ./sbin/init
-r-xr-xr-x  1 bin     bin  176128 Jun 10  1995 ./sbin/ifconfig
-r-xr-xr-x  1 bin     bin  110592 Jun 10  1995 ./sbin/mount_nfs
-r-xr-xr-x  1 bin     bin  135168 Jun 10  1995 ./sbin/reboot
-r-xr-xr-x  1 root    bin   73728 Dec 13 22:38 ./sbin/mount
-r-xr-xr-x  1 root  wheel    1992 Jun 10  1995 ./dev/MAKEDEV.local
-r-xr-xr-x  1 root  wheel   24419 Jun 10  1995 ./dev/MAKEDEV</screen>
    
    <para>If you are not using &man.devfs.5; (which is the default
      in FreeBSD&nbsp;5.X), you should make sure that you
      do not forget to run <command>MAKEDEV all</command> in the
      <filename>dev</filename> directory.</para>

    <para>My <filename>/etc/rc</filename> for <hostid>altair</hostid>
      is:</para>

<programlisting>#!/bin/sh
#
PATH=/bin:/
export PATH
#
# configure the localhost
/sbin/ifconfig lo0 127.0.0.1
#
# configure the ethernet card
/sbin/ifconfig ed0 199.246.76.2 netmask 0xffffff00
#
# mount the root filesystem via NFS
/sbin/mount antares:/DiskLess/rootfs/altair /
#
# mount the /usr filesystem via NFS
/sbin/mount antares:/DiskLess/usr /usr
#
/usr/X11R6/bin/XF86_SVGA -query antares -xf86config /etc/XF86Config.altair > /dev/null 2>&amp;1
#
# Reboot after X exits
/sbin/reboot
#
# We blew up....
exit 1</programlisting>

    <para>Any comments and all questions welcome.</para>
  </sect1>
</article>

<!-- 
     Local Variables:
     mode: sgml
     sgml-indent-data: t
     sgml-omittag: nil
     sgml-always-quote-attributes: t
     End:
-->