Husar
Posts: 67
Joined: Tue Nov 12, 2013 12:43 am
Location: Midwest, USA

Can't login to GUI but SSH is ok. Help.

Sun Dec 11, 2016 10:49 pm

All of a sudden I can't login to the GUI on my RPi 3. First, I don't know why the GUI is asking me to login in the first place. I did not set this. When I login to the GUI it is NOT telling me my password is wrong with pi/raspberry. I get a screen flash to black then the login again. If I type in a wrong password then I do get the message that says wrong password. This tell me it is taking my pi/raspberry but then going immediately to the login again. Very strange.

Here is what I can do and have tried.

1. I got in via SSH. pi/raspberry works find.
2. I did a raspy-config and set the system to go console and not GUI. reboot.
3. Now I can login via the console and GUI doesn't load. That worked with pi/raspberry.
4. Next I tried to start the GUI with startx this took forever and eventually failed. Sorry, I did not capture the messages here. After a very long black screen it took me back to the console login.
5. Then I tried sudo startx. This did start the GUI.
6. I went into the Raspberry Pi Configuration via the GUI. I set Auto Login: Login as user 'pi' and Boot: To Desktop.

Then I rebooted.

It booted back to the console prompting me to login. This time I was able to get in with pi/raspberry but it did not boot to the GUI like I set. I then did a startx and it did what it did before. It fails with the following message. Then screen goes black for a few minutes. Finally comes back and I was able to take a photo this time.

https://drive.google.com/file/d/0B27yyU ... sp=sharing

Next I did a update then an upgrade. Got this message and pressed q to quit. It then finished the update.

https://drive.google.com/file/d/0B27yyU ... sp=sharing

I rebooted and nothing has changed. If I do a sudo startx then the GUI loads. But when I reboot I get the same login and can't use pi/raspberry to get in.

Any advice on fixing this?
Ed

User avatar
Paeryn
Posts: 3519
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: Can't login to GUI but SSH is ok. Help.

Mon Dec 12, 2016 1:00 am

Running sudo startx is a very bad idea, it will prevent the user from normally logging in to the GUI due to a file being now owned by root.

You can generally fix it by booting to the command line and entering (replace pi with your username and pi:pi with username:group if they are different from the default pi:pi)

Code: Select all

sudo chown pi:pi /home/pi/.Xauthority
This should revert the file back to being owned by pi and you should be able to log in again (just don't do it with sudo again).
She who travels light — forgot something.
Please note that my name doesn't start with the @ character so can people please stop writing it as if it does!

Husar
Posts: 67
Joined: Tue Nov 12, 2013 12:43 am
Location: Midwest, USA

Re: Can't login to GUI but SSH is ok. Help.

Mon Dec 12, 2016 2:28 am

Thank you. This fixed it.

Code: Select all

sudo chown pi:pi /home/pi/.Xauthority
Ed

bvrulez
Posts: 6
Joined: Sun Jun 26, 2016 11:51 pm

Re: Can't login to GUI but SSH is ok. Help.

Wed Jul 11, 2018 11:14 am

I had the same problem. I ran startx because I wanted to run gparted and I read somewhere that I need to do it that way instead of using gksudo. This fiexed my problem. Thanks a lot!

DirkS
Posts: 10787
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Can't login to GUI but SSH is ok. Help.

Wed Jul 11, 2018 1:04 pm

bvrulez wrote:
Wed Jul 11, 2018 11:14 am
I had the same problem. I ran startx because I wanted to run gparted and I read somewhere that I need to do it that way instead of using gksudo. This fiexed my problem. Thanks a lot!
No, you did not have the same problem otherwise the same solution would have worked.
Irrelevant necro.

venkatadp
Posts: 1
Joined: Sat May 04, 2019 9:13 am

Re: Can't login to GUI but SSH is ok. Help.

Sat May 04, 2019 9:17 am

Hi,
I had the same problem. And verified the permissions for "/home/pi/.Xauthority" file and user and group owner is "pi". But still unable to login through GUI.

I tried by uninstalling and re-installing the Lightdm package, Did not help.

Could you please help me, whether i am missing anything or not?

QSKONE
Posts: 2
Joined: Tue May 07, 2019 3:05 pm

Re: Can't login to GUI but SSH is ok. Help.

Tue May 07, 2019 3:09 pm

venkatadp wrote:
Sat May 04, 2019 9:17 am
Hi,
I had the same problem. And verified the permissions for "/home/pi/.Xauthority" file and user and group owner is "pi". But still unable to login through GUI.

I tried by uninstalling and re-installing the Lightdm package, Did not help.

Could you please help me, whether i am missing anything or not?
Same here. Pls help.

K-Research
Posts: 3
Joined: Wed Jul 17, 2019 2:05 pm

Re: Can't login to GUI but SSH is ok. Help.

Wed Jul 17, 2019 2:28 pm

I am having the same problem none of the solutions listed above work.

Anybody have any other ideas to resolve this?

Thanks in advance.

Return to “Troubleshooting”