Linux Disable X Window System

Q. How do I disable X Window system on boot? I just need text based interface and there is no need to waste resources on X window system. How do I disable X Window under CentOS / RHEL / Red Hat / Fedora Linux?

A. The X Window System (also known as X11 or X) is a windowing system that implements the X display protocol and provides windowing on bitmap displays. It provides the standard toolkit and protocol with which to build graphical user interfaces (GUIs) on most Unix-like operating systems.

Disable X Windows System Under Red Hat / CentOS / Fedora Linux

Open /etc/inittab file, enter:
# vi /etc/inittab
Find the line that read as follows:
id:5:initdefault:
Change it as follows:
id:3:initdefault:
Save and close the file. Reboot system to test new changes:
# reboot
Run level 5 is used to boot into X Windows (Gnome or KDE GUI managers). Run level 3 is for text (console) based login.


🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 7 comments so far... add one


CategoryList of Unix and Linux commands
Disk space analyzersdf duf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Modern utilitiesbat exa
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg glances gtop jobs killall kill pidof pstree pwdx time vtop
Searchingag grep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
7 comments… add one
  • Andres Montalban Jul 7, 2010 @ 20:48

    Hi,

    Instead of rebooting you can try this command:

    telinit 3

    This will change run level to 3.

    I hope it helps.

    All the best,
    Andres Montalban

  • bill Aug 24, 2010 @ 14:19

    does help if you are not root!!!
    Bill

  • Raj Kumar Kundu Aug 30, 2010 @ 17:35

    i want to disable the xwindow and want to run only one java application at that time..
    only that application window will open after rebooting the system..other all remains locked..what i have to do for that???
    its for Knoppix

  • keving Feb 10, 2011 @ 23:48

    is there a way to do this without rebooting?

  • Deepak Jul 15, 2011 @ 5:19

    telinit 3

    without restart

    Thanks Andres Montalban

  • bunny Apr 30, 2013 @ 14:46

    Could someone tell me, once disable the X window system, how to enable it without restarting the Machine all over again?…There are some applications which needs switching back and forth..

    • Rohit Oct 25, 2013 @ 18:12

      @bunny please use “#xstart” command for centos/redhat/ubuntu

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum