CLI Autologin and autostart a program with Ubuntu 9.10 karmik


Posted by Andrew McCombe on Fri Feb 12, 2010


My old laptop is used as a music server and so I haven’t installed a desktop on it. I use MPD as my music server and ncmpd as the front-end.  However, I’m finding it a pain to enter my username, password, wait (its an old, slow lappy) and then enter ncmpd, so I looked for a way to do this automatically.  And guess what? It can be done!

This is a two step process and requires mingetty to be installed:

Then I needed to edit /etc/init/tty1.conf and edit the getty line:

The final step was to create a .bash_login file and add the path to ncmpc:

NOTE: I have come across a few posts that refer to /etc/event.d/tty1.conf. It seems that this has been deprecated and moved to /etc/init/tty1.conf. If your system doesn’t already have one, check the other.