X11参数没有设定报错

做了一项测试操作,显示如下错误
An error occurred: Can’t connect to X11 window server using ‘localhost:0.0’ as the value of the DISPLAY variable

本人已经设定 DISPLAY 参数为 export DISPLAY=localhost:0.0 在 /etc/profile 里面,是用 root 账户设定的。

请问该问题该如何解决,请提供下思路?