How to get remote x working? - X

This is a discussion on How to get remote x working? - X ; Mostly a newbie, I am trying to connect from A to B with X. In frustration I got vncserver working! Googling just says this and that and newbie like me can't follow it just yet. I am running KDE sessions ...

+ Reply to Thread
Results 1 to 8 of 8

Thread: How to get remote x working?

  1. How to get remote x working?

    Mostly a newbie,

    I am trying to connect from A to B with X.
    In frustration I got vncserver working!

    Googling just says this and that and newbie like
    me can't follow it just yet.

    I am running KDE sessions on both machines at present.
    I want to sit at A and connect to B and do things on B.

    thanks.

  2. Re: How to get remote x working?

    Bill Marcum wrote:

    > On Thu, 02 Sep 2004 21:09:18 GMT, 7
    > wrote:
    >> Mostly a newbie,
    >>
    >> I am trying to connect from A to B with X.
    >> In frustration I got vncserver working!
    >>
    >> Googling just says this and that and newbie like
    >> me can't follow it just yet.
    >>
    >> I am running KDE sessions on both machines at present.
    >> I want to sit at A and connect to B and do things on B.
    >>

    > ssh -X B
    > You may need to edit files in /etc/ssh to enable X forwarding.


    Thanks - made some progress - but not there yet.
    1. Which /etc/ssh files do I need to edit A B or both? and do I need to
    restart ssh and/or other things for the changes to take effect.
    (Now enabled X11 and agent forwarding if that helps.)

    2. how do I tell startx to start a new display session instead of
    tring to restart display 0?

    I get logged into remote machine and then I type startx if that is the
    right thing to do? - with catastrophic error messages about /home
    usename/.Xathority not working etc or dislay 0 in use and to kill
    tmp/.X0-lock



  3. Re: How to get remote x working?

    7 writes:

    > Mostly a newbie,
    >
    > I am trying to connect from A to B with X.
    > In frustration I got vncserver working!
    >
    > Googling just says this and that and newbie like
    > me can't follow it just yet.
    >
    > I am running KDE sessions on both machines at present.
    > I want to sit at A and connect to B and do things on B.
    >
    > thanks.


    It depends on your setup. If you don't have to worry about other people on
    either A or B, and the machines are on a subnet where the firewall permissions
    are set up to trust everything on the subnet (presumably using a strong
    firewall in connection to the internet, and you aren't running on the firewall
    box), you can use the old host based permissions. On A do:

    $ xhost +B
    $ ssh B env DISPLAY=A:0.0 xterm

    However, this can open up various security problems. A better way is to use
    ssh's -X option which enable X11 forwarding, so on A you would do:

    $ ssh -X B xterm

    this will start an xterm on B with the display set up to the ssh server, which
    forwards it to the server on A. There are still some security concerns with
    X11 forwarding, so you need to be able to trust every on B, since they can get
    access to your display through the socket ssh sets up, and can set up a
    keystroke monitor.

    --
    Michael Meissner
    email: mrmnews@the-meissners.org
    http://www.the-meissners.org

  4. Re: How to get remote x working?

    7 (website_has_email@www.ecu.pwp.blueyonder.co.uk) wrote:
    : Mostly a newbie,

    : I am trying to connect from A to B with X.
    : In frustration I got vncserver working!

    : Googling just says this and that and newbie like
    : me can't follow it just yet.

    : I am running KDE sessions on both machines at present.
    : I want to sit at A and connect to B and do things on B.

    There are so many options on doing what you want. Perhaps, you need
    to go in a little more detail than the above sentense.

    When you said "connect to B and do things on B", it can be interpreted
    as

    1. You are on a terminal session at A. You just need to connect to B
    via ssh/telnet to run some non-graphical program on B.

    2. You are on a terminal session at A. You just need to connect to B
    to run some graphical program on B and display it on A.

    3. You are on a terminal session at A. You just need to connect to B
    and get a full desktop session from B with the graphical login prompt.

    4. You have an X desktop on B and you want to join the same desktop
    from the desktop of A.

    Which one of the interpretation you are trying to do?

  5. Re: How to get remote x working?

    7 wrote:
    > Bill Marcum wrote:


    >>ssh -X B
    >>You may need to edit files in /etc/ssh to enable X forwarding.

    >
    >
    > Thanks - made some progress - but not there yet.
    > 1. Which /etc/ssh files do I need to edit A B or both? and do I need to
    > restart ssh and/or other things for the changes to take effect.
    > (Now enabled X11 and agent forwarding if that helps.)


    You need to modify your /etc/ssh/sshd_config on the remote machine

    X11Forwarding yes

    To make this to take affect, you need to restart sshd


    To use the -X option of ssh by default, you need edit your /etc/ssh/ssh_config
    on your client machine

    ForwardX11 yes

    You need to reconnect to the remote machine to make this to take affect (if
    you are already connected and used the -X option, you don't need to reconnect,
    but next time you connect you don't need the option in question as it's
    already default).


    > 2. how do I tell startx to start a new display session instead of
    > tring to restart display 0?


    You don't, ssh allows you to run application from the remote machine and get
    the application shown in the client machine.

    eg:

    mozilla &

    This will start mozilla in the background (this way you still will be able to
    use the shell while mozilla is running and you can open more X sessions this
    way).


    If you want to use the remote X-client and connect to your computers X-server
    (things are called the opposite when you are using X than what you would
    normally call it), then ssh isn't what you want to use, but you need to edit
    quite a lot of your X11 settings. I don't recommend this over slow connections
    (over then internet, 10mbit connections, ...), OpenGL applications won't work
    (some KDE stuff uses OpenGL) as Quake, NWN, ...
    It can be easier to use Xnest for this kind of operations, never used it
    remotly, only locally, so I'm not sure about that.


    //Aho

  6. Re: How to get remote x working?

    Alex Yung wrote:

    > 7 (website_has_email@www.ecu.pwp.blueyonder.co.uk) wrote:
    > : Mostly a newbie,
    >
    > : I am trying to connect from A to B with X.
    > : In frustration I got vncserver working!
    >
    > : Googling just says this and that and newbie like
    > : me can't follow it just yet.
    >
    > : I am running KDE sessions on both machines at present.
    > : I want to sit at A and connect to B and do things on B.
    >
    > There are so many options on doing what you want. Perhaps, you need
    > to go in a little more detail than the above sentense.
    >
    > When you said "connect to B and do things on B", it can be interpreted
    > as
    >
    > 1. You are on a terminal session at A. You just need to connect to B
    > via ssh/telnet to run some non-graphical program on B.


    By a surprise rather than intent, I managed to do this! Use it now
    regularly.

    > 2. You are on a terminal session at A. You just need to connect to B
    > to run some graphical program on B and display it on A.


    Nice option - may also want to do that soon.

    > 3. You are on a terminal session at A. You just need to connect to B
    > and get a full desktop session from B with the graphical login prompt.


    Yes 100%

    > 4. You have an X desktop on B and you want to join the same desktop
    > from the desktop of A.


    That would be 100% nice too as I wouldn't have to restart the session.

    > Which one of the interpretation you are trying to do?



  7. Re: How to get remote x working?

    J.O. Aho wrote:

    > 7 wrote:
    >> Bill Marcum wrote:

    >
    >>>ssh -X B
    >>>You may need to edit files in /etc/ssh to enable X forwarding.

    >>
    >>
    >> Thanks - made some progress - but not there yet.
    >> 1. Which /etc/ssh files do I need to edit A B or both? and do I need to
    >> restart ssh and/or other things for the changes to take effect.
    >> (Now enabled X11 and agent forwarding if that helps.)

    >
    > You need to modify your /etc/ssh/sshd_config on the remote machine
    >
    > X11Forwarding yes
    >
    > To make this to take affect, you need to restart sshd
    >
    >
    > To use the -X option of ssh by default, you need edit your
    > /etc/ssh/ssh_config on your client machine
    >
    > ForwardX11 yes
    >
    > You need to reconnect to the remote machine to make this to take affect
    > (if you are already connected and used the -X option, you don't need to
    > reconnect, but next time you connect you don't need the option in question
    > as it's already default).
    >
    >
    >> 2. how do I tell startx to start a new display session instead of
    >> tring to restart display 0?

    >
    > You don't, ssh allows you to run application from the remote machine and
    > get the application shown in the client machine.
    >
    > eg:
    >
    > mozilla &


    Ah yes!!!!!!!
    This was what I wanted. It came up like magic!
    I typed konqueror &
    and it came with konqueror - albeit in German! (Running Knoppix on remote
    machine).

    I was totally confused with the client and server reversal. Forgive my
    windope distorted experiences. I was completely thinking in terms of
    vncserver and something like rdesktop utlity where everything comes up as
    an image of whats running on the remote machine. Now this is much better
    because its only the app that is running visible on my desktop whilst
    actually running in the remote machine. So when I type in a file URL, I see
    whats in the remote machine, not my machine. When I click on say a text
    file, the text file opens, but with text editor displayed on my machine but
    editing on the remote machine. Very nice!
    I entered qcad &
    because I don't have it on my machine, but the remote machine does have it
    and hey presto, I have CAD running on remote machine but visible and
    interatctive on my desktop without installing it! WOW!

    This is what I wanted.

    Thanks everyone.


    > This will start mozilla in the background (this way you still will be able
    > to use the shell while mozilla is running and you can open more X sessions
    > this way).
    >
    >
    > If you want to use the remote X-client and connect to your computers
    > X-server (things are called the opposite when you are using X than what
    > you would normally call it), then ssh isn't what you want to use, but you
    > need to edit quite a lot of your X11 settings. I don't recommend this over
    > slow connections (over then internet, 10mbit connections, ...), OpenGL
    > applications won't work (some KDE stuff uses OpenGL) as Quake, NWN, ...
    > It can be easier to use Xnest for this kind of operations, never used it
    > remotly, only locally, so I'm not sure about that.
    >
    >
    > //Aho



  8. Re: How to get remote x working?

    7 (website_has_email@www.ecu.pwp.blueyonder.co.uk) wrote:
    : Alex Yung wrote:
    : > When you said "connect to B and do things on B", it can be interpreted
    : > as
    : >
    : > 1. You are on a terminal session at A. You just need to connect to B
    : > via ssh/telnet to run some non-graphical program on B.

    : By a surprise rather than intent, I managed to do this! Use it now
    : regularly.

    : > 2. You are on a terminal session at A. You just need to connect to B
    : > to run some graphical program on B and display it on A.

    : Nice option - may also want to do that soon.

    : > 3. You are on a terminal session at A. You just need to connect to B
    : > and get a full desktop session from B with the graphical login prompt.

    : Yes 100%

    You have to enable the XDMCP from your login manager. You mentioned
    that you are using KDE. It is most likely that you are running kdm.
    Goto your machine B and update the "kdmrc" configuration file and
    enable XDMCP. Now, goto your machine A and enter the following
    command as user root from the console.
    X -query ipAddrOfB :1
    You should be able to get the login manager from B. Or search XDMCP
    from google.

    : > 4. You have an X desktop on B and you want to join the same desktop
    : > from the desktop of A.

    : That would be 100% nice too as I wouldn't have to restart the session.

    KDE supports desktop sharing now. You just have to look into this
    option or you can use VNC.

    : > Which one of the interpretation you are trying to do?

+ Reply to Thread