Automatic display manager
Clone or download
Latest commit da3e006 Sep 5, 2017
Failed to load latest commit information.
m4 upstream: Whitespace clean-up at EOL. Mar 23, 2016
AUTHORS Autotoolized Feb 23, 2009
COPYING Added the usual paperwork Feb 23, 2009
ChangeLog release 0.13 Jan 23, 2017
INSTALL Added the usual paperwork Feb 23, 2009 Add systemd support, via NMU to unstable (debian/0.12-1.1). Jan 23, 2017 Fix miscounting of amount of environment variables. (Close… Mar 23, 2016 Added Feb 25, 2009
common.c upstream: Rename symbol "basename" to "nodm_basename". This is to avo… Mar 24, 2016
common.h upstream: Rename symbol "basename" to "nodm_basename". This is to avo… Mar 24, 2016 release 0.13 Jan 23, 2017
dm.c do not force "-nolisten tcp". Closes: #635992 Aug 17, 2011
dm.h upstream: Whitespace clean-up at EOL. Mar 23, 2016
log.c More log improvements Jul 9, 2011
log.h More log improvements Jul 9, 2011
nodm-man-extras Build and install a manpage Feb 23, 2009
nodm.c upstream: Rename symbol "basename" to "nodm_basename". This is to avo… Mar 24, 2016
nodm.init-script init script: Check whether NODM_XSESSION and NODM_XINIT are available… Jan 23, 2017
nodm.pam nodm.pam: don't log warnings if ConsoleKit isn't installed. Jan 23, 2017 Add systemd support, via NMU to unstable (debian/0.12-1.1). Jan 23, 2017
test-internals.c test-internals.c: -nolisten tcp is no longer added automatically Aug 4, 2017
test-xsession.c Fixed log level enforcement Jul 8, 2011
test-xstart.c Keep a connection open when the X server is started Jul 9, 2011
test.c Cleaned up log interface and exposed more logging options on command … Jul 8, 2011
test.h Adapt tests according to what is possible to run Jul 8, 2011
test_nodm The session starter is now nodm itself: fix test script May 14, 2009
vt.c Cleaned up VT allocation code Jul 6, 2011
vt.h correct spelling mistake Sep 5, 2017
xserver.c xserver.c: Don't FTBFS when built with -Werror=unused-result. (Closes… Mar 23, 2016
xserver.h Better server and session quit report Jul 8, 2011
xsession-child.c xsession-child.c: Set PAM_XDISPLAY pam item. (Closes: #713960). Thank… Mar 23, 2016
xsession-child.h Moved connection to X server to child initialization code Jul 6, 2011
xsession.c Some cargoculting from xinit Jul 9, 2011
xsession.h Better server and session quit report Jul 8, 2011

nodm is a minimal display manager that simply logs in as a given user and starts an X session, without asking for username or password.

On a normal computer, using nodm is a big security issue because it would give anyone access to the computer.

However, there are cases where automatic login is needed: for example in an embedded system such as a mobile phone, or in a kiosk setup, or in a control panel for industrial machinery. For those cases, nodm is simple to setup, lightweight, and it should do exactly the right thing.


nodm is as small as it could be, and tries to provide the minimum amount of features needed to do a good job, following as much as possible the principle of least surprise. This is what is offered:

  • Automatic login with a fixed user, doing all that needs to be done like setting up the session via PAM, updating lastlog, logging to syslog.
  • nodm performs VT allocation, looking for a free virtual terminal in which to run X and keeping it allocated across X restarts.
  • X is started (by default, /usr/bin/X)
  • once the X esrver is ready to accept connections, the X session is set up:
    • the DISPLAY and WINDOWPATH environment variables are set
    • the session is wrapped in a PAM session, which sets up the user environment
    • ~/.xsession-error is truncated if it exists
  • The session script is run (by default, /etc/X11/Xsession) using "sh -l"
  • If the X server or the X session exit, the other is killed and then both are restarted.
  • If a session exits too soon, nodm will wait a bit before restarting. The waiting times go as follow:
    • The first time the session exits too soon, restart immediately
    • The second and third time, wait 30 seconds
    • All remaining times, wait 1 minute. Once a session lasts long enough, the waiting time goes back to zero.

nodm does NOT currently fork and run in the background like a proper daemon: most distributions have tools that do that, and nodm plays just fine with them. This is not a particular design choice: quite simply, so far no one has felt the need to implement it.


Configuration is made via these environment variables:

  • NODM_USER: Controls the user that is used to automatically log in.

  • NODM_X_OPTIONS: X server command line (for example: "vt7 -nolisten tcp"). It is expanded using wordexp, with tilde expansion, variable substitution, arithmetic expansion, wildcard expansion and quote removal, but no command substitution. If command substitution is needed, please get in touch providing a real-life use case for it.

    If the first optiom starts with '/' or '.', it is used as the X server, else "X" is used as the server.

    If the second option (or the first if the first was not recognised as a path to the X server) looks like ":", it is used as the display name, else ":0" is used.

    If the command line contains a "vt" virtual terminal indicator, automatic VT allocation is switched off. Otherwise, the appropriate vt option is appended to the X command line according to the virtual terminal that has been allocated.

  • NODM_MIN_SESSION_TIME: Minimum time (in seconds) that a session should last in order for nodm to decide that it has not quit too soon. If an X session runs for less than this time, nodm will wait an increasing amount of time before restarting it (default: 60).

  • NODM_XSESSION: X session command (default: /etc/X11/Xsession). It is run using the shell, so it can be any shell command.

  • NODM_XINIT Was used by older versions of nodm as the path to the xinit program, but it is now ignored.

  • NODM_X_TIMEOUT Timeout (in seconds) to wait for X to be ready to accept connections. If X is not ready before this timeout, it is killed and restarted.