GrahamBowman
Posts: 6
Joined: Thu Sep 22, 2011 3:20 pm

Cannot boot to X using startx with a user other than pi

Tue Sep 29, 2015 1:32 pm

Hi all. I'm really stuck with this one.

I'm setting up an SD card to be used in a classroom setting.

I want to instruct students to use adduser to create their own area to save files. When logging on as any new user, startx will run but go straight to a black screen. I've left it a long time to see if it was just loading but there's no activity on the LEDs or screen.

The user pi can run startx without issue and any new user can run sudo startx but booting into root's desktop. However using tightvncserver I can login as a new user and boot to their desktop remotely, just not directly on the Pi.

Can anyone suggest why this might be happening or possible fixes?

For information:
Raspberry Pi 2
I have ran apt-get update and apt-get upgrade
I have installed cntlm and added a script to the file /etc/skel/.profile to ask for the user's username and password and insert that into /etc/cntlm.conf
I have set the proxy to go via cntlm in /etc/apt/apt.conf.d/10proxy and /etc/environment

I have tried using an empty skel, skel as the /home/pi folder and skel as a fresh /home/pi from another SD card.

User avatar
AndyD
Posts: 2334
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: Cannot boot to X using startx with a user other than pi

Tue Sep 29, 2015 1:43 pm

The problem is with permissions. The pi user belongs to a number of groups. From memory you will need to add the new user to at least the video and audio groups.

sudo usermod -aG audio,video newuser

GrahamBowman
Posts: 6
Joined: Thu Sep 22, 2011 3:20 pm

Re: Cannot boot to X using startx with a user other than pi

Tue Sep 29, 2015 3:16 pm

Sorry I forgot to add, I edited a file (can't remember which) that adds new users to all the extra groups that pi is in. When I run groups pi and groups newuser the output is the same (apart from the username).

GrahamBowman
Posts: 6
Joined: Thu Sep 22, 2011 3:20 pm

Re: Cannot boot to X using startx with a user other than pi

Fri Oct 02, 2015 9:49 am

I found my error. I had a script running in the user's ~/.profile which ran when logging in, but also ran with startx.

To correct it I put my script into /etc/rc.local which runs before the login so doesn't interrupt the graphical environment.

Return to “Troubleshooting”