LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices



Reply
 
Search this Thread
Old 11-18-2013, 12:46 PM   #1
mattca
Member
 
Registered: Jan 2009
Distribution: Slackware 14.1
Posts: 326

Rep: Reputation: 56
kdm causes Can't connect to X11 window server using ':0' as the value of the DISPLAY


Hi all, normally I boot to the console, then "startx". I'm trying out kdm, and it seems to cause a java project I need for work to fail to load.

I get this error:
"Can't connect to X11 window server using ':0' as the value of the DISPLAY variable"

When I don't use kdm, the DISPLAY variable is set to ':0.0', and I've successfully forced to be this by putting a setenv command in ~/.kde/env, but it still fails with this error.

I'm not familiar with kdm at all, how can I configure it to allow this project to run?

Thanks!
 
Old 11-19-2013, 10:40 PM   #2
aocab
Member
 
Registered: Nov 2009
Location: Heart of Texas
Distribution: Slackware-current
Posts: 138

Rep: Reputation: 30
I could be way off base but I wonder if the issue is becasue kdm is using the "--no-listen tcp" option when it starts X?
As far as I know, starting X from the command line using startx does not use this option unless you include it.

You could try running "xhost +localhost" before running the java project to see if that helps.
This command will allow localhost to make connections to the X server.

See the man page for xhost for more info.
Hope this helps.
 
1 members found this post helpful.
Old 11-21-2013, 03:08 PM   #3
mattca
Member
 
Registered: Jan 2009
Distribution: Slackware 14.1
Posts: 326

Original Poster
Rep: Reputation: 56
Thanks for the suggestion, aocab, I'll try that ASAP. I've got everything set up and working with ratpoison right now (including my DisplayLink monitor!), so I'll probably wait until EOD tomorrow to test it out.
 
Old 11-22-2013, 04:15 PM   #4
mattca
Member
 
Registered: Jan 2009
Distribution: Slackware 14.1
Posts: 326

Original Poster
Rep: Reputation: 56
Alright, so I seemed to have found a workaround. You were on the right track, aocab. I need to run this project as root, and it turns out that root can't connect to the X server. Running xhost as a user worked as expected, but doing it as root produced the same error I was getting when trying to run the project.

A google search led me to this thread:
http://www.linuxquestions.org/questi...s-root-314573/

Most of the suggestions there didn't help much, but doing this:
Code:
ssh -X -l root localhost
instead of "su" allows it to work.

So! The question now is, how can I make this work without a workaround? I tried commenting out this line:
Code:
ServerArgsLocal=-nolisten tcp
in /etc/kde/kdm/kdmrc but it didn't help.

Any suggestions?

Thanks!
 
Old 11-22-2013, 06:23 PM   #5
aocab
Member
 
Registered: Nov 2009
Location: Heart of Texas
Distribution: Slackware-current
Posts: 138

Rep: Reputation: 30
I would think that you could use something similar to what Alien Bob does when he builds a Linux Kernel from scratch.

Code:
echo $DISPLAY                  # you'll be needing this value 3 lines below
sudo -i                        # or "su -" on older Slackwares
xauth merge ~alien/.Xauthority # use your own username here instead of "alien"
export DISPLAY=:0.0            # use the value of DISPLAY you've seen 3 lines before
See the first section here about X and su:
http://alien.slackbook.org/dokuwiki/...kernelbuilding

Hope this helps...
 
Old 11-29-2013, 04:42 PM   #6
mattca
Member
 
Registered: Jan 2009
Distribution: Slackware 14.1
Posts: 326

Original Poster
Rep: Reputation: 56
I found a solution - turns out "kdesu" is the proper way to run X applications with root privileges within KDE.

Thanks for the help!
 
Old 11-29-2013, 08:54 PM   #7
ReaperX7
Senior Member
 
Registered: Jul 2011
Location: California
Distribution: LFS-7.6, Slackware 14.1, FreeBSD 10.1
Posts: 3,834
Blog Entries: 15

Rep: Reputation: 1188Reputation: 1188Reputation: 1188Reputation: 1188Reputation: 1188Reputation: 1188Reputation: 1188Reputation: 1188Reputation: 1188
kdesu will act as a sudo like layer, but even I've had problems with it working correctly.

There is an option in kdmrc to allow root login, which I suggest you enable.
 
Old 12-02-2013, 12:24 PM   #8
mattca
Member
 
Registered: Jan 2009
Distribution: Slackware 14.1
Posts: 326

Original Poster
Rep: Reputation: 56
Quote:
Originally Posted by ReaperX7 View Post
kdesu will act as a sudo like layer, but even I've had problems with it working correctly.

There is an option in kdmrc to allow root login, which I suggest you enable.
AllowRootLogin is already set to "true" in /etc/kde/kdm/kdmrc...
 
  


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 connect to X11 window server using ':0.0' as the value of the DISPLAY variable. defa0009 Linux - General 13 01-20-2012 03:55 PM
Can't connect to X11 window server using ':0' as the value of the DISPLAY variable. chakrinu Linux - Server 3 12-21-2010 07:59 PM
Cannot connect to X11 window server using ":).0" as DISPLAY variable cclack Linux - Newbie 4 09-06-2007 10:32 PM
Can't connect to X11 window server kofibull Linux - Newbie 10 06-17-2006 12:47 AM
Can't connect to X11 window server suresheva31 Linux - General 0 10-19-2004 03:17 PM


All times are GMT -5. The time now is 02:52 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration