X11..

Discussion in 'Mac Apps and Mac App Store' started by mmmdreg, Sep 8, 2006.

  1. mmmdreg macrumors 65816

    mmmdreg

    Joined:
    Apr 14, 2002
    Location:
    Sydney, Australia
    #1
    I want to run programs off the uni server (tkisem in particular) using X11.. I've run stuff off other peoples' computers in the past.. but that was using some other xwindows thing.. when I got to run it now, a window doesnt come up but a message:
    Code:
    Application initialization failed: no display name and no $DISPLAY environment variable
    Error in startup script: invalid command name "toplevel"
        while executing
    "toplevel .isem_debug"
        (file "/home/units/comp226/IsemDir/Isem-4.5.7/real_tkisem" line 106)
    ..
    someone told me to do "setenv DISPLAY this.is.my.ip:0.0"
    ..
    Now, running "tkisem" results in nothing.. It looks like it's doing something but it doesn't show up anything.. "tkisem &" nets "[1] 23190" or similar..

    any ideas here?

    update:
    it eventually comes up with the error
    Code:
     Application initialization failed: couldn't connect to display "60.227.204.212:0.0"
    Error in startup script: invalid command name "toplevel"
        while executing
    "toplevel .isem_debug"
        (file "/home/units/comp226/IsemDir/Isem-4.5.7/real_tkisem" line 106)
     
  2. hayduke macrumors 65816

    hayduke

    Joined:
    Mar 8, 2005
    Location:
    is a state of mind.
    #2
    How are you logging into the remote machine? Is it with SSH? If so make sure you allow X-11 forwarding (ssh -x your_name@machine.school.edu). A good test of the X11 forwarding is to see if xclock will display a clock once you are logged in. That is, once you have logged in with ssh -x onto the uni computer try xclock& at the prompt and the remote machine should display a clock on your local display.

    Also, make sure you have the X11.app installed and running. Without it you're hosed. If you haven't installed it should be on the CDs/DVDs that came with your computer on the Developer's disc.

    If none of this makes sense or if you've tried all that already then you might need someone more expert than I.
     
  3. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #3
  4. mmmdreg thread starter macrumors 65816

    mmmdreg

    Joined:
    Apr 14, 2002
    Location:
    Sydney, Australia
    #4
    hmm yeah.. even the clock doesn't work.. " Error: Can't open display:"
    I reckon it's something simple and some genius guy is going to come here and tell me in 25 words or less what to do =).. til then.. meh.. keep the ideas flowing!
     
  5. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #5
    Try the ssh -X or add the remote host to xhost as in the link I provided...

    B
     
  6. mmmdreg thread starter macrumors 65816

    mmmdreg

    Joined:
    Apr 14, 2002
    Location:
    Sydney, Australia
    #6
    I just read it.. it was a good read =) the ssh -X method doesn't seem to work.. I'm sure I tried it before.. but yeah I just tried it and amazingly the clock and calculator work =) tkisem now has a new error:
    Code:
     Error of failed request:  BadAtom (invalid Atom parameter)
      Major opcode of failed request:  18 (X_ChangeProperty)
      Atom id in failed request:  0xca
      Serial number of failed request:  13
      Current serial number in output stream:  15
     
  7. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #7
    Google says try ssh -Y instead of -X.

    B
     
  8. mmmdreg thread starter macrumors 65816

    mmmdreg

    Joined:
    Apr 14, 2002
    Location:
    Sydney, Australia
    #8
    OMG! You're the man I was looking for! Thanks so much mate =) =) Now I can do this assignment of mine... You're a champ!
     
  9. crackpip macrumors regular

    Joined:
    Jul 23, 2002
    #9
    I have to do a lot of work using X11 so I'll take a stab at a few things.

    Initial setup:
    Of course, have X11.app running. Try connecting through the xterm that pops up when you load X11.app (more on connecting in a bit).

    If you are using Terminal.app to connect to the remote server, then you need to set the DISPLAY variable in the terminal before connecting to the remote server. For tcsh use "setenv DISPLAY :0.0" or in bash "export DISPLAY=:0.0". Test it by running `xterm` on your machine just to make sure the windows are properly displayed.

    Connection:
    Given current network practices (dynamic ip's, firewalls, NAT, etc) ssh forwarding is probably the best way to go. So type `ssh -X username@host`. This will automatically set the DISPLAY variable upon connection. Do not alter the DISPLAY variable. Test the connection using xclock or xterm. This should work if the test in the initial setup part worked. You don't have to touch the xhost command this way either.

    If this didn't work. X11 forwarding may not be enabled on the remote machines, which seems to be the default case for MacOS X Server. Another situation that occurred for me was that a linux box was unable to resolve localhost into a proper ip address (only for a few apps other apps were fine). It was bizarre and I was unable to fix it.

    Alternative (less secure) method:
    Connect to the remote machine via ssh or whatever, and set the DISPLAY variable manually to your_ip_address:0.0. This is easiest if you have an external IP address, and you need to make sure your firewall is not blocking the relevant ports (I can't remember the numbers currently). If you're on an internal network, you need to make sure the router can forward the proper ports to your machine. In this case, "your_ip_address" should be the external one (i.e. the router address). You will also have to allow the remote server to connect to your machine by running `xhost +remote_server_address`. You can type `xhost +`, but this is very insecure.

    Hope this helps,
    crackpip
     

Share This Page