Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Fix Apple's X11 to allow remote use of Mac X11 apps UNIX
I was trying to get X11 forwarding to work on Mac OS X 10.2.6 / Apple X11. This lets you run any X11 app on your Mac from any other unix system. While I could use remote X11 apps from my Mac, I couldn't use apps on my Mac from my linux box at work. Then I found a writeup on the macwrite.com web site that explains how to fix this:

Ten More Mac OS X Loose Ends Part Two - X11 Forwarding

After going through this fix (the instructions are easy to follow), just make sure you have X11.app running on your mac. Then, from any remote OSX/unix/linux box, just type:
ssh yourname@yourhost.com
and you will be able to run any X11 program remotely. As a side benefit, you can launch X11 apps from the OS X terminal. Before applying this fix, you could only launch X11 apps from an xterm session.
    •    
  • Currently 3.50 / 5
  You rated: 5 / 5 (4 votes cast)
 
[17,938 views]  

Fix Apple's X11 to allow remote use of Mac X11 apps | 10 comments | Create New Account
Click here to return to the 'Fix Apple's X11 to allow remote use of Mac X11 apps' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Fix Apple's X11 to allow remote use of Mac X11 apps
Authored by: DrOctagon on Sep 15, '03 11:40:14AM

Actually to make this much easier
do this
ssh hostname -l LoginName -X

if you use the capital X you will get X11 forwarding
if you instead use

ssh hostname -l LoginName -x

you turn off the X forwarding.
which is good if you are on a not too fast connection. or if you are running something like SAS or Matematica.



[ Reply to This | # ]
Fix Apple's X11 to allow remote use of Mac X11 apps
Authored by: thrig on Sep 15, '03 12:37:19PM

I usually recommend the user@hostname format: it is similar to an e-mail address and thus easier for users to remember than a odd flag. I also recommend that the default username be placed into the user's ~/.ssh/config file, as I see frequent login failures on systems at work from people who keep forgetting that their account names are different on different systems.

For example, say the client system has the username johndoe, while the remote server example.org account for the same person is jdoe. The following entry in ~/.ssh/config will let johndoe on the client system simply type ssh example.org and login automagically as jdoe.

Host example.org
  User jdoe


[ Reply to This | # ]
Fix Apple's X11 to allow remote use of Mac X11 apps
Authored by: ducasi on Sep 15, '03 01:15:11PM

This hint and the article it references is mistaken in their implication that there is anything "broken" about Apple's X11.

Apple's X11 is configured exactly the same way as every other X server out there and allows properly authenticated X clients to connect to it.

The problem is authentication. Ssh has a nice facility to help you copy the authentication tokens to remote machines as you connect to them. There are other ways to do this, including a script I used to hack on called "rxx". Ssh, as it's its nature, makes this more secure. Ssh also secures the X connection back to the server.

X11 isn't known for its high level of security. Ssh fills in the gaps, but isn't a necessary component of X11, and as such just because Apple doesn't configure ssh to work with X11, this doesn't mean Apple's X11 is "broken".

Just wanted to clear this point up. If you want to know more about X authentication, try googling for "xauth".

Cheers!



[ Reply to This | # ]
Fix Apple's X11 to allow remote use of Mac X11 apps
Authored by: at_sym on Sep 15, '03 04:07:00PM

The suggested fix involves making changes to /etc/csh.login. I'm a little leery of making changes to system files. Can the Unix gurus verify that it's safe to make this change?



[ Reply to This | # ]
Fix Apple's X11 to allow remote use of Mac X11 apps
Authored by: ducasi on Sep 15, '03 04:58:45PM

My immediate reaction is that the changes to /etc/csh.login are pretty safe, fairly innocuous, and useful if you use X11 and Terminal.

The changes to ssh_config and sshd_config I'm less happy about. They are probably OK, but you don't need to mess with the protocol and cipher preferences in order to get X11 forwarding working.

The author should explain what these modifications do beyond "fixing" X11. If I didn't know what I was doing, I wouldn't trust them.



[ Reply to This | # ]
Use cmdline flags
Authored by: Anonymous on Sep 15, '03 05:21:50PM

The environment variable for DISPLAY needs to be set, but otherwise you can do the rest of it with cmd line flags:

ssh -X -C server.foo.com

-X forwards X, -C turns on compression. Been doing this for years now on OS X.

ssh -X -C server.foo.com "/path/to/my/app" &

will run the remote app. Put it in a script with the .command suffix and you've got a double-click method for X remote apps. I also have my script open X11.app, and check for the window manager (quartz-wm) before executing the ssh command for the true double-click experience; others use applescript to avoid the terminal window but I always have at least one term window open so launching terminal.app is not an issue.

---
Regards,

Ed Hintz



[ Reply to This | # ]
Fix Apple's X11 to allow remote use of Mac X11 apps
Authored by: gsdali on Sep 16, '03 11:43:25AM

It's worth noting that if you make changes to environment variables whilst X11 is open, they won't be reflected in the X11 environment until you quit and restart X11. In fact X11 can be knobbed until you do restart it.

---
--
Ed Lynch-Bell
dali@zerointegrity.co.uk



[ Reply to This | # ]
Fix Apple's X11 to allow remote use of Mac X11 apps
Authored by: david-bo on Sep 18, '03 11:25:21AM

Has anyone succeeded in launching X11-apps from the OS X terminal after applying this hint?

I want to do it remotely, maybe it is limited to laucnhing apps on the local machine?

---
http://www.google.com/search?as_q=%22Authored+by%3A+david-bo%22&num=10&hl=en&ie=ISO-8859-1&btnG=



[ Reply to This | # ]
Fix Apple's X11 to allow remote use of Mac X11 apps
Authored by: agamemnon on Oct 06, '03 11:29:58PM

to launch xwindows apps from Terminal, just start x11.app and set the DISPLAY environment variable:

tcsh% setenv DISPLAY :0.0
bash$ export DISPLAY=:0.0



[ Reply to This | # ]
Fix Apple's X11 to allow remote use of Mac X11 apps
Authored by: bici on Mar 03, '04 05:15:28PM

for bash I beleive the proper command is:

if [ ${#DISPLAY} -eq 0 ]; then
export DISPLAY=':0.0'
fi

Which you add to your .profile file

---
sempre in giro



[ Reply to This | # ]