
Eclipsys has helped McMaster University maximize its investment in the Oracle Exadata Cloud@Customer solution. Read the story here






Oracle Cloud Infrastructure (OCI) provides Bastion as a secure and convenient way to access private resources without exposing them directly to the internet. Recently, while trying to connect to a Windows Server 2012 instance via RDP through a Bastion host, I encountered connection issues. Despite setting up SSH port forwarding, the RDP session would not establish. This experience highlighted an important consideration: while Bastion is ideal for many scenarios, there are situations where it may not work, and OCI’s Console Connection (VNC) can be a reliable alternative.
In this blog, I’ll walk you through the root cause of the Bastion failure, explain why it occurs, and guide you on how to use Console connections to access Windows instances.
After setting up the OCI Bastion session (as shown in the image above) to access my Windows Server 2012 instance, I attempted to initiate an RDP session using the following SSH port forwarding command:
ssh -i ssh-key-2025-12-01.key -N -L 3389:<IP>:3389 -p 22 <OCI_BASTION_SESSION_OCID>@<BASTION_HOST>
Despite the command executing successfully, my RDP client failed to connect, showing a connection error on the local machine.
Error code 0x708, or a generic "internal RDP error," almost always points to a problem within the Windows Server instance itself, specifically with session management.
When Bastion access fails—especially with Windows RDP—OCI provides a reliable alternative: Console Connection. This method allows you to establish a direct VNC-based connection to your Windows instance without relying on SSH port forwarding or RDP availability.
To successfully create and use a VNC console connection, you will need:
1.2. Click Create Console Connection from the OS Management page.
1.3. Download the SSH keys (both public and private). If you already have an existing key pair, you can simply upload the public key. Then click the Create console connection button.
To ensure compatibility with the plink.exe utility, your private key file (which you obtained when creating the Console Connection) must be in the PuTTY Private Key (.ppk) format.
Follow these steps to perform the conversion:
2.1. Locate PuTTYgen: Navigate to your PuTTY installation folder (for example, C:\Program Files\PuTTY).
2.2. Open PuTTYgen: Double-click the puttygen.exe application to launch the PuTTY Key Generator window.
2.3. Load the Key:
2.4. Save as.PPK:
Once the console connection is active:
Click the three dots (...) next to the active connection and select "VNC Connection For Windows" to reveal the detailed commands needed to create the local port-forwarding tunnel.
The OCI Console Connection for Windows requires two distinct SSH tunnels to forward the VNC desktop stream from the cloud to your local machine. We will define variables and then execute the two tunnel commands sequentially.
Open Windows PowerShell as Administrator and run the following three lines to ensure the system knows where to find plink.exe and your private key.
# 1. Define the full path to the Plink executable $PlinkPath= "C:\Program Files\PuTTY\plink.exe" # 2.Define the full path to your converted .PPK key $PrivateKeyPath= "C:\Users\amir.kordestani\Downloads\privatekey\console.ppk"
Note: The original OCI command is split into two parts below.
This first tunnel connects to the OCI console endpoint over HTTPS port 443 and forwards the connection locally to port 5905.
& "$PlinkPath" -i "$PrivateKeyPath" -N -ssh -P 443 -l <ocid1.instanceconsoleconnection> -L 5905:<ocid1.instance>:5905 <instance-console>Wait for Initialization:
The Start-Job command will run the tunnel in the background. Wait a few seconds for it to fully initialize. The PowerShell window running this command will hang/freeze, You should see the output like the image below.
This second tunnel connects to the first tunnel (listening on local port 5905) and forwards the VNC stream to local port 5900, where your VNC client will connect.
# 1. Define the full path to the Plink executable $PlinkPath= "C:\Program Files\PuTTY\plink.exe" # 2. Define the full path to your converted.PPK key $PrivateKeyPath= "C:\Users\amir.kordestani\Downloads\privatekey\console.ppk" # then run the following command. & "$PlinkPath" -i "$PrivateKeyPath" -N -L 5900:localhost:5900 -P 5905 localhost -l <ocid1.instance>
With your PowerShell terminal window frozen (running the second Plink command), the VNC stream is now available on your local port 5900.
Open your preferred VNC viewer application (such as RealVNC Viewer, TightVNC, or TigerVNC).
In RealVNC Viewer, Click File >> New Connection. In the address or server field of your VNC client, enter localhost:5900, as shown in the image below.
4.3. Connect to the VNC session
Double-click the VNC session you already created and connect to the Windows Server.
Once you are connected, proceed immediately to the session troubleshooting steps (like running quser or using Task Manager to sign off the conflicting session) to clear the original RDP error.
Then run the command "logoff 1" to immediately log off the user assigned to session ID 1.
The RDP failure through OCI Bastion—often seen as Error 0x708—stems from a stuck or conflicting RDP session inside the Windows VM, not a Bastion or network issue. Because the Bastion tunnel only provides a pathway and cannot resolve internal Windows session locks, the Console Connection (VNC) becomes essential. This out-of-band access bypasses the broken RDP service entirely and provides direct graphical control of the VM. Using the two-stage VNC tunnel, you can clear the hung session, restart RDP services, and restore normal remote access. Once resolved, RDP via OCI Bastion resumes functioning reliably for ongoing administration.
