Do you have an X server running on the agent? If the machine is just booted with a Pulse agent service run from an init script (or via systemd or upstart), usually no X server would be available for GUI programs. One way to solve this is to run Xvfb, see this blog post of ours:http://www.alittlemadness.com/2008/03/0 ... -headless/
for details (warning: it might be a bit dated). The nice thing about Xvfb is it works even if you are using a headless setup, i.e. you don't need a monitor attached to the agent.
If you have an Xserver running but still see this error than it could be a configuration or permission issue -- your environment might not specify a correct XAUTHORITY, or the Xserver may be rejecting connections from the Pulse user.