Gtk-WARNING **: cannot open display: :0.0之解决
解决 Cannot open WARNING display 0.0 gtk
2023-09-27 14:24:37 时间
当使用su 到另外一个用户运行某个程序,而这个程序又要有图形显示的时候,就有可能有下面提示:
root@dt:~# sudo -i -u keji google-chrome
No protocol specified
(google-chrome:5146): Gtk-WARNING **: cannot open display: :0.0
这是因为Xserver默认情况下不允许别的用户的图形程序的图形显示在当前屏幕上. 如果需要别的用户的图形显示在当前屏幕上, 则应以当前登陆的用户, 也就是切换身份前的用户执行如下命令。
xhost +
通过执行这条命令,就授予了其它用户访问当前屏幕的权限,于是就可以以另外的用户运行需要运行的程序了
相关文章
- 解决ImportError: cannot import name ‘soft_unicode‘ from ‘markupsafe‘
- Python解决 Cannot uninstall ‘pyparsing‘ 问题
- IDEA 最新版2022.3.2 创建Android新空项目时:Cannot resolve symbol ‘R‘错误原因和解决方法
- 每日Ubuntu小技巧:解决VirtualBox中截屏时的黑屏故障
- python3安装库时关于 ImportError: cannot import name 'Feature' from 'setuptools'报错解决
- 解决tomcat一闪而过问题
- 解决“LNK1104cannot open file 'libboost_thread-vc140-mt-gd-x64-1_68.lib'”
- the import java.util.* cannot be resolve,怎么解决
- vmware Unable to open kernel device ".Globalvmx86": The system cannot find the file 的解决方法
- 解决mxnet错误:OSError: libcudart.so.10.0: cannot open shared object file: No such file or directory
- java中解决request中文乱码问题
- 转 SecureCRT中文乱码解决方法 以及linux 中文支持
- windows下go get 报错 go: cannot use path@version syntax in GOPATH mode 解决方法
- 解决Cannot change version of project facet Dynamic web module to 2.5
- 安装apr-1.6.3报错[cannot remove `libtoolT’: No such file or directory]解决方法
- maven依赖包冲突解决思路
- 解决:eth0安装插卡无法自己主动,网卡的配置信息不network-scripts于
- eclipse 常见问题及解决
- 【学习笔记】成功解决:(字体问题)Package fontspec Error: The font “STXingkai“ cannot be found. makecover
- 解决zun docker vif_type(binding_failed) is not supported.A binding script for this type can‘t be found
- PHP提示Cannot modify header information - headers already sent by解决方法