View previous topic :: View next topic |
Author |
Message |
philip Guru
Joined: 10 Jun 2003 Posts: 535 Location: Sweden
|
Posted: Tue Jul 21, 2009 7:12 pm Post subject: Xlib: connection to ":0.0" refused by server [Solv |
|
|
I have installed a CAD program (ProE). It has a startscript:
/usr/local/ptc/proe_startscript
When I run the startscript as root, the program starts fine. But if I run the startscript as user I get the following error message
Quote: | Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified
Error opening display
Graphics type 'OPENGL' is not available with current window environment. |
I have searched the forum but have not found anything that leads me to a solution. If anyone can give me a hint of what the problem might be I would be most greatful.
I have no other problems with X, either as user or root. _________________ /Phil
Last edited by philip on Wed Jul 22, 2009 2:44 pm; edited 1 time in total |
|
Back to top |
|
|
Mike Hunt Watchman
Joined: 19 Jul 2009 Posts: 5287
|
Posted: Tue Jul 21, 2009 8:51 pm Post subject: |
|
|
You can add a user to the X server access list. Run as <username>
Code: | $ xhost +local:<username> |
This allows <username> to connect to the local running X server, which might do what you need. |
|
Back to top |
|
|
philip Guru
Joined: 10 Jun 2003 Posts: 535 Location: Sweden
|
Posted: Wed Jul 22, 2009 2:32 pm Post subject: |
|
|
Hi Mike,
Are you shure I should not run this command as root?
I did as you recommended but get:
Quote: | philip@phils_pc ~ $ xhost +local:philip
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified
xhost: unable to open display ":0.0" |
_________________ /Phil |
|
Back to top |
|
|
philip Guru
Joined: 10 Jun 2003 Posts: 535 Location: Sweden
|
Posted: Wed Jul 22, 2009 2:38 pm Post subject: |
|
|
I ran it as root and then it worked;
Quote: | phils_pc philip # xhost +local:philip
non-network local connections being added to access control list |
Tha application starts fine now (as <user> in terminal).
Thanks Mike! _________________ /Phil |
|
Back to top |
|
|
mikegpitt Advocate
Joined: 22 May 2004 Posts: 3224
|
Posted: Wed Jul 22, 2009 3:31 pm Post subject: |
|
|
It should be noted that opening up the xserver with xhost+ does have some level of security risk to it, although it is smaller when specifying xhost+ with a username, as mentioned above. I would recommend firewalling off port 6000 if you plan to use this often and for extended periods of time, especially if you are working on an open network. |
|
Back to top |
|
|
philip Guru
Joined: 10 Jun 2003 Posts: 535 Location: Sweden
|
Posted: Sat Jul 25, 2009 11:14 am Post subject: |
|
|
Thanks for the advice, I will firewall port 6000.
I am still curious why I need to open up the xserver with xhost+ for this particular application and no other applications? The specific circumstans is that I installed this application manually, i.e. it is not part of the Portage tree. But I have installed other applications manually, without this happening. _________________ /Phil |
|
Back to top |
|
|
widremann Veteran
Joined: 14 Mar 2005 Posts: 1314
|
Posted: Sat Jul 25, 2009 3:46 pm Post subject: |
|
|
mikegpitt wrote: | It should be noted that opening up the xserver with xhost+ does have some level of security risk to it, although it is smaller when specifying xhost+ with a username, as mentioned above. I would recommend firewalling off port 6000 if you plan to use this often and for extended periods of time, especially if you are working on an open network. |
X shouldn't be listening on TCP, so firewalling port 6000 is unnecessary. If it is listening on TCP, turn it off with the -nolisten tcp option to the X server. |
|
Back to top |
|
|
toralf Developer
Joined: 01 Feb 2004 Posts: 3934 Location: Hamburg
|
Posted: Sat Jul 25, 2009 6:00 pm Post subject: |
|
|
philip wrote: | Thanks for the advice, I will firewall port 6000.
I am still curious why I need to open up the xserver with xhost+ for this particular application and no other applications? The specific circumstans is that I installed this application manually, i.e. it is not part of the Portage tree. But I have installed other applications manually, without this happening. | Probably b/c the application runs as user root which isn't the X11 login user ? |
|
Back to top |
|
|
philip Guru
Joined: 10 Jun 2003 Posts: 535 Location: Sweden
|
Posted: Mon Jul 27, 2009 9:02 am Post subject: |
|
|
toralf,
I always log in as "user myslef", i.e. not as root. I installed the program manually as root, i.e su root before installing. When I ran the program as root the X problem did not show. But it was when I wanted to launch the program from a "user myself" termianal that the problem arose. Maybe I should have installed the program as "user myself"? But that is not customary, is it?
widreman,
Is there any way to determine if X listens to TCP? _________________ /Phil |
|
Back to top |
|
|
toralf Developer
Joined: 01 Feb 2004 Posts: 3934 Location: Hamburg
|
Posted: Mon Jul 27, 2009 9:44 am Post subject: |
|
|
philip wrote: | toralf,Maybe I should have installed the program as "user myself"?
| No.
philip wrote: |
widreman,
Is there any way to determine if X listens to TCP? | Look, whether this gives a reasonable output : Code: | ps -efla | grep nolisten | , btw within /usr/kde/3.5/share/config/kdm/kdmrc or sth similar it should be either set or not set. |
|
Back to top |
|
|
philip Guru
Joined: 10 Jun 2003 Posts: 535 Location: Sweden
|
Posted: Mon Jul 27, 2009 8:57 pm Post subject: |
|
|
OK, output says;
Quote: | # ps -efla | grep nolisten
4 S root 6013 5960 2 80 0 - 75522 - Jul25 tty7 01:20:17 /usr/bin/X -br -nolisten tcp :0 vt7 -auth /var/run/xauth/A:0-MOPRpP
0 R root 7251 7242 0 80 0 - 1225 - 22:55 pts/1 00:00:00 grep --colour=auto nolisten |
Does not seem to say anything about user ....
Also,
Quote: | # cat /usr/kde/3.5/share/config/kdm/kdmrc | grep listen
# Whether KDM should listen to incoming XDMCP requests.
# The UDP port on which KDM should listen for XDMCP requests. Do not change.
ServerArgsLocal=-nolisten tcp |
I am not sure how to enterpret this... _________________ /Phil |
|
Back to top |
|
|
Mike Hunt Watchman
Joined: 19 Jul 2009 Posts: 5287
|
Posted: Tue Jul 28, 2009 4:30 am Post subject: |
|
|
philip wrote: | OK, output says;
Quote: | # ps -efla | grep nolisten
4 S root 6013 5960 2 80 0 - 75522 - Jul25 tty7 01:20:17 /usr/bin/X -br -nolisten tcp :0 vt7 -auth /var/run/xauth/A:0-MOPRpP
0 R root 7251 7242 0 80 0 - 1225 - 22:55 pts/1 00:00:00 grep --colour=auto nolisten |
Does not seem to say anything about user ....
X runs as root, and -nolisten-tcp prevents tcp connection to the X server
Also,
Quote: | # cat /usr/kde/3.5/share/config/kdm/kdmrc | grep listen
# Whether KDM should listen to incoming XDMCP requests.
# The UDP port on which KDM should listen for XDMCP requests. Do not change.
ServerArgsLocal=-nolisten tcp |
I am not sure how to enterpret this...
You can set
ServerArgsLocal=
to allow tcp connections to the X server |
What is the output of $ ls -l /usr/local/ptc/proe_startscript; groups |
|
Back to top |
|
|
toralf Developer
Joined: 01 Feb 2004 Posts: 3934 Location: Hamburg
|
Posted: Tue Jul 28, 2009 7:39 am Post subject: |
|
|
Mike Hunt wrote: | You can set
ServerArgsLocal=
to allow tcp connections to the X server | which BTW is the better solution than put a comment sign in fromt of that line '#' - b/c if you later change that file via the KDE control center, that line is lost ... |
|
Back to top |
|
|
philip Guru
Joined: 10 Jun 2003 Posts: 535 Location: Sweden
|
Posted: Mon Aug 10, 2009 3:51 pm Post subject: |
|
|
Mike,
There is no info about user, maybe becasue I use to do su root before I manage my system.
If I stay as user (philip) and do $ ps -efla | grep nolisten
then I get;
Quote: | $ ps -efla | grep nolisten
4 S root 5985 5935 3 80 0 - 140339 - 15:25 tty7 00:05:00 /usr/bin/X -br -nolisten tcp :0 vt7 -auth /var/run/xauth/A:0-l0DNBy
0 R philip 11700 11686 0 80 0 - 1225 - 17:48 pts/1 00:00:00 grep --colour=auto nolisten |
Output of ls -l /usr/local/ptc/proe_startscript; groups is;
Quote: | $ ls -l /usr/local/ptc/proe_startscript; groups
-rwxrwxrwx 1 root root 1115 2009-07-21 20:30 /usr/local/ptc/proe_startscript
disk wheel audio cdrom video games cdrw users portage plugdev vboxusers |
Does this ad any insight?
In which file, btw do I set ServerArgsLocal=
?
Is it in xorg.conf? _________________ /Phil |
|
Back to top |
|
|
Mike Hunt Watchman
Joined: 19 Jul 2009 Posts: 5287
|
Posted: Mon Aug 10, 2009 4:07 pm Post subject: |
|
|
philip wrote: | $ ps -efla | grep nolisten
4 S root 5985 5935 3 80 0 - 140339 - 15:25 tty7 00:05:00 /usr/bin/X -br -nolisten tcp :0 vt7 -auth /var/run/xauth/A:0-l0DNBy
0 R philip 11700 11686 0 80 0 - 1225 - 17:48 pts/1 00:00:00 grep --colour=auto nolisten |
When I do that I get this as normal user Code: | $ps -efla | grep nolisten ; echo $?
1 |
philip wrote: | Output of ls -l /usr/local/ptc/proe_startscript; groups is;
$ ls -l /usr/local/ptc/proe_startscript; groups
-rwxrwxrwx 1 root root 1115 2009-07-21 20:30 /usr/local/ptc/proe_startscript
disk wheel audio cdrom video games cdrw users portage plugdev vboxusers
Does this ad any insight? |
I don't have/know that so I can't comment.
philip wrote: | In which file, btw do I set ServerArgsLocal=
?
Is it in xorg.conf? |
No, it's here. for KDE-4.3.0 on ~x86
but you can do a locate kdmrc if it's not there on your box. Code: | /usr/share/config/kdm/kdmrc |
Hope that helps a little. |
|
Back to top |
|
|
|