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
Old May 2nd, 2005   #1
peekpt
First Cup of Ubuntu
 
Join Date: Apr 2005
Beans: 4
Lightbulb HOWTO: Autologin and Autostart XFCE without login managers

Are you tired off typing logins? Don't want to load heavy/waste of time 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 underline):

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+X to save) btw, use your prefered editor.

Let's compile.. you will need to have gcc installed:

Code:
sudo gcc -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:
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

I used this page as guide:

http://www.dicas-l.unicamp.br/dicas-l/20030129.shtml

Last edited by peekpt; May 2nd, 2005 at 05:18 PM..
peekpt is offline   Reply With Quote
Old May 5th, 2005   #2
abowman
Just Give Me the Beans!
 
Join Date: May 2005
Beans: 68
Ubuntu 6.10 Edgy
Re: HOWTO: Autologin and Autostart XFCE (just pushing power button)

All I did was install Xfce with synaptic and then opened up the Login Screen Setup which can be found under Settings and clicked on Auto Login and selected a user.
abowman is offline   Reply With Quote
Old May 6th, 2005   #3
anggarda
First Cup of Ubuntu
 
Join Date: May 2005
Beans: 2
Re: HOWTO: Autologin and Autostart XFCE (just pushing power button)

abowman, I think you missread the title of his thread.

His howto is the *efficient way of loading xfce on a light system.

The various, login managers, utilise memory in the background.

Salut.
anggarda is offline   Reply With Quote
Old May 6th, 2005   #4
telmo
Ubuntu Extra Shot
 
Join Date: Dec 2004
Location: Braga-Portugal
Beans: 332
Re: HOWTO: Autologin and Autostart XFCE (just pushing power button)

I'll try it... But if i screw my Ubuntu... I'LL KICK YOUR ***!!! (gently!)
Just kidding!
__________________
Linux user #383892

(\ /)
(O.o)
(> <)

This is Bunny. Copy Bunny into your signature to help him on his way to world domination.
telmo is offline   Reply With Quote
Old May 6th, 2005   #5
peekpt
First Cup of Ubuntu
 
Join Date: Apr 2005
Beans: 4
Re: HOWTO: Autologin and Autostart XFCE (just pushing power button)

Quote:
Originally Posted by telmo
I'll try it... But if i screw my Ubuntu... I'LL KICK YOUR ***!!! (gently!)
Just kidding!
I just did this because it's no need to load gdm (lloading extra libs) when you are the only user on the system... I have the autologin running on my laptop with a customized kernel. It boots fast and with the autologin faster.
xfce rox...
peekpt is offline   Reply With Quote
Old May 30th, 2005   #6
wirjo
5 Cups of Ubuntu
 
wirjo's Avatar
 
Join Date: May 2005
Beans: 21
Ubuntu Breezy 5.10
Send a message via MSN to wirjo
Re: HOWTO: Autologin and Autostart XFCE (just pushing power button)

Quote:
Originally Posted by peekpt
I just did this because it's no need to load gdm (lloading extra libs) when you are the only user on the system... I have the autologin running on my laptop with a customized kernel. It boots fast and with the autologin faster.
xfce rox...
How do you bring back the login manager that you deleted?
wirjo is offline   Reply With Quote
Old March 16th, 2006   #7
ChrisNiemy
Just Give Me the Beans!
 
ChrisNiemy's Avatar
 
Join Date: Mar 2006
Location: Germany
Beans: 58
Ubuntu 7.10 Gutsy Gibbon
Re: HOWTO: Autologin and Autostart XFCE (just pushing power button)

Works even better when you uses "startx" instead of "startxfce4" in the ~/.bash_profile

Otherwise I got problems with font savings etc.

Looks like this (compared with first post here):
Code:
if [ -z "$DISPLAY" ] && [ $(tty) == /dev/tty1 ]; then
    startx
fi
Thanks so much for this! Just great! Couldn`t think of this would work. So cool
ChrisNiemy is offline   Reply With Quote
Old March 19th, 2006   #8
conor
Just Give Me the Beans!
 
Join Date: Aug 2005
Location: ON, Canada
Beans: 30
Kubuntu 7.10 Gutsy Gibbon
Re: HOWTO: Autologin and Autostart XFCE (just pushing power button)

This is a great idea! I have a few problems though. When I turn on the computer the autologin works and then xfce4 will begin to load. After a few milliseconds though it boots me out to the command line again and I have to type "sudo startx". Then everything runs as root. What did I do wrong?

Nevermind, I was wrong. It works now.

Last edited by conor; March 21st, 2006 at 05:54 PM..
conor is offline   Reply With Quote
Old March 29th, 2006   #9
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
Re: HOWTO: Autologin and Autostart XFCE (just pushing power button)

If you are using a newer version of ubuntu you will need to
Code:
sudo apt-get install gcc-3.4
then replace
Code:
sudo gcc -o autologin autologin.c
with
Code:
sudo gcc-3.4 -o autologin autologin.c
so it compiles correctly
__________________
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"
Haegin is offline   Reply With Quote
Old May 3rd, 2006   #10
peschkaj
5 Cups of Ubuntu
 
Join Date: Mar 2006
Beans: 18
Re: HOWTO: Autologin and Autostart XFCE without login managers

Wouldn't it also be possible to use something like sysv-rc-conf to remove gdm from the boot order and still use the method you described?
peschkaj 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 08:55 AM.


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