linux下执行xhost命令报错:unable to open display,解决方法,linux 下通过xhost进入图形界面,经常会出现报错“unable to  open display”

linux下的操作步骤如下:

1、复制代码:

复制内容到剪贴板
  • [root@localhost ~]# vncserver   
  •   
  •         New 'localhost:1 (root)' desktop is localhost:1   
  •   
  •         Starting applications specified in /root/.vnc/xstartupLog file is /root/.vnc/localhost:1.log   
  •   
  • [root@localhost ~]# export DISPLAY=localhost:1   
  •   
  • [root@localhost ~]# xhost +   
  •   
  •         access control disabled, clients can connect from any host   
  • 在设置xhost时,出现unable to open display 的问题一般都能用上述方法搞定

    linux上执行 xhost unable to open display

    2、以root用户登录

    输入命令xdpyinfo,记录下里面的name of display:后的字符串,如 name of display:127.0.0.1:1.0

    在执行xhost +命令(使得所有客户都可以访问)

    返回信息为: access control disabled,clients can connect from any host

    如果xhost +不能执行,可以输入命令export DISPLAY=:0执行一下

    再执行xhost +

    xhost + ip (name表示那个ip机器可以使用该服务)

    以oracle用户登录

    如果前面root登录下执行xdpyinfo后的name of display:后的字符串是127.0.0.1:1.0

    那么在该oracle用户下执行一下export DISPLAY=:1.0

    然后再执行xdpyinfo命令,如果能出现信息说明你已经成功了

    这样估计就可以解决linux下安装oracle出现的xhost问题

    linux上执行 xhost unable to open display

    相关文章: