Working via SSH - logging into toolbox image on the remote machine kills X server connection

SOLUTION (suppose you are ssh-ing to machine with hostname bel02)
Do this:

ssh -X user@bel02
toolbox enter c7-nica-dev
sudo hostname bel02
sudo nano /etc/hostname    (replace whatever it is there to bel02)
sudo nano /etc/hosts            (the line with 127.0.1.1 must have hostname bel02)
logout and login back to toolbox

RATIONALE:

  • when logging by SSH to remote machine the X server authentication protocol accepts (amongst other things) ...user@hostname .Xauthority file...
  • when switching to toolbox it gets confused as $HOSTNAME changes so we have ...user@toolbox .Xauthority file...

To fix this, we simply set in toolbox environment the $HOSTNAME variable to the $HOSTNAME of the machine, to which the ssh connects.


Description: suppose you login
ssh -X user@machineip
and your X server forwarding works,
then when you do
toolbox enter c7-nica-dev
module add mpddev
root
TBrowser b

the X server forwarding does not work anymore and you will get a message
X11 connection rejected because of wrong authentication.

More here https://blog.yadutaf.fr/2017/09/10/running-a-graphical-app-in-a-docker-container-on-a-remote-server/

Edited Dec 20, 2022 by Slavomir Hnatic
Assignee Loading
Time tracking Loading