Don't start Xserver [duplicate]

I'm trying to convince Ubuntu's init system not to start X11 at boot-up. Removing gdm did not change the fact that each time the machine restarts, X11 with Gnome comes up.

How do I get rid of it? I need to auto-login as root with no Xserver after startup. It's inteded for a very specific automation-purpose to behave like that and not meant for Desktop experience ;)


There are two files controlling X startup in a standard Ubuntu installation: /etc/init/gdm.conf and /etc/init/failsafe-x.conf. While the first is owned by package gdm, the second is owned by x11-common and will be triggered if GDM fails to start, which happens in particular when you remove GDM.

However, you need not remove packages to prevent GDM from starting; it enough to tell the upstart system not to start it:

  1. edit the /etc/init/gdm.conf and the /etc/failsafe-x.conf files (it might be a good idea to make a backup copy of the files before editing)
  2. change the existing start on ... stanza with a condition that is not met in your standard environment; for instance, you might want to start X only on "runlevel 5" which is what other Linux distros traditionally did:

    start on runlevel [5]
    
  3. save your changes and restart

Complete documentation on the upstart configuration files can be read by man 5 init.


You could do:

sudo update-rc.d -f gdm remove

Then to restore:

sudo update-rc.d -f gdm default

If this is meant for a very specific, non-graphical task, ubuntu-desktop is not what you want.

I know you shouldn't need to remove things to stop them running but, frankly, you'd do better to grab the Ubuntu Server (or even minimal) CD and start from a low-level.

You're driving a tank to work. You could strip it down, breaking the way it was supposed to work and taking a long time about it... Or you could trade it in for the super-bike equivalent and just install what you need.