How to boot into a specific Linux runlevel by default November 4, 2010Posted by Tournas Dimitrios in Linux.
If you don’t already know, a runlevel is what Linux uses as a mode of operation. A ‘runlevel’ defines the state of the operating system after power on.
Typically, Linux runlevels look like the following:
- 0 – Halt (shutdown)
- 1 – Single-User mode
- 2-5 – Full multi-user mode with console logins and display manager if it’s installed
- 6 – Reboot
On most Linux servers, the default runlevel will be set to runlevel 3. Multi-user mode and console logins only. Whereas, most Linux desktops, the default runlevel will be set to runlevel 5.
If you want to boot into a specific runlevel every time your computer turns on, all you need to do is edit the /etc/inittab. For this example, we will change the runlevel from 3 to 5.
# vi /etc/inittab
Modify the line that looks like this:
And change the number 3, to 5.
Save the file. Next time you reboot Linux will boot directly into your desktop window manager.