# Headless X server



## codonnell (Nov 16, 2008)

Not sure if this should be posted under servers/networking.

We run a headless X FreeBSD server accessed by local workstations. The workstations connect using ssh/X11Forwarding to open X clients from the server (primarily xterms and emacs). The only X-related item I had planned to run on the server is the xfs font server. The server has no physical monitor.

Here is the issue: If I do not run XDM on the server it takes ~5-10 seconds to open an X client from a remote host. If I do run XDM on the server, X clients open instantly.

Can anyone suggest a reason for this? Is it simply that certain shared libraries are paged in as long as X is running on the server or is there something else at work like an Xauth mechanism?

Best,
Chuck


----------



## peter (Nov 16, 2008)

It's unlikely to be related to shared libraries unless the server is very slow.  It does sound like Xauth.  Try using 'ssh -v' (maybe with some more 'v's) and see where the delay is.


----------



## romerogordon (Nov 16, 2008)

Maybe name resolution? Try inserting hostnames in /etc/hosts.


----------



## codonnell (Nov 17, 2008)

thanks for the replies.

i believe name resolution is fine, but even so, if it were name resolution or Xauth, why would the problem go away simply by running xdm on the server?


----------



## tarkb (Dec 4, 2008)

If you are making a seperate ssh connection per X client (as opposed to ssh-ing once, and then starting background processes like "xterm &" or whatever) then ssh multiplexing can decrease the ssh connection time.

Add something like:

ControlMaster auto
ControlPath ~/.ssh/control-master/%l_to_%r@%h_port_%p

to ~/.ssh/config (see google and ssh_config manpage for more, but I think those are the only 2 lines needed).

If the files become "stale" (power went off, or whatever) you can safely

rm ~/.ssh/control-master/*

to fix things. (and if you have /home on nfs or similar, you can tell by the hosts in the filename which ones are "stale" and which might still be in use)

If the same user makes multiple ssh sessions to the same machine, this will speed up subsequent (all but the first) connects. It is especially noticable when e.g. the server is a 100 Mhz Pentium.

Hope this helps, I run X programs over my LAN (separate ssh connection per X client) and this helped me anyway.


----------

