Oracle图形化界面无法调出统一解决办法--VNC服务
概述
最近在安装Oracle时报错Could not execute auto check for display colors using command /usr/bin/xdpyinfo. Check if the DISPLAY variable is set.
好吧,又是Oracle调出图形界面问题,本来想通过本机给服务器起x-manager图形界面的时候报出这个错误,网上的办法有display的,有用xstart的,有xhost的,试了一下都有坑,所以就用VNC统一解决,不管那些乱七八糟的了,下面基于centos7.3环境,源是阿里源。
1、安装 X-Window
yum groupinstall "X Window System" -yyum install gnome-classic-session gnome-terminal nautilus-open-terminal control-center liberation-mono-fonts -y
2、设定预设启动图形界面
ll /lib/systemd/system/graphical.targetunlink /etc/systemd/system/default.target
ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target
3、安装 VNC 服务器
yum install tigervnc-server -y
4、 配置 VNC
4.1、service就是5901 连线的时候会用到,这里先cp档案到服务目录system里面cp /lib/systemd/system/[email protected] /etc/systemd/system/[email protected]:1.service
4.2、切换使用者su - oracle && vncpasswd 设定使用者连线的密码,这里和ssh登入的密码不一样。

4.3、编辑刚才复制的1.service
su - root
vim /etc/systemd/system/[email protected]:1.service

4.4、重新载入配置
pidfile放到使用者家目录里面就行,之后执行下面的命令重新载入配置
systemctl daemon-reload
4.5、配到开机启动服务,并启动这个服务
systemctl enable [email protected]:1.service #开启启动
systemctl start [email protected]:1.service #启动服务
netstat -anlpt |grep 590

5、VNC客户端连线
下载连结:连结:https://pan.baidu.com/s/1dSncijAYIko1KQLug5GpNA
提取码:8lyc
开启安装过程如下:



输入密码123456

成功调出图形界面

VNC在处理这块bug比较少,就是配置麻烦了一点,后面会分享更多devops和DBA方面的内容,感兴趣的朋友可以关注一下~
