Oracle Enterprise Linux 8.5 on Azure User Guide
Videos
Overview
This guide covers the deployment and configuration of Oracle Enterprise Linux 8.5 on Microsoft Azure using cloudimg's virtual machine image from the Azure Marketplace (offer prod-dm5uqotgrats4).
Oracle Linux is a free, enterprise grade Linux distribution built by Oracle to be binary compatible with Red Hat Enterprise Linux 8. Oracle provides the binaries, updates and errata at no cost and permits redistribution, so there is no subscription and no licence key needed to use or patch it.
This image is an established Oracle Linux 8 system that was built on Oracle Linux 8.5 and has since taken updates from the Oracle Linux 8 channels. Its release file still reads 8.5, while many of its packages are newer 8.6 to 8.9 builds, and the first boot script adds the current 8.10 security errata. Steps 5 and 6 show both, and how to bring the whole machine to Oracle Linux 8.10, the latest Oracle Linux 8 update.
Oracle Linux 8 is in Oracle Premier Support until July 2029, and the free Oracle Linux 8 channels keep receiving errata, so a machine from this image can be kept current with dnf.
What's included:
- Oracle Linux 8 (release file 8.5, packages from the Oracle Linux 8 update channels), binary compatible with RHEL 8
- The Unbreakable Enterprise Kernel Release 6 (booted by default) and the Red Hat Compatible Kernel
- A first boot script that applies the security errata available on the enabled channels, without kernel changes
ol8_baseos_latest,ol8_appstream,ol8_UEKR6, EPEL and Microsoft package repositories enabled- Azure Linux Agent (waagent) and cloud-init for Azure provisioning
- Azure CLI 2.55
- Python 3.6 as
python3, and Python 3.9 aspython3.9 - Chronyd for NTP time synchronisation
- Generation 1 (BIOS) Hyper V virtual machine
- cloudimg's support team on hand 24 hours a day by email (support@cloudimg.co.uk), with a guaranteed response within 24 hours
Platform: Microsoft Azure (Generation 1 Hyper V)
Default user: azureuser
Prerequisites
Before deploying this image, ensure you have:
- An active Microsoft Azure subscription
- Access to the Azure Portal, or the Azure CLI installed locally or in Azure Cloud Shell
- An SSH key pair for Linux VM access
- Familiarity with Azure VM management
Step 1: Deploy the Virtual Machine
Option A: Azure Portal
- In the Azure Portal, open Marketplace and search for "Oracle Enterprise Linux 8.5 cloudimg", or open the listing on Azure Marketplace and choose Get it now
- Select the image and click Create
- Configure the basics: your subscription, a resource group, a virtual machine name, your region, and a size that suits your workload
- Under Administrator account, select SSH public key, set the username to
azureuserand enter your key - Under Inbound port rules, allow SSH (port 22), and restrict it to your trusted IP address once the VM is created
- Click Review + create, then Create
Option B: Azure CLI
Deploy the image by its Marketplace URN. The image carries a purchase plan, so accept its terms once per subscription first:
az vm image terms accept --urn cloudimg1647283583153:prod-dm5uqotgrats4:prod-dm5uqotgrats4:latest
az vm create \
--resource-group myResourceGroup \
--name my-oel-8-5-vm \
--image cloudimg1647283583153:prod-dm5uqotgrats4:prod-dm5uqotgrats4:latest \
--admin-username azureuser \
--generate-ssh-keys \
--public-ip-sku Standard
Add --size with the size your workload needs. This is a Generation 1 image. The Azure CLI may print a warning that new virtual machines default to Trusted Launch; with this image the machine is still created as a standard Generation 1 virtual machine, and the warning needs no action.
Step 2: Connect via SSH
Run these on your own workstation, not on the VM. Find the public IP, then connect:
az vm show --resource-group myResourceGroup --name my-oel-8-5-vm --show-details --query publicIps -o tsv
ssh azureuser@<vm-ip>
There is no password to enter. If SSH asks you for one, the key you supplied at create time is not the key your client is offering.
Your first login prints a Last login line dated January 2024 from a 10.0.0.x address. That line comes from the login history the image was built with, not from anyone using your machine. Step 3 shows how to clear that history.
Step 3: Give the machine its own machine ID
cloud-init creates new SSH host keys for every virtual machine at first boot, so your machine's host keys are its own. The systemd machine ID is different: it was created when the image was built and is not regenerated at first boot, so every virtual machine deployed from this image starts with the same /etc/machine-id. Software that identifies a machine by it (for example log collectors and some monitoring agents) would see your machines as one. Replace it with one unique to your machine:
sudo rm -f /etc/machine-id
sudo systemd-machine-id-setup
Expected output:
Initializing machine ID from random generator.
The login records (last, lastb, lastlog) also start with entries from the image's build, going back to 2022. To start your machine's history clean:
sudo truncate -s 0 /var/log/wtmp /var/log/btmp /var/log/lastlog
last
last then prints only a wtmp begins line with the current date.
The image's clock is set to the America/New_York time zone, so local times (including uptime -s, file listings and log timestamps) read five hours behind UTC in winter. To use UTC, or your own zone:
sudo timedatectl set-timezone UTC
timedatectl | grep 'Time zone'
Expected output:
Time zone: UTC (UTC, +0000)
Step 4: Remove the Azure Site Recovery agent
The image still carries the Azure Site Recovery mobility agent (InMageVx) from the way it was migrated into Azure: its services, boot scripts, a kernel module (involflt) built into every installed kernel's initramfs, and configuration directories holding keys and settings that belong to that migration. Its vxagent service fails at every boot, and your machine does not need any of it. List the failed units:
systemctl --failed --no-legend
Expected output:
vxagent.service loaded failed failed Configuration file for vxagent service
Removing the package on its own takes away only its installer files, so the block below also removes the services, the SysV boot scripts, the udev rule, the kernel module and its dracut module, the directories and logs, the configuration backups the agent left beside the originals, and a sudoers file left for an ssm-user account that does not exist. It then rebuilds the initramfs of every installed kernel without the module. That rebuild runs for about five minutes without printing anything, and Azure drops a connection through a public IP address after four minutes with no traffic. Connect with a keepalive before you start, so the session stays open:
ssh -o ServerAliveInterval=60 azureuser@<vm-ip>
Then run:
sudo dnf -q -y remove InMageVx
sudo systemctl disable vxagent uarespawnd vConService_linux asr-installga involflt_start involflt_stop
for s in boottimemirroring_phase1 boottimemirroring_phase2; do sudo chkconfig --del $s; sudo rm -f /etc/rc.d/init.d/$s; done
sudo rm -f /etc/systemd/system/{vxagent,uarespawnd,vConService_linux,involflt_start,involflt_stop}.service /usr/lib/systemd/system/asr-installga.service /etc/udev/rules.d/09-inm_udev.rules /etc/sudoers.d/ssm-agent-users
sudo rm -f /usr/lib/modules/*/kernel/drivers/char/involflt.ko /etc/default/grub-INMAGE-ORG /etc/fstab-INMAGE_ORG /etc/sysconfig/*-INMAGE*ORG /.boottimemirroring.log* /var/log/InMage_drivers.log /var/log/involflt_telemetry_completed_*.log /var/log/uarespawnd.log
sudo rm -rf /usr/local/InMage /usr/local/asr-installga /etc/vxagent /usr/lib/dracut/modules.d/95involflt /var/ASRLinuxGA-* /InMageAgent* /var/log/ApplicationData
for k in /usr/lib/modules/*/; do sudo depmod "$(basename "$k")"; done
sudo dracut -f --regenerate-all
sudo systemctl daemon-reload
sudo systemctl reset-failed
systemctl --failed --no-legend
dnf prints a short Removed: InMageVx-9.55.0.0-1.x86_64 summary, and systemctl disable prints a Removed /etc/systemd/system/... line for each of the six services. The dracut rebuild takes a few minutes. The last command prints nothing, meaning no unit has failed. The module stays loaded in memory until the next restart; after it, lsmod | grep involflt prints nothing and systemctl --failed stays empty. Do this step before the full update in Step 6, so that the new kernels' initramfs images are built without the agent's dracut module, and restart once at the end of Step 6.
Step 5: Confirm the release
cat /etc/oracle-release
grep -E '^(NAME|VERSION|ID|VERSION_ID)=' /etc/os-release
uname -rm
rpm -q oraclelinux-release redhat-release
Expected output:
Oracle Linux Server release 8.5
NAME="Oracle Linux Server"
VERSION="8.5"
ID="ol"
VERSION_ID="8.5"
5.4.17-2136.320.7.1.el8uek.x86_64 x86_64
oraclelinux-release-8.5-1.0.7.el8.x86_64
redhat-release-8.8-0.8.0.1.el8.x86_64
The release file and oraclelinux-release say 8.5. Many packages are newer builds, such as redhat-release above, tagged el8_8; others carry el8_6, el8_7 and el8_9 tags, and the first boot script adds el8_10 security errata. The el8uek tag on the kernel shows the machine is running the Unbreakable Enterprise Kernel. The Red Hat Compatible Kernel (4.18) is installed alongside it:
rpm -q kernel kernel-uek
Expected output:
kernel-4.18.0-372.9.1.el8.x86_64
kernel-4.18.0-425.13.1.el8_7.x86_64
kernel-4.18.0-477.13.1.el8_8.x86_64
kernel-uek-5.4.17-2136.308.9.el8uek.x86_64
kernel-uek-5.4.17-2136.316.7.el8uek.x86_64
kernel-uek-5.4.17-2136.320.7.1.el8uek.x86_64
Step 6: Updates and the first boot script
At every boot, root's crontab runs /stage/scripts/initial_boot_update.sh, which applies the security errata available on the enabled channels, leaving out kernels and the release package:
sudo crontab -l
cat /stage/scripts/initial_boot_update.sh
Expected output:
@reboot /stage/scripts/initial_boot_update.sh
#!/bin/bash
dnf -y update --security --exclude=kernel* --exclude=oraclelinux-release >> /stage/scripts/initial_boot_update.log
On a fresh machine this run takes ten minutes or more after boot, and other dnf commands wait for its lock until it finishes. It does not bring the machine fully up to date. Afterwards, dnf check-update still lists pending updates (exit code 100), including newer kernels and the Oracle Linux release packages:
sudo dnf -q check-update; echo "exit code: $?"
List the enabled repositories:
sudo dnf -q repolist enabled
Expected output:
repo id repo name
epel Extra Packages for Enterprise Linux 8 - x86_64
ol8_UEKR6 Latest Unbreakable Enterprise Kernel Release 6 for Oracle Linux 8 (x86_64)
ol8_appstream Oracle Linux 8 Application Stream (x86_64)
ol8_baseos_latest Oracle Linux 8 BaseOS Latest (x86_64)
packages-microsoft-com-prod packages-microsoft-com-prod
To apply everything the channels carry, including the kernels and the 8.10 release packages, run a full update and restart. Do Step 4 first:
sudo dnf -y update
sudo systemctl reboot
The update takes several minutes. After the restart, the machine reports Oracle Linux 8.10 and runs the newest Unbreakable Enterprise Kernel Release 6, and dnf check-update returns exit code 0, meaning nothing further is available from the enabled channels:
cat /etc/oracle-release
uname -r
sudo dnf -q check-update; echo "exit code: $?"
Expected output (the kernel release is the newest one on the channel on the day you update):
Oracle Linux Server release 8.10
5.4.17-2136.361.4.5.el8uek.x86_64
exit code: 0
The full update also brings the Azure CLI, cloud-init and the Azure Linux Agent to their current Oracle Linux 8 and Microsoft repository builds. The first boot script runs again after the restart; wait for it as shown under Troubleshooting before running dnf yourself.
Step 7: Security posture
getenforce
sudo sshd -T | grep -E '^(pubkeyauthentication|passwordauthentication|challengeresponseauthentication) '
systemctl is-active firewalld
Expected output:
Disabled
pubkeyauthentication yes
passwordauthentication no
challengeresponseauthentication no
inactive
- SSH is key only. Password and challenge response logins are disabled. The root and
azureuserpasswords are locked, and no account has a password hash. - SELinux is disabled on this image (
SELINUX=disabledin/etc/selinux/config). If your policy needs SELinux, plan to enable it yourself, which needs a full filesystem relabel and a reboot. - The host firewall is off.
firewalldis installed but disabled. The Azure Network Security Group is the only network control until you turn it on.
To turn on the host firewall:
sudo systemctl enable --now firewalld
sudo firewall-cmd --list-all
The default public zone lists cockpit dhcpv6-client ssh under services, so your SSH session keeps working. To expose another service, open it in both the Azure NSG and firewalld, for example HTTPS:
sudo firewall-cmd --permanent --add-port=443/tcp
sudo firewall-cmd --reload
Step 8: Verify Azure integration
systemctl is-active waagent
systemctl is-enabled waagent
cloud-init --version
sudo cloud-init status
systemctl is-active chronyd
df -h /
Expected output on a fresh machine:
active
enabled
/usr/bin/cloud-init 23.1.1-10.0.1.el8
status: done
active
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 38G 6.3G 29G 18% /
The used and available figures on / change as you install and update packages, and the OS disk may appear as sda or sdb (see the disk layout below).
waagent lets Azure run extensions and report VM health. cloud-init handles provisioning: it creates azureuser, installs your SSH key, generates the SSH host keys and runs any custom data you supply.
Run cloud-init status with sudo, as above. Without sudo it stops with PermissionError: [Errno 13] Permission denied: '/run/cloud-init/cloud.cfg', because that file is readable by root only. Provisioning itself completes, and sudo cloud-init status reports status: done.
Disk layout
| Partition | Size | Use |
|---|---|---|
| OS disk partition 1 | 2 GB | /boot (ext4) |
| OS disk partition 2 | 38 GB | / root filesystem (ext4) |
| OS disk partition 3 | 10 GB | swap partition, not enabled (free -h shows 0B swap) |
| Temporary disk partition 1 | varies | /mnt, the Azure temporary resource disk |
Azure may present the OS disk as sda and the temporary disk as sdb, or the other way round, from one boot to the next; /etc/fstab mounts / and /boot by UUID and /mnt by its /dev/disk/cloud name, so either order works. ls -l /dev/disk/cloud shows which is which (azure_root and azure_resource).
The OS disk is 50 GB. The root partition is followed by the swap partition, so making the OS disk larger in Azure does not grow / on its own.
Step 9: Networking
sudo ss -tlnp
On a fresh machine the only TCP listener is sshd on port 22, on IPv4 and IPv6.
Step 10: Install software and add a user
Install packages from the enabled repositories in the usual way, for example:
sudo dnf -y install git
To add another administrator, create the account with sudo adduser <name>, add it to the wheel group with sudo usermod -aG wheel <name>, then copy your public key into /home/<name>/.ssh/authorized_keys with mode 600 and the .ssh directory mode 700, owned by that user.
Server Components
| Component | Version on a fresh machine | Notes |
|---|---|---|
| Oracle Linux | release file 8.5 | 8.10 after the full update in Step 6 |
| Unbreakable Enterprise Kernel | Release 6 (5.4) | booted by default |
| Red Hat Compatible Kernel | 4.18 | installed alongside |
| Azure Linux Agent | WALinuxAgent 2.7 | waagent service |
| cloud-init | 23.1.1 | provisioning |
| Azure CLI | 2.55 | az |
| Python | 3.6 (python3) and 3.9 (python3.9) |
|
| chrony | chronyd service |
Scripts and Log Files
| Path | Purpose |
|---|---|
/stage/scripts/initial_boot_update.sh |
the first boot script (security errata at every boot) |
/stage/scripts/initial_boot_update.log |
its output, appended at every boot |
/var/log/cloud-init.log, /var/log/cloud-init-output.log |
cloud-init provisioning |
/var/log/waagent.log |
the Azure Linux Agent |
/var/log/messages |
the system log |
On Startup
At every boot, root's crontab entry @reboot /stage/scripts/initial_boot_update.sh runs the first boot script, which applies the security errata available on the enabled channels without kernel changes and appends its output to /stage/scripts/initial_boot_update.log. To stop it running at boot, remove that line from root's crontab:
sudo crontab -e
Delete the @reboot /stage/scripts/initial_boot_update.sh line, save and exit. sudo crontab -l then no longer lists it. You can still update by hand at any time with sudo dnf -y update.
Common Use Cases
- Hosting applications that were certified on an Oracle Linux 8 or RHEL 8 base
- Compatibility and regression testing against Oracle Linux 8
- Lift and shift of existing Oracle Linux 8 workloads to Azure
Troubleshooting
Cannot connect via SSH
- Verify the VM is in Running state in the Azure Portal
- Check that port 22 is allowed in the Network Security Group
- Ensure you are using the correct username:
azureuser - Verify your SSH key matches the one you supplied at create time. Password login is disabled, so a wrong key cannot fall back to a password prompt.
A dnf command waits for a lock after boot
The first boot script holds the dnf lock for several minutes after each boot. Wait for it to finish:
sudo tail -3 /stage/scripts/initial_boot_update.log
The run has finished when the last line reads Complete!.
vxagent.service failed
The Azure Site Recovery agent is still installed. Follow Step 4.
Azure agent not running
sudo systemctl status waagent
If it is not running, start it with sudo systemctl enable --now waagent.
Package manager issues
Refresh the metadata cache first:
sudo dnf clean all
sudo dnf makecache
If repositories are unreachable, check DNS resolution with getent hosts yum.oracle.com.
Security Recommendations
- Do Steps 3 and 4 before you rely on the machine: give it its own machine ID and remove the Azure Site Recovery agent.
- Restrict SSH in the Network Security Group to the addresses you connect from.
- Run the full update in Step 6, and keep applying updates with
sudo dnf -y update. - Turn on firewalld (Step 7) if your policy needs a host firewall, and SELinux if it needs mandatory access control.
Important Notes
Support lifecycle. Oracle's Lifetime Support Policy lists Oracle Linux 8 with Premier Support ending in July 2029 (Oracle Lifetime Support Policy: Oracle Open Source Service Offerings). Oracle Linux 8.10 is the latest Oracle Linux 8 update (endoflife.date: Oracle Linux); the full update in Step 6 brings this machine to it.
Oracle Linux is free and open source, and Oracle permits its redistribution. It is a distribution assembled from thousands of independently packaged components, each carrying its own terms, including the GPL, LGPL, MIT, BSD, Apache 2.0 and MPL; every package's terms are readable with rpm -qi <package>. No subscription, licence key or Red Hat entitlement is required.
Oracle and Oracle Linux are trademarks of Oracle Corporation. The names are used here only to identify the distribution this image contains. cloudimg is not affiliated with, endorsed by or sponsored by Oracle Corporation.
Support
For assistance with this image, contact cloudimg support:
- Website: www.cloudimg.co.uk
- Product Catalogue: www.cloudimg.co.uk/products
- User Guides: www.cloudimg.co.uk/guides
- SLA: 24 hour response guaranteed