Open up
From ZENotes
echo $DISPLAY # you'll be needing this value 3 lines below sudo -i # or "su -" on older linuxes xauth merge ~<YourUserNameHere>/.Xauthority # use your own username here with ~ in front export DISPLAY=<ValueGatheredBefore> # use the value of user's DISPLAY from 3 lines before
Source: http://alien.slackbook.org/dokuwiki/doku.php?id=linux:kernelbuilding
Real Life Sample:
My machine is called DC266; my user is jslack and looks like that: <(^_^)> in a terminal :)
<(^_^)> ~ echo $DISPLAY :0.0
<(^_^)> ~ sudo -i Password: root@DC266:~#
root@DC266:~# xauth merge ~jslack/.Xauthority xauth: creating new authority file /root/.Xauthority
root@DC266:~# export DISPLAY=:0.0 root@DC266:~# echo $DISPLAY :0.0