Remote xterm with XQuartz

Discussion in 'Windows, Linux & Others on the Mac' started by Cave Man, Oct 6, 2013.

  1. Cave Man macrumors 604

    Cave Man

    #1
    I'm having trouble getting an xterm window open from my Mac Mini to my Mac Pro. Both machines are running XQuartz and from an xterm on the Mini I type:

    rsh -l myloginname xterm -display xxx.xxx.xxx.xxx:0.0 &

    The error message generated is:

    rcmd: getaddrinfo: nodename nor servname not provided, or unknown

    Clearly, I am invoking it incorrectly. My address is correct because it's the same that I use for Screen Sharing and it works just fine. Any tips?
     
  2. SlCKB0Y macrumors 68040

    SlCKB0Y

    Joined:
    Feb 25, 2012
    Location:
    Sydney, Australia
    #2
    What are you trying to accomplish?

    What are you going to run in the xterm?
     
  3. Cave Man thread starter macrumors 604

    Cave Man

    #3
    I want to remotely log onto my Mac Pro from another computer using xterm.

    To run command line software on the Mac Pro.
     
  4. whiteonline, Oct 8, 2013
    Last edited: Oct 8, 2013

    whiteonline macrumors 6502

    whiteonline

    Joined:
    Aug 19, 2011
    Location:
    California, USA
    #4
    For what you are trying to do, i would use SSH.

    Edit /private/etc/sshd_config on the Pro
    Change : #X11Forwarding no
    To: X11Forwarding yes
    And start the SSH server in system preferences (sharing->remote login).

    On the Mini, execute the command:
    ssh -X yourloginname@xxx.xxx.xxx.xxx xterm

    Of course, starting xterm is really unnecessary. Better off just ssh'ing unless you are doing something specific with X
     
  5. SlCKB0Y macrumors 68040

    SlCKB0Y

    Joined:
    Feb 25, 2012
    Location:
    Sydney, Australia
    #5
    XQuartz is completely unnecessary for this. You'd only need this to login to your Mac Pro and run GUI software which requires X (such as those you've compiled with Macports).

    To do what you need:

    On the Mac Pro

    1. System Preferences > Sharing > Enable Remote Login. This will start the SSHD service
    2. Then set which users you want to login (if you have issues logging in set this to "All users" whilst diagnosing the problem).

    On the Mac Mini

    1. Applications > Utilities > Terminal
    2. SSH to the Mac Pro by the command:
    ssh username@ipaddressofmacpro (on my machine this would be "ssh sickboy@192.168.1.25"
    then type that users password and press enter.
    3. You will then be logged into the Mac Pro - run your terminal commands as required.

    If you have issues:

    1. Try using a non-root username when SSHing to the Mac Pro
    2. Temporarily disable any firewalls on the Mac Pro
    3. Temporarily allow access to "All users" when configuring the Mac Pro

    ----------

    Turns out the OP is trying to run command line software - changing the configuration of SSHD or even using XQuartz at all is completely unnecessary!
     
  6. Cave Man, Oct 8, 2013
    Last edited: Oct 8, 2013

    Cave Man thread starter macrumors 604

    Cave Man

    #6


    Thanks very much. Still having troubles. When I type "ssh name@xxx.xxx.xxx.xxx" there is about a 15 second delay then I'm presented with the message:

    ssh: Could not resolve hostname xxx.xxx.xxx.xxx: nodename nor servname not provided, or unknown

    I am now connected to my Mac Pro from my MacBook Air by wifi. My Mac Pro is connected to the network by ethernet and I am sharing that ethernet connection over the Mac Pro's wifi (called "office") and my MacBook Air is connected to "office". The computers are only about a meter apart.
     
  7. SlCKB0Y macrumors 68040

    SlCKB0Y

    Joined:
    Feb 25, 2012
    Location:
    Sydney, Australia
    #7


    If you are using connection sharing on the Mac Pro in order for the Mac Mini to access the network (and that is it's only connection), it is probably on a different subnet.

    On the Mac Pro, do the following:
    1. Turn off Internet Connection Sharing
    2. Open a terminal and run the following:
    ifconfig
    3. Keep a note of the entire output of this command (maybe copy and paste it into TextEdit
    4. Turn on Internet Connection Sharing and then run ifconfig again. Compare this output to the previous output and you should notice that a new network "bridge" device has been created. On mine it looks like the following:
    Code:
    bridge100: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    	options=3<RXCSUM,TXCSUM>
    	ether 42:6c:8f:32:b1:64 
    	inet 192.168.2.1 netmask 0xffffff00 broadcast 192.168.2.255
    	Configuration:
    		id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0
    		maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200
    		root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0
    		ipfilter disabled flags 0x2
    	member: en1 flags=3<LEARNING,DISCOVER>
    	        ifmaxaddr 0 port 5 priority 0 path cost 0
    	media: autoselect
    	status: active
    
    5. Take a note of the "inet" field - that is the IP you would need to SSH to from the Mac Mini. In my example I would be doing the following from the Mac Mini terminal:
    ssh sickboy@192.168.2.1
     
  8. Cave Man thread starter macrumors 604

    Cave Man

    #8
    Sorry for the delay in replying - got distracted with other things at work.

    The above works perfectly; however, how can I use this if I have to log on from my Mini at home? I first establish a VPN connection to the university, then I can do Screen Sharing. I also need to do a terminal.

    Thanks!
     
  9. SlCKB0Y macrumors 68040

    SlCKB0Y

    Joined:
    Feb 25, 2012
    Location:
    Sydney, Australia
    #9
    It should be possible but will completely depend on the setup you have at home and also the VPN configuration your University uses.

    The first thing I would try is connecting via VPN and then just attempt to SSH to the main IP of the Mac Pro (not the connection sharing IP in the last example). If you can't can you ping it's IP address?
     
  10. Cave Man thread starter macrumors 604

    Cave Man

    #10
    Since I can open Screen Sharing from home to the Mac Pro, will using the method you described above that worked with my MacBook Air allow me to identify that address for use from home with the Mini?

    Thanks very much for your help - I really appreciate it.
     

Share This Page