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.
- 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 email@example.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.
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”.
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.
- How to use OCI Bastion Service to connect to your Private Resources
- Documentation: Serial Console Access for Troubleshooting and Managing a Bare Metal or VM System