centos7 minimal 远程运行图形界面gui程序报错 Gtk-WARNING **: cannot open display:

检查ssdd配置中x11forwarding 为yes

> grep 'X11' /etc/ssh/sshd_config
 X11Forwarding yes
 # X11DisplayOffset 10
 # X11UseLocalhost yes
 # X11Forwarding no

安装 xauthxorg-x11-fonts

> yum install xauth
Installing:
 xorg-x11-xauth x86_64 1:1.0.9-1.el7 base 30 k
Installing for dependencies:
 libICE x86_64 1.0.9-2.el7 base 65 k
 libSM x86_64 1.2.2-2.el7 base 39 k
 libXmu x86_64 1.1.2-2.el7 base 71 k
 libXt x86_64 1.1.4-6.1.el7 base 173 k

> yum install xorg-x11-fonts-Type1
Installing:
 xorg-x11-fonts-Type1 noarch 7.5-9.el7 base 521 k
Installing for dependencies:
 libXfont x86_64 1.5.1-2.el7 base 150 k
 libfontenc x86_64 1.1.2-3.el7 base 30 k
 ttmkfdir x86_64 3.0.9-42.el7 base 48 k
 xorg-x11-font-utils x86_64 1:7.5-20.el7 base 87 k

退出用户重新登录

查看环境变量已经多了DISPLAY

export
declare -x DISPLAY="localhost:10.0"

使用mobaxterm启动一个带图形界面的程序试试吧

CentOS7安装GNOME桌面

yum groupinstall "GNOME Desktop" "Graphical Administration Tools"
启动GNOM桌面可使用
startx

参考:

https://bitsanddragons.wordpress.com/2017/08/23/gtk-warning-cannot-open-display-on-centos-7-minimal-server-install/

https://superuser.com/questions/310197/how-do-i-fix-a-cannot-open-display-error-when-opening-an-x-program-after-sshi

https://www.linuxidc.com/Linux/2017-10/148145.htm

http://blog.csdn.net/Lux_Veritas/article/details/19244349

© 2018 - 2020, 新之助meow. 原创文章转载请注明: 转载自http://www.xinmeow.com

0.00 avg. rating (0% score) - 0 votes
点赞