LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-15-2013, 03:11 AM   #1
beyonce
LQ Newbie
 
Registered: Feb 2013
Posts: 1

Rep: Reputation: Disabled
can not start Xwindows


I use RHEL 6 server , when I start xwindows , it pops the following error , I checked no other X server is running by chkconfig , can advise what is wrong ? thanks

bash-2.05b# startx

_XSERVTransSocketINETCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already running

Fatal server error:
Cannot establish any listening sockets - Make sure an X server isn't already running

If you encounter a server crash, please report the problem by filing a bug
report in the XFree86.org bugzilla at http://bugs.xfree86.org and/or Red Hat
bugzilla at http://bugzilla.redhat.com/bugzilla. When filing your report, it
is very important that you explain your problem in as much detail as possible,
and include a complete description on how to reproduce the problem. After
submitting the bug report, attach the following files as uncompressed
individual file attachments using the bugzilla file attachment feature:
- X server log file: /var/log/XFree86.0.log
- Kernel log file: /var/log/messages
 
Old 02-15-2013, 07:52 PM   #2
kostya
Member
 
Registered: Mar 2010
Location: Moscow, Russia
Distribution: Ubuntu Studio, antix(mepis), Fedora, FreeBSD
Posts: 173
Blog Entries: 5

Rep: Reputation: 17
How about this ?
 
Old 02-15-2013, 08:12 PM   #3
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Did you check or set your DISPLAY variable before launching startx? Also, are you launching it on local machine or remote system?
Code:
user#hostname~$ echo $DISPLAY
user@hostname~$ startx &
Also, once check manual here.
 
Old 02-16-2013, 07:57 PM   #4
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
The DISPLAY environment variable doesn't exist and is not valid unless the X server is already running.

If it is already running, then startx SHOULD fail unless you are specifying an alternate display (I believe the syntax is "startx -- :1" where the "1" is the alternate unused display, and the DISPLAY environment gets created with a ":1.0" value).
 
Old 02-17-2013, 10:09 PM   #5
cmt2013
LQ Newbie
 
Registered: Feb 2013
Posts: 2

Rep: Reputation: Disabled
I also have the same problem , when run "echo $DISPLAY", nothing output to the screen , when run "startx -- :1" , there is the same error , how to fix it ? thanks
 
Old 02-17-2013, 10:27 PM   #6
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Quote:
Originally Posted by cmt2013 View Post
I also have the same problem , when run "echo $DISPLAY", nothing output to the screen , when run "startx -- :1" , there is the same error , how to fix it ? thanks
In that case, you can set DISPLAY manually as,
Code:
For bash shell:
[user@localhost]~$ set DISPLAY=localhost:0.0; export DISPLAY

For csh/tcsh shell:
[user@localhost]~$ setenv DISPLAY localhost:0.0
To check whether DISPLAY is set properly, invoke any x utility:
Code:
[user@localhost]~$ xterm &
OR
[user@localhost]~$ xclock &
If these x utilities launch on your display, then DISPLAY variable is set properly. You can then launch any other utilities you want.

Last edited by shivaa; 02-17-2013 at 10:30 PM.
 
Old 02-18-2013, 08:27 AM   #7
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
Quote:
Originally Posted by shivaa View Post
In that case, you can set DISPLAY manually as,
Code:
For bash shell:
[user@localhost]~$ set DISPLAY=localhost:0.0; export DISPLAY

For csh/tcsh shell:
[user@localhost]~$ setenv DISPLAY localhost:0.0
To check whether DISPLAY is set properly, invoke any x utility:
Code:
[user@localhost]~$ xterm &
OR
[user@localhost]~$ xclock &
If these x utilities launch on your display, then DISPLAY variable is set properly. You can then launch any other utilities you want.
1. the X server didn't start, and until it does you have no idea what the display environment variable SHOULD be, as noted in the reference you gave.
2. using "localhost:0.0" directs applications to use TCP, port 6000. By default TCP is NOT enabled, even when the X server does start, so applications will still fail, but with a "Error: Can't open display: localhost:0.0".

There are other possible reasons for X to be unable to create the lock or socket.

The access mode for /tmp should/must be rwxrwxrwt (the t is as important as the rwx - it is what provides the protection to the socket). SELinux (if active) also requires /tmp to have the proper security labeling: system_ubject_r:tmp_t:s0.

Repairing SELinux labeling can be done with a "restorecon -R /tmp", but access mode requires a "chmod a=rwxt /tmp".

When X gets starts, it will create a /tmp/.X11-unix directory for the purpose of holding the name for the domain socket it uses for communication. In normal operation (assuming only one connection) there is also a /tmp/.X0-lock file to prevent duplication (and hijacking) of a display. The "0" is the display number (the part of the DISPLAY environment value which is formatted "server:display.screen", the 'server' is only used for TCP values, and may have the name "unix" as a designation for a domain socket, the 'screen' is to support a multi monitor environment).

If SELinux is active, then the label given the /tmp/.X11-unix directiry is "system_ubject_r:xdm_tmp_t:s0", and the access mode is also rwxrwxrwt. And any lock files will be "system_ubject_r:xdm_tmp_t:s0". Ownership of any lock files and the directory is root, with group root.

Within the directory /tmp/.X11-unix directory will be a file "X0", which corresponds to the lock file /tmp/X0-lock. When multiple displays are active there will be one for each display. When a display is inactive (as in no X server active), there would normally be no file present. The SELinux label of a file should be "system_ubject_r:xdm_tmp_t:s0", with access mode rwxrwxrwx. Security control over accesses are done via the X servers authorization keys which are put in other places.

If /tmp appears correct, and there is NO X server active (such as booting into runlevel 3 for instance) then it is entirely valid to delete "/tmp/.X*-lock" files and the directory tree "/tmp/.X11-unix". As they should/will be recreated as needed.

If you like, you can record an entire trace of activity by first using the "script" utility to create a log. The only entries in the log file will be those used in the terminal where the script command is started. It will record any error messages, commands, and output generated. It will NOT record any activity done by the X server (other than error messages) or utilities started when using the X environment. The log is only terminated when you exit the script utility.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
can't start xwindows ust Linux - General 3 01-17-2005 09:05 AM
can't start xwindows ust Linux - Software 6 10-27-2003 08:16 PM
Can't start xwindows juno Linux - General 3 12-18-2002 02:21 PM
Can't start xwindows juno Linux - General 2 11-29-2002 03:07 AM
Can't start xwindows juno Linux - General 6 11-17-2002 01:34 PM


All times are GMT -5. The time now is 10:33 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration