-->

DEVOPSZONES

  • Recent blogs

    How to Install VNC Server on CentOS 7/Oracle Linux

     How to Install VNC Server  on CentOS 7 / Oracle Linux 7


    Virtual Network Computing (VNC) is a graphical desktop-sharing system that uses the Remote Frame Buffer protocol to remotely control another computer.

    In this guide, we will look at how to install and configure a VNC server on the CentOS 7.x operating system to allow remote connections from any VNC clients, such as TigerVNC TightVNC, RealVNC, and others. 


    Install TigerVNC

    Now let's see how we can install and configure TigerVNC on Oracle Linux 7. The first thing to do is to install the TigerVNC Server program by opening a terminal session and entering the following command with root privileges:

    Manas#yum install tigervnc-server

    install VNC

    create a separate VNC user and password. To do this, enter the following:


    Manas# useradd vncuser

    Manas# passwd vncuser

    After you create vncuser and set a password for logging in, you also need to set a unique VNC password for this user. The command to do this is:

    # su - vncuser   --- (This is to switch user)

    # vncpasswd


    vncpasswd


    Setup the Firewall

    As our VNC service is listening on TCP port 5901, we must open that port to access it from outside. 

    How many ports to open will depend on how many VNC server instances you need. In our scenario, its 1, so you only open the first  VNC port: TCP 5901. 

    Find Articles on troubleshooting Other OCI issues.

    The command to open this port on Firewalld:

    # firewall-cmd --add-port = 5901 / tcp

    # firewall-cmd --add-port = 5901 / tcp --permanent

    Install GUI:

    If you already have GNOME, KDE, or other installed desktop environments, you can skip this step. Otherwise, you need to install one of them.

    GNOME

    Manas# yum groupinstall "GNOME Desktop"


    Xfce

    If you need a lightweight alternative for GNOME, we have Xfce, a free, open-source environment for Unix-like platforms that works great with TigerVNC. To install it, enter the following:


    # yum install epel-release

    # yum groupinstall xfce

    You will also need to modify the file that was executed when the VNC session started. To do this, edit the file /home/<user>/.vnc/xstartup and 

    change the exec entry  from etc/X11/xinit/xinitrc to startxfce4, as shown below:

    #!/bin/sh

    unset SESSION_MANAGER

    unset DBUS_SESSION_BUS_ADDRESS

    exec startxfce4

    vncserver -kill $DISPLAY

    VNC client:

    As everything setup now, we need to connect VNC service using VNC client tigerVNC Viewer. In Our case the Port is 5901.

    vnc viewer


    No comments