x11 - I dont get it

Discussion in 'macOS' started by starrin, Jan 12, 2006.

  1. starrin macrumors member

    Joined:
    Aug 22, 2004
    #1
    Okay - I am trying to work with x11. And I do not understand it ... read some docs but all the technical unix jargon ... i am not getting ... so any help is appreciated.

    I go into the terminal and ssh into my university server ... use the password.

    I get logged in and on the command line. But I thought that x11 was like a remote client that would show me a desktop from that server account?

    Also - how do I move files from my computer to the account on the server?
     
  2. Chundles macrumors G4

    Chundles

    Joined:
    Jul 4, 2005
    #2
    No, X11 is a windowing environment for Unix apps.

    I'm not sure but would a VNC program work in this situation?
     
  3. BearRanger macrumors member

    BearRanger

    Joined:
    May 23, 2005
    Location:
    Deep in the Woods
    #3
    As has been pointed out, X11 is a windowing system. You can use it in such a way that you can execute programs on your server and have the graphical output displayed on your local computer. But I wouldn't recommend it. The performance is bound to be slow, and unless you're using VPN you'll have security issues as well. It will take some work on your part to make this happen, though. For one thing, you'll need an X server on both sides of the connection. And you'll need to read up on environment variables.

    As for transferring files, it depends on the server OS. Most servers support FTP in some form or another. If you'd like to know more, consult the OSX man page on ftp. (type "man ftp" in a terminal window)
     
  4. theBB macrumors 68020

    theBB

    Joined:
    Jan 3, 2006
    #4
    Not every server allows FTP. I remember there was a command like "scp" (=secure-copy) to copy files from the server to your local computer. I am not absolutely sure about the name of the command, so it may be a slight variation of scp. Check it from the man pages.
     
  5. gekko513 macrumors 603

    gekko513

    Joined:
    Oct 16, 2003
    #5
    Yes, scp can be used to transfer files. It's almost like the cp command.

    Code:
    scp sourcefile destinationfile
    There is a special syntax to indicate files that reside on remote systems. Example:

    Code:
    scp myfile.txt apple.com:/var/www/html/
    This will try to copy the file "myfile.txt" in the current local directory to the server apple.com and place the file in the /var/www/html/ directory using the same username on the remote system as you're currently logged in as on the local system.

    Code:
    scp gekko513@apple.com:~/myfile.txt .
    This will try to copy the file myfile.txt from the server apple.com using the username gekko513 and from the home directory of that user. It will be put in the current local direcory.

    Alternatively, download Fugu and do the same thing but with a nice graphical user interface instead of the command line.
     
  6. semaja2 macrumors 6502a

    Joined:
    Dec 12, 2005
    Location:
    Adelaide
    #6
    you could use ssh ftp to transfer files, not as fast but does a great job, as for remote viewing use vnc and u could tunnel vnc through ssh
     
  7. starrin thread starter macrumors member

    Joined:
    Aug 22, 2004
    #7
    Hi everyone and thank you for your replies.

    I feel pretty Unix saavy when it comes down to environment variables and the like as I am a developer by trade.

    Essentially this is for a graduate class I am taking ... the professor asked up to put some code up on the server and then run it on the server so that you can verify it is working. I assume he is going to use this server to check our projects.

    So this is a User Interface course ... so I assume I could export the display of a Java Gui app to my mac.

    But isn't there something that would make it more like Remote Desktop?
     
  8. jhu macrumors 6502a

    jhu

    Joined:
    Apr 4, 2004
    #8
    forget what other people have said about remote x sessions being insecure and slow. well, depending on your connection it may be slow, but definitely in combination with ssh it is secure.

    now the only way that remote x sessions will work is if the server you're logging onto allows x-forwarding. you can test this by typing

    ssh -X *****

    where ***** is your remote server. once you're in there type

    echo $DISPLAY

    if you get nothing, then that means the remote ssh server doesn't allow x-forwarding. if it does, then you home free. fire up the x server on your side and start executing x programs remotely. if that all works, next time type:

    ssh -X -c ****

    that allows x-forwarding and compression to speed up transfers.
     
  9. jhu macrumors 6502a

    jhu

    Joined:
    Apr 4, 2004
    #9
    a better method is sftp. it works exactly like the ftp program but through ssh.
     
  10. jhu macrumors 6502a

    jhu

    Joined:
    Apr 4, 2004
    #10
    you only need the x server on the client side. the remote side isn't displaying any of the output so an x server isn't necessary there.
     
  11. starrin thread starter macrumors member

    Joined:
    Aug 22, 2004
    #11
    Hi,

    I went into X11 and an xterm terminal window is opened

    So I do the following:

    ssh -X user@machine_name (obviously not the real parameters)

    type in my password

    and get a prompt to the machine.

    so then I type:
    echo $DISPLAY

    and get the following back:

    localhost:11.0

    Now is there a way to get a desktop or do I need to launch stuff to see it come up on my display?
     
  12. maestro55 macrumors 68030

    maestro55

    Joined:
    Nov 13, 2005
    Location:
    Goat Farm in Meridian, TX
    #12
    If you don't have a fast connection, I wouldn't use remote x11, I have never tried it so I don't know how fast the connection should be to get it to work without being too slow. However, I will say that you should be able to move files using scp and ssh will do a lot in the terminal. If you know your way around the terminal, don't bother with remote x11.
     
  13. blackstone macrumors regular

    Joined:
    Dec 12, 2005
    Location:
    Washington, DC
    #13
    To see anything come up on your display, you'll need to launch it from the command line, e.g. if you enter xemacs & then it'll launch xemacs.

    If you want to use a desktop environment, then you're probably better off using VNC tunnelled over SSH, as others have suggested.
     
  14. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #14
    That depends very heavily on what's installed on the remote machine, but you should be able to fire up a X window manager or desktop on the remote machine that points back to your Mac and gives you a desktop. Helps if you know what environment is used on the remote machine. Here's a site that gives a nice overview of the many options. http://xwinman.org/

    B
     
  15. BearRanger macrumors member

    BearRanger

    Joined:
    May 23, 2005
    Location:
    Deep in the Woods
    #15
    Duh. Must have been asleep on that one. Thanks for the correction.
     

Share This Page