Operating Systems Azure

Ubuntu Server 22.04 LTS on Azure User Guide

| Product: Ubuntu Server 22.04 LTS on Azure

Videos

Overview: Ubuntu Server 22.04 LTS on Azure: overview (watch on YouTube)
Launch and log in: Ubuntu Server 22.04 LTS on Azure: launch and log in (watch on YouTube)

Overview

This guide covers the deployment and configuration of Ubuntu Server 22.04 LTS (Jammy Jellyfish) on Microsoft Azure using cloudimg's pre configured virtual machine image from the Azure Marketplace.

What's included:

  • Ubuntu Server 22.04 LTS with Canonical standard security maintenance until April 2027 (extended maintenance to 2032 requires an Ubuntu Pro subscription, which is not included)
  • Azure Linux Agent (waagent) for cloud integration
  • Chrony (chronyd) for NTP time synchronisation
  • Gen2 Hyper V virtual machine support
  • APT package management with Ubuntu repositories
  • 24/7 cloudimg support

Platform: Microsoft Azure (Gen2 Hyper V) Login user: the administrator username you choose when you deploy (azureuser in the examples below). The image honours the authentication type you pick in the portal: SSH public key (recommended) or password.

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 (recommended) or a strong password 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 "Ubuntu Server 22.04 LTS on Azure 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, choose the username you want to log in as, then select SSH public key (recommended) and enter your key, or select Password and set a strong password
  10. Under Inbound Port Rules, allow SSH (port 22)
  11. Click Review + Create, then Create

Option B: Azure CLI

az vm image terms accept --urn cloudimg1647283583153:ubuntu-22-04:default:latest

az vm create \
  --resource-group myResourceGroup \
  --name my-ubuntu-server-22-04-azure-vm \
  --image cloudimg1647283583153:ubuntu-22-04:default:latest \
  --size Standard_B2s \
  --admin-username azureuser \
  --generate-ssh-keys \
  --public-ip-sku Standard

Choosing a VM size

General purpose, memory optimised, compute optimised and burstable sizes of the v5 generation and earlier run this image. Four kinds of size do not work with this image:

  • NVMe-only sizes (the v6 generation, such as Dsv6, Ddsv6, Dasv6 and Easv6): this image boots from a SCSI disk controller, so Azure refuses to create it on a size that offers only NVMe ("cannot boot with OS image or disk"). Choose a v5 or earlier size instead, for example Standard_D2s_v5 or Standard_D2as_v5.
  • Confidential VM sizes (such as DCasv5, ECasv5 and their v6 successors): these need an image that supports the Confidential VM security type. This image supports the Standard security type only (not Trusted launch or Confidential VM), so if your organisation's Azure Policy requires Trusted launch, the deployment is refused.
  • Arm64 sizes (a p in the size name, such as Standard_D2ps_v5): this image is x64.
  • NVv4 GPU sizes (such as Standard_NV4as_v4): Microsoft supports the NVv4 AMD GPU on Windows only and retired the series on 30 September 2026, so the GPU cannot be used from Linux. For an NVIDIA GPU size, see Step 6.

Step 2: Connect via SSH

Once your VM is running, connect using SSH:

ssh azureuser@<public-ip-address>

To find your VM's public IP:

az vm show --resource-group myResourceGroup --name my-ubuntu-server-22-04-azure-vm --show-details --query publicIps -o tsv

Step 3: Verify the Installation

After connecting, verify the operating system:

cat /etc/os-release
uname -r

Check disk space and memory:

df -h
free -h

Verify the Azure Linux Agent is running (on Ubuntu its service is named walinuxagent):

systemctl status walinuxagent

Step 4: Update the System

Keep your system up to date with the latest security patches:

sudo apt-get update && sudo apt-get upgrade -y

Step 5: Configure Firewall (Optional)

The Azure Network Security Group (NSG) controls inbound and outbound traffic. Ubuntu's own firewall, ufw, ships inactive; check it with:

sudo ufw status verbose

To enable it, always allow SSH first so you do not lock yourself out, then allow any other ports you need:

sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw enable

Step 6: Install a GPU Driver (NVIDIA GPU Sizes Only)

The image ships without a GPU driver, so on an NVIDIA GPU size (such as the NC, ND and NV series with NVIDIA GPUs) nvidia-smi does not work until you install one. Canonical publishes prebuilt NVIDIA kernel modules for the image's Azure kernel, and ubuntu-drivers picks the right driver for your GPU:

sudo apt-get update
sudo apt-get install -y ubuntu-drivers-common
sudo ubuntu-drivers list
sudo ubuntu-drivers install
sudo reboot

After the reboot, run nvidia-smi to see the GPU. On a size without an NVIDIA GPU, ubuntu-drivers list prints nothing and ubuntu-drivers install has nothing to install. ubuntu-drivers may also print an aplay error from its sound modem check; it is harmless.

Common Use Cases

  • Web application and microservices hosting
  • Container orchestration (Docker, Kubernetes)
  • Database and data platform deployments
  • Machine learning and AI workloads

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 administrator username you chose at deployment (azureuser only if you kept the example), and the matching key or password
  4. Verify your SSH key matches the one configured during deployment

Azure Agent Not Running

sudo systemctl start walinuxagent
sudo systemctl enable walinuxagent

Package Manager Issues

sudo apt-get update && sudo apt-get upgrade -y

If repositories are unreachable, check DNS resolution:

nslookup google.com

Important Notes

Ubuntu is free and open source. No licence required.

Support

For assistance with this image, contact cloudimg support: