Prerequisite

Make sure you are able to connect to cloud VM using putty. Follow this post to setup the env

https://dbatracker.com/2020/06/01/login-to-cloud-vm-directly-using-ppk-private-key-file/

After making above changes do this extra step and enable x11 forwarding

Do not open the session instead go to session and save this change.

Now prepare your local machine

Install xming on your local machine

select Normal putty link SSH client option

check mark xlaunch option and click next to finsh the install

once install completed run xlaunch

select multiple windows option

select start no client

continue with these settings

click finish

Login to your cloud vm machine and switch user to root and make these changes

[opc@cloud-node01 ~]$ sudo su -
Last login: Mon Jun  1 10:32:20 GMT 2020 on pts/0
[root@cloud-node01 ~]#

Edit /etc/ssh/sshd_config file and uncomment X11UseLocalhost parameter and make it values as “no” and X11Forwarding as yes

[root@cloud-node01 ~]# vi /etc/ssh/sshd_config file
2 files to edit
[root@cloud-node01 ~]# cat /etc/ssh/sshd_config |grep X11UseLocalhost
X11UseLocalhost no
[root@cloud-node01 ~]#
[root@cloud-node01 ~]# cat /etc/ssh/sshd_config |grep X11Forwarding
X11Forwarding yes
#       X11Forwarding no

Restart sshd

[root@cloud-node01 ~]# sudo systemctl restart sshd

Install xauth

[root@cloud-node01 ~]# yum -y install xauth
Loaded plugins: langpacks, ulninfo
Package 1:xorg-x11-xauth-1.0.9-1.el7.x86_64 already installed and latest version
Nothing to do 

Install xterm

[root@cloud-node01 ~]# yum -y install xterm
Loaded plugins: langpacks, ulninfo
Resolving Dependencies
--> Running transaction check
---> Package xterm.x86_64 0:295-3.el7 will be installed
--> Processing Dependency: libXaw.so.7()(64bit) for package: xterm-295-3.el7.x86_64
--> Running transaction check
---> Package libXaw.x86_64 0:1.0.13-4.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================================================
 Package                                    Arch                                       Version                                          Repository                                      Size
=============================================================================================================================================================================================
Installing:
 xterm                                      x86_64                                     295-3.el7                                        ol7_latest                                     454 k
Installing for dependencies:
 libXaw                                     x86_64                                     1.0.13-4.el7                                     ol7_latest                                     191 k

Transaction Summary
=============================================================================================================================================================================================
Install  1 Package (+1 Dependent package)

Total download size: 645 k
Installed size: 1.7 M
Downloading packages:
(1/2): libXaw-1.0.13-4.el7.x86_64.rpm                                                                                                                                 | 191 kB  00:00:00
(2/2): xterm-295-3.el7.x86_64.rpm                                                                                                                                     | 454 kB  00:00:00
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                        4.9 MB/s | 645 kB  00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : libXaw-1.0.13-4.el7.x86_64                                                                                                                                                1/2
  Installing : xterm-295-3.el7.x86_64                                                                                                                                                    2/2
  Verifying  : libXaw-1.0.13-4.el7.x86_64                                                                                                                                                1/2
  Verifying  : xterm-295-3.el7.x86_64                                                                                                                                                    2/2

Installed:
  xterm.x86_64 0:295-3.el7

Dependency Installed:
  libXaw.x86_64 0:1.0.13-4.el7

Complete!

Install xclock

[root@cloud-node01 ~]# yum -y install xclock
Loaded plugins: langpacks, ulninfo
Resolving Dependencies
--> Running transaction check
---> Package xorg-x11-apps.x86_64 0:7.7-7.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================================================
 Package                                          Arch                                      Version                                      Repository                                     Size
=============================================================================================================================================================================================
Installing:
 xorg-x11-apps                                    x86_64                                    7.7-7.el7                                    ol7_latest                                    307 k

Transaction Summary
=============================================================================================================================================================================================
Install  1 Package

Total download size: 307 k
Installed size: 772 k
Downloading packages:
xorg-x11-apps-7.7-7.el7.x86_64.rpm                                                                                                                                    | 307 kB  00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : xorg-x11-apps-7.7-7.el7.x86_64                                                                                                                                            1/1
  Verifying  : xorg-x11-apps-7.7-7.el7.x86_64                                                                                                                                            1/1

Installed:
  xorg-x11-apps.x86_64 0:7.7-7.el7

Complete!

Exit from this session and open a new session

Check the DISPLAY is should show similar kind on value for opc user

[opc@cloud-node01 ~]$ env|grep DISP
DISPLAY=10.0.0.2:10.0
[opc@cloud-node01 ~]$

Make sure xming is running on your local machine. Now Run xclock it will display the clock

[opc@cloud-node01 ~]$ xclock
Warning: Missing charsets in String to FontSet conversion

So our opc user is all set for GUI based applications. Now we need to make some changes so that oracle user is also able to do same.

Do xauth list for opc

[opc@cloud-node01 ~]$ xauth list $DISPLAY
cloud-node01.subnet.vcn.oraclevcn.com:10  MIT-MAGIC-COOKIE-1  35a26244b95e3d35b4e17a6256b722ad

now login as oracle user and set display as below

[opc@cloud-node01 ~]$ sudo su - oracle
Last login: Mon Jun  1 09:56:17 GMT 2020 on pts/5
[oracle@cloud-node01 ~]$ export DISPLAY=cloud-node01.subnet.vcn.oraclevcn.com:10
[oracle@cloud-node01 ~]$
[oracle@cloud-node01 ~]$ env|grep DISP
DISPLAY=cloud-node01.subnet.vcn.oraclevcn.com:10

Now run xauth add

[oracle@cloud-node01 ~]$ xauth add cloud-node01.subnet.vcn.oraclevcn.com:10  MIT-MAGIC-COOKIE-1  35a26244b95e3d35b4e17a6256b722ad
xauth:  file /home/oracle/.Xauthority does not exist

it will give you this error but file actually exist

[oracle@cloud-node01 ~]$ ls -ltr /home/oracle/.Xauthority
-rw-------. 1 oracle oinstall 50 Jun  1 14:16 /home/oracle/.Xauthority

rerun this command this error is no more visible

[oracle@cloud-node01 ~]$ xauth add cloud-node01.subnet.vcn.oraclevcn.com:10  MIT-MAGIC-COOKIE-1  35a26244b95e3d35b4e17a6256b722ad
[oracle@cloud-node01 ~]$

Now do xauth list

[oracle@cloud-node01 ~]$ xauth list
cloud-node01.subnet.vcn.oraclevcn.com:10  MIT-MAGIC-COOKIE-1  35a26244b95e3d35b4e17a6256b722ad

run xclock as oracle user

[oracle@cloud-node01 ~]$ xclock
Warning: Missing charsets in String to FontSet conversion

Run dbca

you are now all set !!