14

I'm not able to start any GUI applications as a root user:

# pgrep -lf Xorg
1590 /usr/bin/Xorg -br -nolisten tcp :0 vt7 -auth /var/lib/xdm/authdir/authfiles/A:0-PNnJzp
# echo $DISPLAY
:0
# xeyes
No protocol specified
Error: Can't open display: :0
# firefox
No protocol specified
No protocol specified
Error: cannot open display: :0
# xcalc
No protocol specified
Error: Can't open display: :0
#

Distribution is openSUSE 11.2(2.6.31.5-0.1-default) and X.Org X Server version is 1.6.5. My DISPLAY variable is set correctly, isn't it? Any ideas what might cause this problem?

1
  • This isn't really an SF question, and will probably get transferred soon, but you might want to look into the xauth command and see what you can learn about how the X server makes decisions about who should be allowed to perform operations through it.
    – MadHatter
    Commented Mar 6, 2013 at 8:38

1 Answer 1

14

:0 should work as should :0.0 (normal default) as also localhost:0 etc. Permissions are most likely problem.

Try disabling xhost with: xhost +

(This is unlikely to work but easier to do than the following which is required if it didn't).

So if that fails it's probably xauth.

Follow the first answer on here:

How to use xauth to run graphical application via other user on linux | Server Fault

To add the xauth key from your user logged into X to the root user.

3
  • 2
    ❯ xhost + xhost: unable to open display "home:10.0"
    – alper
    Commented Jun 14, 2020 at 15:13
  • $ xhost + xhost: unable to open display "desktop:0"
    – Mona Jalal
    Commented Jan 25, 2021 at 19:23
  • xhost + need to be executed before change user
    – qux
    Commented Oct 29, 2022 at 0:09

Not the answer you're looking for? Browse other questions tagged .