There are instances when you need to run an X Window application. For me this is often running a terminator instance as root so that I can create tabs and split the window as still be root in each of those terminals.
In order for the root user to be able to connect to the X server you need to provide it with “credentials”. In this case it is on the same box and not over the network so the use of cookie authentication is acceptable.
As the user that is already authenticated to the X server run the following command to get the cookie used to connect to the the current $DISPLAY
rchapin@leviathan:~$ xauth list $DISPLAY
leviathan/unix:0 MIT-MAGIC-COOKIE-1 5fb2c0e68f4618ee4fa2202e1e4ae937
su to root and then run the following to add that cookie to roots authorization file
root@leviathan:~# xauth add leviathan/unix:0 MIT-MAGIC-COOKIE-1 5fb2c0e68f4618ee4fa2202e1e4ae937
You should now be able to run X windows applications from that root terminal.