u have to set the DISPLAY environment variable properly
to see the current DISPLAY environment variable
(on the remote machine) use
$ set|grep DISPLAY
If it's something like :0 or :1,then u have to export DISPLAY
then on the machine u r working on u have to do
$ export DISPLAY=ip_of_the_remote_machine:0
Hope this helps