My failure with Xpra (probably because what I want is almost impossible)

May 25, 2020

I'll start with my tweet about trying out Xpra:

In theory xpra should be an improvement over 'ssh -X'. In practice, the Fedora 31 version doesn't like my SSH authentication setup or then my HiDPI environment with fvwm, so that's basically a failure. Oh well, 'ssh -X' works well enough.

In this current time of working from home, I've wound up wanting to run a number of X programs remotely. My home DSL link is good enough to make this acceptable, but it could definitely be better than it is, so I recently tried out Xpra to see if it would give me better performance.

The first issue I found is that I had to force Xpra to explicitly use the real ssh program to connect to my work machine, instead of what appears to be an internal SSH client implementation. I assume that this is because I'm using ssh-agent and encrypted SSH keys, and whatever Xpra is doing by default can't deal with them (or doesn't deal with them properly). The second and more fatal issue is that programs running under Xpra were not seeing my HiDPI settings for my home HiDPI monitor, and so I got things like tiny xterms. This is a vast regression in usability regardless of any speed increase, so I stopped there (after trying a few things to fix it).

(Another practical issue I ran into with Xpra is that it started quite slowly. For usage as a remote desktop this isn't very bad, because you start it once. For use as a 'ssh -X' replacement, this is not great because I tend to close windows and programs frequently, including remote ones.)

At first I was sad and grumpy about this, but after thinking about it some more I've come around to the view that what I want is at least a very difficult problem (and so I'm unlikely to find anything that does it). What I want is something that behaves exactly like 'ssh -X', which is to say that it's just like a straight X connection directly to my X server for all of those weird things like keymaps, X properties, multiple windows, and so on, but is faster than a plain forwarded X connection (possibly over a compressed channel). This isn't impossible, but how modern X applications work makes it difficult, since even text based applications are now actually sending rendered bitmaps to the server. A very clever X protocol proxy could probably speed this up with various techniques, but the problem is that it would have to know a lot about X, perhaps to the extent of basically being able to render its own private copy of the client's window.

(My impression is that most people are interesting in 'remote desktop', not 'remote X client'. I'm not, for various reasons. Accelerating a full remote desktop is in some ways an easier problem, if only because you can borrow a lot of infrastructure from the X server itself.)

PS: I expect that Xpra probably works for HiDPI local screens in common cases like GNOME or KDE desktops. As mentioned in my tweet, my setup is rather unusual so I'm not entirely surprised that it didn't go well, although I'm a little bit disappointed. I am setting my DPI in a number of places and normal 'ssh -X' remote X programs pick them up.


Comments on this page:

By Opk at 2020-05-26 04:35:41:

It's some time ago that I tried out xpra but I also found it to be a somewhat frustrating experience. It had the habit, common of things written in python, of dumping stack traces instead of sane error messages. Startup was slow and it all felt somewhat clumsy. That said, it did basically work which is more than can be said for my attempts with freenx.

The thing I've ended up using somewhat during the current lockdown is broadway with a Gtk application. I'm not necessarily keen on having to run it inside Firefox but at least http is easy to proxy through my work laptop which runs the VPN client – unlike vnc which is what I'm supposed to use. Mostly, I've tried to get by with ssh and vim's support for accessing files over scp.

From 193.219.181.211 at 2020-05-26 14:17:46:

Xpra actually doesn't correctly work even on low-DPI screens. Its log messages tell me that I need a patched xdummy version to fix some "DPI issues", and indeed several GNOME3 apps (such as Evince) running via Xpra appear to use some utterly low DPI value, so that an A4 page at 100% is the size of a thumb-nail.

It's still indispensable when I want to remotely run something like Thunderbird, which is otherwise difficult with raw X11 even over gigabit ethernet...

Written on 25 May 2020.
« A cheatsheet for Python's pip for how I use it
My various settings in X to get programs working on my HiDPI display »

Page tools: View Source, View Normal, Add Comment.
Search:
Login: Password:
Atom Syndication: Recent Comments.

Last modified: Mon May 25 22:45:30 2020
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.