LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-15-2013, 02:01 AM   #1
Meinchel
LQ Newbie
 
Registered: May 2013
Posts: 6

Rep: Reputation: Disabled
Can't open display. No protocol specified. using gdm


Hi all.
I've found this problem solved everywhere and I tried a lot of suggestions. But none of them worked.
This is the situacion.
- There is a server running a Debian. It has a user, let's say myuser.
- This myuser needs to execute a python library that makes use of libqt4 and it requires an active X server to perform almost any graphic operation. This python program does not need to pop up any window or so, it just creates a svg file, but the X server is a dependence that can't be avoided.
- But when I try to run this python I get the same as when I run, for instance, xclock:
$ xclock
No protocol specified
Error: Can't open display: :0.0


These are the things I tried to solve it unsuccesfully:
- login as myuser with ssh -X:
$ xhost +localhost
xhost: unable to open display "000.000.00.000:0.0"

Also tried login as root.

- xauth merge ~/.Xauthority

-In /etc/ssh/ssh_config set ForwardX11 yes

- xhost root logged as root. Also logged as myuser -I'm not sure who is the server and the client in this situation-.

- xhost + from both user and root
# xhost root
No protocol specified
xhost: unable to open display ":0"

- Installed network manager and added nm-system-settings.conf:
[keyfile]
hostname = <your hostname>

- In /etc/X11/Xwrapper.config allowed_users=anybody

After the changes sudo /etc/init.d/gdm restart

This may help:
$ startx
Fatal server error:
Server is already active for display 0
If this server is no longer running, remove /tmp/.X0-lock
and start again.
Please consult the The X.Org Foundation support
at http://wiki.x.org
for help.
^CInvalid MIT-MAGIC-COOKIE-1 keygiving up.
xinit: Resource temporarily unavailable (errno 11): unable to connect to X server
xinit: No such process (errno 3): unexpected signal 2.


Any idea? Thanks in advance.
 
Old 05-15-2013, 02:10 AM   #2
nyshtyak
Member
 
Registered: Nov 2008
Distribution: Arch
Posts: 38

Rep: Reputation: 2
Post here output of 'ps aux|grep X'. It will show the options you server started with as well as if your X server is really up and running. /var/log/Xorg.*.log could be useful too.
 
Old 05-15-2013, 03:47 AM   #3
Meinchel
LQ Newbie
 
Registered: May 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
There it goes:

# ps aux|grep X
root 934 0.0 0.5 94516 2928 tty7 Ss+ Apr25 7:36 /usr/bin/X :0 -audit 0 -auth /var/lib/gdm/:0.Xauth -nolisten tcp vt7
root 9370 0.0 0.1 15520 768 ? S 04:23 0:00 xinit /etc/X11/xinit/xinitrc -- /usr/bin/X :1 -auth /tmp/serverauth.cUFnJhfnCb
root 9371 0.0 1.9 100028 9552 tty8 S<s+ 04:23 0:01 /usr/bin/X :1 -auth /tmp/serverauth.cUFnJhfnCb
root 10273 0.0 0.0 5912 484 ? Ss 06:33 0:00 /usr/lib/gdm/gdmopen -l /bin/sh -c /usr/bin/whiptail --yesno 'There already appears to be an X server running on display :0. Should another display number by tried? Answering no will cause GDM to attempt starting the server on :0 again. (You can change consoles by pressing Ctrl-Alt plus a function key, such as Ctrl-Alt-F7 to go to console 7. X servers usually run on consoles 7 and higher.)' 16 70
root 10274 0.0 0.1 3956 628 tty9 Ss+ 06:33 0:00 -sh -c /usr/bin/whiptail --yesno 'There already appears to be an X server running on display :0. Should another display number by tried? Answering no will cause GDM to attempt starting the server on :0 again. (You can change consoles by pressing Ctrl-Alt plus a function key, such as Ctrl-Alt-F7 to go to console 7. X servers usually run on consoles 7 and higher.)' 16 70
root 10280 0.0 0.3 17904 1608 tty9 S+ 06:33 0:00 /usr/bin/whiptail --yesno There already appears to be an X server running on display :0. Should another display number by tried? Answering no will cause GDM to attempt starting the server on :0 again. (You can change consoles by pressing Ctrl-Alt plus a function key, such as Ctrl-Alt-F7 to go to console 7. X servers usually run on consoles 7 and higher.) 16 70
root 10468 0.0 0.0 5912 488 ? Ss 06:53 0:00 /usr/lib/gdm/gdmopen -l /bin/sh -c /usr/bin/whiptail --yesno 'There already appears to be an X server running on display :0. Should another display number by tried? Answering no will cause GDM to attempt starting the server on :0 again. (You can change consoles by pressing Ctrl-Alt plus a function key, such as Ctrl-Alt-F7 to go to console 7. X servers usually run on consoles 7 and higher.)' 16 70
root 10469 0.0 0.1 3956 624 tty10 Ss+ 06:53 0:00 -sh -c /usr/bin/whiptail --yesno 'There already appears to be an X server running on display :0. Should another display number by tried? Answering no will cause GDM to attempt starting the server on :0 again. (You can change consoles by pressing Ctrl-Alt plus a function key, such as Ctrl-Alt-F7 to go to console 7. X servers usually run on consoles 7 and higher.)' 16 70
root 10474 0.0 0.3 17904 1616 tty10 S+ 06:53 0:00 /usr/bin/whiptail --yesno There already appears to be an X server running on display :0. Should another display number by tried? Answering no will cause GDM to attempt starting the server on :0 again. (You can change consoles by pressing Ctrl-Alt plus a function key, such as Ctrl-Alt-F7 to go to console 7. X servers usually run on consoles 7 and higher.) 16 70
root 12541 0.0 0.1 7552 836 pts/2 S+ 10:37 0:00 grep X


