X11 won't remote display

crispyp

Registered
I had X11 remote display working and now it doesn't. I keep getting "Can't connect to sever <hostname>:0,0" (or somehting like that). Here's a summary of what I've been through:

For about 4 years I've been using Xdarwin my my G4 at home, running MacOS 10.1.5. I connect to my work net using VPN, and remote display from work machines onto my G4. This has always worked without any problem (and still does). I use both ssh and telnet to connect to work machines, and enable access on my G4 with "xhost +" (I know, I should use ssh X11 forwarding. I only recently learned about it).

I just got an iMac G5 with Mac OS 10.4.3 (clean install, no Xdarwin remnants). Of course I installed apple's X11. It worked with no isses just as Xdarwin did on my G4. I even did remote display between my G4 and iMac without any problems (once again, using "xhost +").

Now remote display for the iMac is broken and I'm not sure why. I get something like the "Can't connect to display <hostname>:0,0" message. This is true both when logging into my G4 and when logging into work machines over VPN (in both cases remote displaying onto the iMac). ssh and telnet both have the problem. I've typed "xhost +" about a zillion times just to make sure. I've also done reboots and reinstalled X11. I've also verified the $DISPLAY variable on the machine I log into. I've been using X11 remote display for years, so I pretty much know the basic pitfalls well. This time I'm stuck.

What did I do to break remote display? I'm not sure. I went a few days without trying it. During that time I installed fink and downloaded a few packages (mainly xemacs). The local X apps work fine, but not remote display onto my iMac. I also had twiddled with some of the "." files in my home directory, but these files are all very small and I can't see anything in them that might cause problems. I mucked with .Xmodmap and .xinitrc. I've since removed the .xinitrc to no avail. I've also verified that the firewall is not enabled on the iMac (it can't be my router firewall because remote display still works fine on the G4 through the router). The rest was just assorted MacOS twiddling, and I can't think of anything that might affect the ability to remote display.

I've googled a lot for help and none of the tips have worked. A number of times I've seen references to X11 security options under the Preferences menu to allow remote hosts to connect. I don't have these options. Just "Input" and "Output". I assume they are referring to an older version of X11 and the options have since been removed.

Please help!

thanks,

Chris
 
Ok, I found a fix. I removed my X11 preferences ~/Library/Preferences/com.apple.X11.plist, and then everthing was fine again. Since I still had the old preferences lying around, I decided to compare the old and new in PrefEdit.

The broken com.apple.X11.plist has about 11 preferences settings, and the new only had done_xinit_check. It was set to 1 in both pref files. I then chose Preferences from the X11 app and disabled "Use the system keyboard layout" since I had done this previously when using X11. This caused 7 more preferences settings to be created. 5 of them seemed to match up with settings in the X11 Preferences dialog. Two of them did not: no_auth and nolisten_tcp. Based on posts I've seen elsewhere, I think these used to be settable in the old verson of X11, but no longer are. It turns out the nolisten_tcp=true setting is the problem. So basically if I ever change an X11 preference, I need to run PrefEdit and set nolisten_tcp=false. Is there away around this? I also read the following will work:

defaults write com.apple.x11 nolisten_tcp false

The seems like a real pain. Why should changing an X11 setting result in a new setting being written to com.apple.X11.plist that is different than the built-in default. Also, why do I seem to be one of the few people having this problem. Is this a problem you doing see if using X11forwarding, and pretty much everyone is using X11forwarding? If so, this didn't work for me either. On the remote host (the one I run the X app on), I've set "X11Forwarding yes" in sshd_config (and rebooted). When I log into the remote host using "ssh -X", verify DISPLAY is set properly, and then run an X app, I still can't connect to the remote host unless I've fix the nolisten_tcp=true setting first.
 
Back
Top