Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I was trying to find the /etc/inittab where I do my autologin. But in Ubuntu 11.04 that file seems to be lost. Is this the correct way you do it in Ubuntu?

# Auto Login for Ubuntu how?
# 1. apt-get install mingetty
# 2. vim /etc/init/tty1.conf

# tty1 - getty
#
# This service maintains a getty on tty1 from the point the system is
# started until it is shut down again.
start on stopped rc RUNLEVEL=[2345]
stop on runlevel [!2345]
respawn
#exec /sbin/getty -8 38400 tty1
exec /sbin/mingetty --autologin <PUTYOUR_USERNAME_HERE> tty1
^
|____ edited only this line, seems to be working 
share|improve this question

3 Answers 3

up vote 16 down vote accepted

There is no /etc/inittab in Ubuntu, because Ubuntu uses upstart to define startup services and runlevel. And this has not started from the last release of Ubuntu, but a long time ago.

Anyway, you can still use inittab, simply create one. I report a passage from /usr/share/doc/upstart/README.Debian.gz:

How do I change the default runlevel?
-------------------------------------

If you have an /etc/inittab file, edit it.  Locate the following line:

    id:N:initdefault:

Where N is the default runlevel, change this to match.

Most people won't have that file, you can edit /etc/init/rc-sysinit.conf
and change the following line:

    env DEFAULT_RUNLEVEL=2

but bear in mind that Ubuntu do not use standard runlevel meaning as other linux distros/unix os. Old standard was:

  • 0 - shutdown
  • 1 - single user mode
  • 3 - multiuser text mode
  • 5 - multiuser graphical mode
  • 6 - reboot

but Ubuntu uses:

  • 0 - shutdown
  • 1 - single user mode
  • 2 - multiuser graphical mode
  • 6 - reboot

Finally, if you want to have a virtual terminal with automatic login, then modifying the exec line in tty1.conf seems the correct way, though I do not know mingetty, so cannot say if you used it correctly.

share|improve this answer
    
I don't really see how this is an answer to the question. The only information you've provided that is even related to the question is your last sentence wherein you state that you do not actually know the answer... –  Justin Buser Jun 6 '13 at 8:21

On my xubuntu 11.10 system, the default runlevel was set in /etc/init/rc-sysinit.conf - the line in question read env DEFAULT_RUNLEVEL=2. So I created a /etc/init/rc-sysinit.override, and put in it one line that reads env DEFAULT_RUNLEVEL=5, so now my default runlevel is 5.


Then I created a /etc/init/lightdm.override (or gdm.override, or kdm.override, whatever the case may be for whatever display manager you're using), and copied all of the start and stop items from lightdm.conf - and just changed the runlevel bits so my display manager starts in runlevel 5, and stops in other runlevels.

share|improve this answer

I unclear as to what and where the "this" you have posted is supposed to be. Regardless however, Upstart will still parse /etc/inittab if it exists, I'd suggest putting non-runlevel related stuff into it just as you did before.

share|improve this answer

Your Answer

 
discard

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.