If you have Xming installed and are forwarding X11 with putty you may notice that all is well until you need to run a gui application as the root user (after issuing sudo su).
If you just need to run the gui application and don’t require the entire root environment then issuing a sudo app should launch your application in Xming.
However, if you do require the root environment then follow these steps.
sudo su cat /home/your_username/.Xauthority >> /root/.Xauthority
or you could do this
sudo su su - your_username -c "xauth list" > X11auth xauth add $(<X11auth)
I found this solution here: linuxquestions.org