解决远程桌面执行sudo启动X应用报错“Gtk-WARNING **: 12:39:47.296: cannot open display: :10.0”

通过远程桌面(RDP)连接到远程Ubuntu服务器桌面,执行调用X窗口应用的时候,报错如下:

$ sudo update-manager
No protocol specified
Unable to init server: Could not connect: Connection refused
No protocol specified
Unable to init server: 无法连接: Connection refused
No protocol specified
Unable to init server: 无法连接: Connection refused

(update-manager:2547): Gtk-WARNING **: 12:39:47.296: cannot open display: :10.0

原因因为:
XServer默认情况下不允许别的用户的图形程序的图形显示在当前屏幕上

如果需要别的用户的图形显示在当前屏幕上,则应以当前登陆的用,也就是切换身份前的用户执行如下命令。

当前登陆普通用户执行:xhost +

$ xhost +
access control disabled, clients can connect from any host

$ sudo update-manager

参考链接


Ubuntu gedit报错Gtk-WARNING **: cannot open display: 问题解决

发布者

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注