Thursday, September 14, 2006

If you ever want to use a Unix box with your Mac

This should be useful: (thanks to Dr Kenwright for this howto...)

Couple of hoops to jump through but quite simple really


To run remote X11 programmes on your mac
1) get X11.app - if you are running OS X Panther (10.3) then you can
download this from Apple's website (http://www.apple.com/downloads/
macosx/apple/x11formacosx.html). If you are running 10.4 Tiger, then
I think you need the version they supply on the install disks.

2) Install it, it will go into /Applications/Utilities/X11.app

3) Run it


Now you need to edit /etc/ssh_config, which will have a section like
this:

# Host *
ForwardAgent yes
ForwardX11 yes
ForwardX11Trusted yes
# RhostsRSAAuthentication no
# RSAAuthentication yes

Now **I think** that the only bit you need to change is the
'ForwardX11 yes' which will probably look like
#ForwardX11 no

If this fails, then set ForwardAgent to yes as above.

The above section is from my ssh_config and I can't remember exactly
why each bit was turned on, so a little trial and error might help
and might vary with your network connection.

Save the file.

With X11 running, open up an xterm (top menu Applications ->
Terminal) and ssh into your favourite box and type the command to
start your preferred X11 programme. Note that this is an xterm NOT
Terminal.app

In order to run remote X11 apps from Terminal.app (which is a nicer
terminal programme) you need to determine the shell you are running
and set the environment variable DISPLAY to :0.0

Older OS X uses a tcsh shell, newer uses bash (I don't know when they
changed over though).
typing "echo $SHELL" in the Terminal will tell you which you have.

If bash you need to type
export DISPLAY=":0.0"
If tcsh then it is
setenv DISPLAY ":0.0"

The appropriate line can be put in ${HOME}/.profile for bash (OS X
seems to be a bit wierd about bash config files) or ${HOME}/.tcshrc
for tcsh (which works for Faye). Open up a new Termiinal.app and
type echo $DISPLAY to check it is set.

Now run X11.app in the background and run everything through
Terminal.app, remembering to ssh not telnet.

HTH

Chris.

0 comments:

Post a Comment