TICKET ARCHIVE -> Cannot Connect to Local X11 Xserver From Remote Linux Server
ez045864 - Oct 11, 2005 - 1:43 am
This worked when I first installed X11. Then something must have changed such that now all I get are:
cannot connect to X server on 192.168.0.4:0.0
I made sure I set "xhost
" and even tried "xhost +". I checked that X11Forwarding was set to "yes" in the remote system's sshd_config file.
Now when I start up the console utility and view the console log I see the following:
Could not init font path element /usr/X11R6/lib/X11/fonts/CID/, removing from list!
Looking this up didn't really turn up anything useful. One suggestion was to repair all the file permissions, which I did, but which didn't help.
So now I am in need of some help.
Thanks in advance for any insight.
-dj
P.S.-Reason I need this is to justify Mac laptops vs Windows using Exceed.
macbri - Oct 11, 2005 - 6:03 am
Hi Dj -
First of all, can I make sure I understand exactly what you wish to do? So you're sitting at a Linux system running X windows, and you wish to connect from there to the X server running on your macintosh is that right? A few basic things to check (and please forgive me if I'm covering ground you've already done, I just want to be sure we cover everything):
- Do you have the IP address of your Mac (local X server) correct?
- Is X11.app running on your Mac?
- Is your DISPLAY set correctly on your linux box?
I gather from your message you're connecting via ssh (hence the sshd_config comment). Note that the change you mention should be done on the machine you're trying to connect TO, not the machine you're connecting from. Also, make sure you restart (or "killall -HUP) sshd after changing sshd_config. Finally, using the X11 forwarding mechanism negates the requirement to "set xhost +" and so you should avoid doing that at all.
let me know if you you're still having trouble connecting. We've seen several users here reporting X11 remote connectivity problems, especially after upgrading to Tiger (which we've resolved!), so if you're still having an issue getting this going do get back to me!
- Brian
--------
Brian S.
MacOSX.com Technical Support
brian@macosx.com
ez045864 - Oct 11, 2005 - 3:22 pm
Thanks for the reply. My end goal is to run an application on the Linux server that will display on my Mac. Specifically a native client for a network management package. This works flawlessly on windows running exceed, and worked on my Mac when I first installed X11.
- Do you have the IP address of your Mac (local X server) correct?
Not sure what you mean by this one.
- Is X11.app running on your Mac?
Yep, I am using the X11 terminal to ssh to the Linux server.
- Is your DISPLAY set correctly on your linux box?
Yep, I use the following command to set the display whenever anyone logs into the Linux server:
DISPLAY="`who am i | cut -f2 -d'(' | cut -f1 -d')' | cut -f1 -d':'`:0.0"
ssh_config and sshd_config both have X11 forwarding set to yes on both the Mac and Linux machines (overkill just in case).
TTFN
-dj
macbri - Oct 11, 2005 - 6:48 pm
Hi Dj -
Ok I got it backwards

Sorry bout that, You want to ssh into the linux box and display on your mac, I had it the other way around.
My first question, about the IP address. That's just the host ID of the linux server you're logging into. So don't worry about that, you obviously have it correct of your wouldn't be able to connect.
After modifiying sshd_config on the linux server, be sure to restart ssh or send it a HUP signal (killall -HUP sshd).
Next, resetting your DISPLAY on your linux server is probably interfering with your setup. When you ssh into the linux box with X11 forwarding enabled, the display is set automatically to something similar to localhost:10.0. By resetting that in a user or system profile or whatever, this won't work properly any more. ssh will automatically set your DISPLAY for you *if* it's set on the client before you connect, and if you're using the xterm within X11 as your jumping off point, this should also already be fine.
Third, I have a similar setup with a linux box and a powerbook at home. I use the "-X" flag for ssh to enable X11 forwarding:
ssh -X 192.168.1.104
To connect without the "-X" flag and enable X11 forwarding, it should be configured in sshd_config on the server (your linux box) and ssh_config on the client (your mac) and since you've configured both on each of the server and client, you should be fine there.
Let me know if this is of any help, or if things are still misbehaving and we'll dig a little deeper!
- Brian
--------
Brian S.
MacOSX.com Technical Support
brian@macosx.com
ez045864 - Oct 11, 2005 - 10:11 pm
The DISPLAY export works cuz I use it with various Windows laptops/desktops from this same linux server.
I tried to ssh using the '-X' option, but got the same result.
As for the sshd config change, I just restarted the server to be safe. It hadn't been restarted in a month, so it was time.
Starting to wonder if my Mac is cursed :0
-dj
macbri - Oct 12, 2005 - 4:35 am
Hey Dj -
It's been my experience though, especially after the latest round of updates, that X11 on the Mac seems to be less willing to play nice -- see my earlier remark about connectivity issues with latest versions. So here's in a nutshell what (I think) is happening:
You ssh into your Linux box from your Windows desktop with Exceed running. Ssh manages the display re-routing behind the scenes, and sets a DISPLAY variable. This means your display is automatically forwarded AND encrypted. Your login script then re-writes DISPLAY to the remote_host:0.0 (i.e. your Wintel box). The X connection is now a direct across-the-local-network X connection and is noo longer tunneled through ssh, so it's un-encrypted. Exceed happily accepts this, perhaps after an "xhost", and off you go. On the Mac however, X doesn't want to accept the unencrypted connection, and so when you re-write your DISPLAY, you're no longer taking advantage of the ssh tunneled X, and so it's rejected.
Here's an idea: from your DISPLAY line I'll assume you're using /bin/bash so this is in a profile or bashrc, either local to each user or system-wide. How about adding a test to exclude your mac from this DISPLAY re-write to see what happens? for example if your Macintosh IP is 192.168.1.101 then you could do:
REMOTE="`who am i | cut -f2 -d'(' | cut -f1 -d')' | cut -f1 -d':'`"
if [ $REMOTE != "192.168.1.101" ];
then
$DISPLAY="$REMOTE:0.0"
fi
... and see what happens then?
- Brian
--------
Brian S.
MacOSX.com Technical Support
brian@macosx.com
ez045864 - Oct 12, 2005 - 11:30 pm
Definitely got a different result (this is the output from mysqlcc, but the same is true for other apps):
;root@frodo:/usr/local/mysqlcc-0.9.4-linux-glibc23[root@frodo mysqlcc-0.9.4-linux-glibc23]# ./mysqlcc &
[1] 5101
]0;root@frodo:/usr/local/mysqlcc-0.9.4-linux-glibc23[root@frodo mysqlcc-0.9.4-linux-glibc23]# xlib: extension "glx" missing on display "localhost:11.0".
xlib: extension "glx" missing on display "localhost:11.0".
xlib: extension "glx" missing on display "localhost:11.0".
xlib: extension "glx" missing on display "localhost:11.0".
xlib: extension "glx" missing on display "localhost:11.0".
xlib: extension "glx" missing on display "localhost:11.0".
xlib: extension "glx" missing on display "localhost:11.0".
xlib: extension "glx" missing on display "localhost:11.0".
xlib: extension "glx" missing on display "localhost:11.0".
xlib: extension "glx" missing on display "localhost:11.0".
xlib: extension "glx" missing on display "localhost:11.0".
xlib: extension "glx" missing on display "localhost:11.0".
xlib: extension "glx" missing on display "localhost:11.0".
xlib: extension "glx" missing on display "localhost:11.0".
xlib: extension "glx" missing on display "localhost:11.0".
xlib: extension "glx" missing on display "localhost:11.0".
xlib: extension "glx" missing on display "localhost:11.0".
xlib: extension "glx" missing on display "localhost:11.0".
xlib: extension "glx" missing on display "localhost:11.0".
xlib: extension "glx" missing on display "localhost:11.0".
xlib: extension "glx" missing on display "localhost:11.0".
xlib: extension "glx" missing on display "localhost:11.0".
xlib: extension "glx" missing on display "localhost:11.0".
xlib: extension "glx" missing on display "localhost:11.0".
xlib: extension "glx" missing on display "localhost:11.0".
xlib: extension "glx" missing on display "localhost:11.0".
xlib: extension "glx" missing on display "localhost:11.0".
xlib: extension "glx" missing on display "localhost:11.0".
xlib: extension "glx" missing on display "localhost:11.0".
xlib: extension "glx" missing on display "localhost:11.0".
xlib: extension "glx" missing on display "localhost:11.0".
xlib: extension "glx" missing on display "localhost:11.0".
xlib: extension "glx" missing on display "localhost:11.0".
x error: badatom (invalid atom parameter) 5
major opcode: 20
minor opcode: 0
resource id: 0xa6
*** glibc detected *** ./mysqlcc: double free or corruption (!prev): 0x08159f88 ***
======= backtrace: =========
/lib/libc.so.6[0x40c424]
/lib/libc.so.6(__libc_free+0x77)[0x40c95f]
/usr/x11r6/lib/libx11.so.6(xfree+0x1d)[0xca974f]
./mysqlcc[0x815e5e9]
./mysqlcc[0x815f928]
./mysqlcc[0x8160d1b]
./mysqlcc[0x81afa8b]
./mysqlcc[0x81af6c4]
./mysqlcc[0x807f998]
./mysqlcc[0x80e1eec]
./mysqlcc[0x80e389f]
/lib/libc.so.6(__libc_start_main+0xc6)[0x3bdde6]
./mysqlcc(wait+0x6d)[0x8050871]
======= memory map: ========
00111000-00112000 rwxp 00111000 00:00 0
00112000-00189000 r-xp 00000000 03:01 7741000 /usr/x11r6/lib/libgl.so.1.2
00189000-0018c000 rwxp 00077000 03:01 7741000 /usr/x11r6/lib/libgl.so.1.2
0018c000-00190000 rwxp 0018c000 00:00 0
00190000-00199000 r-xp 00000000 03:01 18972725 /lib/libnss_files-2.3.5.so
00199000-0019a000 r-xp 00008000 03:01 18972725 /lib/libnss_files-2.3.5.so
0019a000-0019b000 rwxp 00009000 03:01 18972725 /lib/libnss_files-2.3.5.so
0019b000-0019d000 r-xp 00000000 03:01 7930241 /usr/x11r6/lib/x11/locale/lib/c
ommon/xlcdef.so.2
0019d000-0019e000 rwxp 00001000 03:01 7930241 /usr/x11r6/lib/x11/locale/lib/c
ommon/xlcdef.so.2
00272000-00273000 rwxp 00272000 00:00 0
002c4000-002e1000 r-xp 00000000 03:01 7743093 /usr/lib/libexpat.so.0.5.0
002e1000-002e3000 rwxp 0001c000 03:01 7743093 /usr/lib/libexpat.so.0.5.0
002e5000-002fc000 r-xp 00000000 03:01 7736237 /usr/x11r6/lib/libice.so.6.3
002fc000-002fd000 rwxp 00016000 03:01 7736237 /usr/x11r6/lib/libice.so.6.3
002fd000-002ff000 rwxp 002fd000 00:00 0
00301000-0030a000 r-xp 00000000 03:01 18973748 /lib/libgcc_s-4.0.0-20050520.so
.1
0030a000-0030b000 rwxp 00009000 03:01 18973748 /lib/libgcc_s-4.0.0-20050520.so
.1
0030d000-00315000 r-xp 00000000 03:01 7740276 /usr/x11r6/lib/libsm.so.6.0
00315000-00316000 rwxp 00007000 03:01 7740276 /usr/x11r6/lib/libsm.so.6.0
00537000-0055d000 r-xp 00000000 03:01 7746086 /usr/lib/libfontconfig.so.1.0.4
0055d000-00560000 rwxp 00026000 03:01 7746086 /usr/lib/libfontconfig.so.1.0.4
00560000-00561000 rwxp 00560000 00:00 0
00563000-005c4000 r-xp 00000000 03:01 7740312 /usr/lib/libfreetype.so.6.3.7
005c4000-005cb000 rwxp 00061000 03:01 7740312 /usr/lib/libfreetype.so.6.3.7
005cd000-005d4000 r-xp 00000000 03:01 7743022 /usr/x11r6/lib/libxrender.so.1.
2.2
005d4000-005d5000 rwxp 00007000 03:01 7743022 /usr/x11r6/lib/libxrender.so.1.
2.2
005d7000-005e0000 r-xp 00000000 03:01 7740302 /usr/x11r6/lib/libxcursor.so.1.
0.2
005e0000-005e1000 rwxp 00008000 03:01 7740302 /usr/x11r6/lib/libxcursor.so.1.
0.2
00731000-00743000 r-xp 00000000 03:01 7746133 /usr/x11r6/lib/libxft.so.2.1.2
00743000-00744000 rwxp 00012000 03:01 7746133 /usr/x11r6/lib/libxft.so.2.1.2
00746000-00749000 r-xp 00000000 03:01 7740322 /usr/x11r6/lib/libxrandr.so.2.0
00749000-0074a000 rwxp 00002000 03:01 7740322 /usr/x11r6/lib/libxrandr.so.2.0
009cc000-009e2000 r-xp 00000000 03:01 7742377 /usr/x11r6/lib/libxmu.so.6.2
009e2000-009e3000 rwxp 00015000 03:01 7742377 /usr/x11r6/lib/libxmu.so.6.2
00a41000-00a5b000 r-xp 00000000 03:01 18972766 /lib/ld-2.3.5.so
00a5b000-00a5c000 r-xp 00019000 03:01 18972766 /lib/ld-2.3.5.so
00a5c000-00a5d000 rwxp 0001a000 03:01 18972766 /lib/ld-2.3.5.so
00a5f000-00b83000 r-xp 00000000 03:01 18972767 /lib/libc-2.3.5.so
00b83000-00b85000 r-xp 00124000 03:01 18972767 /lib/libc-2.3.5.so
00b85000-00b87000 rwxp 00126000 03:01 18972767 /lib/libc-2.3.5.so
00b87000-00b89000 rwxp 00b87000 00:00 0
00b8b000-00b8d000 r-xp 00000000 03:01 18972806 /lib/libdl-2.3.5.so
00b8d000-00b8e000 r-xp 00001000 03:01 18972806 /lib/libdl-2.3.5.so
00b8e000-00b8f000 rwxp 00002000 03:01 18972806 /lib/libdl-2.3.5.so
00b91000-00bb3000 r-xp 00000000 03:01 18972847 /lib/libm-2.3.5.so
00bb3000-00bb4000 r-xp 00021000 03:01 18972847 /lib/libm-2.3.5.so
00bb4000-00bb5000 rwxp 00022000 03:01 18972847 /lib/libm-2.3.5.so
00bb7000-00bc9000 r-xp 00000000 03:01 7741043 /usr/lib/libz.so.1.2.2.2
00bc9000-00bca000 rwxp 00011000 03:01 7741043 /usr/lib/libz.so.1.2.2.2
00bcc000-00bda000 r-xp 00000000 03:01 18972837 /lib/libpthread-2.3.5.so
00bda000-00bdb0
[1]+ aborted ./mysqlcc
macbri - Oct 13, 2005 - 1:49 am
Hi Dj -
Ok, that basically tells you that "glx" is not supported on your X server. GLX is Open GL on X11, in other words, access to hardware acceleration. I did some poking around and found that if I connect to my remote Linux box in the method I explained to you, I also cannot find GLX support.
To see the difference, first in your Xterm on your Mac, type:
xdpyinfo | more
And you'll see a bunch of supported extensions, including GLX. Now if you "ssh -X your_linux_box" and from there again run the 'xdpyinfo' command you'll see GLX isn't on the list. This it seems is a change not in X11 per se, but in SSH. As of OpenSSH 3.8 X sessions are apparently untrusted, and thus extensions are limited. BUT, if you get a trusted connection and then run 'xdpyinfo' GLX is again in the list of extensions. Happily it's easy to do: use the -Y instead of the -X flag with ssh.
ssh -Y your_linux_box
Hope this helps!
- Brian
--------
Brian S.
MacOSX.com Technical Support
brian@macosx.com
ez045864 - Oct 14, 2005 - 12:08 am
Good to know on the glx stuff. I tried the '-Y' option and it did get rid of the error messages about glx, but it still gave me the could not connect to X server message.
Arrrgggg!!!!
-dj
macbri - Oct 14, 2005 - 1:36 am
Hi -
That's odd, when you got the GLX-related errors, it's specifically because you *did* connect to the local X server on your mac, as shown by:
linux-glibc23]# xlib: extension "glx" missing on display "localhost:11.0"
So, if you use "ssh -Y", after you're connected to the linux box, what does the DISPLAY variable contain? Also, I was thinking about an earlier suggestion I gave you, where the DISPLAY is not reconfigured if the incoming IP address (network address) identifies your macintosh. However if your mac get's its network address automatically this is liable to change. So check your network address once logged into the linux box also:
who ami i | sed 's/.*(//;s/)//'
Let me kinow what you get.
- Brian
--------
Brian S.
MacOSX.com Technical Support
brian@macosx.com