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

This is a discussion on "Can't open display" Error when running X applications remotely - Setup ; 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 ...

+ Reply to Thread
Results 1 to 6 of 6

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

  1. "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

  2. 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

  3. 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

  4. 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!

  5. 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! **
    -----------------------------------------------------------------------

  6. 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 to Thread