Gtk-WARNING **: cannot open display;
时间: 2023-08-17 07:06:59 浏览: 371
回答: 当出现"Gtk-WARNING **: cannot open display"的错误提示时,通常是因为Xserver默认情况下不允许别的用户的图形程序的图形显示在当前屏幕上。如果需要让别的用户的图形显示在当前屏幕上,可以以当前登录的用户执行命令"xhost +"来授予其他用户访问当前屏幕的权限。这样就可以以另外的用户运行需要运行的程序了。\[1\]
另外,如果是通过SSH远程链接到服务器,并且出现"Gtk-WARNING **: cannot open display"的错误提示,可以尝试修改SSH的远程链接方式为"-Y",这样可以解决该问题。\[2\]
对于使用qemu-kvm开启虚拟机时出现"Gtk-WARNING **: cannot open display"的错误提示,这通常是因为在通过ssh登录到服务器时,执行qemu的启动程序会产生该错误。这是因为qemu-kvm利用图形界面方式开启虚拟机,而ssh登录到服务器时没有图形界面。\[3\]
#### 引用[.reference_title]
- *1* [使用gedit出现No protocol specified (gedit:14333): Gtk-WARNING **: cannot open display: :0.0](https://blog.csdn.net/wojiuguowei/article/details/83618821)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [亲测有用,轻松解决远程链接的“Gtk-WARNING **: cannot open display;”或“Cannot connect to display;...](https://blog.csdn.net/weixin_40303822/article/details/118547587)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [Gtk-WARNING **: cannot open display问题的解决](https://blog.csdn.net/Lux_Veritas/article/details/19244349)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文