New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to start KDE except as root user #891

Closed
Apophenia opened this Issue Jun 18, 2014 · 8 comments

Comments

Projects
None yet
4 participants
@Apophenia

Apophenia commented Jun 18, 2014

I installed trusty + the KDE, and I can't figure out how to start KDE except as root. startkde did not work out of the box, and it never has: I just get "$DISPLAY is not set or cannot connect to the X server."

I couldn't find any crouton-specific solutions when I Googled this problem, but I did see someone suggesting initializing X jointly with xinit startkde. This works, but only if I execute it as root. Otherwise, I get an X popup about how it can't write to a temporary directory, and KDE doesn't start.

setversion 1.4 failed: Permission denied
mkdir: cannot create directory ‘/home/lyndsey/.kde’: Permission denied
mkdir: cannot create directory ‘/home/lyndsey/.kde’: Permission denied
/usr/bin/startkde: 57: /usr/bin/startkde: cannot create /home/lyndsey/.kde/share/config/startupconfigkeys: Permission denied
trying to create local folder /home/lyndsey/.kde/share: Permission denied
/usr/bin/startkde: 94: test: Illegal number: 
Error: "/home/lyndsey/.kde/tmp-localhost" is not a link or a directory.
startkde: Call to lnusertemp failed (temporary directories full?). Check your installation.
Running exit commands...
/usr/bin/xinit: connection to X server lost

I suspect I may be facing something similar to issue #80 , but I don't have the knowledge to figure out how to reverse whatever I've done or make sure I don't do the exact same thing if I create another chroot.

Sorry if the answer to this is already documented somewhere, and thanks for making Crouton!

@DennisLfromGA

This comment has been minimized.

Collaborator

DennisLfromGA commented Jun 18, 2014

@Apophenia,

'startkde', as well as the other 'start*' commands, as well as enter-chroot, etc. do indeed need to be run as root but they enter the chroot as user 1000 which is the name you gave it when you first installed the chroot, in your case lyndsay. In my case, user 1000 is denny, so I'm logged in to the chroot as user denny.

This is the intended behaviour with crouton; see if when you run sudo startkde from crosh, it logs you in as lyndsay. If it's not working that way for you then there may be other problems and this is definitely the right place for that.

-DennisL

@Apophenia

This comment has been minimized.

Apophenia commented Jun 18, 2014

Thanks, that helps me frame the problem a lot. I have a feeling that the problem lies in what I'm doing to avoid this issue with X display.

sudo startkde works neither before nor after enter-chroot. (Am I wrong in thinking that sudo startkde should be, like sudo startxfce4, a shortcut for sudo enter-chroot startkde?) I still get the error about not being able to connect to the X server either way: $DISPLAY is not set or cannot connect to the X server.

Running sudo xinit startkde from outside the chroot results in this:

Fatal server error:
Server is already active for display 0
        If this server is no longer running, remove /tmp/.X0-lock
        and start again. 

Is this because it's not starting the graphical chroot first and is therefore trying to link into the X that's in use by Chrome OS?

The only command I have found so far that successfully starts the KDE is running sudo xinit startkde after enter-chroot, which starts the KDE as root (root@localhost). If I want to navigate the system as a normal user, I have to use su lyndsey to get lyndsey@localhost, which is why I suspect I've gone wrong somewhere.

@DennisLfromGA

This comment has been minimized.

Collaborator

DennisLfromGA commented Jun 18, 2014

@Apophenia,

(Am I wrong in thinking that sudo startkde should be, like sudo startxfce4, a shortcut for sudo enter-chroot startkde?)

Nope, you're right in your thinking - sudo startkde should work the same way, along with the shortcut that you mentioned.

I think what might have happenned is some of the permissions in your $HOME directory have been borked, I've seen this happen to others and a similar problem and solution was posted here #208 (comment). Hopefully the remedy is to simply remove the .ICEauthority file and try entering the chroot again (via sudo startkde from crosh).

-DennisL

@Apophenia

This comment has been minimized.

Apophenia commented Jun 18, 2014

(trusty)lyndsey@localhost:~$ rm .ICEauthority
rm: cannot remove ‘.ICEauthority’: No such file or directory

ls -a doesn't reveal anything similarly named, either.

@DennisLfromGA

This comment has been minimized.

Collaborator

DennisLfromGA commented Jun 19, 2014

@Apophenia, Sorry, I suppose the .ICEauthority file problem might have dealt with a different issue. I still suspect it might be a permissions problem but I'm afraid I'm out of my depth at this point. Hopefully someone more familiar with this will chime in. Fear not though, I haven't given up; I always have google at my side and I haven't even looked at even the Reddit Crouton threads yet... ;-)

@drinkcat

This comment has been minimized.

Collaborator

drinkcat commented Jun 19, 2014

@Apophenia : You're not the first one to hit this one. You should not use sudo startkde from inside the chroot, as that'll start KDE as root and break permissions in your home folder.

From crosh, you can use either sudo startkde, or sudo enter-chroot then startkde, but NOT sudo enter-chroot then sudo startkde.

See #624 for a fix: first sudo enter-chroot, then sudo chown -R 1000:1000 "$HOME".

@Apophenia

This comment has been minimized.

Apophenia commented Jun 19, 2014

Thanks @drinkcat! I ran sudo chown -R 1000:1000 "$HOME" and then successfully used sudo startkde after restarting crosh.

@DennisLfromGA

This comment has been minimized.

Collaborator

DennisLfromGA commented Jun 19, 2014

I was hoping some of the big guns would show up and they did, thanx @drinkcat. 👍
I thought I had seen this issue somewhere but I couldn't find it when needed :-(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment