You are not logged in.

#1 2015-03-21 08:39:32

knowNothing23
Member
Registered: 2013-08-25
Posts: 33

No protocol specified xhost: unable to open display ":0.0"

Hello all,

I know this is a common problem.
Whenever I try to start firefox, xclock, dolphin, or any gui from terminal it shows this errors:

/home/jav/.Xauthority
[jav@localhost ~]$ su
Password: 
[root@new-host jav]# firefox 

(process:2898): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
No protocol specified
No protocol specified
Error: cannot open display: :0.0
[root@new-host jav]# su
[root@new-host jav]# jav
bash: jav: command not found
[root@new-host jav]# cls
bash: cls: command not found
[root@new-host jav]# 
[root@new-host jav]# su jav
[jav@new-host ~]$ xeyes
bash: xeyes: command not found
[jav@new-host ~]$ xhost +
No protocol specified
xhost:  unable to open display ":0.0"
[jav@new-host ~]$ xhost + :0.0
No protocol specified
xhost:  unable to open display ":0.0"
[jav@new-host ~]$ xhost + jav
No protocol specified
xhost:  unable to open display ":0.0"
[jav@new-host ~]$ ps aux | grep X11
jav       3023  0.0  0.0  10696  2232 pts/1    S+   04:36   0:00 grep X11
[jav@new-host ~]$ dolphin 
No protocol specified
dolphin: cannot connect to X server :0.0
[jav@new-host ~]$ 




My $DISPLAY and $XAUTHORITY are present in my environment; however, things do not work.

I have tried several "solutions" and none work for me hmm
I have tried this:
https://bbs.archlinux.org/viewtopic.php?id=108695
http://unix.stackexchange.com/questions … -specified
http://www.linuxquestions.org/questions … 175462031/
http://unix.stackexchange.com/questions … -superuser

Offline

#2 2015-03-21 10:13:58

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: No protocol specified xhost: unable to open display ":0.0"

It's not clear
1. are you running from X or from tty
2. why are you trying to run GUI apps as root. https://wiki.archlinux.org/index.php/Ru … ps_as_root

Offline

#3 2015-03-21 13:36:10

knowNothing23
Member
Registered: 2013-08-25
Posts: 33

Re: No protocol specified xhost: unable to open display ":0.0"

I startx into a KDM display manager.
From here I open my terminal and open chrome and do my thing.
Then, if I want to open any GUI from the terminal. i.e, evince, firefox, dolphin, or whatever. I get that error.

If I try to open those GUIs without the terminal, then the GUIs would just don't show up at all and no error
message is shown.

Even when I try to run things as non-root I get those error messages.

Help.

Last edited by knowNothing23 (2015-03-21 13:37:22)

Offline

#4 2015-03-21 13:43:13

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: No protocol specified xhost: unable to open display ":0.0"

What's the output of

uname -a
env | grep -e DISPLAY -e AUTHORITY
loginctl show-session $XDG_SESSION_ID

When did this problem start?

Edit: Also

echo $HOSTNAME

Last edited by karol (2015-03-21 13:46:38)

Offline

#5 2015-03-21 20:10:08

knowNothing23
Member
Registered: 2013-08-25
Posts: 33

Re: No protocol specified xhost: unable to open display ":0.0"

The problem started since I installed my arch linux for the first time.
I had this problem before with other laptops, but the other solutions worked that time.

BTW, I also get the error of warning some files such as /temp/*  has as owner other user or something.
This happens when I install stuff with pacman.

Here's the output you requested:

[jav@localhost ~]$ uname -a
Linux new-host.home 3.18.2-2-ARCH #1 SMP PREEMPT Fri Jan 9 07:37:51 CET 2015 x86_64 GNU/Linux
[jav@localhost ~]$ env | grep -e DISPLAY -e AUTHORITY
DISPLAY=:0.0
XAUTHORITY=/home/jav/.Xauthority
[jav@localhost ~]$ loginctl show-session $XDG_SESSION_ID
Id=c1
Name=jav
Timestamp=Sat 2015-03-21 15:59:52 EDT
TimestampMonotonic=26940669
VTNr=1
TTY=tty1
Remote=no
Service=login
Scope=session-c1.scope
Leader=271
Audit=0
Type=tty
Class=user
Active=yes
State=active
IdleHint=no
IdleSinceHint=1426967992537715
IdleSinceHintMonotonic=26842810
[jav@localhost ~]$ echo $HOSTNAME
localhost
[jav@localhost ~]$ 

Thanks for the help!

Last edited by knowNothing23 (2015-03-21 20:10:35)

Offline

#6 2015-03-21 20:24:53

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: No protocol specified xhost: unable to open display ":0.0"

Fix your hostname: https://wiki.archlinux.org/index.php/Hostname

And don't run your browser as root: that is just insane.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#7 2015-03-21 20:28:30

knowNothing23
Member
Registered: 2013-08-25
Posts: 33

Re: No protocol specified xhost: unable to open display ":0.0"

I read the page, but I don't know what you mean by fix.

Should my hostname be jav?

Offline

#8 2015-03-21 20:40:48

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: No protocol specified xhost: unable to open display ":0.0"

knowNothing23 wrote:

I read the page, but I don't know what you mean by fix.

Should my hostname be jav?

Did you run

# hostnamectl set-hostname localhost

?
In your first post I see

[jav@localhost ~]$ su
Password: 
[root@new-host jav]#

Is this what's literally printed on th screen?

Offline

#9 2015-03-21 20:42:54

Alad
Wiki Admin/IRC Op
From: Bagelstan
Registered: 2014-05-04
Posts: 2,420
Website

Re: No protocol specified xhost: unable to open display ":0.0"

karol wrote:

In your first post I see

[jav@localhost ~]$ su
Password: 
[root@new-host jav]#

Is this what's literally printed on th screen?

I remember having that with a correctly configured hostname (in /etc/hosts and /etc/hostname), but it was "root@new-host-2". No idea why that happens.


Mods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby

Offline

#10 2015-03-21 21:17:55

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: No protocol specified xhost: unable to open display ":0.0"

knowNothing23 wrote:

I read the page, but I don't know what you mean by fix.

Should my hostname be jav?

Your hostname should be whatever you want it to be.

Please don't expect to have your hand held here...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#11 2015-03-23 20:57:29

knowNothing23
Member
Registered: 2013-08-25
Posts: 33

Re: No protocol specified xhost: unable to open display ":0.0"

@jasonwryan: My hostname is set as localhost. If it can be any arbitrary name, then this hostname should do.

@karol: Thanks, I think that

# hostnamectl set-hostname localhost

fixed my problem, but then again this problem is weird.
It would come and go.
And, yes code snippet I posted at the beginning is literally what my computer shows.

Offline

#12 2015-03-23 23:20:21

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: No protocol specified xhost: unable to open display ":0.0"

knowNothing23 wrote:

@jasonwryan: My hostname is set as localhost. If it can be any arbitrary name, then this hostname should do.

man hostnamectl wrote:

If a static hostname is set, and is valid (something other than localhost)...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB