I stumped here, I've a shell script that starts my pythonAI. It works fine on Raspberry Pi Stretch when launched by a node-red exec node. But when launhed on Ubuntu 18.04 node red it dies with ": cannot connect to X server" in my log file. If I run the script from a terminal on the Ubuntu machine it works as expected. If I launch it from my desktop (where the node-red webpage is being viewed/edited) via ssh -X it works. I get the X display locally when launched from the 18.04 terminal and I get the the X display on my desktop when launched with ssh -X.
Why does running the script via node-red exec node not work the same as launching it via a terminal login?