Automatically log into Xfce without a login managerJuly 13, 2006 at 8:24 am | Posted in tips and tricks, xubuntu | 16 Comments
This has been done countless times before. However, I want to provide a version that doesn’t require messing with gcc and removing xubuntu-desktop. This howto is based off of this message from the Ubuntu Lite group.
1) Install mingetty:
sudo aptitude install mingetty
2) Edit your .bash_profile file. This controls what happens when you log in:
And paste this in, at the bottom of the file:
# autologin tty2
if [ -z "$DISPLAY" ] && [ $(tty) == /dev/tty2 ];
Save the file, and exit.
3) Edit /etc/inittab (
sudo mousepad /etc/inittab), and replace the following line:
1:2345:respawn:/sbin/getty 38400 tty1
2:23:respawn:/sbin/getty 38400 tty2
#1:2345:respawn:/sbin/getty 38400 tty1
Obviously, replace YOURUSERNAME with your username. Save the file and exit.
4) Stop GDM from loading on startup. Go to Xfce menu > Services, and uncheck “Graphical Login Manager (gdm)”.
5) Reboot. While this saves RAM, Xfce’s default Quit menu does not work (for me, anyway.) To fix this, create a group that can shutdown your computer:
sudo addgroup shutdown
Then, edit /etc/group:
sudo mousepad /etc/group
Scroll down to the bottom, and write in your username after
export EDITOR=mousepad && sudo visudo
And paste in:
%shutdown ALL=(root) NOPASSWD: /sbin/halt, /sbin/reboot, /sbin/shutdown
Then, right click the Xfce menu > run, Edit menu, and create shortcuts to
gksudo /sbin/halt and
gksudo /sbin/reboot. Save your menu, and exit.
Now, your computer will automatically log in, and save some RAM and CPU cycles along the way.