xdm and diskless.

Eduardo Viruena Silva mrspock at esfm.ipn.mx
Sat Apr 26 00:09:40 PDT 2003


Hello List!

Some days ago I sent a question about not having any
messages during the booting time in a diskless system.

Somebody asked me how I had made my diskless system
display a login dialog using xdm.

I lost that message, and I don't know who sent it
[late at night you are able to do anything], so, I'm
sending the answer to this list in the hope of
reaching the person who wrote to me.

======

The following supposes you are running FreeBSD 5.0-RELEASE
in the diskless and server computers.  XFree86-4.2
is installed in the server, and its directories are share
to the diskless clients.

The diskless system is set.  The server lends its /usr
directory to the diskless client and we suppose the
server is not running xdm yet.

We are supposing also that X in configured in the server,
We are also supposing that your X configuration file [XF86config]
is in the /etc/X11 directory, don't keep this file in /usr/X11R6/lib/X11
because if you are sharing your /usr directory to your
diskless systems systems will try to use this file,
and we are not sure that the server and the diskless systems
have the same X configuration.


PART I:  The server

Ok, the first step is go to the /usr/X11R6/lib/X11/xdm directory
of your server and make some changes:

		cd /usr/X11R6/lib/X11/xdm

s.a) Let us allow anyone open a window dialog.  In the file
Xaccess, around line 42, it says:

36 # In all cases, xdm uses the first entry which matches the terminal;
37 # for IndirectQuery messages only entries with right hand sides can
38 # match, for Direct and Broadcast Query messages, only entries without
39 # right hand sides can match.
40 #
41
42 #*                              #any host can get a login window

Let us remove the '#' character in line 42.
Security officers will crucify me for doing this.  Sorry.
Save your changes.

s.b) Now, let us allow the manage Xterminals with xdm.
In file xdm-config, in the last lines it says:


! SECURITY: do not listen for XDMCP or Chooser requests
! Comment out this line if you want to manage X terminals with xdm
DisplayManager.requestPort:   0

Following the comment, comment out the last line. Just keep
in mind that comment character is "!"  so, we get:

! SECURITY: do not listen for XDMCP or Chooser requests
! Comment out this line if you want to manage X terminals with xdm
! DisplayManager.requestPort:   0

Save your changes.

s.c) Ok, start xdm and everything will be set in the server.
This can be made by hand, by running the xdm program, or you can
make your server always be ready to manage its x-terminals, let us
then change the file /etc/ttys.

Around line 44, it says:

43 ttyv7   "/usr/libexec/getty Pc"         cons25  on  secure
44 ttyv8   "/usr/X11R6/bin/xdm -nodaemon"  xterm   off secure

In this last line, change off to on:

43 ttyv7   "/usr/libexec/getty Pc"         cons25  on  secure
44 ttyv8   "/usr/X11R6/bin/xdm -nodaemon"  xterm   on  secure

save your changes and now, let us send hang up signal to init:

		kill -HUP 1

Your server will display the login dialog.

-------------

PART II:  The diskless client


Now, the diskless sytem is ready to be configured.

d.a) I think you must configure your mouse in the first place.
I use moused(8) for driving it, so, if you have a traditional
ps/2 mouse attached to your computer you may want to enable it:

	moused -p /dev/psm0 -t auto -3

move your mouse and check if it works.  Now, it would be a good
idea to make the proper changes to your rc.conf file to keep
this configuration.

As you must know,  when a diskless system boots, it creates
its /etc with its configuration properly set.  This is done by
creating a memory file system and copying on it the /conf/default/etc
directory.  Then, you can give particular specification to configure
every diskless client in the directory:  /conf/your_diskless_ip/etc
I mean, if your diskless client has the IP: 192.168.3.44 then
the configuration for this client must be in /conf/192.168.3.44/etc
directory.

Add the lines:

moused_enable="YES"
moused_flags="-3"

to your /conf/your_diskless_ip/etc/rc.conf file


d.b) You have to configure your X system in your client.  I think
the easiest way of doing this is by using:

		/usr/X11R6/bin/xf86cfg -textmode

this will show you a menu that almost takes you by the hand
and guides you.  Just follow it.  Perhaps you will require
some minor changes for the keyboard, mouse, video card, and monitor
configurations.  Make the proper changes.  Save your changes in
/etc/X11/XF86Config.

NOTE: keeping this file in this place is just for testing purposes.
Rememeber that /etc directory is built in memory in diskless systems.

Now, try to start X.  Just type:  X
If everything is alright, you will see the root window of your
X11 environment, the mouse must be working.  If you don't, just type
CTRL-ALT-BACKSPACE and make the proper corrections.


d.c) Get back to your text session by pressing CTRL-ALT-BACKSPACE.
Once your X system is set, you have to save XF86Config file in its
place, this is the /conf/your_diskless_ip/etc/X11 directory.   So,
give these commands:

	mkdir -p /conf/your_diskless_ip/etc
	cp /etc/X11/XF86Config /conf/your_diskless_ip/etc


in our example:

	mkdir -p /conf/192.168.3.44/etc
	cp /etc/X11/XF86Config /conf/192.168.3.44/etc

In my diskless system I needed to configure a swap area to my
diskless client because XFree86-4.2 loads a lot of modules in memory,
removing them is out of the scope of this text.


d.d) Finally, to display your login window in your diskless server
you can doing it by giving:

		X -query your_server_name_or_ip

or, if you want, you can teach your diskless sytem to start with the
X window dialog by changing your /etc/ttys  [of course, we are
doing this just for testing purposes, you must to save your changes
to the /conf/your_diskless_ip/etc/ttys file].

Let us begin.

Again, in line 44 of your /etc/ttys file of your diskless system change:

43 ttyv7   "/usr/libexec/getty Pc"         cons25  on  secure
44 ttyv8   "/usr/X11R6/bin/xdm -nodaemon"  xterm   off secure

to:

43 ttyv7   "/usr/libexec/getty Pc"         cons25  on  secure
44 ttyv8   "/usr/X11R6/bin/X -query your_server_name_or_ip"  xterm on secure

[look that "off" changed to "on" in line 44] and, as you made in your
server:

		kill -HUP 1

you will see the login window on your diskless system.  Remember that
you are working on a diskless system, this can take a few [20?] seconds.
Be patient.

d.e) Get back to your text session by typing CTRL-ALT-F1.
If everything is ok, you can save your changes to the proper place,
I mean, /conf/your_diskless_ip/etc directory:

		cp /etc/ttys /conf/your_diskless_ip/etc


d.f) Now, do you want to reboot your diskless system to be sure that
it makes what it has to make?   If you do, reboot it.

========

Hope you find this text useful.

			Eduardo


More information about the freebsd-questions mailing list