Xserver Permission Denied tty7

8,166

Solution 1

I ran in this error today. After some investigation, the solution is provided by the Kodi how-to. Chapter 5 says:

As of Ubuntu 16.04 (Xenial Xerus), you need to install and reconfigure the package xserver-xorg-legacy instead.

It works fine on my rig.

Solution 2

Oke not really the best solution out there but changing the systemd start job to chmod /dev/tty7 before launching kodi seems to "fix" it. If anybody has a better and more ubuntu way to go, please enlighten me :D

[Unit]
Description = kodi-standalone using xinit
After = systemd-user-sessions.service network.target sound.target network-online.target

[Service]
User = kodi
Group = kodi
Type = simple
PAMName=login
ExecStartPre=/bin/chmod 777 /dev/tty7
PermissionsStartOnly=true
ExecStart = /usr/bin/xinit /usr/bin/dbus-launch --exit-with-session /usr/bin/openbox-session -- :0 -nolisten tcp vt7
Restart = on-abort

[Install]
WantedBy = multi-user.target
Share:
8,166

Related videos on Youtube

DanFritz
Author by

DanFritz

Updated on September 18, 2022

Comments

  • DanFritz
    DanFritz almost 2 years

    I have a linux box with kodi and the following systemd script to start kodi at boot:

    [Unit]
    Description = kodi-standalone using xinit
    After = systemd-user-sessions.service network.target sound.target network-online.target
    
    [Service]
    User = kodi
    Group = kodi
    Type = simple
    PAMName=login
    ExecStart = /usr/bin/xinit /usr/bin/dbus-launch --exit-with-session /usr/bin/openbox-session -- :0 -nolisten tcp vt7
    Restart = on-abort
    
    [Install]
    WantedBy = multi-user.target
    

    This worked fine under Ubuntu 15.10 but after an upgrade this doesn't work anymore. The service fails to start

    Apr 24 17:30:19 rasnas sudo[3644]: kodi : TTY=pts/0 ; PWD=/home/kodi ; USER=root ; COMMAND=/usr/sbin/service kodi start Apr 24 17:30:19 rasnas sudo[3644]: pam_unix(sudo:session): session opened for user root by kodi(uid=0) Apr 24 17:30:19 rasnas systemd[1]: Starting Detect the available GPUs and deal with any system changes... Apr 24 17:30:19 rasnas gpu-manager[3671]: /etc/modprobe.d is not a file Apr 24 17:30:19 rasnas gpu-manager[3671]: /etc/modprobe.d is not a file Apr 24 17:30:19 rasnas gpu-manager[3671]: /etc/modprobe.d is not a file Apr 24 17:30:19 rasnas gpu-manager[3671]: /etc/modprobe.d is not a file Apr 24 17:30:19 rasnas gpu-manager[3671]: /etc/modprobe.d is not a file Apr 24 17:30:19 rasnas gpu-manager[3671]: update-alternatives: error: no alternatives for x86_64-linux-gnu_gfxcore_conf Apr 24 17:30:19 rasnas systemd[1]: Started Detect the available GPUs and deal with any system changes. Apr 24 17:30:19 rasnas systemd[1]: Started kodi-standalone using xinit. Apr 24 17:30:19 rasnas sudo[3644]: pam_unix(sudo:session): session closed for user root Apr 24 17:30:19 rasnas systemd[3692]: pam_unix(login:session): session opened for user kodi by (uid=0) Apr 24 17:30:19 rasnas systemd[1]: Started Session 11 of user kodi. Apr 24 17:30:19 rasnas systemd[3692]: pam_ck_connector(login:session): cannot determine display-device Apr 24 17:30:19 rasnas xinit[3692]: X.Org X Server 1.18.3 Apr 24 17:30:19 rasnas xinit[3692]: Release Date: 2016-04-04 Apr 24 17:30:19 rasnas xinit[3692]: X Protocol Version 11, Revision 0 Apr 24 17:30:19 rasnas xinit[3692]: Build Operating System: Linux 3.13.0-85-generic x86_64 Ubuntu Apr 24 17:30:19 rasnas xinit[3692]: Current Operating System: Linux rasnas 4.4.0-21-generic #37-Ubuntu SMP Mon Apr 18 18:33:37 UTC 2016 x86_64 Apr 24 17:30:19 rasnas xinit[3692]: Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.4.0-21-generic root=UUID=1bca803d-6ad4-4e76-bc0d-10d37e041d51 ro quiet splash vt.handoff=7 Apr 24 17:30:19 rasnas xinit[3692]: Build Date: 07 April 2016 09:18:50AM Apr 24 17:30:19 rasnas xinit[3692]: xorg-server 2:1.18.3-1ubuntu2 (For technical support please see http://www.ubuntu.com/support) Apr 24 17:30:19 rasnas xinit[3692]: Current version of pixman: 0.33.6 Apr 24 17:30:19 rasnas xinit[3692]: Before reporting problems, check http://wiki.x.org Apr 24 17:30:19 rasnas xinit[3692]: to make sure that you have the latest version. Apr 24 17:30:19 rasnas xinit[3692]: Markers: (--) probed, (**) from config file, (==) default setting, Apr 24 17:30:19 rasnas xinit[3692]: (++) from command line, (!!) notice, (II) informational, Apr 24 17:30:19 rasnas xinit[3692]: (WW) warning, (EE) error, (NI) not implemented, (??) unknown. Apr 24 17:30:19 rasnas xinit[3692]: (==) Log file: "/home/kodi/.local/share/xorg/Xorg.0.log", Time: Sun Apr 24 17:30:19 2016 Apr 24 17:30:19 rasnas xinit[3692]: (==) Using system config directory "/usr/share/X11/xorg.conf.d" Apr 24 17:30:19 rasnas xinit[3692]: (EE) Apr 24 17:30:19 rasnas xinit[3692]: Fatal server error: Apr 24 17:30:19 rasnas xinit[3692]: (EE) xf86OpenConsole: Cannot open virtual console 7 (Permission denied) Apr 24 17:30:19 rasnas xinit[3692]: (EE) Apr 24 17:30:19 rasnas xinit[3692]: (EE) Apr 24 17:30:19 rasnas xinit[3692]: Please consult the The X.Org Foundation support Apr 24 17:30:19 rasnas xinit[3692]: at http://wiki.x.org Apr 24 17:30:19 rasnas xinit[3692]: for help. Apr 24 17:30:19 rasnas xinit[3692]: (EE) Please also check the log file at "/home/kodi/.local/share/xorg/Xorg.0.log" for additional information. Apr 24 17:30:19 rasnas xinit[3692]: (EE) Apr 24 17:30:19 rasnas xinit[3692]: (EE) Server terminated with error (1). Closing log file. Apr 24 17:30:23 rasnas hyperiond[853]: V4L2 Grabber: Signal lost Apr 24 17:30:34 rasnas xinit[3692]: /usr/bin/xinit: giving up Apr 24 17:30:34 rasnas xinit[3692]: /usr/bin/xinit: unable to connect to X server: Connection refused Apr 24 17:30:34 rasnas xinit[3692]: /usr/bin/xinit: server error Apr 24 17:30:34 rasnas systemd[3697]: pam_unix(login:session): session closed for user kodi

    So how can I fix this? Please note that everything worked fine using 15.10!

    Thanks!

  • eddiewould
    eddiewould about 8 years
    Please let us know what the root cause is when you find it. I hit the exact same thing!
  • Olle Härstedt
    Olle Härstedt almost 7 years
    In which file did you make this edit?
  • gazzamc
    gazzamc over 6 years
    See wiki.archlinux.org/index.php/Xorg#Rootless_Xorg The legacy wrapper needs more configuration: Edit /etc/X11/Xwrapper.config and add allowed_users=anybody needs_root_rights=yes