X11 for accessing remote Linux Box?

Discussion in 'Mac Apps and Mac App Store' started by mdjd, Feb 1, 2003.

  1. mdjd macrumors newbie

    Joined:
    Feb 1, 2003
    Location:
    Bay Area
    #1
    newbie here...

    Will X11 allow me to get rid of my PC monitor (i.e. let me log into my linux box and run programs as if I was using the keyboard attached to the linux box)?

    Thx.
     
  2. lmalave macrumors 68000

    lmalave

    Joined:
    Nov 8, 2002
    Location:
    Chinatown NYC
    #2
    Yes, you should be able to run all your Linux GUI apps remotely. I don't think you should get rid of your monitor entirely though. What happens if theres something wrong with you Linux box and you can't connect to it (like let's say you Linux box is having network issues, for example).
     
  3. ddtlm macrumors 65816

    Joined:
    Aug 20, 2001
    #3
    mdjd:

    I've played with Apple's X11 package and it works great, I was able to export things from Linux, although certain hardware accelerated things are not going to work, like OpenGL games.

    The only reason that you need a monitor or keyboard for the Linux machine is if the network dies, or you have some sort of other serious issue.
     
  4. mdjd thread starter macrumors newbie

    Joined:
    Feb 1, 2003
    Location:
    Bay Area
    #4
    thanks for the replies.
    so, exactly how do i run the remote linux apps? do i need to download kde for X11? or is that already included in apple's x11? so far i've only been able to find xterm.
     
  5. lmalave macrumors 68000

    lmalave

    Joined:
    Nov 8, 2002
    Location:
    Chinatown NYC
    #5
    No, you run them from your Linux machine, not your Mac. So you don't really "run" your Linux machine's X11 apps on your mac - it's more like you just display them. Basically, X11 can display the graphics for a remote program, and can also capture remote user input from a mouse or keyboard. So you have to telnet or ssh to your linux machine, then run the software from the command line. But first you have to set your DISPLAY environment variable. So let's say your Mac has an IP address of 192.168.0.100, you'd run something like this from you Linux machine:

    export DISPLAY=192.168.0.100:0.0

    Once you've done that you can run any software on your Linux machine and it will magically appear on your Mac OS X desktop. So if from your Linux machine you run:

    emacs &

    You will magically see an emacs window on your Mac! Make sense? X11 is really cool - I've been using it since I was in college more than 10 years ago. Since almost all Linux apps are implemented with X11, you should be able to display them. Also note that the reverse is true - if you run X11 enabled app from your Mac, you can display it on your Linux machine.
     
  6. mdjd thread starter macrumors newbie

    Joined:
    Feb 1, 2003
    Location:
    Bay Area
    #6
    Very nice! Thx a lot! This will give me something to play with for awhile.
     
  7. ddtlm macrumors 65816

    Joined:
    Aug 20, 2001
    #7
    Do not set your display like this if you are using SSH, because this will cause your X11 session to go outside of the SSH channel. It will work but will not be secure. Your SSH server should set up your display variable itself. Sometimes you need to use the -X (or was that -x) when connecting from your Mac.

    You also need to use the X11-packaged terminal and not the standard Apple terminal to connect.
     
  8. mdjd thread starter macrumors newbie

    Joined:
    Feb 1, 2003
    Location:
    Bay Area
    #8
    whoa. i really can't get over how awesome this is. just executed startkde and it seems to work great (running on linux and displayed on the apple cinema display)!
     
  9. mdjd thread starter macrumors newbie

    Joined:
    Feb 1, 2003
    Location:
    Bay Area
    #9
    Thanks for the tip. This worked very well (when I ssh'd with -X). Didn't even have to touch the Linux keyboard. :D
     
  10. peterjhill macrumors 65816

    peterjhill

    Joined:
    Apr 25, 2002
    Location:
    Seattle, WA
    #10
    Yeah, ssh -X hostname
    It is great. when I am on a wireless connection and I want to start up a bunch of secure terminal windows I ssh to my desktop at work and then open up some xterms, that way I don't have to open up separate ssh connections for each terminal window. Also, Mozilla on linux rocks when you open it up on your mac.

    Forget KDE, stick with the apple aqua X11 window manager. It is hardware accelerated and is fully integrated with the dock.

    Try that windows ;-)
     
  11. ddtlm macrumors 65816

    Joined:
    Aug 20, 2001
    #11
    mdjd:

    Your welcome.

    peterjhill:

    How exactly is any of this better than what various Windows products have been able to do for the past couple years or so?
     
  12. peterjhill macrumors 65816

    peterjhill

    Joined:
    Apr 25, 2002
    Location:
    Seattle, WA
    #12
    I have used X-win32, and it pales in comparison with running x on a mac. Not to mention that windows does not include an ssh client. I prefer running X on a unix based system. I like having all my /bin apps waiting for me to call upon them.

    X-win32 does not integrate with the windows gui at all. I prefer the mac os x X11s integration with my normal operating environment. I like minimizing an app, and it shrinks to the dock.
     
  13. yzedf macrumors 65816

    yzedf

    Joined:
    Nov 1, 2002
    Location:
    Connecticut
    #13
    A good little app for this is PuTTY
     
  14. Chimaera macrumors regular

    Joined:
    Nov 15, 2002
    #14
    try eXceed sometime, thats a great app for win32, about the best program of its type I've seen

    and I'm with yzedf, Putty is a fantastic telnet/ssh client :)
     
  15. ddtlm macrumors 65816

    Joined:
    Aug 20, 2001
    #15
    peterjhill:

    Huh? You need to elaborate on how it "pales". I have no idea how you think that.

    Is installing one really that hard?

    Irrelevant for remote sessions.

    The ones I've used do.

    Huh? Xwin32 integrates fine into windows, it can be minimized and all that.
     
  16. peterjhill macrumors 65816

    peterjhill

    Joined:
    Apr 25, 2002
    Location:
    Seattle, WA
    #16
    Believe me, I have used Putty, teraterm ssh, and cygwin. The fact remains, that they all run under windows. I don't want to run an OS that is not POSIX compliant. Windows is annoying. XWin32 is the best thing for running X on a PC, but it is still running on Windows. I like running my window manager on my local host, not on the remote box. Things like sawfish are nice, but they are not aqua.

    It comes down to personal preference. I dealt with xwin32 for a year and ran it only when i had to. With Apples X11, I often run mozilla from my remote linux box. It starts up damn fast and runs great.

    This is getting pretty offtopic now, so I will return you to your regularly scheduled thread.
     
  17. ddtlm macrumors 65816

    Joined:
    Aug 20, 2001
    #17
    peterjhill:

    Hey I don't like windows either ;) , I just thought I should defend the facts of the matter.
     
  18. peterjhill macrumors 65816

    peterjhill

    Joined:
    Apr 25, 2002
    Location:
    Seattle, WA
    #18
    Sorry, one of my foibles is being too defensive. Your points are excellent. Xwin32 is probably the best X server for windows. (it is a server right, aren't the client/server backwards to what you would expect) I am also not to fond of gnome, kde, twm, fvwm. They are all okay, but they are not aqua.

    What I think apple should do is allow me to "open safari.app" in an ssh session, and have it open a window on my local machine. They could make it so it would only work for machines running jaguar, it seems like it would not be impossible.

    Does anyone have a suggestion on where to add
    xhost +host
    commands so that they execute once per session. I was putting them in my .tcshrc, but I am sure you can understand why that gets annoying. I don't need it to do that every time I open a terminal window. I could make an alias for it, then I could make an alias for "ssh -X" that first executed the xhost + commands, then did the ssh -X.
     
  19. Bear macrumors G3

    Joined:
    Jul 23, 2002
    Location:
    Sol III - Terra
    #19
    Actually if you are using ssh to transport the X11 session, using xhost is not necessary, since the X11 display server will think the session is coming from the local machine.
     
  20. peterjhill macrumors 65816

    peterjhill

    Joined:
    Apr 25, 2002
    Location:
    Seattle, WA
    #20
    damn, youre right! When will MS incorporate ssh into their command shell? Is it there yet?
     
  21. Bear macrumors G3

    Joined:
    Jul 23, 2002
    Location:
    Sol III - Terra
    #21
    For a real good (add free) set of ssh utilities for Windows, check out PuTTY by Simon Tathal.

    The programs have a small memory footprint and work well. I suspect anything MS could come up with would be overblown, use excessive memory and rather buggy.
     
  22. peterjhill macrumors 65816

    peterjhill

    Joined:
    Apr 25, 2002
    Location:
    Seattle, WA
    #22
    I like teraterm ssh better, but putty is good. I would like to sshd included with windows. Have it right on the command line. I don't need fancy windows for a terminal app.
     
  23. Bear macrumors G3

    Joined:
    Jul 23, 2002
    Location:
    Sol III - Terra
    #23
    PuTTY has a command line version available I think it is called something like PuttyTel.
     

Share This Page