Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: HOWTO: Autologin and Autostart XFCE (just pushing power button)

  1. #1
    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 10:18 PM.

  2. #2
    Join Date
    May 2005
    Beans
    67
    Distro
    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.

  3. #3
    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.

  4. #4
    Join Date
    Dec 2004
    Location
    Braga-Portugal
    Beans
    251

    Re: HOWTO: Autologin and Autostart XFCE (just pushing power button)

    I'll try it... But if i screw my Ubuntu... I'LL KICK YOUR ASS!!! (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.

  5. #5
    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 ASS!!! (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...

  6. #6
    Join Date
    May 2005
    Beans
    18
    Distro
    Ubuntu Breezy 5.10

    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?

  7. #7
    Join Date
    Mar 2006
    Location
    Germany
    Beans
    59
    Distro
    Ubuntu 10.10 Maverick Meerkat

    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

  8. #8
    Join Date
    Aug 2005
    Location
    ON, Canada
    Beans
    46
    Distro
    Ubuntu UNR

    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 10:54 PM.

  9. #9
    Join Date
    May 2005
    Location
    Marlborough, UK
    Beans
    469
    Distro
    Ubuntu Karmic Koala (testing)

    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"

  10. #10
    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?

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •