Error: Can't open display: :0.0

Hi,

I get errors while running xclock from a non root user:

[root@localhost girish]# xclock        --- this works fine
[root@localhost girish]# su - girish
[girish@localhost ~]$ DISPLAY=:0.0; export DISPLAY
[girish@localhost ~]$ xclock
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

Error: Can't open display: :0.0
[girish@localhost ~]$ 

I basically want to install oracle. Please advice.

Regards,
Girish.

Hi.

Try running this as root before you do "su - girish":

xhost local:girish
1 Like

Many thanks Scott.
It worked :slight_smile:

Hi,

How do you get around this if you cannot get root access? I get this same issue when I login as someone else and my display cannot connect

Thanks

cyberfrog:

Whichever user is logged in controls the console, therefore you won't need root in order to use the xhost command.

xhost will still do what you need as listed above, using the same format shown.

For other options, check 'man xhost'

Hope this helps!