Xlib: connection refused

New to the group, sorry if this question has been asked before. I googled a lot and could not find good answer. I will admit up front that a lot my confusion probably stems from not having a very good understanding of x windows and security/accessibility set up of x11 forwarding. Anyway, here goes, if any of this does not make sense please ask me and I will try to clarify...

I have installed 6.2u3 on two machines running CentOs 5. I have the Qmaster and execution host on one machine and just an execution host on the other. I am able to schedule and run the simple.sh example. When I try to schedule a run for one of my real jobs I first got the can not connect to DISPLAY "" error. I then set the DISPLAY environment variable in the QMON job submit, after doing that I now get the Xlib connection refused;Xlib no protocol defined errors.

If I log into the execution host, print the DISPLAY variable and then set the job script DISPLAY variable to that same value the job will run, but I have to stay logged into the machine. Is this because the sge_execd process is running as root and then spawning the job as the user on the execution host?

The job I am trying to execute does not need to actually display anything, it is using the x windows for off screen buffer. I sae a bunch of stuff about changing /etc/profile to set export XAUTHORITY environment variable based on who is logging in, but this seems like a clunky solution.

I tried xhost + and this did not seem to fix the problem, plus is even worse than solution mentioned above...

Any help or suggestions would be much appreciated, I have spent a couple of days on this. Maybe I just need to read further on the x windows setup?

Thanks in advance

John