场景:oracle安装途中需要用到xhost,使用xhost 命令报错"unable to open display"
解决方法,linux 下通过xhost进入图形界面,经常会出现报错“unable to open display”
若没有vncserver则先安装
输入 vncserver 检查是否安装
[root@VM_0_11_centos ~]# vncserver
New 'VM_0_11_centos:2 (root)' desktop is VM_0_11_centos:2
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/VM_0_11_centos:2.log
[root@VM_0_11_centos ~]# vncserver:1
-bash: vncserver:1: command not found
[root@VM_0_11_centos ~]# xhost +
access control disabled, clients can connect from any host
如果之后还报错就重置一下DISPLAY
export DISPLAY=VM_0_11_centos:1
VM_0_11_centos 是主机名
参考地址: