Xpra: Ticket #200: Eliminate the need to specify --socket-dir on the client side

It took me like an hour to get it working with a CIFS mounted $HOME -- including updating xpra from xpra.org (and not from default Ubuntu where it's in version 0.0.7.XXX). The problem was similar to #120, but I had a hard time finding the solution: using --socket-dir on both the server and the client side.

This is a bit redundant. Would it be possible to implement something along the following lines:

  1. The base location of the socket file is always ~/.xpra/$HOST-$DISPLAY (just as it's now without --socket-dir). If --socket-dir is given for "xpra start", the server creates a symlink (or, if that fails, a simple text file) at the "base location", pointing to the location of the "true" socket.
  1. With "xpra attach ssh:", the "base location" is tested for being a socket, a symlink or a simple text file; the "true" socket is used transparently.
  1. "xpra list" also won't need the --socket-dir anymore.

This could be even the default behavior: Try to create the socket at the base location, if that fails, try /tmp/xpra-$USER, if that fails, suggest using --socket-dir. By that, the use cases for --socket-dir would be greatly reduced. More importantly, the entry barrier would be lowered.



Tue, 23 Oct 2012 16:29:01 GMT - Antoine Martin: priority, status changed

First of all, v0.0.7.x is so old, buggy and insecure that I do not understand why any distro would ship this code. Only irresponsible ones I guess.

As you found out, when you use NFS/CIFS home the sockets need to reside in /tmp (or just anywhere where sockets can be created and accessed, or you may want to use tcp sockets instead).

IIRC, specifying the socket dir can be done in /etc/xpra/xpra.conf, so you do not need to specify it every time you invoke xpra. I have not checked to see if the xpra proxy code invoked via ssh honours it, but it should, so then you should be able to specify it only once on the server and the clients will use this option transparently, without knowing about it. (please do let me know if that is not the case)

I like your idea of setting up symlinks to find the sockets no matter where they are. However, there are a number of difficulties here:

Nothing insurmountable here, but a change like this is bound to be more complicated to implement than first thought. I will try to fit it in this development cycle - but no promises made or implied here!


Thu, 25 Oct 2012 13:06:49 GMT - grumpfl:

Setting socket-dir in ~/.xpra/xpra.conf worked for me. Given that, I think it should be enough to mention in the man page that socket-dir should better be used in the server-side xpra.conf or on both client and server side from the command line.


Thu, 25 Oct 2012 13:14:26 GMT - grumpfl:

No, sorry, it did not. I set it in ~/.xpra/xpra.conf on the server side, but still the --socket-dir switch was required on the client side.


Sun, 24 Feb 2013 14:45:31 GMT - Antoine Martin: status changed


Sun, 24 Feb 2013 14:45:40 GMT - Antoine Martin: status changed; resolution set

fixed in r2778


Sat, 23 Jan 2021 04:48:15 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/200