Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Failed to open X11 display; make sure the DISPLAY env variable is set correct  (Read 9423 times)

0 Members and 1 Guest are viewing this topic.

c-jay

  • Newbie
  • *
  • Posts: 26
    • View Profile
    • Email
Hi,

after updating Ubuntu 14.01 to Ubuntu 16.01 xenial with KDE 4.14 I get this terminal error :

root@PC-Ubuntu:/home/user/test# ./TEST
Failed to open X11 display; make sure the DISPLAY environment variable is set correctly
 

If i run the code in Eclipse the window open correctly.

Some additional Informaion:
root@PC-Ubuntu:/home/user/test# echo $DISPLAY
localhost:10.0

root@PC-Ubuntu:/home/user/test# grep X /etc/ssh/sshd_config
X11Forwarding yes
X11DisplayOffset 10
 
Any idea how to fix?


c-jay

  • Newbie
  • *
  • Posts: 26
    • View Profile
    • Email
solved-> don't run program as root