Friday, December 26, 2025

VNC Console Connection from Windows to Oracle Cloud Virtual Machine Instance

I generallay use cloud shell for console connections, but recently for bringing an image to OCI, troubleshoot and complete the installation I needed serial connection. I am using Windows with WSL, and most of my customers also prefer Windows, so I thought this will be good idea to take note of the steps for future myself as well as customers. This is based on my colleague Florian's Git Post which was brought to my attention by Kenan, another colleague when I needed most, thanks to bot of them! So here we go:

Steps

1 Download and unzip Portable Git Bash I prefer portable one, you can also install it with right click context menu integration. This will give us ssh in Windows without going into Powershell details.

2 Download a VNC Viewer, I prefer TigerVNC as it doesn't require any installation.

3 Create a console connection to the instance:

  • Go to OCI Console and Compute
  • Find your instance and click on the name
  • Go to OS Management tab and scroll down to Console Connections
  • Click Create local connection
  • You can use OCI generated ssh keys, or bring your own key.

You can use compute instance-connection create cli command.

4 Copy VNC connection string for Linux/Mac


You can use compute instance-connection list cli command by filtering only ACTIVE connections.

5 We will update the command to use SSH key for authentication
After adding -i ~/.ssh/jump-server.key -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedKeyTypes=+ssh-rsa to the script and it will look like this

6 Run the script in git bash

7 Connect using VNC Viewer to VNC server at localhost:5900




Some usefull scripts

Find all RUNNING instances in $compartment_id where instance name like 'qradar':

Find all ACTIVE console connection for particular $compute_instance_ocid:

Generic script without OCI CLI dependency with minimum input:

All in one script which finds compute instance, creates console connection and start SSH port forwarding for VNC serial connection :

No comments:

Post a Comment

Featured

Putting it altogether: How to deploy scalable and secure APEX on OCI

Oracle APEX is very popular, and it is one of the most common usecases that I see with my customers. Oracle Architecture Center offers a re...