You are on page 1of 19

10/30/2020 Using VNC securely in the Oracle Cloud | A-Team Chronicles

A-Team Chronicles A-Team Chronicles

Best Practices from Oracle Development's A‑Team

TECHNOLOGIES / COMPUTE ... view more

April 29, 2016

Using VNC securely in the Oracle


Cloud
Roland Koenn
CONSULTING SOLUTION ARCHITECT

file:///D:/Doyensys EBS training documents/Using VNC securely in the Oracle Cloud _ A-Team Chronicles ole6.10.html 1/19
10/30/2020 Using VNC securely in the Oracle Cloud | A-Team Chronicles

Introduction
Having access to a VM in the Cloud via VNC can be very useful in many
situations – e.g. most customers want to install software using GUI
based installer, e.g. Oracle Database etc. Using VNC the installation can
continue, even without being connected. The easiest way to achieve this
with a reliable and secure mechanism is to use VNC via a SSH Tunnel. In
this example a simple Oracle Compute Cloud VM is used to con gure a
Gnome Desktop & VNC Server. It has been created as shown in the
tutorial here. Most other VMs in the Oracle Cloud that run Oracle Linux
can be con gured in the same way, e.g. DBaaS VMs.

This tutorial is for Oracle Cloud Infrastructure - Classic. For Oracle Cloud
Infrastructure please
visit: h ps://cloud.oracle.com/iaas/whitepapers/run_graphical_apps_securely_on_oci.pdf

file:///D:/Doyensys EBS training documents/Using VNC securely in the Oracle Cloud _ A-Team Chronicles ole6.10.html 2/19
10/30/2020 Using VNC securely in the Oracle Cloud | A-Team Chronicles

Configure SSH Tunnel


The SSH Tunnel is established using the Pu y Tool – alternatives will be
discussed later in this tutorial. Use the public IP address of the created
VM and give it the session a name.

file:///D:/Doyensys EBS training documents/Using VNC securely in the Oracle Cloud _ A-Team Chronicles ole6.10.html 3/19
10/30/2020 Using VNC securely in the Oracle Cloud | A-Team Chronicles

Next expand the session tree on the left hand side and select the
category “Data” in the “Connection” branch. Per default Oracle Cloud
VMs are con gured with the user opc. For easier login enter “opc” in the
Auto-login username eld.

file:///D:/Doyensys EBS training documents/Using VNC securely in the Oracle Cloud _ A-Team Chronicles ole6.10.html 4/19
10/30/2020 Using VNC securely in the Oracle Cloud | A-Team Chronicles

Expand the “SSH” branch and select “Tunnels”. Here enter 5901 as
source port and the Public IP of the VM in the format 1.1.1.1:5901. Here
5901 is the destination port. Click add.
All VNC tra c is routed through this SSH tunnel on Port 22, hence no
additional port needs to be opened via Security Lists. See this MOS
Note should you want to use iptables Doc ID 2102424.1.

file:///D:/Doyensys EBS training documents/Using VNC securely in the Oracle Cloud _ A-Team Chronicles ole6.10.html 5/19
10/30/2020 Using VNC securely in the Oracle Cloud | A-Team Chronicles

Next navigate to “Auth” in the “SSH” branch and point to the private key
that has the authentication information as provided during the
provisioning of the VM. See this tutorial, if you are unsure which key to
use: SSH Keys

file:///D:/Doyensys EBS training documents/Using VNC securely in the Oracle Cloud _ A-Team Chronicles ole6.10.html 6/19
10/30/2020 Using VNC securely in the Oracle Cloud | A-Team Chronicles

Finally navigate back to the “Session” category. Press the “Save” Bu on


and then press “Open” to establish the connection.

file:///D:/Doyensys EBS training documents/Using VNC securely in the Oracle Cloud _ A-Team Chronicles ole6.10.html 7/19
10/30/2020 Using VNC securely in the Oracle Cloud | A-Team Chronicles

Configure VNC Server


If everything is con gured correctly you will be greeted by the usual
prompt.

file:///D:/Doyensys EBS training documents/Using VNC securely in the Oracle Cloud _ A-Team Chronicles ole6.10.html 8/19
10/30/2020 Using VNC securely in the Oracle Cloud | A-Team Chronicles

Install the GNOME desktop via yum. To achieve this switch to the root
user and then use the groupinstall function for Oracle Linux 6:

sudo su -

yum -y groupinstall "Desktop"

For Oracle Linux 7 use:

sudo su - yum groups install "Server with GUI" --skip-broken

file:///D:/Doyensys EBS training documents/Using VNC securely in the Oracle Cloud _ A-Team Chronicles ole6.10.html 9/19
10/30/2020 Using VNC securely in the Oracle Cloud | A-Team Chronicles

If you have issue with yum – follow this simple tutorial. If you have
problems try to disable or remove all existing yum repositories by
running:

