Linux-Noob Forums

Full Version: How to change from Xwindows-Console
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

How to change the default login to Xwindows to console or vice versa.

 

do as follows: open a console and login as

 

su -

 

then, as root type the following:-

 

cp /etc/inittab /etc/inittab.org

 

That has just copied (cp) a text file called 'inittab' to a new text file called 'inittab.org'. The reason for that is incase you accidently screw up the text editing that comes next ;-)

 

 

 

once done, type the following:-

 

vi /etc/inittab

 

that opens a pretty cool (or anal depending on how you think) console based text editor, and opens a text file. Use your up and down (and left and right) cursor keys to navigate the flashing cursor around this file.

Scroll down to the line that reads:

 

id:5:initdefault:

 

^^ yes that line there ^^

 

and change the number five (5) to a number three (3) so that it now reads

 

id:3:initdefault:

 

^^ now it's a 3 ^^

 

 

If you find you cannot type the number 3, try pressing the INSERT key on your keyboard. (hint: pressing INSERT will toggle between INSERT and REPLACE mode, also, pressing ESC will CANCEL out of those modes and allow you to enter commands).

 

Once you have managed to get the line looking like this

 

id:3:initdefault:

 

press ESC to get control back, and press

 

:wq

 

Thats right, just a colon with a w (to write) and a q (to quit)

ok, you are done !

 

now let's exit from X windows, easiest way is to reboot ! so go ahead and reboot, once you have rebooted you'll be presented with a console login prompt...

 

(to get Xwindows to load automatically at boot time change the 3 in /etc/inittab back to 5).


Default runlevel. The runlevels used by RHS are:

0 - halt (Do NOT set initdefault to this
)

1 - Single user mode

2 - Multiuser, without NFS (The same as 3, if you do not have networking)

3 - Full multiuser mode

4 - unused

5 - X11

6 - reboot (Do NOT set initdefault to this
)

 

Most use 3 or 5


a shortcut, for the lazy:

 

perl -pi -e 's/id:5:initdefault:/id:3:initdefault:/' /etc/inittab