No protocol specified xhost: unable to open display

本文记录了解决Xhost无法打开显示的问题过程。通过检查并修改/etc/hosts文件中的localhost条目,以及使用xhost命令调整显示设置,最终解决了远程显示连接的问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

[weblogic@hdp-01 ~]$ xhost +
No protocol specified
xhost:  unable to open display "192.168.56.1:0.0"
[weblogic@hdp-01 ~]$ env|grep DISPLAY
DISPLAY=192.168.56.1:0.0
[weblogic@hdp-01 ~]$ exit
logout
[root@hdp-01 ~]#  env|grep DISPLAY
DISPLAY=localhost:10.0

然后看看 /etc/hosts 发现了缺失 localhost 

[root@hdp-01 ~]# cat /etc/hosts
192.168.56.129   hdp-01 

[root@hdp-01 ~]# vi /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.56.129   hdp-01
 
OJBK 了
[root@hdp-01 ~]# xhost +
access control disabled, clients can connect from any host
 
 
 

转载于:https://www.cnblogs.com/vzhangxk/p/11220385.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值