"Can't open display" Error when running X applications remotely

This is a discussion on "Can't open display" Error when running X applications remotely within the X forums, part of the Help category; I am trying to run graphical applications remotely in my Fedora Core 6 (KDE Desktop)machine. I want to run a application say xcalc from a machine with IP 172.20.1.211 (so ...

Go Back   Unix Linux Forum > Unix > Linux > Help > X

FixUnix.com - Unix Linux Forums

Unix Content Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 07-25-2008, 09:27 AM
Default "Can't open display" Error when running X applications remotely

I am trying to run graphical applications remotely in my Fedora Core 6
(KDE Desktop)machine.
I want to run a application say xcalc from a machine with IP
172.20.1.211 (so this is my X client). The display should be on my
machine whose IP is 172.20.11.66 (this is my Xserver).

step 1: To enable 172.20.1.211 to write on my display, I issued the
command xhost +172.20.1.211.

Step 2: in my x client(172.20.1.211), I change the DISPLAY variable by
giving the command
DISPLAY=172.20.11.66:0.0

Step 3: I executed the command xcalc from 172.20.1.211.
I get the error : "Can't open display"

172.20.11.66 setting is:
/etc/pam.d/xserver
#%PAM-1.0
auth sufficient pam_rootok.so
#auth required pam_console.so
account required pam_permit.so
session optional pam_keyinit.so force revoke
Reply With Quote
  #2  
Old 07-25-2008, 09:54 AM
Default Re: "Can't open display" Error when running X applications remotely

In comp.os.linux.x TsanChung wrote:
> I am trying to run graphical applications remotely in my Fedora Core 6
> (KDE Desktop)machine.
> I want to run a application say xcalc from a machine with IP
> 172.20.1.211 (so this is my X client). The display should be on my
> machine whose IP is 172.20.11.66 (this is my Xserver).


> step 1: To enable 172.20.1.211 to write on my display, I issued the
> command xhost +172.20.1.211.


> Step 2: in my x client(172.20.1.211), I change the DISPLAY variable by
> giving the command
> DISPLAY=172.20.11.66:0.0


> Step 3: I executed the command xcalc from 172.20.1.211.
> I get the error : "Can't open display"


> 172.20.11.66 setting is:
> /etc/pam.d/xserver
> #%PAM-1.0
> auth sufficient pam_rootok.so
> #auth required pam_console.so
> account required pam_permit.so
> session optional pam_keyinit.so force revoke


I don't know what's wrong with your config. But you could just do
"ssh -X 172.20.1.211" (with sshd running on that machine).

HTH,
Niklaus
Reply With Quote
  #3  
Old 07-25-2008, 10:06 AM
Default Re: "Can't open display" Error when running X applications remotely

Niklaus Kuehnis writes:

> I don't know what's wrong with your config. But you could just do
> "ssh -X 172.20.1.211" (with sshd running on that machine).


Yes, don't use xhost at all. (-: For sshd one might need to make sure
that one has `X11Forwarding yes' in /etc/ssh/sshd_config. Given the OP's
PAM use they might also be interested in the `UsePAM yes' option.

Mark
Reply With Quote
  #4  
Old 07-25-2008, 11:43 AM
Default Re: "Can't open display" Error when running X applications remotely

On Jul 25, 10:06*am, "Mark T.B. Carroll"
wrote:
> Niklaus Kuehnis writes:
> > I don't know what's wrong with your config. But you could just do
> > "ssh -X *172.20.1.211" (with sshd running on that machine).

>
> Yes, don't use xhost at all. (-: For sshd one might need to make sure
> that one has `X11Forwarding yes' in /etc/ssh/sshd_config. Given the OP's
> PAM use they might also be interested in the `UsePAM yes' option.
>
> Mark


It works.
Thanks!
Reply With Quote
  #5  
Old 07-25-2008, 08:29 PM
Default Re: "Can't open display" Error when running X applications remotely

TsanChung wrote:

> I am trying to run graphical applications remotely in my Fedora Core 6
> (KDE Desktop)machine.
> I want to run a application say xcalc from a machine with IP
> 172.20.1.211 (so this is my X client). The display should be on my
> machine whose IP is 172.20.11.66 (this is my Xserver).
>
> step 1: To enable 172.20.1.211 to write on my display, I issued the
> command xhost +172.20.1.211.


That allows everybody on 172.20.1.211 to fully access your X display
(which means full access to your account)=. Bad idea if other people
have access to 172.20.1.211, too.

> Step 2: in my x client(172.20.1.211), I change the DISPLAY variable by
> giving the command
> DISPLAY=172.20.11.66:0.0
>
> Step 3: I executed the command xcalc from 172.20.1.211.
> I get the error : "Can't open display"


Most likely the X server on your box doesn't listen for incoming
TCP connections (that's the default on most modern Linux distributions).

If possible enable X forwarding on 172.20.1.211 on login there using
ssh -X: Otherwise enable X to listen for TCP connections (depends on
your distributions how to do that) and use xauth to allow your user at
172.20.11.66 to access your display. See man xauth and man Xsecurity
for more about that.l



Florian
--

-----------------------------------------------------------------------
** Hi! I'm a signature virus! Copy me into your signature, please! **
-----------------------------------------------------------------------
Reply With Quote
  #6  
Old 07-27-2008, 06:33 AM
Default Re: "Can't open display" Error when running X applications remotely

Dear all,

TsanChung wrote:

> On Jul 25, 10:06*am, "Mark T.B. Carroll"
> wrote:
>> Niklaus Kuehnis writes:
>> > I don't know what's wrong with your config. But you could just do
>> > "ssh -X *172.20.1.211" (with sshd running on that machine).

>>
>> Yes, don't use xhost at all. (-: For sshd one might need to make sure
>> that one has `X11Forwarding yes' in /etc/ssh/sshd_config. Given the OP's
>> PAM use they might also be interested in the `UsePAM yes' option.
>>
>> Mark

>
> It works.
> Thanks!



Of course I agree that the ssh -X method is to be preferred.

But it could that the method the OP wanted to use failed because the
X-server access is blocked by the iptables firewall, if enabled.

Kind Regards,
H.Janssen

Reply With Quote
Reply

Thread Tools


All times are GMT -5. The time now is 05:17 PM.

In an effort to better serve ads to our visitors, cookies are used on Fixunix.com. For more information, check out our Privacy Policy.

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Ad Management by RedTyger