On a mailing list or an IRC channel I recall seeing someone say that however bad X11 is, they’d never switch to a newer alternative like Wayland (which I believe Ubuntu is doing) because X11 is capable of being used on a network at a pretty fundamental level. Today I tried that out by opening a graphical Emacs frame on my laptop connected to the same Emacs process on my desktop.

And it’s so easy, and that’s the point. You just have to remember that ‘client’ and ‘server’ feel like they are the wrong way around: the X server in this case is my laptop, and the X client is the emacsclient process running on the desktop, whereas at a more natural level of abstraction, the laptop is the client and the desktop the server because the desktop has the persistent running Emacs process.

Ideally I would like to do Emacs this way so that I could just keep everything running. This isn’t practical because I’m on a laptop, but perhaps when I stop being a student I’ll be able to switch to it.

Oh yes and the coolest part: the remote box doesn’t have to have X running in any shape or form; it doesn’t even need it to be installed. The program in question just needs to be able to use the X11 libraries, and it just sends it all tunnelled over SSH to the local machine which draws it on the screen.

X authentication got in my way, so for trying this out, these are the hacks I had to make. To /etc/sshd_config on my desktop

X11Forwarding yes
XAuthLocation /usr/bin/xauth

and then I had to nuke ~/.Xauthority on my desktop and run ssh -Y desktop rather than ssh -X desktop to get it to work. Then you can just type xterm or emacsclient -c or whatever and it pops up locally.

This may be relevant for actually doing it properly.