Howto disable X windows or GUI on startup
Hey, I was wondering if it is possible to make it so on startup x windows is disabled, but I can login and start it using command startx?
Well, anything is possible. In fact many dedicated servers does not require x windows or gui, and they rely on ssh only. For security reason they just shut off the x windows as to say it is more secure that way.
If you are using Debian / Ubuntu, this is what you need to do:
1) Stop the X display for the current session, command:
$ sudo /etc/init.d/[g|x|w|k]dm stop
2) Now, you may put an “exit 0″ at the top of /etc/init.d/[g|x|w|k]dm file.
Or
$ dpkg –purge [g|x|w|k]dm
* [g|x|w|k]dm substituting it with all of the xdm(x11), gdm(gnome), kdm(kde), and wdm(wings)
* You can still start x windows with the startx command from any console shell.
If you are using Fedora / Centos, this is what you need to do:
1) Open file /etc/inittab
$ vi /etc/inittab
2) Find the line: “id:5:initdefault:”. Set the default runlevel to 3 (text mode) “id:3:initdefault:”.
3) Save and close the file.
4) Reboot. Now you will boot into text mode only.
* You can still start x windows with the startx command from any console shell.
~



