I'm having the same issue found here (and tried to suggested solution, but that didn't help any):
But it won't let me comment on that one, says I don't have enough reputation. I used to be able to use the GUI all the time, but then after applying some patches a few months ago, it stopped letting me log-in to the GUI. I hoped it was a temporary bug that would eventually get fixed, but it's still a problem, and preventing me form using the desktop GUI (and thus some programs).
The CLI works fine, but in the GUI, I select my user name, put in the password, it acts like it's logging in, then the screen goes black, and eventually it goes back to the log-in screen.
I'm running "Ubuntu 16.04.1 LTS" and have tried applying the latest patches with "apt upgrade", but the problem persists.
The only error message I see when logging in on the CLI:
[ ##.######] systemd-login: Failed to start user service, ignoring: Unknown unit: firstname.lastname@example.org
I put #'s in there because that number seems to change every time.
Thanks in advance for any suggestions or help.
If I login to the CLI, then run "startx", it does basically the same thing, dumping me back to the CLI.
Here's the only error message I see in the output:
xinit: connection to X server lost