rm -rf /etc/yum.repos.d/* yum clean all

Then rerun the steps in the tutorial.

Alternatively KDE desktop can be installed on OL6 using:

yum -y groupinstall kde-desktop

file:///D:/Doyensys EBS training documents/Using VNC securely in the Oracle Cloud _ A-Team Chronicles ole6.10.html 10/19
10/30/2020 Using VNC securely in the Oracle Cloud | A-Team Chronicles

Make sure that there are no errors and look for the “Complete!”
message once everything is installed.

file:///D:/Doyensys EBS training documents/Using VNC securely in the Oracle Cloud _ A-Team Chronicles ole6.10.html 11/19
10/30/2020 Using VNC securely in the Oracle Cloud | A-Team Chronicles

Install additional tools to help with your activities, like a browser (here
Firefox) or even an O ce Suite. Make sure to install the mesa-libGL
package to avoid a number of known issues. Most importantly install
“tigervnc-server” to allow access to the desktop.

yum -y install tigervnc-server

yum -y install firefox

yum -y install mesa-libGL

file:///D:/Doyensys EBS training documents/Using VNC securely in the Oracle Cloud _ A-Team Chronicles ole6.10.html 12/19
10/30/2020 Using VNC securely in the Oracle Cloud | A-Team Chronicles

yum -y groupinstall "General Purpose Desktop"

After all packages are installed simply issue:

vncserver

file:///D:/Doyensys EBS training documents/Using VNC securely in the Oracle Cloud _ A-Team Chronicles ole6.10.html 13/19
10/30/2020 Using VNC securely in the Oracle Cloud | A-Team Chronicles

This will start the VNC server with the default se ings, e.g. port 5901 for
display :1 etc. These se ings can be changed in the con guration le:
/home/opc/.vnc/xstartup.

Should you want to use iptables for a direct connection to the VM later,
also run:

iptables -I INPUT -m state --state NEW -p tcp --destination-port 5901 -j


ACCEPT

Connect to the VNC Server


Next start your local VNC viewer on your local client. The SSH tunnel
redirects the VNC output of your VM to your localhost on port 5901.
Hence enter localhost:5901 in the VNC Server eld and press “Connect”.

The rst time you connect you will be issued a warning, that the
connection is not encrypted. As we are using a SSH tunnel to encrypt
the tra c this warning can be ignored.

file:///D:/Doyensys EBS training documents/Using VNC securely in the Oracle Cloud _ A-Team Chronicles ole6.10.html 14/19
10/30/2020 Using VNC securely in the Oracle Cloud | A-Team Chronicles

Enter the password you have selected for the VNC Server.

This will connect you to the Desktop. This Desktop will be active, even if
you disconnect the Pu y Session – this allows to resume work
comfortably.

file:///D:/Doyensys EBS training documents/Using VNC securely in the Oracle Cloud _ A-Team Chronicles ole6.10.html 15/19
10/30/2020 Using VNC securely in the Oracle Cloud | A-Team Chronicles

To stop the VNC Server simply connect via pu y or open a terminal and
enter:

vncserver –kill :1

If you prefer to have a di erent resolution simply start the vncserver


using the geometry ag and the prefered resolution.

vncserver –kill :1
file:///D:/Doyensys EBS training documents/Using VNC securely in the Oracle Cloud _ A-Team Chronicles ole6.10.html 16/19
10/30/2020 Using VNC securely in the Oracle Cloud | A-Team Chronicles

vncserver -geometry 1600x1200

Note that the Desktop has a timeout, after which the screen locks and
you have to authenticate via password, to set the password run:

sudo passwd opc

Further Reading
Con gure tigervnc-server on Oracle Linux 7 (Doc ID 2102424.1)

Access VNC Server Through A Web Browser (Doc ID 1555696.1)

Be the rst to comment

Comments ( 0 )

file:///D:/Doyensys EBS training documents/Using VNC securely in the Oracle Cloud _ A-Team Chronicles ole6.10.html 17/19
10/30/2020 Using VNC securely in the Oracle Cloud | A-Team Chronicles

Recent Content

IDENTITY, ACCESS MANAGEMENT & IAAS IAAS


SECURITY Integrate Oracle Cloud Guard with Deploy machine
Push Cloud Guard Problems to External Systems Using OCI Events environment in
Splunk HEC with OCI SDK and Functions
I found myself c
Introduction Cloud Guard is an OCI Oracle Cloud Guard service was and tearing dow
Service for Security Posture released recently. It helps customers my machine lea
Management. Cloud Guard’s monitor their OCI resources and Each time, I wo
functionality is to assess, alert and maintain a strong security posture.
act on... For...

file:///D:/Doyensys EBS training documents/Using VNC securely in the Oracle Cloud _ A-Team Chronicles ole6.10.html 18/19
10/30/2020 Using VNC securely in the Oracle Cloud | A-Team Chronicles

Site Map Legal Notices Terms of Use Privacy Cookie Preferences Ad Choices Oracle Content Marketing Login

file:///D:/Doyensys EBS training documents/Using VNC securely in the Oracle Cloud _ A-Team Chronicles ole6.10.html 19/19

You might also like