I would like to know how to set a default runlevel? This is to ensure that my computer directly boots at the set level .

share|improve this question
4  
The concept of runlevels is somewhat depreciated with both upstart and systemd. With systemd it is termed "states" - nice reiew - linux.com/learn/tutorials/… . runlevels are still emulated in some distros, most still use the concept of runlevels 0 , 1, 6 . On Debian and Ubunt 2 = 3 = 4 = 5. For upstart see help.ubuntu.com/community/… – Panther Apr 29 '15 at 3:40
up vote 9 down vote accepted

The simpler way is to edit /etc/init/rc-sysinit.conf and change:

env DEFAULT_RUNLEVEL=2

To:

env DEFAULT_RUNLEVEL=N

Where N is the desired runlevel.


The runlevel can be set using kernel parameters. Edit /etc/default/grub, and change:

GRUB_CMDLINE_LINUX="

to

GRUB_CMDLINE_LINUX="N"

Where N is the runlevel you want. Then run:

sudo update-grub

You can also force a one-time boot to a different runlevel by editing the command line from the GRUB menu at boot.


In practice, remember that runlevels 2-5 have no difference in the default Ubuntu setup. So don't expect anything different to happen if you boot to runlevel 3.

share|improve this answer

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.