Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a server that is extremely slow (takes 3-5 minutes) at starting X11 applications over a forwarded X11 link. I have tried connecting to it with 2-3 different machines with different operating systems. After the applications start everything seems to be fine. I am connecting using trusted X11 forwarding (ssh -Y) and using cert based authentication (not that that should matter).

The operating system is Gentoo Linux on amd64. None of the applications give any messages related to the X environment (one shows nothing, another just a standard welcome message and the last an error message about a resource being in use (which the window that finally popped up told me about as well).

As per Bertera's suggestion I ran with the -v option. It doesn't print anything until the window shows up when it prints:

debug1: client_input_channel_open: ctype x11 rchan 3 win 87380 max 16384
debug1: client_request_x11: request from 43716
debug1: channel 1: new [x11]
debug1: confirm x11

Also, I have tested ssh port forwarding and it is extremely slow as well (and I'm guessing this could be the problem with the X11 forwarding).

share|improve this question
check if your IP address is known in all the servers. Check the logs, you will maybe see an IP instead of a FQDN. – Dom Mar 22 '13 at 8:08
maybe a DNS issue ? try to use -v option to see where ssh stuck. – Bertera Mar 22 '13 at 8:35
I'm unclear how DNS could be related to this. In any case, if I connect to the IP instead of the FQDN it still takes a really long time. As for using the -v option, nothing is printed out at the point that it gets stuck. – CrazyCasta Mar 22 '13 at 14:36
P.S. Just to be clear, it's not the ssh connection that is taking forever, it's the starting of an application after having connected. – CrazyCasta Mar 22 '13 at 14:59
To troubleshoot you could run tcpdump on the xserver, filtering for traffic from the client. If there is no traffic then something is happening on the client. If there is a large amount of traffic it may be the X protocol being chatty. I believe for modern apps the client renders the decorations and will have to be initially transmitted as bitmaps to the server, which caches them thereafter. – Mark Wagner Mar 22 '13 at 18:51
up vote 0 down vote accepted

Problem is that ssh does things on the loopback with ipv6 and I had ip6tables setup to drop all traffic. Just did the following and it works now:

ip6tables -A INPUT -i lo -j ACCEPT
ip6tables -A OUTPUT -o lo -j ACCEPT
ip6tables -A FORWARD -i lo -o lo -j ACCEPT

Thanks to ezakimak on #gentoo for pointing out the ipv6 angle.

share|improve this answer
Of course. localhost is an IPv6 address by default, and port forwards connect/bind to/from localhost on the remote system. – Michael Hampton Mar 22 '13 at 19:09
No, it all depends on how the listener is listening. On my machine localhost is, but because ssh is listening on an IPv6 socket it uses the IPv6 version of that. – CrazyCasta Mar 24 '13 at 23:37

What is the latency/RTT to the server (a simple ping would suffice)? What application you are trying to start?

X11 is a synchronous protocol, with serialized drawing call. If the latency is high or the application execute many drawing call, its load time will increase.

If you can, you should install freenx on the server and use a nx client (eg: remmina or client): they work by de-serializing X11 drawing calls, giving much improved performances.

share|improve this answer
As you see, I've already figured out the problem. Furthermore I have no interest in installing extra junk like nomachine. – CrazyCasta Feb 12 '15 at 17:57
@CrazyCasta ...and that's why you downvoted a seemingly legitimate answer? – Felix Frank Oct 15 '15 at 8:32
@FelixFrank Yes, when there's already an answer completely that completely fixes the problem I don't see the point in adding an answer 1) asks questions 2) provides an incorrect answer (has nothing to do with the X11 serialization) and 3) suggests that I try some other software for a problem that I've already fixed. It doesn't rise to the level of flagging the answer, but I don't see it as constructive. – CrazyCasta Oct 19 '15 at 21:06
@CrazyCasta I disagree completely. Yes, your particular issue was solved, but for future readers of your questions (e.g., your's truly), shodanshok's answer is actually more helpful because it offers general approaches that are valuable even in the general case when the reader does not happen to suffer from your exact issue. – Felix Frank Oct 20 '15 at 19:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.