Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Other Community Discussions > Tutorials & Tips
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Ubuntu 9.10 is out!!!

When downloading Ubuntu 9.10 please consider using bittorrent to get your copy of Ubuntu.

The Ubuntu Developers Summit for Lucid Lynx will be held the week of 16-Nov-2009 till 20-Nov-2009 in Dallas, TX USA. Visit the the Ubuntu wiki for more information about UDS and how to participate remotely.

Tutorials & Tips
The place to find Ubuntu related Tips & Tricks.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old March 29th, 2006   #1
Haegin
Quad Shot of Ubuntu
 
Haegin's Avatar
 
Join Date: May 2005
Location: Marlborough, UK
Beans: 483
Ubuntu Karmic Koala (testing)
Send a message via MSN to Haegin Send a message via Skype™ to Haegin
HOWTO: Automatically login to XFCE without a login manager

I based this post of one made in the Hoary section by "peekpt" with some updates for breezy and later versions of ubuntu.

Are you tired off typing logins? Don't want to load heavy login managers?

This guide let's you have autologin and autostart for your XFCE:

Let's open a console and then create the file autologin.c

Code:
sudo nano autologin.c
and paste this code inside (middle mouse button will paste the text you select):
Code:
int main() { execlp( "login", "login", "-f", "your_user_here", 0); }
replace the string: your_user_here with the user you want to autologin. (ctrl+O to save and Ctrl + X to quit)

Let's compile.. you will need to have gcc-3.4 installed so if you dont you need to
Code:
sudo apt-get install gcc-3.4
first. (If you are unsure just try and install it anyway).

Code:
sudo gcc-3.4 -o autologin autologin.c
copy the compiled autologin file into /usr/local/sbin

Code:
sudo cp autologin /usr/local/sbin
now we need to edit the file /etc/inittab

Code:
sudo nano /etc/inittab
search for this:

Code:
1:2345:respawn:/sbin/getty 38400 tty1
put a # to comment this line and add this new line:

Code:
1:2345:respawn:/sbin/getty -n -l /usr/local/sbin/autologin 38400 tty1
it will look like this:

Code:
#1:2345:respawn:/sbin/getty 38400 tty1
1:2345:respawn:/sbin/getty -n -l /usr/local/sbin/autologin 38400 tty1
2:23:respawn:/sbin/getty 38400 tty2
3:23:respawn:/sbin/getty 38400 tty3
4:23:respawn:/sbin/getty 38400 tty4
5:23:respawn:/sbin/getty 38400 tty5
this will make the autologin stuff...

let's make the autostart:

Code:
Code:
nano .bash_profile
put this code on the bottom and save it

Code:
if [ -z "$DISPLAY" ] && [ $(tty) == /dev/tty1 ]; then
       startxfce4
fi
then you just have to remove your login manager :
Code:
sudo apt-get remove gdm xdm kdm
Reboot your machine (to try it out)

I used this page as guide:
http://www.dicas-l.unicamp.br/dicas-l/20030129.shtml

Notes
If you don't use xfce you can also run startx at startup using
Code:
if [ -z "$DISPLAY" ] && [ $(tty) == /dev/tty1 ]; then
       startx
fi
in your .bash_profile file instead.

To undo the changes you have made just edit the inittab file and uncomment the line you commented and comment out the line you added.
Code:
sudo nano /etc/inittab
__________________
Regards,
Haegin
If all else fails curl up in bed with a good book.
"<mc44> rob: every time you don’t read the topic, god kills a lolcat"

Last edited by Haegin; December 11th, 2006 at 04:49 PM.. Reason: Updating to bring inline with new forum rules on howtos
Haegin is offline   Reply With Quote
 

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:54 PM.


vBulletin ©2000 - 2009, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. lingonberry