February 2008
Merge your ~/.Xauthority with the ~/.Xauthority of root:
~/.Xauthority
sudo xauth merge ~user/.Xauthority
user
Or for a more permanent solution:
Modify your ~/.bashrc to contain the following:
~/.bashrc
export XAUTHORITY=~/.Xauthority
Modify your /etc/sudoers to contain the following:
/etc/sudoers
Defaults env_keep += "DISPLAY XAUTHORITY"