Find the answer to your Linux question:
Results 1 to 6 of 6
Hi all, I work remotely with X applications. Is there a possibility, If I start an X application remotely, that I can later show it on the local display? Is ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2006
    Posts
    35

    X remotely and local


    Hi all,

    I work remotely with X applications.

    Is there a possibility, If I start an X application remotely, that I can later show it on the local display?

    Is it possible and how is it possible?

    thanks in advance

  2. #2
    Linux Newbie jpalfree's Avatar
    Join Date
    Jul 2005
    Location
    Montreal, CA
    Posts
    198

    VNC to the rescue

    Yes you can definately do this (in a very cool way).
    You will need two things:
    • VNC server set up on your server
    • A VNC viewer on your client


    VNC is the program you need. I don't know what distrobution you are using but, you can follow this Gentoo "how to" and just ignore wherever it says 'emerge' which means install it on your distrobution:
    http://gentoo-wiki.com/HOWTO_x11vnc

    It will explain two methods to set VNC up (I recommend the Second method). The result will be the ability to type:

    Code:
    $ vncviewer -via yourserver.yourdomain localhost:0
    and a little remote desktop-like window will pop up and you will be able to control your desktop on this server (if you are already logged in).

    The alternative method is to have a normal 'virtual' VNC session running, that will only be accessible via a 'vncviewer' command. This "how to" is here:
    http://gentoo-wiki.com/HOWTO_RealVNC...tVNC%2C_XF4VNC
    Avatar from xkcd.com, a hilarious computer related webcomic.

  3. #3
    Just Joined!
    Join Date
    Jan 2006
    Posts
    35
    thank you for your quick reply jpalfree!

    I set up VNC through SSH yesterday and it works.

    One thing... I need to log in on the local machine before I can actually connect to the server?

    Some questions though... I explain to you the situation I had yesterday...
    I connected to vncserver on port 5901 and I get the prompt asking for my password. I type it in and get on the desktop with the TWM windowmanager.
    I wanted to exit the session and I type exit on xterm. After that I choose Exit in the TWM menu.
    After that, I can't do anything... the connection is still there. Because, after I close the window and reconnect I get the same screen.
    So I thought... Lets restart the vncserver service ("service vncserver start").
    After this, I get the same problem.
    THen I look at the running processes that contain vnc and I kill them(server side).
    Now I can't connect... After a while I found something that I have to type(server side): "vncserver" or something like that. After this it works again.

    Now my question:
    Why is there a service and a commandline tool that I need to be able to connect to the vncserver?
    It is not normal that I have to kill these processes, is it? So, how can I stop the vncsession? So in case of, Next time I connect, the standard programs get started(TWM and xterm).

    Do I have to be logged in on the server machine before I can start a vncsession? Or can I also log in with ssh and then start it? Or what if I didnt login and just try to connect to the server?

    Greetings

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Newbie jpalfree's Avatar
    Join Date
    Jul 2005
    Location
    Montreal, CA
    Posts
    198
    I'm not entirely sure but i think the difference between the service and the commandline tool is that the service integrates with Xorg, so that you can log in to your normal X session (like remote desktop) and the commandline tool is to start a virtual vnc server that is only viewable using 'vncviewer'

    If you want to kill a vnc session, you can do this:
    Code:
    $ vncserver -kill PORT
    you can definitely ssh to the server and start a virtual vnc session like this:
    Code:
    $ vncserver :PORT -geometry 800x600 #change to whatever resolution you want
    hope that helps
    Avatar from xkcd.com, a hilarious computer related webcomic.

  6. #5
    Just Joined!
    Join Date
    Jan 2006
    Posts
    35
    I think that answers most of my questions

    But why is it possible to exit the window manager and the xterm (so there is no app left)? Then I cant do anything with it and have to kill the proccess.

    or can I start apps from another session (locally on the terminal) and send that app to the desired screen?

    thx again for your efforts!

    greetings

  7. #6
    Linux Newbie jpalfree's Avatar
    Join Date
    Jul 2005
    Location
    Montreal, CA
    Posts
    198
    We are reaching the extent of my knowledge of vnc, but i'll give it a shot

    I think the reason that you can exit all apps (and not do anything else) is because once you kill all apps, there is no fallback for a vnc session. In X it would just load gdm or kdm so that you can login again, but vnc doesn't have this.

    If you want to load different window managers/apps you can look for a ~/.vnc/xstartup file. You should be able to put things like this in it:
    Code:
    #!/bin/sh
    xrdb $HOME/.Xresourses
    /etc/X11/Sessions/Gnome & #a bit gentoo specific
    #blackbox & # to start blackbox, 
    ##etc...
    Avatar from xkcd.com, a hilarious computer related webcomic.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •