access Xserver through ssh

Discussion in 'Linux Networking' started by charly, Jan 8, 2004.

  1. charly

    charly Guest

    Greetings,

    I want to access the x Server of my machine through ssh.

    After researches and google, I come here seeking light and guidance :)

    So far, my machine is a linux, with sshd daemon running and working ( I
    can access it from outside with putty to use console stuff).
    I've enabled X11 forwarding in etc/sshd/sshd_config

    In putty, I've enabled X11 forwarding.
    My X server runs on port 10 on my box
    I connect with putty on my linux box.

    then, I open vnc client on my windows box but what port am i suposed to
    give him to connect to ?

    I tried to look at the port which putty opened on the windows box and
    told vnc to connect there -> no go (that would have been too easy :) )

    I must be missing some point here so any help (a former thread or Howto
    is most welcome)

    many thx !
     
    charly, Jan 8, 2004
    #1
    1. Advertisements

  2. charly

    ynotssor Guest

    Why are you using a VNC client if you are connecting to sshd with X
    forwarding? They are 2 completely different client/server implementations
    with no operational relations.

    You need an X server running on the MICROS~1 box, then just start the X
    application in the ssh session, e.g. "xterm &" (assuming $PATH is correct).

    tony
     
    ynotssor, Jan 8, 2004
    #2
    1. Advertisements

  3. charly

    charly Guest

    Why are you using a VNC client if you are connecting to sshd with X
    Oups, I thought that vnc could connect to X Server
    That is "some" mimstake :)

    thx for correcting me :)

    I'll try google to find some free X server on W2K then ...

    thx a bunch !
     
    charly, Jan 8, 2004
    #3
  4. Or install the VNC server on the Linux box and follow the suggestion on the
    VNC home page on how to use SSH in conjunction with VNC.
    http://www.uk.research.att.com/archive/vnc/sshvnc.html


    And read the posting "vnc tunneling over ssh" in this news group to get more
    tips.


    /Mats
     
    Mats Karlsson, Jan 8, 2004
    #4
  5. charly

    charly Guest

    Or install the VNC server on the Linux box and follow the suggestion on the
    Yeah, I did some digging around this way, but I don't like having a X
    server and a vnc server at the same time :
    I'll check google about this...
    Sure, I will :)

    Thank youuuu....
     
    charly, Jan 8, 2004
    #5
  6. charly

    Wayne Throop Guest

    ::: I want to access the x Server of my machine through ssh. [...]
    ::: In putty, I've enabled X11 forwarding. My X server runs on port 10
    ::: on my box I connect with putty on my linux box. then, I open vnc
    ::: client on my windows box but what port am i suposed to give him to
    ::: connect to ?

    :: Why are you using a VNC client if you are connecting to sshd with X
    :: forwarding? They are 2 completely different client/server
    :: implementations with no operational relations.

    : charly <>
    : Oups, I thought that vnc could connect to X Server
    : That is "some" mimstake :)

    Well, you can, sort of. There are three methods.

    Xvnc -- a server for both X and VNC; you run this server, and
    it provides a virtual X desktop that you access via vnc.
    this is probably not what you want, since it isn't "the"
    X server on a machine, its "a virtual" X server on a
    machine (and each machine can have multiple X servers,
    both virtual and non).

    x11vnc -- an X client that is also a VNC server; you run this as
    an app of some existing X server, and it allows VNC
    clients to remote-control that X server; there's also
    x0vncserver in realvnc 4 beta which does the same thing.

    xf4vnc -- a loadable module that allows the linux X server to
    also serve VNC; you load this in your XF86 config,
    and then you can remote-control your X session with VNC;
    this will perform better than x11vnc.

    :: You need an X server running on the MICROS~1 box, then just start the
    :: X application in the ssh session, e.g. "xterm &" (assuming $PATH is
    :: correct).

    Right; note that this allows you to run new X apps on the box you log
    into, and display them on your windows box. It doesn't allow you to
    access the X server on the box you log into.

    But note a common terminology misunderstanding: an X server is the
    thing that controls your keyboard and display, and is running on
    your LOCAL machine; X clients are the applications that are running
    somewhere, perhaps on a REMOTE machine, eg, openoffice or mozilla
    are X clients.

    So... do you want "access to the X server" running on some machine,
    and if so, what do you mean by "access"? Taking it at face value,
    "accessing the X server on machine 'foo'" means "starting an
    application which then displays its windows on the physical display
    on machine 'foo'". Which is probably not what you meant.

    So do you want to

    - start an app locally that displays on foo
    - start an app on foo that displays locally
    - interact with already-running apps that
    are currently displaying on the server on foo

    The first is tricky; you'll need to use explicit redirection, and it's
    probably not what you wanted; I'll leave that as an excersize for
    the interested reader.

    The second is what ssh X forwarding is designed to do; you simply

    ssh -f -X foo some_X_app

    (or equivalent) from a place that's running an X server. That's
    what you'd use an X server on your windows box for. See for eg

    http://www.cygwin.com/xfree/

    The third is what xf4vnc and x11vnc are for.

    http://xf4vnc.sourceforge.net/
    http://karlrunge.com/x11vnc/index.html

    Note that an X server is a biiiiiig install, whereas a VNC client is
    very small; if you want to keep the disk and memory footprint that this
    requires of your windows box low, you'd tent to want to use VNC;
    possibly Xvnc on the server side and vncviewer on the windows side,
    which will give you much the same situation as installing an X server on
    the windows side. The convenince of this method is that most recent
    linux distributions contain Xvnc by default, so you won't have anything
    new to install.

    So, on the linux box you say

    vncserver

    and then on the windows box you use putty to forward port 5901
    to the linux box, and then on the windows box you say the equivalent
    of
    vncviewer localhost:1


    So. Bottom line, there are lots of ways to proceed, depending
    on exactly what you want to accomplish.


    Wayne Throop http://sheol.org/throopw
     
    Wayne Throop, Jan 8, 2004
    #6
  7. I have both X and VNC, no prob on my machines. I like the VNC alot, the
    thing that you can use a web browser as the VNC client is briliant. But I
    don't have any security issues :)


    /Mats
     
    Mats Karlsson, Jan 9, 2004
    #7
  8. charly

    charly Guest

    For the moment I trashed the fonts and icons while playing with libs so
    no more X for the moment :)

    But thax everybody for giving such a deal of information : as soon as
    I've reinstalled a new distribution (just to try things out :), i'll try
    Gentoo but no troll ans OT here :) ), I'll setup the thing to see my
    linux desktop on my remote windows machine.

    Cheers !
     
    charly, Jan 9, 2004
    #8
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.