I've solved the problem. I needed to enable ssh x11 forwarding in a ssh config file. Works fine now. Thanks for your help.