formula13x
Posts: 3
Joined: Wed Aug 12, 2015 4:24 pm

Only the pi user can run applications in X11

Wed Aug 12, 2015 4:32 pm

I just received a brand new raspberry Pi 2 Model B. After going through the install of raspian using NOOBS, I added a user and added them to sudo.

Both the pi account and the additional user can start x windows, however, only the pi user seems to be able to run programs like the python games or the minecraft.. When logged in as the other user, I can open a terminal window, but can't seem to run other things.

I can run the epiphany web browser as the additional user, but when I try to pull up a web page of any kind the window disappears?

What is going on? Any help will be greatly appreciated.

asandford
Posts: 1998
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: Only the pi user can run applications in X11

Wed Aug 12, 2015 11:21 pm

formula13x wrote:I just received a brand new raspberry Pi 2 Model B. After going through the install of raspian using NOOBS, I added a user and added them to sudo.

Both the pi account and the additional user can start x windows, however, only the pi user seems to be able to run programs like the python games or the minecraft.. When logged in as the other user, I can open a terminal window, but can't seem to run other things.

I can run the epiphany web browser as the additional user, but when I try to pull up a web page of any kind the window disappears?

What is going on? Any help will be greatly appreciated.
Make sure that your additional user belongs to the appropriate groups.

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 13367
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Only the pi user can run applications in X11

Thu Aug 13, 2015 1:12 am

adding an additional user can be done, but its not the normal way to go, and can be a PITA to set up.

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: Only the pi user can run applications in X11

Thu Aug 13, 2015 1:12 am

IOW, why make life so hard on yourself?

I mean, seriously, if this is a learning experience, then sure, go for it. Figure out all the 50,000 things you have to configure manually to get your new user to work the same as the pi user.

But if the goal is just to get up and running, then just use 'pi'. You'll thank yourself.
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: Only the pi user can run applications in X11

Thu Aug 13, 2015 1:13 am

mahjongg wrote:adding an additional user can be done, but its not the normal way to go, and can be a PITA to set up.
Yes, massive +1 on this.
(Your post came in as I was composing my previous post)
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

formula13x
Posts: 3
Joined: Wed Aug 12, 2015 4:24 pm

Re: Only the pi user can run applications in X11

Thu Aug 13, 2015 1:59 am

Yes.. It was a learning experience. Trying to work through some stuff with the kids and wanted to give them their own home directory and account etc.. If I wanted a full linux experience, what distro is recommended for this device?

InsideJob
Posts: 58
Joined: Sat Jul 04, 2015 3:00 pm

Re: Only the pi user can run applications in X11

Thu Aug 13, 2015 2:02 am

Looks to me like they've learned very little about Linux if they can't even add a new user account.

It's a perfectly normal thing to do. Any app that refuses to work is just poorly written garbage. You don't even need to add them to suders. Debian like some other Linux distros wants a group with the same name as the user account though.

formula13x
Posts: 3
Joined: Wed Aug 12, 2015 4:24 pm

Re: Only the pi user can run applications in X11

Thu Aug 13, 2015 5:14 am

InsideJob wrote:Looks to me like they've learned very little about Linux if they can't even add a new user account.

It's a perfectly normal thing to do. Any app that refuses to work is just poorly written garbage. You don't even need to add them to suders. Debian like some other Linux distros wants a group with the same name as the user account though.
This was all within about 10 minutes of unboxing it, and their very first exposure to linux. A usser was added using normal means (not typically very complicated, but I'm seeing here that it is a bit more involved on raspbian for some reason, and that does interest me a bit). Sudo wasn't necessary, just a preference for them to be able to run things requiring elevated privileges. The apps that aren't running in the X Window System are the default apps that are installed. No new packages were installed. Everything that they explored within the shell worked as expected. The idea was to let them have a more personalized LXDE experience etc.. I now understand that Raspbian is not necessarily intended to provide elegant exploration of all of these features, and that's fine and I can appreciate that, it does it's job and does it well. I'm just curious at this point if there is a distro recommended by the community for such exploration. I see lots of options https://en.wikipedia.org/wiki/Raspberry ... ng_systems. I'm just looking to consult with the community about it.

Thanks!

User avatar
jojopi
Posts: 3353
Joined: Tue Oct 11, 2011 8:38 pm

Re: Only the pi user can run applications in X11

Thu Aug 13, 2015 7:51 am

formula13x wrote:Both the pi account and the additional user can start x windows, however, only the pi user seems to be able to run programs like the python games or the minecraft.
minecraft-pi requires access to the VideoCore GPU, so your user will need to be a member of group "video". If you want sound you may need to be in group "audio" too, but that does not appear to be a hard requirement.

The python games are installed in /home/pi rather than system wide, because you are encouraged to modify the programs yourself. Other users can either run pi's copies, or install their own from https://github.com/KenT2/python-games. Switching to a different distro is not going to make either option any easier.

The authors of GUIs generally think that users are so scared of error messages that they would rather have things just silently fail. If you want to know why something is not working, you are better to run it from a terminal than a menu.

DAveShillito
Posts: 10
Joined: Sun Jun 17, 2012 9:43 pm

Re: Only the pi user can run applications in X11

Wed Oct 07, 2015 8:35 pm

Cheers for that,

I was just setting a pair of user accounts up for two siblings and failing to get Minecraft to start.
Adding them both to the video and audio groups seems to have fixed it :)

