Thursday, December 22, 2011

HOWTO: Get right to X with No Display Manager

GDM, KDM, LXDM, LightDM - so many display managers so little time! If your not sure what a "Display Manager" does on your Linux system, in short it is the piece of software that starts your graphical user interface and manages your user login.  I've been doing more and more work with ARM hardware of the late and most times with embedded devices there is little (or no) need for a display manager to be present. You want to get right to your desktop and just start using the system.

If you have a single user computer odds are you also have no need for a display manager to be cluttering your system. The solution is to simply have your desktop GUI of choice auto-start when the computer turns on. To do this we are going to use a simple, but effective, piece of software cleverly called "NoDM".

Before we begin, you first need to disable or uninstall any current display managers running on the system (look into your display manager documentation on doing this, it varies with each display manager).

Next you need to install NoDM. On a Debian/Apt based system it is as simple as running:

sudo apt-get install nodm

After your package manager works it's magic you need to edit at least two lines in the NoDM configuration file. Typically this file is located at /etc/default/nodm, to edit it open it as super user with your preferred text editor. For example:

sudo leafpad /etc/default/nodm 

The default configuration file should look something like this. The two lines we need to edit most are:

NODM_ENABLED=false

and

NODM_USER=root

The first line you simply need to change to read:

NODM_ENABLED=true

The second line you need to make equal to the username you want to be logged in with.

Finally you need to tell your system what type of session to start when X is spawned. For instance I prefer to use the Enlightenment desktop, so in my ~/.xsession file I add the following line:

enlightenment_start

To add this line to your .xsession file via the CLI simply run:

echo enlightenment_start > ~/.xsession

If you are using a desktop other than Enlightenment you will need to figure out what that desktop's start up command is. Have any questions feel free to drop a comment below and I'll do my best to help out.

Cheers,
~Jeff Hoogland

9 comments:

  1. What about XDMCP? The display manager normally handles that.

    emk

    ReplyDelete
  2. I must profess my ignorance on the inner workings of such things, I do know though that the above instructions do work with Enlightenment and should extra to any other desktop that is properly written.

    ReplyDelete
  3. > If you're not sure what a "Display Manager" does on your Linux system, in short it is the piece of software that starts your graphical user interface and manages your user login.

    That's the way I see it and though I'm no expert I highly doubt it handles XDMCP (X Display Manager Control Protocol). Out of the blue, I'd venture XDMCP is an important part of X which a display manager uses but does not implement.

    For reference, when I started on this Linux thing I had a very primitive computer (Pentium One 100MHz). I used to boot into console mode (non-graphical, ah, those were the good times) and afterwards ran "startx". No display manager, IIRC.

    Later, I got annoyed with the computer speed (Flash required 120MHz) and got me a second one, a Pentium One 133MHz. I would back then run X on one and applications on the other (maybe the 100MHz one ran X, can't recall).

    For instance, I ran XFCE on the one which was not running XFree86. Firefox didn't exist, it was Netscape 4.7 -- yeah, get off my lawn! Openoffice.org didn't exist, it was Wordperfect 8, I believe. KDE existed (2.0 perhaps) and was the best, but too big for my gig.

    Ooh, how times have changed! (apply sarcastic font).

    ReplyDelete
  4. Hey, cool! I didn't know that nodm existed. This is definitely a lot better than keeping around a full blown display manager that's only going to be set to auto-login a single user every time. Thanks!

    ReplyDelete
  5. There's no need to add any package for this. It can be done either by modifying .bash_profile or, at a more basic level, by editing /etc/inittab. See https://wiki.archlinux.org/index.php/Start_X_at_Boot for further details.

    ReplyDelete
  6. Yeah, I agree with Anonymous that there is no need for an extra package, you can boot straight into X. However, it looks a lot more friendly for people who don't want to futz with their various importantly files. Nice and easy.

    ReplyDelete
  7. Or you can be at your desktop in <1 second.
    http://murga-linux.com/puppy/viewtopic.php?p=590822#590822

    ReplyDelete
  8. Jeff

    Thankyou to alerting me to nodm.

    I am not an expert but some managers like slim have trouble with PAM but nodm works well for E17

    ReplyDelete
  9. I also just heard about "nodm" and was goggling it looking for docs. I came across this. Thanks

    ReplyDelete