Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am running Ubuntu Server, and just installed the gnome desktop on there (I neeeded to run an application that would only work in a graphical interface). However, now the server boots to the GUI every time. I need the server to boot to the command line (runlevel 3). According to several articles that I've read, Ubuntu does not use the standard runlevels. What file do I need to modify in order to boot to runlevel 3 (or whatever the Ubuntu equivalent is)?

share|improve this question
    
Take a look at askubuntu.com/questions/79651/… –  Andy Friese Dec 12 '12 at 20:36

3 Answers 3

Theoretically, if Ubuntu were compliant with UNIX and Linux standard, adding '3' to grub's 'kernel' command in /boot/grub/menu.lst should have been sufficient, because runlevel '3' means no 'X11' according to this standard.

Unfortunately, Ubuntu has ignored the standard and that's why you'll need to change /etc/init/lightdm.conf or /etc/init/gdm.conf (or whatever DM you use) as well. This is how mine "on start" condition looks like:

start on ((filesystem
       and runlevel [!06]
       and runlevel [!03]
       and started dbus
       and plymouth-ready)
      or runlevel PREVLEVEL=S)

In Grub's menu.lst I've also added a menu item that allows me to boot to runlevel 3:

title           Ubuntu 11.10 Server No UI, kernel 3.0.0-32-generic-pae
root            (hd0,0)
kernel          /vmlinuz-3.0.0-32-generic-pae root=UUID=your-root-disk-id 3 ro
initrd          /initrd.img-3.0.0-32-generic-pae
quiet


title           Ubuntu 11.10, kernel 3.0.0-32-generic-pae
root            (hd0,0)
kernel          /vmlinuz-3.0.0-32-generic-pae root=your-root-disk-id ro
initrd          /initrd.img-3.0.0-32-generic-pae
quiet

Now I can chose between booting to runlevel 5 with X11 or to runlevel 3 without it.

share|improve this answer

I think there is a good answer here (askubuntu.com)

Just to answer your question on how tho change runlevel. Edit the file /etc/init/rc-sysinit.conf and change this line.

env DEFAULT_RUNLEVEL=2

But changing runlevel won't stop X. Look at the start condition for ligthdm:

start on ((filesystem
       and runlevel [!06]
       and started dbus
       and (drm-device-added card0 PRIMARY_DEVICE_FOR_DISPLAY=1
            or stopped udev-fallback-graphics))
      or runlevel PREVLEVEL=S)

You need change the start condition in the /etc/init/XXX file to something than isn't met, e.g. a higher runlevel than you use. XXX is the display manager you use, e.g. lightdm.conf, gdm.conf, failsafe-x.conf.

share|improve this answer

Here is deep instrtuction for runlevels - http://sysadmin.te.ua/linux/linux-boot.html

share|improve this answer
2  
Whilst this link may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. Link only answers can become invalid if the linked page changes or is unavailable. –  minerz029 Jan 28 at 7:52
    
A post in russian.. very descriptive indeed.. –  Matthias Hryniszak Oct 19 at 21:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.