User avatar
jorabo
Posts: 40
Joined: Thu Feb 21, 2013 8:31 am
Location: Nuernberg
Contact: Website

startx as user pi (permission denied)

Tue Jan 17, 2017 12:23 pm

Hi,

i recenty upgraded my RPI3, the result is,
that startx as user pi causes a error.
I tried to install the latest Raspbian jessie light, but got the same results with this fresh image. The only way "startx" works is as root.

Code: Select all

[email protected]:~ $ startx


X.Org X Server 1.18.4
Release Date: 2016-07-19
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.4.26-v7+ armv7l Raspbian
Current Operating System: Linux raspberrypi 4.4.38-v7+ #938 SMP Thu Dec 15 15:22:21 GMT 2016 armv7l
Kernel command line: 8250.nr_uarts=0 dma.dmachans=0x7f35 bcm2708_fb.fbwidth=800 bcm2708_fb.fbheight=480 bcm2709.boardrev=0xa02082 bcm2709.serial=0x14159675 smsc95xx.macaddr=B8:27:EB:15:96:75 bcm2708_fb.fbswap=1 bcm2709.uart_clock=48000000 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000  dwc_otg.lpm_enable=0 console=ttyS0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
Build Date: 11 November 2016  11:59:59AM
xorg-server 2:1.18.4-2+rpi1 (https://www.debian.org/support)
Current version of pixman: 0.33.3
        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/home/pi/.local/share/xorg/Xorg.0.log", Time: Tue Jan 17 12:09:56 2017
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
(EE)
Fatal server error:
(EE) parse_vt_settings: Cannot open /dev/tty0 (Permission denied)
(EE)
(EE)
Please consult the The X.Org Foundation support
         at http://wiki.x.org
 for help.
(EE) Please also check the log file at "/home/pi/.local/share/xorg/Xorg.0.log" for additional information.
(EE)
(EE) Server terminated with error (1). Closing log file.




xinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: server error
Couldn't get a file descriptor referring to the console
the rights of /dev/tty0 are

Code: Select all

crw--w---- 1 root tty 4, 0 Jan 17 12:08 /dev/tty0


So i changed them to

Code: Select all

crw-rw-rw- 1 root tty 4, 0 Jan 17 12:08 /dev/tty0
BUT .... i only crashed into the next message....

Code: Select all

[email protected]:~ $ startx


X.Org X Server 1.18.4
Release Date: 2016-07-19
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.4.26-v7+ armv7l Raspbian
Current Operating System: Linux raspberrypi 4.4.38-v7+ #938 SMP Thu Dec 15 15:22:21 GMT 2016 armv7l
Kernel command line: 8250.nr_uarts=0 dma.dmachans=0x7f35 bcm2708_fb.fbwidth=800 bcm2708_fb.fbheight=480 bcm2709.boardrev=0xa02082 bcm2709.serial=0x14159675 smsc95xx.macaddr=B8:27:EB:15:96:75 bcm2708_fb.fbswap=1 bcm2709.uart_clock=48000000 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000  dwc_otg.lpm_enable=0 console=ttyS0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
Build Date: 11 November 2016  11:59:59AM
xorg-server 2:1.18.4-2+rpi1 (https://www.debian.org/support)
Current version of pixman: 0.33.3
        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/home/pi/.local/share/xorg/Xorg.0.log", Time: Tue Jan 17 12:18:33 2017
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
(EE)
Fatal server error:
(EE) xf86OpenConsole: Cannot open virtual console 2 (Permission denied)
(EE)
(EE)
Please consult the The X.Org Foundation support
         at http://wiki.x.org
 for help.
(EE) Please also check the log file at "/home/pi/.local/share/xorg/Xorg.0.log" for additional information.
(EE)
(EE) Server terminated with error (1). Closing log file.

xinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: server error

Any ideas, solutions, help ? :?:

User avatar
DougieLawson
Posts: 35347
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: startx as user pi (permission denied)

Tue Jan 17, 2017 7:16 pm

Add your userid to the tty group.

Something like sudo useradd -G tty dougie;logout
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Martin Frezman
Posts: 1020
Joined: Mon Oct 31, 2016 10:05 am

Re: startx as user pi (permission denied)

Tue Jan 17, 2017 7:20 pm

Is this a known problem? Is it known that the latest upgrade messes up the group membership of the 'pi' user?
If this post appears in the wrong forums category, my apologies.

User avatar
PeterO
Posts: 4726
Joined: Sun Jul 22, 2012 4:14 pm

Re: startx as user pi (permission denied)

Tue Jan 17, 2017 9:16 pm

Martin Frezman wrote:Is this a known problem? Is it known that the latest upgrade messes up the group membership of the 'pi' user?
Did anyone think to type "ls -l /dev/tty0" on a working system ? :roll:
Or for that matter "groups" on a working system ? :roll:

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

Martin Frezman
Posts: 1020
Joined: Mon Oct 31, 2016 10:05 am

Re: startx as user pi (permission denied)

Tue Jan 17, 2017 10:16 pm

Good question.

Here's what I get on an old, working, Wheezy system:

[email protected] ~ $ dir /dev/tty0
0 crw------- 1 root root 4, 0 Dec 31 1969 /dev/tty0
[email protected] ~ $ groups
pi adm dialout cdrom sudo audio video plugdev games users netdev fuse gpio i2c spi input
[email protected] ~ $

And similar results on Jessie (no significant difference). So, it seems clear that access to that device is not needed for X to work. Hmmm.
If this post appears in the wrong forums category, my apologies.

User avatar
jorabo
Posts: 40
Joined: Thu Feb 21, 2013 8:31 am
Location: Nuernberg
Contact: Website

Re: startx as user pi (permission denied)

Wed Jan 18, 2017 6:45 am

It seems to be one of the following packages, because if i exclude them from upgranding , startx works fine:

apt-mark hold x11-common xarchiver xserver-common xserver-xorg xserver-xorg-core xserver-xorg-input-evdev xserver-xorg-input-synaptics xserver-xorg-video-fbdev lightdm lxinput lxkeymap lxterminal

User avatar
jorabo
Posts: 40
Joined: Thu Feb 21, 2013 8:31 am
Location: Nuernberg
Contact: Website

Re: startx as user pi (permission denied)

Wed Jan 18, 2017 6:59 am

Versions before upgrade:

Code: Select all

hi  x11-common                            1:7.7+7                                   all          X Window System (X.Org) infrastructure
hi  xarchiver                             1:0.5.4-1                                 armhf        GTK+ frontend for most used compression formats
hi  xserver-common                        2:1.17.2-1+rpi1                           all          common files used by various X servers
hi  xserver-xorg                          1:7.7+7+b1                                armhf        X.Org X server
hi  xserver-xorg-core                     2:1.17.2-1+rpi1                           armhf        Xorg X server - core server
ii  xserver-xorg-input-all                1:7.7+7+b1                                armhf        X.Org X server -- input driver metapackage
hi  xserver-xorg-input-evdev              1:2.9.2-1~bpo8+1                          armhf        X.Org X server -- evdev input driver
hi  xserver-xorg-input-synaptics          1.8.2-1~bpo8+1                            armhf        Synaptics TouchPad driver for X.Org server
hi  xserver-xorg-video-fbdev              1:0.4.4-1+rpi1                            armhf        X.Org X server -- fbdev display driver
hi  lightdm                               1.10.3-3                                  armhf        simple display manager
hi  lxterminal                            0.2.0-1                                   armhf        LXDE terminal emulator
hi  lxkeymap                              0.8.0~bzr25-1+rpi1                        all          Application that allows to easily switch between keyboard layouts
hi  lxinput                               0.3.4-1+rpi2                              armhf        LXDE keyboard and mouse configuration

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

Re: startx as user pi (permission denied)

Wed Jan 18, 2017 8:37 pm

jorabo wrote:I tried to install the latest Raspbian jessie light, but got the same results with this fresh image. The only way "startx" works is as root.
How did you add the PIXEL GUI to Raspbian Jessie Lite?

'startx' is working fine here on an up to date full version of Raspbian Jessie.

Code: Select all

uname -a
Linux Raspberrypi 4.4.38-v7+ #938 SMP Thu Dec 15 15:22:21 GMT 2016 armv7l GNU/Linux
User 'pi' is not a member of the 'tty' group.

Code: Select all

crw--w---- 1 root tty 4, 0 Jan 18 14:41 /dev/tty0
All the '/dev/tty*' devices are group 'tty', but only '/dev/tty1' is owned by 'pi'.

Dave.

himijendrix
Posts: 4
Joined: Mon Feb 29, 2016 11:14 am

Re: startx as user pi (permission denied)

Sun Feb 05, 2017 11:30 pm

I have the same problem.
LXDE was installed on an updated Jessie Lite following this guide: viewtopic.php?f=66&t=133691

Code: Select all

	sudo apt-get install --no-install-recommends xserver-xorg
	sudo apt-get install --no-install-recommends xinit
	sudo apt-get install lxde-core lxappearance
        sudo apt-get install lightdm
	sudo reboot -h 0
I am connected via SSH and when I login as pi and run

Code: Select all

startx
I get:

Code: Select all

X.Org X Server 1.18.4
Release Date: 2016-07-19
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.4.26-v7+ armv7l Raspbian
Current Operating System: Linux raspberrypi 4.4.38+ #938 Thu Dec 15 15:17:54 GMT 2016 armv6l
Kernel command line: dma.dmachans=0x7f35 bcm2708_fb.fbwidth=640 bcm2708_fb.fbheight=480 bcm2708.boardrev=0x900093 bcm2708.serial=0x125a2b6c smsc95xx.macaddr=B8:27:EB:5A:2B:6C bcm2708_fb.fbswap=1 bcm2708.uart_clock=48000000 bcm2708.disk_led_gpio=47 vc_mem.mem_base=0x1ec00000 vc_mem.mem_size=0x20000000  dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait modules-load=dwc2,g_ether
Build Date: 11 November 2016  11:59:59AM
xorg-server 2:1.18.4-2+rpi1 (https://www.debian.org/support)
Current version of pixman: 0.33.3
        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/home/pi/.local/share/xorg/Xorg.0.log", Time: Mon Feb  6 00:29:33 2017
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
(EE)
Fatal server error:
(EE) parse_vt_settings: Cannot open /dev/tty0 (Permission denied)
(EE)
(EE)
Please consult the The X.Org Foundation support
         at http://wiki.x.org
 for help.
(EE) Please also check the log file at "/home/pi/.local/share/xorg/Xorg.0.log" for additional information.
(EE)
(EE) Server terminated with error (1). Closing log file.
^Cxinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: unexpected signal 2
Couldn't get a file descriptor referring to the console
## UPDATE ##
I activated autologin to desktop using

Code: Select all

sudo raspi-config
and after pi is logged in I can run GUI applications using SSH (later this will be done by using a bash script). In this case it's a processing sketch which displays at a monitor connected to the HDMI port:

Code: Select all

DISPLAY=:0 /usr/local/lib/processing-3.2.4/processing-java --sketch=/home/pi/Star --present
Since I don't need anything from the LXDE Desktop, I'm now searching for an even more "low-memory" alternative to run GUI aplications. Xvfb might be possible, since I only need sound.

cashchew
Posts: 2
Joined: Fri Nov 18, 2016 9:06 pm

Re: startx as user pi (permission denied)

Tue Feb 07, 2017 9:28 pm

I have the same issue after updating to pixel, and with boot option set to Console Autologin, and run the startx with user pi in rc.local. Any solution for this?

shayneloyd
Posts: 1
Joined: Mon May 08, 2017 9:19 pm

Re: startx as user pi (permission denied)

Mon May 08, 2017 9:32 pm

I tried everything; I could think or find. When I ran

Code: Select all

sudo usermod -a -G tty pi
, my message changed from tty0 access to virtual console 2.
I found this on an Ubuntu forum; it worked for me

Code: Select all

sudo apt-get install xserver-xorg-legacy
, so I assume that means it is an issue with the xserver upgrade.

Return to “Raspbian”