Find the answer to your Linux question:
Results 1 to 5 of 5
I know about X11 forwarding which allows me to display an X application on the same machine that the SSH/X clients are on. However, I was wondering if it's possible ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2004
    Location
    Hamilton, Canada
    Posts
    13

    Can I start X apps on one computer from an SSH window on another?


    I know about X11 forwarding which allows me to display an X application on the same machine that the SSH/X clients are on. However, I was wondering if it's possible to use a remote SSH connection to start an X application on the host machine (the one running sshd) and have it also display on the host machine.

    It would probably be easier to use VNC to connect to the host and start the application that way, but I like to be difficult.

  2. #2
    Linux Guru sdousley's Avatar
    Join Date
    Feb 2004
    Posts
    1,790
    Quote Originally Posted by Massif View Post
    I know about X11 forwarding which allows me to display an X application on the same machine that the SSH/X clients are on. However, I was wondering if it's possible to use a remote SSH connection to start an X application on the host machine (the one running sshd) and have it also display on the host machine.

    It would probably be easier to use VNC to connect to the host and start the application that way, but I like to be difficult.
    As far as i know, this wont be possible. The reason...

    When an application is started, it is assigned to a DISPLAY. The DISPLAY variable on the SSH session will not be (and probably will not be allowed to be) the same as the DISPLAY variable for the desktop on the machine. For this reason, you will not be able to open a program remotely AND locally unless you connected to the DISPLAY variable (eg VNC)
    "I am not an alcoholic, alcoholics go to meetings"
    Registered Linux user = #372327

  3. #3
    Linux Engineer Zelmo's Avatar
    Join Date
    Jan 2006
    Location
    Riverton, UT, USA
    Posts
    1,001
    Wait, are you asking to see the app on both computers, or just the server? If it's just the server, you can easily pass the "-display :0" argument on the command line (e.g., "firefox -display :0 &") and it will show up on the server.

    If you want it on both machines, the X server on the server machine has to be aware of the X server on the remote machine. You might try a little trickery with forwarding X over ssh and passing two -display arguments, but I'm not sure that'll work. I'd test it myself, but I haven't had good experiences with X forwarding (messes up my Xauth on the server).
    Stand up and be counted as a Linux user!

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Jan 2007
    Location
    Germany
    Posts
    73
    I myself did this many times from home:

    ssh -X Xaleandr@work.computer.com
    SomeGraphicalApplication.


    so the answer to your question is yes,
    but the problem is that the graphical applications start considerably slower.

  6. #5
    Linux Guru sdousley's Avatar
    Join Date
    Feb 2004
    Posts
    1,790
    They wil be a lot slower if they go over the internet. The reason being that the internet has to transport all the data for the application. It's not a local thing like it is when you just open the program. Also, it has to go through all the encryption and everythin that an ssh link uses.
    "I am not an alcoholic, alcoholics go to meetings"
    Registered Linux user = #372327

Posting Permissions

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