KDE Display Manager (KDM): Installing kdm
Description: KDM
Keywords: KDM installation introduction

Next Previous Table of Contents

### 2. Installing kdm

### 2.1 Setting up kdm

See the file README! It will tell you how to compile kdm. But normally you don't need to compile kdm yourself, as it is part of the kdebase package and compiled with all other stuff. It is then installed in your $KDEDIR/bin directory.

NOTE: `make install` will overwrite your previous `kdmrc`.

During the installation a new version of the file `Xsetup_0` is installed. It espacially contains a line

> `

>     kdmdesktop

> `

to display some nice backgrounds (pictures and background colors). Normally you find this file in the xdm config directory `/etc/X11/xdm/XSetup_0` for Redhat and `/usr/X11R6/lib/X11/xdm/XSetup_0` for S.u.S.E. If your KDEDIR is not /opt/kde you may have to change the path to kdmdesktop.

If you chose the PAM (which is normal with Red Hat 5 and 5.1) option, then you should check /etc/pam.conf for the lines

> `

>     # xdm authorization
>     xdm    auth       required     pam_unix_auth.so
>     xdm    auth       required     pam_unix_acct.so

> `

and insert them, if they aren't there.

Now it's time to test kdm. You should bring your system to a runlevel that doesn't run xdm. To do so edit the file `/etc/inittab` and look for the lines saying

> `

>     # default runlevel
>     id:3:initdefault:

> `

The value after id: is the code of the default runlevel and very distribution dependent, but always well explained. The runlevel with graphical login (xdm) for the most common distributions are

- 5 for Red Hat 3.x, 4.x and 5.x, LST
- 4 for Slackware
- 3 for S.u.S.E. 4.x and 5.x

After this you can try to start kdm by typing the following command on your favourite shell:

> `

>     > kdm -nodaemon

> `

If you get a kdm login box and you are able to log in, things are great. The main thing that can go wrong here, is that the runtime linker might not find the shared Qt or KDE libraries. When everything works, you can start to replace xdm by kdm. This is again distribution dependent.

- for Redhat you edit `/etc/inittab`, look for the string xdm and replace it with kdm (including all paths).
- for S.u.S.E. you have to edit the file `/sbin/init.d/xdm` and to add a first line

  > `

  >     . /etc/rc.config
  >     DISPLAYMANAGER=kdm
  >     export DISPLAYMANAGER

  > `

- for other distributions it's rather the Redhat way, but I'm not too sure about this.

For every distribution I know, you have to change the runlevel in the /etc/inittab file (to 5 for Redhat, 3 for S.u.S.E. as mentioned above or in the inittab file itself). If you have a binary distribution of the KDE libraries, make sure kdm is installed where the libraries believe kde is installed. This is again normally /opt/kde/bin. If you dont like changing inittab, you might instead rename xdm to xdm.bak and make xdm a symlink to kdm. Kdm will read the general display manager settings from the xdm configuration files and the kdm specific ones from the file $KDEDIR/share/config/kdmrc. Kdmdesktop will also read kdmrc.

### 2.2 Different window managers with kdm (chooser)

If you have to use different window managers or you just want to try others from time to time you can take advantage of the chooser built into kdm. The chooser lets you choose a window manager of a predefined list. This again needs some changes in configuration files. First you have to change your `Xsession`-file (path is `/etc/X11/xdm/` for Redhat and `/usr/X11R6/lib/X11/xdm/` for S.u.S.E.) to pass parameters. To do so look at the lines `'exec $startup'` and change it to `'exec $startup " $@"'` (without ') After this you have to create/edit your /etc/xinitrc or /.xinitrc file to react on the different window managers. The following script has three different windowmanagers to start. You can add more stuff if you like. Don't forget to save a copy of your `.xinitrc` file to `/etc/skel`, so it will be automatically generated for every user you create from now on.

> `

>     #!/bin/bash
>     #
>     # .xsession/.xinitrc
>     #
>     # choose a window manager
>     #

>     defaultwm=kde
>     #set the window manager to $1 if it was supplied
>     windowmgr=${1:-$defaultwm}

>     #start the respective window managers
>     case ${windowmgr} in
>       kde|kwm|kdestart)
>             WINDOWMANAGER=startkde
>             ;;
>       fvwm|fvwm2)
>             WINDOWMANAGER=fvwm2
>             ;;

>       fvwm95)
>             WINDOWMANAGER=fvwm95
>             ;;

>       *)    WINDOWMANAGER=windowmgr   # default for unknown wm's

>     esac

>     #
>     # load resources
>     #

>     if [ -f /usr/X11R6/lib/X11/Xmodmap ]; then
>         xmodmap /usr/X11R6/lib/X11/Xmodmap
>     fi

>     if [ -f ~/.Xmodmap ]; then
>         xmodmap ~/.Xmodmap
>     fi

>     if [ -f ~/.Xdefaults ]; then
>         xrdb -merge ~/.Xdefaults
>     fi

>     if [ -f ~/.Xresources ]; then
>         xrdb -merge ~/.Xresources
>     fi
>     #
>     # finally start the window manager
>     #
>     exec $WINDOWMANAGER

> `

Next Previous Table of Contents