14

I have a Ubuntu (Hardy Heron) sever that currenlty boots up and runs gnome. I would like to make it so that when it boots it only goes into text-mode (e.g. the x server never starts)

I tried:

sudo update-rc.d -f gdm remove

without any avail...how can I do this?

5
  • 2
    I have concerns about this question, in that the title ask an entirely different question to the real question in the body of the question! (Both are answered below). This isn't good for anyone searching later. Please update the title.
    – Mark Baker
    Oct 14, 2008 at 8:42
  • Maybe I simply don't understand something, but the title and question (as of Dec. 14 2010) match. Did the title or question change?
    – Daniel H
    Dec 15, 2010 at 4:34
  • The title changed, on Feb 6 '10 at 15:04, edited by quack quixote. May 11, 2013 at 17:01
  • Revisions of questions can be viewed by using the date link of the last edit. So, for this question, the credits widget at the bottom right shows (at the time of writing) that it was last edited by arulappan on Aug 2 '12 at 6:52 - and the date string is a link to the revision. May 11, 2013 at 17:01
  • For more information, see stackoverflow's meta site: How does editing work? May 11, 2013 at 17:02

9 Answers 9

7

Messing with the runlevel, through /etc/inittab or /etc/event.d (replacement for inittab) or the kernel boot options, won't help. The default runlevel on Ubuntu is 2 (check with the runlevel command), and there is no runlevel which is configured to be multi-user and text mode by default.

Actually, I think your solution

sudo update-rc.d -f gdm remove

should have worked (and it works for me on 8.04)... Is there still a script named something like S30gdm in your /etc/rc2.d folder?

1
  • 1
    it did work, I was an idiot and must have mistyped something...thanks.
    – mmattax
    Sep 17, 2008 at 0:46
6

You need to do this:

mv /etc/rc2.d/S30gdm /etc/rc2.d/K70gdm

See, /etc/rc2.d/README. There's README files in all the /etc/rc?.d directories, as well as /etc/init.d.

Edit: The update-rc.d tool is not for editing these links. From the update-rc.d man page:

Please note that this program was designed for use in package maintainer scripts and, accordingly, has only the very limited functionality required by such scripts. System administrators are not encouraged to use update-rc.d to manage runlevels. They should edit the links directly or use runlevel editors such as sysv-rc-conf and bum instead.

3

Just an answer here for anyone using Ubuntu 10.10+

Using rcconf or sysv-rc-conf to disable gdm will not stop GDM from running on startup.

That is because 'upstart' (http://upstart.ubuntu.com/getting-started.html) is now being used to manage these services.

To disable GDM absolutely, and prevent it from running ever, do this:

sudo mv /etc/init/gdm.conf ~/gdm.conf

(To restore GDM put the file back in /etc/init)

2

I know this is slightly unrelated, but have you tried the server edition of Ubuntu? I believe it installs without X11 by default, and is a far cleaner base for a server. This also has the added benefit of making it boot really really fast!

2
  • yes, I have actually used the server version in the past, but i am converting another computer from dev computer to server, and I have apache installed with several mods that I don't want to recompile ;)
    – mmattax
    Sep 16, 2008 at 23:52
  • Yep, the old if it works, don't touch it rule! :)
    – Patrick_O
    Sep 17, 2008 at 1:30
2

On Ubuntu 8.04, I used sysv-rc-conf to remove gdm from all runlevels. Upon restarting the system, X did not start. So, you should do the same!

2

Using sysv-rc-conf and telling gdm not to load works here with Jaunty Jackalope.

1

I've never dwelt into the internal configurations of initd for Ubuntu in particular, but for other linux flavours it's usually in /etc/inittab.

You'll find there, very up the top, a line that defines your default run-level. Hopefully you'll have some comments to help you decide which one it is. I'll bet it's 3.

3
  • ubuntu and debian don't use inittab Oct 2, 2008 at 18:03
  • 1
    Yes they do. What they don't do is use the runlevel to determine what software to use. All of 2-5 are configured to be exactly the same by default, so that you can use them yourself if you want.
    – Mark Baker
    Oct 13, 2008 at 15:21
  • i.e. this answer is an absolutely correct answer to the question in the title. It just won't help the original poster get rid of X.
    – Mark Baker
    Oct 13, 2008 at 15:21
0

I think this post has a much better solution for modern Ubuntu (10.X):

... booting with the text kernel parameter will also prevent display managers managed by Upstart (e.g. gdm, kdm and lxdm) from being started at boot time.

If you are using Grub2, then in /etc/default/grub replace:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

with

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash text"

then run:

sudo update-grub

Remove splash to disable the splash screen and/or quiet to make the boot process verbose. If you wish to create a separate boot option for the text and GUI mode then check out this.

Then, if you want to go graphical after booting up, I guess you can use startx or start gdm

0

For Ubuntu 18.04 this worked for me:

Disable gdm
This will prevent gdm from loading on boot and login is via console.

systemctl set-default multi-user.target

Using this method, gdm can still be started manually with systemctl start gdm

Check the systemd default with

systemctl get-default

Usually this will be graphical.target and can be reverted with systemctl set-default graphical.target

Source: https://wiki.debian.org/GDM#systemd

You must log in to answer this question.