EDIT 2021-09-02: A reader made me realize that the “socat” trick can be greatly improved by adding “,fork” on the server part. This allows socat to accept multiple consecutive connections, just like a real production server would. In practice, I find myself using a variation of this trick a lot, but without the ‘socat’. Indeed, if it is acceptable for the container to open a connection with the host, this easiest is to set X11UseLocalhost=no in /etc/ssh/sshd_config. The rest of th...