Enable Run Command plugin for Ubuntu based VMs in OCI

Suraj RameshSuraj Ramesh
3 min read

Introduction:

Managing cloud instances in OCI often means logging in via SSH, manually running scripts, and opening ports, but what if you could skip all that? With Run Command in Oracle Cloud Infrastructure (OCI), you can remotely execute scripts on your compute instances without needing SSH access or inbound ports at all.

Whether you’re automating routine tasks like configuring secondary VNICs, joining instances to an identity provider, troubleshooting connectivity issues, or responding to cross-region disaster recovery events, Run Command makes it simple and secure.

Under the hood, it works through the Compute Instance Run Command plugin, part of the Oracle Cloud Agent software, which handles command execution safely from within the instance.

By default, the Run Command plugin comes with various Oracle Cloud platform images like Oracle Autonomous Linux, Oracle Linux, CentOS, and Windows Server.

Currently Ubuntu images doesn’t have run command plugin by default. In this post, we’ll show you how to manually install the Run Command plugin on an OCI compute instance running an Ubuntu platform image.

The OCI Full Stack DR service relies heavily on the Run Command feature to perform key tasks like attaching or detaching block volumes for moving and non-moving instances, mounting or unmounting file systems, and running user-defined scripts. Therefore, having the Run Command plugin is essential if you are planning to integrate the VMs with an Ubuntu platform image with Full Stack DR.

Pre-requisites for using run command

Before you can use the Run Command feature in OCI, you’ll need to set up the right IAM policies for both users and instances to ensure secure access.

Also, keep in mind that Run Command executes scripts with administrator (root) privileges, so use it responsibly.

For detailed setup steps and policy examples, check out the official OCI documentation.

Install the Cloud Agent package and test the Run Command functionality

  1. I have launched a VM named “ubuntu-vm” with Canonical-Ubuntu-24.04-aarch64-2025.05.20-0 platform image

  2. Navigate to the Management section in the OCI console, as expected, you will not see the run command plugin available for the VM.

  1. Uninstall the oracle cloud agent software.

     sudo snap remove oracle-cloud-agent
    

4. Download and copy the cloud agent package file to the VM. Please note to get the cloud agent package you need to create a support ticket with Oracle.

  1. Install the cloud agent package
sudo gdebi oracle-cloud-agent_1.51.0-4_amd64.deb

  1. Test the Run Command through the OCI Console. From the VM's home page, navigate to Management → Run Command → Create Command. To keep it simple, type any Linux command in the script section — for example, date — and then click Create Command.

  1. Verify the status after a few minutes to confirm successful completion.

    In case if you want to verify the status of the running command you can verify the logs from the VM using the below command.

tail -f /var/log/oracle-cloud-agent/plugins/runcommand/runcommand.log

Conclusion:

In summary, enabling the Run Command plugin for Ubuntu VMs in Oracle Cloud makes managing and automating tasks much easier. This guide shows you how to install and test it, so you can run scripts remotely without using SSH or opening ports. This also helps you integrate Ubuntu VMs smoothly with Full Stack DR.

0
Subscribe to my newsletter

Read articles from Suraj Ramesh directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Suraj Ramesh
Suraj Ramesh

I work as a Product Manager at Oracle. I am a member of the Oracle Database High Availability (HA), Scalability & Maximum Availability Architecture (MAA) Product Management team in Oracle. The team is part of the product development of the core database technologies. I focus on Oracle Cloud Infrastructure Full Stack Disaster Recovery and Oracle Database Online Redefinition. My interests are Databases, Cloud Infrastructure, Cloud Automation, and Disaster Recovery.