Boot without starting Gnome

Posted on 2006-05-14
Medium Priority
Last Modified: 2012-06-27
How do I set my ubuntu server to boot without automatically starting Gnome?

I tried changing the runlevel in /etc/inittab from id:2:initdefault: to id:3:initdefault:, but that didn't work.

Question by:msibley
  • 2
  • 2
  • 2
  • +1
LVL 19

Expert Comment

ID: 16678107
Do you mean that you don't wan the graphical login on boot but just want text?

I'm not really sure whats up here, you shouldnt have gnome running at runlevel 2.

If you type `runlevel` at the command prompt what do you get?

stupid question....did you reboot?

LVL 20

Expert Comment

ID: 16678116
Make sure when editing    /etc/inittab   file  you're doing that as root and also make sure to press <ENTER> key right after  initdefault:  ( line break) so the line has terminated properly.
# Default runlevel. (Do not set to 0 or 6 !)

good luck'
LVL 20

Expert Comment

ID: 16678129
Linux runlevels :

# 0 = halt
# 1 = single user mode : minimum HW
# 2 = multiuser text desktop : network
# 3 = multiuser text server  : network, servers
# 4 = multiuser GUI desktop  : network, X-window
# 5 = multiuser GUI server   : network, servers, X-window
# 6 = reboot

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

LVL 19

Expert Comment

ID: 16678174
nedvis: I thought the question was asking how to boot WITHOUT starting gnome, surely a graphical boot will boot with gnome...

That is of course if it's what msiblev wanted, or perhaps he wants KDE instead! :-)

Author Comment

ID: 16678416
Yep, I rebooted.

"runlevel" returns "N 3"

Doesn't make sense to me.  Is something else starting the desktop?

I want the default boot up to go directly to the command line.  Then I can start the desktop from there, because I will only use it occasionally.

Below is the inittab file


# /etc/inittab: init(8) configuration.
# $Id: inittab,v 1.91 2002/01/25 13:35:21 miquels Exp $

# The default runlevel.

# Boot-time system configuration/initialization script.
# This is run first except when booting in emergency (-b) mode.

# What to do in single-user mode.

# /etc/init.d executes the S and K scripts upon change
# of runlevel.
# Runlevel 0 is halt.
# Runlevel 1 is single-user.
# Runlevels 2-5 are multi-user.
# Runlevel 6 is reboot.

l0:0:wait:/etc/init.d/rc 0
l1:1:wait:/etc/init.d/rc 1
l2:2:wait:/etc/init.d/rc 2
l3:3:wait:/etc/init.d/rc 3
l4:4:wait:/etc/init.d/rc 4
l5:5:wait:/etc/init.d/rc 5
l6:6:wait:/etc/init.d/rc 6
# Normally not reached, but fallthrough in case of emergency.

# What to do when CTRL-ALT-DEL is pressed.
ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now

# Action on special keypress (ALT-UpArrow).
#kb::kbrequest:/bin/echo "Keyboard Request--edit /etc/inittab to let this work."

# What to do when the power fails/returns.
pf::powerwait:/etc/init.d/powerfail start
pn::powerfailnow:/etc/init.d/powerfail now
po::powerokwait:/etc/init.d/powerfail stop

# /sbin/getty invocations for the runlevels.
# The "id" field MUST be the same as the last
# characters of the device (after "tty").
# Format:
#  <id>:<runlevels>:<action>:<process>
# Note that on most Debian systems tty7 is used by the X Window System,
# so if you want to add more getty's go ahead but skip tty7 if you run X.
1:2345:respawn:/sbin/getty 38400 tty1
2:23:respawn:/sbin/getty 38400 tty2
3:23:respawn:/sbin/getty 38400 tty3
4:23:respawn:/sbin/getty 38400 tty4
5:23:respawn:/sbin/getty 38400 tty5
6:23:respawn:/sbin/getty 38400 tty6

# Example how to put a getty on a serial line (for a terminal)
#T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100
#T1:23:respawn:/sbin/getty -L ttyS1 9600 vt100

# Example how to put a getty on a modem line.
#T3:23:respawn:/sbin/mgetty -x0 -s 57600 ttyS3

LVL 23

Accepted Solution

Mysidia earned 200 total points
ID: 16678515

is what you want.

But by default  Ubuntu   has an annoying configuration, with gdm active in all runlevels.

As root, run:

update-rc.d -f gdm remove

To turn gdm off on all runlevels.

And should you ever want to turn it back on at boot....

update-rc.d -f gdm defaults
LVL 23

Expert Comment

ID: 16678593
Correction, there's no reason to change
 the initdefault from   id:2:initdefault        to id:3:initdefault

On  Debian-based distributions; 2 is ordinarily the default runlevel.
You might as well change that back to 2, as IMO, it could only lead to
future complications.

Runlevels 4 and 5 as described above are really Redhat runlevels, not Linux runlevels.
The fact you think they're Linux runlevels, really just shows how influential the
conventions taken by just a distribution and its descendants can be.

On  Redhat, runlevel 4  means enable network and graphics, and level 5 means
run everything; however, both of these are really customized runlevels, for use
and customization by specific distributions.

For what it's worth; I would prefer every distribution use the same set of runlevels, for the
sake of consistency, but they don't.

Author Comment

ID: 16678836
Mysidia, that did the trick.


Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses
Course of the Month16 days, 3 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question