The .log is LONG, not sure if I should paste all of it here... The last thing I see on that log are about devices, the mouse, concretely. (Is a quite fresh installation.)
 
Old 05-15-2013, 06:02 AM   #4
nyshtyak
Member
 
Registered: Nov 2008
Distribution: Arch
Posts: 38

Rep: Reputation: 2
Ok. I'm not a big specialist in X, but may be there is a good idea to try to stop GDM, kill all the X you started before (listed in ps output) and then start X from console?
 
Old 05-15-2013, 11:03 PM   #5
Meinchel
LQ Newbie
 
Registered: May 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
Well I did it and this is what I get now:

# ps aux|grep X
root 934 0.0 0.5 94516 2820 tty7 Ss+ Apr25 7:49 /usr/bin/X :0 -audit 0 -auth /var/lib/gdm/:0.Xauth -nolisten tcp vt7
root 9370 0.0 0.1 15520 752 ? S May15 0:00 xinit /etc/X11/xinit/xinitrc -- /usr/bin/X :1 -auth /tmp/serverauth.cUFnJhfnCb
root 9371 0.0 1.9 100028 9828 tty8 S<s+ May15 0:01 /usr/bin/X :1 -auth /tmp/serverauth.cUFnJhfnCb
root 16778 0.0 0.1 7552 832 pts/1 S+ 05:52 0:00 grep X


Also did this logged as user: $ export DISPLAY=localhost:0
And now the "No protocol specified" disappeared, and now only get the error:

ETE: cannot connect to X server localhost:0

If I try this as user I get:
$ xhost +
xhost: unable to open display "localhost:0"
 
Old 05-16-2013, 01:05 AM   #6
nyshtyak
Member
 
Registered: Nov 2008
Distribution: Arch
Posts: 38

Rep: Reputation: 2
Hmm. You still have two X servers run. My primary idea was avoid using GDM-started session. Also, try to set DISPLAY to ':1' where non-GDM X running. Does this help?
 
Old 05-16-2013, 07:22 PM   #7
Meinchel
LQ Newbie
 
Registered: May 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
I rebooted and this is what I get now:

# ps aux|grep X
root 927 0.4 1.3 93084 6748 tty7 Ss+ 02:06 0:00 /usr/bin/X :0 vt7 -nolisten tcp -auth /var/lib/xdm/authdir/authfiles/A:0-DRBDdQ

It seems there's only one X now. Then I guess that of :1 would not be necessay, am I wrong?
If I make this logged as root:
# echo $DISPLAY
:0.0

If I make this as user:
$ echo $DISPLAY
:0.0

And as user I still get:
$ xclock
No protocol specified
Error: Can't open display: :0.0

If I specify as user that of localhost, the protocol message disappears-I guess this should be good:
$ DISPLAY=localhost:0
$ xclock
Error: Can't open display: localhost:0

And I'm completely stuck now. :/
 
Old 05-16-2013, 08:58 PM   #8
Meinchel
LQ Newbie
 
Registered: May 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
Other things I tried:

# grep X11Forwarding /etc/ssh/sshd_config
X11Forwarding yes

(then login as ssh -Y user@hostname)

$ xhost + localhost

xhost: unable to open display :0.0

export XAUTHORITY=/home/usersnamegoesinhere/.Xauthority

sudo apt-get install --reinstall xserver-xorg

sudo dpkg-reconfigure xserver-xorg
 
Old 05-17-2013, 01:47 AM   #9
nyshtyak
Member
 
Registered: Nov 2008
Distribution: Arch
Posts: 38

Rep: Reputation: 2
Start X like this:
/usr/bin/X :0 vt7 -ac (this turns off authentication)

And run client with DISPLAY=localhost:0

I this work, all the problem is in authentication.
 
1 members found this post helpful.
Old 05-18-2013, 11:24 AM   #10
Meinchel
LQ Newbie
 
Registered: May 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
Thanks for helping me to discard causes, nyshtyak, I finally found it!
In /etc/X11/xdm/xdm-config I needed to set:

DisplayManager*authorize: false
DisplayManager*authComplain: false

I hope it helps somebody, it took me lots of hours to find it.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cairo Dock error "No protocol specified". Docky Gtk cannot open display: :0 nando321 Slackware 1 02-02-2013 04:41 PM
[SOLVED] a simple command in script not working:No protocol specified, Error cant open display mla.rue Linux - Newbie 3 11-07-2012 07:18 AM
No protocol specified Can't open display: :0.0 brandon@rhiamet.com Linux - General 3 04-06-2009 07:41 AM
Stretched display only in GDM?? TheJuice Linux - General 0 11-13-2007 10:55 AM
Display Protocol Hierarchy Statistics with tethereal powah Linux - Software 0 08-22-2005 11:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration