Operating Systems Azure

Rocky Linux 10 LVM on Azure User Guide

| Product: Rocky Linux 10 LVM on Azure

Overview

This guide covers the deployment and configuration of Rocky Linux 10 LVM on Microsoft Azure using cloudimg's pre configured virtual machine image from the Azure Marketplace.

Rocky Linux is a community enterprise distribution produced by the Rocky Enterprise Software Foundation, binary compatible with Red Hat Enterprise Linux 10. This image is the LVM variant: the root filesystem lives on a Logical Volume Manager logical volume rather than on a plain disk partition. LVM lets you grow the root filesystem online, add disks to the volume group and take snapshots, without repartitioning or downtime. The current build tracks the latest Rocky 10 minor, 10.2, and is rebuilt as new minors are released.

What's included:

  • Rocky Linux 10.2, binary compatible with RHEL 10
  • An LVM partitioned root: volume group rocky, logical volume lvroot, formatted xfs
  • Every available 10.2 maintenance stream update applied at build time
  • dnf-automatic armed, so the machine keeps applying security updates on its own
  • Azure Linux Agent (waagent) and cloud-init for Azure integration
  • Chronyd for NTP time synchronisation
  • SELinux in enforcing mode
  • BaseOS, AppStream and Extras repositories enabled, so your update path is intact
  • Gen2 Hyper V virtual machine support
  • 24/7 cloudimg support

Platform: Microsoft Azure (Gen2 Hyper V) Default user: azureuser

Security posture

This image ships with no known credential. There is no default password and no baked in SSH key:

  • The root account password is locked, so no one can log in as root with a password.
  • PasswordAuthentication is disabled in the SSH daemon, so every login is by key.
  • PermitRootLogin is set to no, so root cannot be reached over SSH at all.
  • The only key that works is the public key you supply when you create the virtual machine. Azure injects it into azureuser at first boot, so no two machines you launch ever share a secret.
  • The machine identity and the SSH host keys are regenerated uniquely on every instance, so no two machines share a host key either.
  • SELinux is left in enforcing mode, the Rocky Linux default.

Prerequisites

Before deploying this image, ensure you have:

  1. An active Microsoft Azure subscription
  2. Access to the Azure Portal or Azure CLI
  3. An SSH key pair for Linux VM access
  4. Familiarity with Azure VM management

Recommended VM Size: Standard_B2s (2 vCPU, 4 GB RAM) or larger.

Step 1: Deploy the Virtual Machine

Option A: Azure Portal

  1. Navigate to the Azure Marketplace and search for "Rocky Linux 10 LVM cloudimg"
  2. Select the image and click Create
  3. Configure the basics:
  4. Subscription: Select your Azure subscription
  5. Resource Group: Create new or select existing
  6. Virtual Machine Name: Enter a name for your VM
  7. Region: Select your preferred Azure region
  8. Size: Standard_B2s recommended
  9. Under Administrator Account, select SSH public key and enter your key
  10. Under Inbound Port Rules, allow SSH (port 22)
  11. Click Review + Create, then Create

Option B: Azure CLI

az vm create \
  --resource-group myResourceGroup \
  --name my-rocky-10-lvm-vm \
  --image cloudimg:rocky-linux:rocky10lvm:latest \
  --size Standard_B2s \
  --admin-username azureuser \
  --generate-ssh-keys \
  --public-ip-sku Standard

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-rocky-10-lvm-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.

Step 3: Confirm the release

Check that the machine is the Rocky Linux 10.2 release you expect:

cat /etc/rocky-release
grep -E '^(NAME|VERSION|ID|PLATFORM_ID)=' /etc/os-release
uname -rm

Expected output:

Rocky Linux release 10.2 (Red Quartz)
NAME="Rocky Linux"
VERSION="10.2 (Red Quartz)"
ID="rocky"
PLATFORM_ID="platform:el10"
6.12.0-211.44.1.el10_2.x86_64 x86_64

The kernel version carries an el10_2 tag. That is the marker that the machine is tracking the 10.2 maintenance stream.

Terminal showing cat of etc rocky-release reporting Rocky Linux release 10.2 Red Quartz, os-release fields ID rocky and PLATFORM_ID platform el10, and uname reporting the 6.12.0 el10_2 kernel on x86_64

Step 4: Verify the LVM root layout

This is the defining feature of this image. The root filesystem is a logical volume, not a plain partition. Confirm the layout:

lsblk -o NAME,TYPE,MOUNTPOINT,SIZE,FSTYPE
findmnt /
sudo vgs
sudo lvs

Expected output:

NAME             TYPE MOUNTPOINT  SIZE FSTYPE
sda              disk              10G
├─sda1           part               2M
├─sda2           part /boot/efi   200M vfat
├─sda3           part /boot      1000M xfs
└─sda4           part             8.8G LVM2_member
  └─rocky-lvroot lvm  /           8.8G xfs

TARGET SOURCE                   FSTYPE OPTIONS
/      /dev/mapper/rocky-lvroot xfs    rw,relatime,...

  VG    #PV #LV #SN Attr   VSize VFree
  rocky   1   1   0 wz--n- 8.82g 32.00m

  LV     VG    Attr       LSize
  lvroot rocky -wi-ao---- <8.79g

Root is /dev/mapper/rocky-lvroot, a logical volume in the rocky volume group. The lvm type against / in lsblk is the proof that this is the LVM variant.

Terminal showing lsblk with root on the LVM logical volume rocky-lvroot over partition sda4, findmnt confirming root is dev mapper rocky-lvroot xfs, and vgs and lvs showing the rocky volume group and lvroot logical volume

Growing the root filesystem

Because root is an LV, you can grow it online. If you resize the OS disk larger in Azure first (stop the VM, set a larger disk size, start it), then grow the partition, the physical volume, the logical volume and the xfs filesystem in sequence:

# grow partition 4 to fill the enlarged disk
sudo growpart /dev/sda 4
# grow the physical volume into the enlarged partition
sudo pvresize /dev/sda4
# extend the logical volume to use all free space in the volume group
sudo lvextend -l +100%FREE /dev/rocky/lvroot
# grow the xfs filesystem to fill the enlarged logical volume (xfs grows mounted)
sudo xfs_growfs /

You can also add a second data disk to the volume group and extend root across both, which is the main reason to run an LVM root:

sudo pvcreate /dev/sdc
sudo vgextend rocky /dev/sdc
sudo lvextend -l +100%FREE /dev/rocky/lvroot
sudo xfs_growfs /

Step 5: Check the patch level

The image is fully updated at build time. dnf check-update returns exit code 100 when updates are pending and 0 when none are:

sudo dnf check-update
echo "exit code: $?"
dnf repolist --enabled

This image also arms dnf-automatic, so security updates are downloaded and applied on a timer without any action from you. You can still run updates on your own schedule:

sudo dnf upgrade -y
sudo systemctl reboot   # only if a new kernel was installed

Step 6: Verify the security posture

Confirm SELinux is enforcing, root is locked, and SSH is key only:

getenforce
sudo passwd -S root
sudo sshd -T | grep -E '^(permitrootlogin|passwordauthentication|pubkeyauthentication)'

Expected output:

Enforcing
root LK 2009-12-22 -1 -1 -1 -1 (Alternate authentication scheme in use.)
permitrootlogin no
pubkeyauthentication yes
passwordauthentication no

Terminal showing getenforce reporting Enforcing, passwd -S root reporting root as LK meaning locked, the effective sshd policy reporting permitrootlogin no pubkeyauthentication yes and passwordauthentication no, and rpcbind on port 111 closed

Step 7: Verify Azure integration and unattended updates

Confirm the Azure Linux Agent, cloud-init and time synchronisation are healthy, that unattended security updates are armed, and check your resources:

systemctl is-active waagent
systemctl is-enabled waagent
cloud-init --version
systemctl is-enabled dnf-automatic.timer
systemctl is-active chronyd
df -h /
free -h

waagent is what lets Azure provision your SSH key, resize the OS disk, run extensions and report VM health, so it should always be active and enabled. dnf-automatic.timer being enabled is what keeps the machine applying security updates on its own after launch.

Terminal showing the Azure Linux Agent active and enabled at boot, cloud-init present, dnf-automatic.timer enabled so security updates apply on a timer, chronyd active, dnf check-update exiting 0 meaning fully patched, and the disk and memory summary

Step 8: Networking and the firewall

The Azure Network Security Group is the control plane for inbound and outbound traffic, and it is the first and usually the only place you need to open a port. The image advertises a single inbound port, SSH on 22.

This image binds no unnecessary listeners: rpcbind (the local RPC helper on port 111 that the stock cloud image leaves running) is masked, because NFSv4, the Rocky 10 default, does not use it. Masking is stronger than disabling: it prevents the socket from being started even on demand. If you need NFSv3, unmask it first, then enable it:

sudo systemctl unmask rpcbind.socket rpcbind.service
sudo systemctl enable --now rpcbind.socket

Confirm what is listening before you open anything:

ss -tlnp

On a fresh machine the only listener is sshd on port 22. If your policy requires a host firewall as well, install and enable firewalld, adding the SSH service first so you do not lock yourself out:

sudo dnf install -y firewalld
sudo systemctl enable --now firewalld
sudo firewall-cmd --permanent --add-service=ssh
sudo firewall-cmd --reload

Step 9: Install software

AppStream carries the application packages. Search it, then install what you need:

dnf search nginx
dnf module list nginx
sudo dnf install -y nginx
sudo systemctl enable --now nginx

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.

Common Use Cases

  • RHEL 10 compatible application hosting where LVM managed storage is a requirement
  • Workloads that need to grow the root filesystem online without downtime
  • Estates that add data disks to a machine over its lifetime and want them pooled under one filesystem
  • A base for software certified on the 10 platform

Troubleshooting

Cannot connect via SSH

  1. Verify the VM is in Running state in the Azure Portal
  2. Check that port 22 is allowed in the Network Security Group
  3. Ensure you are using the correct username: azureuser
  4. Verify your SSH key matches the one you supplied at create time. Password login is disabled by design, so a wrong key cannot fall back to a password prompt.

To see which key your client is actually offering, run ssh -v azureuser@<vm-ip> from your workstation and look for the Offering public key lines.

Azure agent not running

sudo systemctl status waagent
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 download.rockylinux.org. Install bind-utils if you want dig and nslookup available.

A service is blocked and the logs mention SELinux

SELinux is enforcing on this image. Rather than disabling it, look at what was denied:

sudo ausearch -m AVC -ts recent 2>/dev/null || echo "no recent AVC denials"

Important Notes

Rocky Linux is free and open source. It is not covered by a single licence: 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> and under /usr/share/licenses/. No subscription, licence key or Red Hat entitlement is required.

Rocky Linux 10 is supported until 2035. Applying updates keeps you on the current 10 minor.

Rocky Linux is a trademark of the Rocky Enterprise Software Foundation. The name is used here nominatively, only to identify the distribution this image contains. cloudimg is not affiliated with, endorsed by or sponsored by the Rocky Enterprise Software Foundation.

Support

For assistance with this image, contact cloudimg support: