Disabling GDM in Ubuntu

There are various reasons for installing a full Ubuntu desktop, but wanting to run the system in text-only mode by default. Perhaps your machine is a server, and you want as much RAM available as possible for its server activities. Maybe it’s an LTSP server, which needs all the nice GUI stuff for its clients, but doesn’t need them itself. Or perhaps you just did a standard install and don’t need a GUI that often. Whatever the reason, your goal is to disable GDM, the graphical login manager. Fortunately, this is simplicity itself.

GDM’s configuration is in the file /etc/init/gdm.conf. At the top of this file are two commands that specify when GDM starts, and when it stops. In Lucid Lynx (10.04), these lines look like this:

start on (filesystem
          and started dbus
          and (graphics-device-added fb0 PRIMARY_DEVICE_FOR_DISPLAY=1
               or drm-device-added card0 PRIMARY_DEVICE_FOR_DISPLAY=1
               or stopped udevtrigger))
stop on runlevel [016]

All we need to do, then, is to alter the start criteria. The easiest way is to replace the multi-line start command with this:

start on runlevel []

The runlevel approach tells GDM to start or stop when a given runlevel is entered. And if we give it an empty list on runlevels, it never starts. Simple!


  1. Hi,

    but to switch back fails..
    (enable again)
    i must reinstall gdm, don’t know why..

  2. Hmm. I don’t know why it wouldn’t work, and I can’t say I’ve tried it. My machine’s tied up for a while, but I’ll check it out next time I have the chance.

    Anyone else have any experience of this?


  3. I’ve just tried reinstating my original gdm.conf, and the machine booted just fine, with GDM working straight off the bat.

    Is there any chance you’ve still got the gdm.conf that didn’t work? If so, email it to me (my address is on the Contact page) and I’ll have a look at it.


Leave a Reply

Your email address will not be published. Required fields are marked *