How to disable graphical login

Asked by Alexander Zemerov on 2007-08-07

I want to disable graphical login (with possibility to restore it in future).

Sorry if it is FAQ, but I couldn't find solution for Ubuntu, while could find one for another systems.
I can run "gdm stop" but after system reboot it is enabled again. As I understand I have to configure init daemon. In other systems I could modify inittab file to change runlevel (set it to 2 or 3). But Ubuntu doesn't make difference between 2,3,4,5 runlevels. And more now it uses upstart instead of init.
So, my question is - how can I configure system to prevent starting of gdm and hence get simple text-based login?
BTW, I use Ubuntu 7.04.

Alexander Zemerov

Question information

English Edit question
Ubuntu xorg Edit question
No assignee Edit question
Solved by:
Cesare Tirabassi
Last query:
Last reply:
Cesare Tirabassi (norsetto) said : #1

Whats the problem with booting in Recovery Mode?

Alexander Zemerov (azemerov) said : #2

Recovery mode is single-user mode. I think it has some other limitations also.
Actually, I need fully functional system just without X. And the same time I want to preserve possibility to start X manually when I need it.

Cesare Tirabassi (norsetto) said : #3

I see these possibilities:

1. At session start, press ctrl-alt-F2 and use the tty.
2. Completely remove the ubuntu desktop applications. This can be long as while you can do an automatic installation I'm not sure you can do an automatic removal.
3. Remove the gdm, perhaps it is also possible to disable it.
4. But, perhaps best of all, why don't you just install the server edition? Its a bit silly to install the desktop one if you don't need the functionality of the desktop.

Alexander Zemerov (azemerov) said : #4

  Ok, probably I should describe my situation in more details.
  I have old laptop with 32Mb memory on board. So server edition isn't good for me either. BTW I think disabling some features by module uninstall or whole system reinstall is too "MS Windows" way. I like Linux because it gives a great flexibility to _configure_ system. Plus I don't want to remove X Window from the system at all - I want to have possibility to run it occasionally - while it is very slow it is still working even with 32Mb. So I need configurable solution. And I found it - in GUI mode go to "Main Menu"->"System Administration"->"Services" (or just run services-admin in terminal window) and uncheck "GDM". Immediately X Window is terminated and after reboot I have only text-only mode with possibility to run "startx".
  Fine, but I would like to modify configuration without starting X Window - just running some script or editing some file. Actually it is not about "how to disable X Window" now - it is about "how init (upstart since version 6.10) daemon is working and configured. And I found that Ubuntu definitely has a lack of documentation dedicated to upstart daemon configuration/explanation. And because this daemon is used in Ubuntu only (so far) I couldn't find such documentation on Web. While is a good source for developers, for regular user it is almost useless, IMHO.

Best Cesare Tirabassi (norsetto) said : #5

To do this, you should rename the symlink related to the service you want to avoid starting.
For instance, suppose you don't want to start the gdm script/service, then rename the symlink /etc/rc2.d/S13gdm to /etc/rc2.d/K87gdm


S -> Start
K -> Kill (don't start)


87 = 100 - 13

Alexander Zemerov (azemerov) said : #6

Thanks Cesare Tirabassi, that solved my question.

Justin Buser (erma-tate) said : #7

Those are all terrible answers, just comment out the first line in /etc/X11/default-display-manager and you get a text based login but can still run startx. I really don't get why people answer questions when they don't know the right answer.

Tookelso (tookelso) said : #8

>I really don't get why people answer questions when they don't know the right answer.

I really don't get how you can post the "right answer" A YEAR AFTER the original question was asked, and then act snarky about it.


crabby (wypong00) said : #9

Justin may read the question only recently, But just as Tookelso said, there's no reason to be snarky about it.

keLz (kinkelson) said : #10

>Those are all terrible answers, just comment out the first line in /etc/X11/default-display-manager and you get a text based login but can still run startx.

This approach doesn't even work for me. I tried it and the system was set in some kind of delay mode. I'm currently using Ubuntu 10.10. I'm hesitant to use the symbolic link approach too since I want to understand the solution before rolling it out.