I use

  • Debian Wheezy/Sid with XDM
  • urxvt as terminal as well as i3 as window manager
  • ~/.xsession and /.Xresources as session and resources file, respectively.

Last night I accidentally used up all my battery, so my notebook shut down. Since then, whenever I try to login with xdm (as launched by startup), the session crashes and loops back to the login screen as described here.

However, if I start XDM manually by

sudo xdm -session ~/.xsession

I can log in normally without the session crashing. Judging from the terminal layout I get, ~/.Xresources isn't loaded and adding -resoucres ~/.Xresources to the line starting XDM doesn't help either.

Now, what I want is XDM to behave as before on startup, that is not to loop back to login screen after logging in, and my terminal to look as before. I believe that means I have to tell XDM to use ~/.Xresources as well as ~/.xsession by default.

I also tried to launch XDM as

sudo xdm -config .xdm-config

where ~/.xdm-config is a config file I copied from /etc/X11/xdm/xdm-config in which I changed the values of the lines

  • DisplayManager*resources to /home/*myname*/.Xresources and
  • DisplayManager*session to /home/*myname*/.xsession.

As before (manually specifying) the correct session file was used, but the terminal layout remained wrong, so the correct resources file probably wasn't used.

What can I do?

  • By the way, I copied .Xresources to .Xdefaults, so that my terminal now looks like before, but this solution isn't as "clean" as I want it to be. – k.stm Oct 4 '12 at 15:01
  • Your question is on topic and absolutely fine to stay here. If it doesn't receive enough attention, you could place a bounty on it or migrate it to Unix & Linux, as you wish. If the latter is what you want, flag it for moderator attention to have it migrated. – slhck Oct 4 '12 at 18:53

After an unsuccessful login you could look into ~/.xsession-errors. It usually shows what went wrong.

Looking into ~/.xsession-errors won't help though if your home directory is read-only, or full, or you ran into your quota. In this case you would get returned to the login screen quick, too, because X needs write access to your ~/.Xauthority file.

Quota or full disk don't apply the root user (there are usually 5% of a disk space kept free for root-only usage) so that may be the reason why it worked with sudo but not without.


I had this same issue. From my research, it could be one of the following:

  • the space in name bug
  • no startlxdm
  • missing .x-- files


space in name:

  1. save an extra copy of

    /usr/share/xsessions/<your desktop environment, mine was xfce>.desktop
  2. open up

    /usr/share/xsessions/<your desktop environment, mine was xfce>.desktop

    as root using mousepad or other editor

  3. replace all spaces (" ") with a hyphen (dash) or underscore
    • graphically, using "Search" --> "Find and Replace...." in mousepad
    • [CTRL] + H usually works
  4. save changes

no startlxdm:

  1. save a copy of

  2. open up


    as root using mousepad or other editor

  3. after this (or similar) line:

    ## default session or desktop used when no systemwide config....

    add this line:

    session=/usr/bin/start<your desktop environment, xfce4 for me>
  4. save changes

missing .x--files:

  • I have no experience here. search around on the web. sorry. :/

FYI: I'm no noob to this, but no master either. Proceed at your own risk.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.