Cannot Login Using GUI – 2





I use the Xfce desktop with the lxdm display manager on most of my systems. I have run into a problem with logging in recently and it took me days of research over weeks of time to figure this out. It was a time-consuming task and due to the number of people complaining about it on various Linux fora I thought it might be helpful for me to record my solution here.

Of course, I verified that my /tmp directory still had plenty of room to create new files.

The symptoms

The symptoms I encountered were that I was unable to login as a non-root user through the lxdm login screen. It looked like it worked and the display was left with only the background and none of the normal login fields. Checking the running processes showed that some of the normal processes to be expected for a GUI login user had started but the desktop never displayed. Eventually an error message indicating that the failsafe desktop could not start.

All users including root could login via SSH or one of the virtual consoles.

The solution

I managed to find an old solution from July of 2008 to this same problem on the Internet on LinuxQuestions.org.

It is really simple. I just add the following line to the /etc/X11/xinit/xinitrc file.

exec ck-launch-session xfce4-session

This listing is the complete, revised version of my /etc/X11/xinit/xinitrc file. Be sure to add the exec line in the location shown.

#!/usr/bin/sh
# Copyright (C) 1999 - 2005 Red Hat, Inc. All rights reserved. This
# copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the
# GNU General Public License version 2.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# Authors:
#       Mike A. Harris <mharris@redhat.com>

# Mandatorily source xinitrc-common, which is common code shared between the
# Xsession and xinitrc scripts which has been factored out to avoid duplication
. /etc/X11/xinit/xinitrc-common

#########################################################################################
#########################################################################################
# Added by David Both to try to resolve a strange problem when starting GUI sessions.
#########################################################################################
#########################################################################################
exec ck-launch-session xfce4-session

# The user may have their own clients they want to run.  If they don't,
# fall back to system defaults.
if [ -f $HOME/.Xclients ]; then
    exec $CK_XINIT_SESSION $SSH_AGENT $HOME/.Xclients || \
    exec $CK_XINIT_SESSION $SSH_AGENT $HOME/.Xclients
elif [ -f /etc/X11/xinit/Xclients ]; then
    exec $CK_XINIT_SESSION $SSH_AGENT /etc/X11/xinit/Xclients || \
    exec $CK_XINIT_SESSION $SSH_AGENT /etc/X11/xinit/Xclients
else
    # Failsafe settings.  Although we should never get here
    # (we provide fallbacks in Xclients as well) it can't hurt.
    [ -x /usr/bin/xsetroot ] && /usr/bin/xsetroot -solid '#222E45'
    [ -x /usr/bin/xclock ] && /usr/bin/xclock -geometry 100x100-5+5 &
    [ -x /usr/bin/xterm ] && xterm -geometry 80x50-50+150 &
    [ -x /usr/bin/twm ] && /usr/bin/twm
fi

Resources

I did not figure out the actual fix myself. Internet searches showed a fairly high number of people who have experienced this problem going back to at least 2008 from what I can tell. Most of the information did not resolve this problem for me even though it may have done so for others.

I did find this fix which does work for me on LinuxQuestions.org.