Introduction
A serial console connection to bare metal or virtual machine DB system allows you to manage and troubleshoot your system in single-user mode using an SSH connection, e.g. if the boot volume becomes full causing a standard SSH connection to fail with permission denied errors.
In this blog post, we will demonstrate step-by-step guidance to create the connection and connect to the DB system.
The Environment
- Virtual Machine DB System in OCI
- SSH client (Git Bash) on my local Windows notebook.
Create Console Connection
Step 1: Create Console Connection
From your DB System details page, under “Resources” on the left side, click on “Console Connections”, then “Create Console Connection”.
Upload or paste your SSH key and click on “Create Console Connection”.
Establish the Connection
Step 2: Copy the SSH String
Once the Console Connection got created, click on the dotted menu on the very right side, then on “Copy SSH String”.
Step 3: Connect to the Console
Paste the SSH String from the previous step in a terminal window, e.g. Git Bash on your local computer.
ssh -o ProxyCommand='ssh -W %h:%p -p 443 ocid1.instanceconsoleconnection.oc1.eu-frankfurt-1.antheljsrbhecuicgjziyrlc6k4mhrp76s44d3hxvlqyq6drd25fgttugkya@instance-console.eu-frankfurt-1.oci.oraclecloud.com' ocid1.instance.oc1.eu-frankfurt-1.antheljsrbhecuicvge5ap2mftr2t24x7xtyo2a7ydchjwbxuog7ivcwy54q |
If you are not using the default SSH key, then modify the SSH Sting by including the -i flag to specify the SSH key location.
ssh -i /your/ssh/key/location/id_rsa -o ProxyCommand=... |
Hit Enter again to activate the console.
Step 4: Reboot your Node
From the DB System details page, under “Resources” on the left side, click on “Nodes”. Click on the dotted menu on the very right side, then on “Reboot”.
Confirm rebooting the node.
Switch back to your console connection and you will see restart messages start to appear in the window.
As soon as you see the boot menu appear, use the up/down arrow keys to stop the automatic boot process.
Step 5: Enter the Boot Menu
As indicated in the menu, press “e” to edit the boot entry.
Use the down arrow key to scroll down through the entries until you reach the line that starts with “linuxefi” for instances running Oracle Linux 7.x (or “kernel for Oracle Linux 6.x”).
Add the following at the end of that line.
init= /bin/bash |
You are already in the edit mode, so just use the left/right arrow keys to place the cursor at the end of the line and start typing.
Step 6: Start the Instance
As indicated in the menu, press “Ctrl-x” to start.
Now your machine is in maintenance mode and you can start troubleshooting.
Step 7: Delete the Console Connection
Once you are done, delete the console connection. Click on the dotted menu on the very right side, then on “Delete.
Confirm with “OK”.
Conclusion
Serial Console Connections provide a simple way to connect to your DB System machines as user root for troubleshooting even though a standard SSH connection is not possible due to issues on that machine.
Please find out all of our articles send us the Invitation or Follow us:
Ramkumar’s LinkedIn: https://www.linkedin.com/in/ramkumardba/
LinkedIn Group: https://www.linkedin.com/in/ramkumar-m-0061a0204/
Facebook Page: https://www.facebook.com/Oracleagent-344577549964301
Ramkumar’s Twitter: https://twitter.com/ramkuma02877110
Ramkumar’s Telegram: https://t.me/oracleageant
Ramkumar’s Facebook: https://www.facebook.com/ramkumarram8