forwardX11 option not working in 18.04

In UM 16.04 (and 16.10, 17.04 and 17.10) I could get the remote machine's files GUI just by using the ssh -X [email protected] command and then issuing the caja command.

This is from a 16.04 client to a 16.04 server. However, when attempting the same from an 18.04 client to an 18.04 server, this is what I get -

Caja does indeed open and display on the server but not on my local machine. Does anyone know why this happens or more importantly how I can get a remote GUI to display on my local machine?

X2go works as it always has, more or less perfectly and SSHFS is flawless. Only X forwarding seems broken.

When I ssh to my 18.04 xclock works (and other X apps).

There is caja --display= which I tried on my 18.04 but did not work.

I tried installing and then using XPRA on both client and server machines but neither worked - I could see caja opening on the server across the room but it didn’t open locally (on the client). Probably bug reporting time…

Edit: I installed gksu and its’ supporting library on two servers and then I could get a local GUI by issuing sudo caja using the X client. The problem has to do with the X server, not the client.

Gksu is just a dirty hack as you know well.

Edit 2: Reported as a bug - https://bugs.launchpad.net/ubuntu-mate/+bug/1774288

Have you tried exporting DISPLAY and XAUTHORITY variables when running pkexec?

pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY caja

Yes, I’ve tried pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY caja on every ssh connection and it doesn’t appear to work.

Just a while ago, after ssh -X into a server, I entered pluma /home/michael/Documents/special.txt and pluma opened the requested document on the server.

This has something to do with caja, my favorite file manager. Essentially, I’m here (using MATE) because of caja. caja /home/data3/ doesn’t work either.

Over on ubuntuforums, Morbius1 came up with a pretty good workaround though not a solution, sudo -E caja which worked to open an administrative remote Caja locally. I’ve been able to uninstall the gksu .debs that I’ve been using. Great!

See - https://ubuntuforums.org/showthread.php?t=2396430&page=2&p=13796581#post13796581

So something about 18.04’s Caja is still preventing an ssh -X caja command from working for me. Rats!

Xfe (the x window file manager) works as a reasonable work-around FYI.

sudo -E aka --preserve-env, Yeah some environment variable is required for caja to work. pkexec starts a clean environment.

Maybe SSH_AUTH_SOCK or just dbus?
You can run env command in the terminal and try to pass some of those variables to caja.

env

env will print all the environmet variables.

pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY GTK_MODULES=$GTK_MODULES DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS SSH_AUTH_SOCK=$SSH_AUTH_SOCK caja

By the way, if you use sudo on gui apps, any configuration file written to home directory will be owned by root. In case caja writes a configuration file to home dir. That's something you probably don't want to do. That's why gksudo was used.

This bug (https://bugs.launchpad.net/ubuntu-mate/+bug/1774288) has been Changed in: ubuntu-mate Status: New => Invalid by Martin Wimpress. Probably due to my poor reporting. Sigh… I’ll report it again.