Terminal, X-11 and DISPLAY settings

Posted:
in Genius Bar edited January 2014
Hi all, hope you can help me out...

I've been logging into my school to use programs from the server using X-11:

ssh -2 -X server -l username

this is all good, but i want to know if this is possible from OS X's Terminal??

i try, but the DISPLAY setting doesn't match...anyone

know if this is possible?

Thanks!

Comments

  • Reply 1 of 10
    it is possible. Off the top of my head it's like:



    setenv $DISPLAY=<your local machine's IP>:0



    search google for 'X11 Display' for more.
  • Reply 2 of 10
    Quote:

    Originally posted by 1337_5L4Xx0R

    it is possible. Off the top of my head it's like:



    setenv $DISPLAY=<your local machine's IP>:0



    search google for 'X11 Display' for more.




    actaully, for a (probably not noticeable) speed boost, you can omit the ip (assuming you execute the command from the computer that runs the x11 server). also, you don't want the '$' and '=' in the 'setenv' command. it should be 'setenv DISPLAY :0' (or if you really want: 'setenv DISPLAY '<ip>:0'). also, in order for the display env variable to work, an x11 server has to be running (like the X11.app, or XDarwin.app, or similar). locally, your DISPLAY variable should be ':0', but on another computer, it should be '<your ip>:0'. i dont know what you are trying to do with that ssh command, and i'm now clear if its locally or remotely run. note: if it remote, you may have to authorize remote access; i dont remember the command to do that, maybe 'xauth'.
  • Reply 3 of 10
    i had some probs but got there eventually see this thread



    http://forums.appleinsider.com/showt...&highlight=x11



    Hope it helps
  • Reply 4 of 10
    Thanks guys...well i can remotely log on to my school's server using X11 but i read that you can launch that from Terminal(without entering through X11)

    is that true?

    because i've had back luck getting the DISPLAY settings right on Terminal...does anybody do this?(use Terminal for all the command line and call on X11 for graphical interface)
  • Reply 5 of 10
    dobbydobby Posts: 797member
    Are you asking whether you can ssh from the terminal prompt?

    If so then yes.

    You can drop the '-X server' to connect via ssh without the X11 stuff.



    We use it here all the time.



    Dobby.
  • Reply 6 of 10
    Quote:

    Originally posted by dobby

    You can drop the '-X server' to connect via ssh without the X11 stuff.





    But,that's what i want to do, connect via ssh to a server and run X11 stuff...

    right now i can only get the command line interface Matlabfrom ssh with Terminal...i wanna get the graphical Matlab (this works for me from X11's xterm, but i heard u can do it w/ Terminal which would be great 'cuz i like the colored text and dark background settings on my shell)
  • Reply 7 of 10
    ok, i hope i understand this right: matlab is an x11 program, located on a remote computer. you want to run it (off of that comptuer), and view it locally.



    in order to do this, you first have to get into the remote computer (probably through ssh). while there, set your DISPLAY variable to your ip address, with ':0' added onto the end. so, if your ip is 1.2.3.4, your DISPLAY should be 1.2.3.4:0. To set your DISPLAY variable from a csh, tcsh or similar shell, you type 'setenv DISPLAY 1.2.3.4:0'. from sh, bash, or a similar, you do 'export DISPLAY=1.2.3.4:0'. now, make sure your home computer has x11 open, and running. next make sure your x11 program is setup to allow remote connections (from inside the xterm that X11 gives you, type 'xhost ip-of-the-matlab-computer'). now, in your remote computer ssh, startup the matlab program. it should open a window on your home computer shortly thereafter.
  • Reply 8 of 10
    Quote:

    Originally posted by thuh Freak

    ok, i hope i understand this right: matlab is an x11 program, located on a remote computer. you want to run it (off of that comptuer), and view it locally.





    AND, i wanna know if i can do this from Terminal (i can already do it from X11's xterm)



    i found some instructions here:

    https://engineering.purdue.edu/ECN/R...20030116135559



    but it hasn't worked for me (the Terminal part, doing it from X11 works fine)
  • Reply 9 of 10
    ok, i did a little searching on google about that -X option for ssh. basically here's how it works (by my understanding). first, you open X11 locally. next, open up Terminal.app. inside Terminal you set your DISPLAY variable, like this:

    Code:


    setenv DISPLAY :0





    next you type this:

    Code:


    ssh -2 -l [userName] -X [server] [program to run]





    replacing [userName] with your user name, [server] with the server, and [program to run] with matlab or whatever program. Now, hopefully, matlab shows up on your computer. It may take a little while, because it is running over the internet.
  • Reply 10 of 10
    Quote:

    Originally posted by thuh Freak

    ok, i did a little searching on google about that -X option for ssh. basically here's how it works (by my understanding). first, you open X11 locally. next, open up Terminal.app. inside Terminal you set your DISPLAY variable, like this:

    Code:


    setenv DISPLAY :0





    next you type this:

    Code:


    ssh -2 -l [userName] -X [server] [program to run]





    replacing [userName] with your user name, [server] with the server, and [program to run] with matlab or whatever program. Now, hopefully, matlab shows up on your computer. It may take a little while, because it is running over the internet.



    Hey thanks it's working (slowly, my school's server is bad right now) but it seems the -> DISPLAY :0

    setting is what i needed...muchas gracias!
Sign In or Register to comment.