Detailed explanation of VNC installation environment for preparing Oracle 11g on azure cloud


1. First, check whether VNC service has been installed on the server and not. Check whether VNC is installed on the server as follows

The two installation methods of Yum or RPM package are checked:

[[email protected]_test_pd_121_129 ~]# ps -eaf|grep vnc                                                                  
root   15895 15846 0 15:04 pts/1  00:00:00 grep vnc
[[email protected]_test_pd_121_129 ~]#
[[email protected]_test_pd_121_129 ~]# rpm -qa | grep vnc
[[email protected]_test_pd_121_129 ~]#

2. Install VNC software

Yum installation command:

yum install tigervnc tigervnc-server –y                                                                           
yum install -y libvncserver*

After successful installation, check:

[[email protected]_test_pd_121_129 ~]# rpm -qa | grep vnc                                                              
[[email protected]_test_pd_121_129 ~]#

3. Install Gnome software

This is the component needed to generate the GUI lock:

yum install -y gnome*                               
yum install libXfont -y
yum install xorg-x11-xfs 
yum install xorg-x11-xfs-utils 
yum install xorg-x11-xinit 
yum install xorg-x11-xdm 
yum install xorg-x11-fonts* 

4. Configure vncservers

Configure vncservers. The initialization size of the desktop window of VNC remote connection to the server is shown here. The default size is 800×600. You can also set it to the mode you are accustomed to, such as 1280×960:

[[email protected]_test_pd_121_129 ~]# vim /etc/sysconfig/vncservers                                                    
VNCSERVERARGS[1]="-geometry 800x600"

5. Set vncserver password

Set to yueworld. The password must be set before starting VNC:

[[email protected]_test_pd_121_129 ~]# vncpasswd                                                                    
[[email protected]_test_pd_121_129 ~]#

6. Start and stop vncserver

Start command servicevncserver start:

[[email protected]_test_pd_121_129 ~]# service vncserver start                                                         
Starting VNC server: 1: root xauth: creating new authority file / root /. Xauthority
New 'hch_test_pd_121_129:1 (root)' desktop is hch_test_pd_121_129:1
Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/hch_test_pd_121_129:1.log
[[email protected]_test_pd_121_129 ~]#

Stop command servicevncserver stop:

[[email protected]_test_pd_121_129 ~]# service vncserver stop                                                         
Shut down the VNC server: 1:root [OK]
[[email protected]_test_pd_121_129 ~]#

Restart command servicevncserver restart:

[[email protected]_test_pd_121_129 ~]# service vncserver restart                                                       
Shut down the VNC server: 1:root [OK]
Starting VNC server: 1: root
New 'hch_test_pd_121_129:1 (root)' desktop is hch_test_pd_121_129:1
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/hch_test_pd_121_129:1.log
[[email protected]_test_pd_121_129 ~]#

7. Configure xstartup startup command
Configure the / root /. VNC / xstartup command as follows:

[[email protected]_test_pd_121_129 ~]# more /root/.vnc/xstartup               

# Uncomment the following two lines for normal desktop:
exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
#xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm &
gnome-session &
[[email protected]_test_pd_121_129 ~]#


If you use Gnome image interface, you need to comment out the following two lines,

xterm -geometry80x24+10+10 -ls -title “$VNCDESKTOP Desktop” & 
twm & 

And add the following line:

gnome-session &


If the screen is black, the background log reports the following error:

Sat May 7 15:05:35 2016
 vncext:   VNC extension running!
 vncext:   Listening for VNC connections on all interface(s), port 5901
 vncext:   created VNC server for screen 0
/root/.vnc/xstartup: line 4: /etc/X11/xinit/xinitrc: No such file or directory
/root/.vnc/xstartup: line 4: exec: /etc/X11/xinit/xinitrc: cannot execute: No such file or directory

Then go to the server to retrieve xinitrc, if it can’t be retrieved, as follows:

[[email protected] rpms]# ll /etc/X11/xinit/xinitrc
ls: cannot access /etc/X11/xinit/xinitrc: No such file or directory
[[email protected] rpms]# find / -name xinitrc
[[email protected] rpms]# 

The solution is to comment out exec / etc / X11 / xinit / xinitrc in / root /. VNC / xstartup, let VNC server choose the default one, and let VNC load the default GUI program

8. Change the permissions of xstartup

This is a problem that many people tend to ignore, and it is also one of the reasons for the black screen after the successful connection.

In CentOS, the file path of xstartup is: / root /. VNC / (you can view the file path of xstartup through locatexstartup)

So you need to execute: Chmod 777 / root /. VNC / xstartup to grant permissions. Then restart vncserver.

9. Install VNC viewer in local windows and access remotely

Install the VNC client under windows at; package name, realvnc_cngr.rar, install it under windows of the machine, and then open and connect. The connection address is shown as follows: D: \ study \ CSDN \ 0801.png:

After entering the password, enter “application” – “system tools” – “terminal”, drag the terminal to the desktop, double-click the terminal on the desktop, and then you can start to install Oracle, as shown in D: \ study \ CSDN \ 0802.png below:

In this way, you can remotely operate the Oracle server of CentOS 6.7 through VNC. The above is the whole content of this article. I hope it will help you in your study, and I hope you can support developepaer more.