How to Change RunLevel on CentOS 7 / RHEL 7

Old method to change the runlevel via /etc/inittab in Redhat Enterprise Linux version and CentOS server has become obsolete on RHEL 7 and CentOS 7. This latest Linux operating system uses systemd system management daemon and relies on systemctl command in order to change the runlevel. RunLevel is set with linking to /etc/systemd/system/ Please make sure you have already install Gnome GUI before you proceed to change runlevel.

1. Check the current runlevel :

# runlevel
N 3


# systemctl get-default

2. We can display the by using list command :

# ll /etc/systemd/system/
lrwxrwxrwx. 1 root root 37 Sep  1  2014 /etc/systemd/system/ -> /lib/systemd/system/

3. For example to list all currently loaded targets :

# systemctl list-units -t target
UNIT                LOAD   ACTIVE SUB    DESCRIPTION        loaded active active Basic System   loaded active active Encrypted Volumes        loaded active active Login Prompts loaded active active Local File Systems (Pre)     loaded active active Local File Systems   loaded active active Multi-User System      loaded active active Network        loaded active active Paths    loaded active active Remote File Systems       loaded active active Slices      loaded active active Sockets         loaded active active Swap      loaded active active System Initialization       loaded active active Timers

LOAD   = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB    = The low-level unit activation state, values depend on unit type.

14 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.

4. Type the following command to change the RunLevel to Graphical-login :

# systemctl set-default
rm '/etc/systemd/system/'
ln -s '/usr/lib/systemd/system/' '/etc/systemd/system/'

5. Verify the changed runlevel :

# runlevel
N 5


# systemctl get-default

6. Reboot the server to login to GNOME gui.

READ  How to Setup Central Log Server using Rsyslog on CentOS 6.2/CentOS 6.3


Leave a Reply

Your email address will not be published. Required fields are marked *

A world leading hosting company that provides fully-managed innovative and secure solutions, suitable for hosting small to medium-sized websites

Built on the best available technologies combined with Google Cloud for strong redundancy and application availability. Backed by skilled experts to address web security threats, a devops team to create advanced custom security solutions, and 24/7 sysadmins to watch over the platform. This powerful, hands-on approach makes your sites faster, safer, and easier to manage. Starting from only $3.95/mo.


* up to 30 days money back guarantee