Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've installed Ubuntu 12.04 & and edited the /etc/default/grub file to auto boot into text mode. but every time I turn on the computer it asks for username and password (in text mode), I wanted it to automatically login without asking for username and password, so in graphical mode I went to "System Setting->User Accounts" and checked the "Automatic login", but it didn't work. so what should I do to automatically log in even in text mode?

share|improve this question
Try this link – Peachy Aug 13 '12 at 10:00
This question adds the condition that a userid and password not be entered in text mode in order to sign on. – John S Gruber Aug 20 '12 at 3:53
up vote 5 down vote accepted

To boot into text mode

sudo vim /etc/default/grub

and change the following line:


exit and enter:

 sudo update-grub

Automatically login in text mode without specifying userid or password

Add -a <your-user-name> to the line:

exec /sbin/getty -8 38400 tty1

in file /etc/init/tty1.conf

like so:

exec /sbin/getty -8 38400 tty6 -a gruber

/etc/init/tty1.conf is the upstart job that runs at the appropriate time to start the terminal session on tty1. Adding the -a option tells getty to call the login program with the -f option to sign that user in, bypassing the user prompt from getty and the password prompt from login.

Upstart is the Ubuntu system that operates as the kernel init process (process 1).

I tested this on my tty6 and it worked great. Because of the upstart respawn line if you exit the shell it will start back up again automatically.

share|improve this answer
tty1 worked fine for me. – razzak Mar 26 at 17:28

open terminal and do as

sudo kate /etc/default/grub

then find this line and change as shown below


now close the editor and do as

sudo update-grub 

and do restart now

share|improve this answer
I like this answer, but you may want to add a from: to: section for the find this line and change part – RobotHumans May 26 '12 at 7:31
I've followed the instructions but it still boots to the GUI. Could it be because I'm using virtual box? – errorhandler May 26 '12 at 7:37

sudo gedit etc/default/grub

and replace




Also comment GRUB_HIDDEN_TIMEOUT=0 This line is for unhiding the GRUB menu (comment is to put "#" in the line )

sudo update-grub

and to start the x just type startx

share|improve this answer
No, I've done this before, I just want that the text mode doesn't ask for username and password – Navid777 Aug 13 '12 at 10:15
sudo update-rc.d -f gdm remove

If you use Kubuntu, replace gdm with kdm in the command above.

if it still does the graphical boot/shutdown, but it will drop you at the command line after boot. You should probably check the grub configuration. For that Click Here

share|improve this answer
I tried that but it still boots into the GUI – errorhandler May 26 '12 at 7:18
Then you may want to try GRUB configuration. – Mitch May 26 '12 at 7:19

Pardon me for asking, but why do you wan't to. There might be a better solution like using the alternative iso image or going into recovery mode (which should have some kind of command line only interface in it somewhere). If you could tell me your problem that you need solved in a different way and your situation I might be able to help you more, but what I recommend trying is booting to recovery mode.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.