DAve

plugwash
Forum Moderator
Forum Moderator
Posts: 3688
Joined: Wed Dec 28, 2011 11:45 pm

Re: Only the pi user can run applications in X11

Wed Oct 07, 2015 8:48 pm

The root problem is that we (still :( ) don't have proper intergration between the GPU and X. So apps that want to use 3D on the Pi need to run with fairly high privilages (e.g. "video" group) so they can hack arround this limitation.

flagtrax
Posts: 38
Joined: Thu Mar 02, 2017 12:31 am

Re: Only the pi user can run applications in X11

Wed Mar 29, 2017 9:26 pm

Hi All,
I know this thread is a bit old, but I am new to the Pi, and Linux and got my hands on a Pi 2B. My command line experience goes way back before "Dos" hit the scene so the syntax is a bit foreign to me. I've installed Rasbian via NOOBs, and all that went well. But like the originator of this thread I haven't been able to run these same python programs under a new user. (By that I mean clicking on the python menu item and nothing happens.) Why do I want to, it has been asked. There are many blogs encouraging setting up users other than the default "pi" for security reasons. That makes sense to me. So I added a new user, with sudo, and assigned groups, still I am unable to run those python games under the new user login. (they do run without issue using "pi". Most other selections from the menu run. Any explanation and help would be greatly appreciated.

User avatar
DougieLawson
Posts: 40126
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Only the pi user can run applications in X11

Wed Mar 29, 2017 9:38 pm

Have you added your new userid to the following groups:

Code: Select all

 adm dialout cdrom sudo audio video plugdev games users input netdev gpio i2c spi
Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

flagtrax
Posts: 38
Joined: Thu Mar 02, 2017 12:31 am

Re: Only the pi user can run applications in X11

Wed Mar 29, 2017 10:12 pm

Hi Doug, Thanks for the reply, yes I actually did all the groups that "pi" had.

User avatar
DougieLawson
Posts: 40126
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Only the pi user can run applications in X11

Wed Mar 29, 2017 10:14 pm

After adding a user to groups you need to restart the session for that user by logging out and back in or (possibly easier) rebooting.
Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

flagtrax
Posts: 38
Joined: Thu Mar 02, 2017 12:31 am

Re: Only the pi user can run applications in X11

Wed Mar 29, 2017 10:19 pm

Yep I think i did that :lol: let me try again

dgordon42
Posts: 793
Joined: Tue Aug 13, 2013 6:55 pm
Location: Dublin, Ireland

Re: Only the pi user can run applications in X11

Wed Mar 29, 2017 10:26 pm

The 'Python Games' files are in the '/home/pi/python_games/' directory, so if you are logged in with a different user name the bash script that runs the Python Games Menu can't find them.
I added a soft link from my new users home directory to the '/home/pi/python_games' directory with:

Code: Select all

cd 
ls -s /home/pi/python_games python_games
and the games run OK.

Hope this helps,
Dave.

flagtrax
Posts: 38
Joined: Thu Mar 02, 2017 12:31 am

Re: Only the pi user can run applications in X11

Wed Mar 29, 2017 10:27 pm

So I tried a log out/in, and a reboot and login. still the same... specifically if I open the menu, navigate to games the submenu comes up with minecraft pi and Python games. Clicking on minecraft brings it up, but for the python games the hour glass comes up with the pointer for a few seconds then drops.

flagtrax
Posts: 38
Joined: Thu Mar 02, 2017 12:31 am

Re: Only the pi user can run applications in X11

Thu Mar 30, 2017 3:54 am

Thank you Dave for the reply. So I did that from the new-user home, exited the terminal rebooted, and logged back in. Unfortunately all stayed the same. This is not an important thing, I'm just getting started with Raspbian and using this as a learning experience. I'm very new to the syntax, and even though there are some similarities to command line OS's of the past like DOS or CP/M, RTE, Etc., it appears to me at least that file management, as well as user control can be a bit tricky. My overall goal is to get proficient enough to integrate the pi with my Arduino and ESP8266 projects. Working from windows with the Arduino IDE works OK, but I see many on those forums relate more toward Linux based systems. I've also used the NodeMCU IDE on the 8266 and that leans even more-so toward Linux so at times I feel lost. I may try reimaging the sd and start over incase I inadvertently messed something up. I'll post results for others who may have interest.

stderr
Posts: 2178
Joined: Sat Dec 01, 2012 11:29 pm

Re: Only the pi user can run applications in X11

Thu Mar 30, 2017 4:37 am

flagtrax wrote:, still I am unable to run those python games under the new user login. (they do run without issue using "pi". Most other selections from the menu run. Any explanation and help would be greatly appreciated.
I don't have the full Raspbian running so I'm not sure exactly what you are trying to do but as another poster suggested, it might be true that the games are actually owned by the pi account. So perhaps the menu is confused when it is invoked by an account that isn't pi. For example, if a menu was set up to run from the home directory of a user, and it was assumed to be pi user, if it wasn't the pi user, it wouldn't be the same home directory. There are things like this hard coded into various scripts on the lite version of raspbian so I'm not doubting it could be true in the full one too.

flagtrax
Posts: 38
Joined: Thu Mar 02, 2017 12:31 am

Re: Only the pi user can run applications in X11

Thu Mar 30, 2017 5:02 am

Hi stderr,
Thank you for your insight. If I understand the documentation correctly, loading Raspbian from NOOBs would be a full install. According to Dave's post he was able to create a work around by placing a "soft link" to "pi's" directory. (see his post for commands). That worked for him, but it failed to change anything on the Rpi in question.

IMHO if a GUI's menu has an item in it, it should be accessible without having to jump through hoops. Conversely if it isn't available, it shouldn't show up in the application menu. That to me is the point of a GUI. As in networking situations an object on a server would be presented to the (permitted) clients GUI. This would be administered by the network administrator not the client. But again, I am brand new to Raspbian and the whole Linux world, so I realize I shouldn't speculate, I'm just trying to learn how it comes together. Thanks again.

dgordon42
Posts: 793
Joined: Tue Aug 13, 2013 6:55 pm
Location: Dublin, Ireland

Re: Only the pi user can run applications in X11

Thu Mar 30, 2017 11:13 am

Apologies, there's a typo in my earlier post. The commands to set up a soft link to the pi users 'python_games' directory should read:

Code: Select all

cd 
ln -s /home/pi/python_games python_games
You should be logged in with your new user name when you run those commands.

You can check the results of those commands with:

Code: Select all

ls -lh python_games
and the result should be:

Code: Select all

lrwxrwxrwx 1 flash flash 22 Oct  4  2015 python_games -> /home/pi/python_games/
As you can see, my new user name here is 'flash'.

This change, and the addition of the groups to your new user as suggested by Dougie above, should get your games working.

Sorry about the confusion,
Dave.

flagtrax
Posts: 38
Joined: Thu Mar 02, 2017 12:31 am

Re: Only the pi user can run applications in X11

Thu Mar 30, 2017 2:41 pm

Hi Dave,
Thanks for that. Entered said commands verified proper results..but...no change. Rebooted, logged back in .....no change. And looking at the folder with the GUI file manager, I do see a shortcut to the /home/pi/python_games folder. Puzzling..

flagtrax
Posts: 38
Joined: Thu Mar 02, 2017 12:31 am

Re: Only the pi user can run applications in X11

Fri Mar 31, 2017 5:34 am

Well Guy's, I had some time to play tonight, and reimaged the Pi, went through creating a new user gave sudo privileges, added to groups. then did Dave's workaround and it works now. Only thing I can think at this point is something had gotten corrupted at some point. Thank you all for the great help.

Return to “Raspberry Pi OS”