How To

Run Azure Linux on VirtualBox / VMware

Azure Linux (formerly CBL-Mariner) is Microsoft’s open-source Linux distribution built for container workloads. It ships with a minimal package set – around 500 packages – a hardened kernel, and a secure-by-default configuration that makes it a solid choice for running containers on bare metal or virtual machines. Azure Linux 3.0 is the current stable release, shipping with kernel 6.6, systemd v255, and containerd 2.0.

Original content from computingforgeeks.com - post 100481

This guide walks through downloading Azure Linux 3.0 ISO and running it as a virtual machine in both VirtualBox and VMware Workstation. We cover the full installation, networking, package management with tdnf, and running containers with Docker and Podman. The Azure Linux GitHub repository hosts the source code and ISO downloads.

Prerequisites

Before starting, make sure you have the following ready:

  • A host machine running Windows, macOS, or Linux with at least 8 GB RAM
  • VirtualBox 7.x or VMware Workstation 17.x / VMware Player installed
  • At least 20 GB free disk space for the VM
  • Internet connection to download the Azure Linux ISO (approximately 800 MB)
  • Hardware virtualization (VT-x/AMD-V) enabled in BIOS/UEFI

Step 1: Download Azure Linux 3.0 ISO

Microsoft provides the Azure Linux ISO directly from their release infrastructure. Download the x86_64 ISO using your browser or the command line.

Download the ISO using wget or curl:

wget https://aka.ms/azurelinux-3.0-x86_64.iso -O AzureLinux-3.0-x86_64.iso

Alternatively, use curl:

curl -L -o AzureLinux-3.0-x86_64.iso https://aka.ms/azurelinux-3.0-x86_64.iso

The direct download URL resolves to https://osrelease.download.prss.microsoft.com/pr/download/AzureLinux-3.0-x86_64.iso. You can also grab the ISO from the Azure Linux releases page on GitHub.

After downloading, verify the file is complete by checking its size:

ls -lh AzureLinux-3.0-x86_64.iso

Step 2: Create Azure Linux VM in VirtualBox

Open VirtualBox and create a new virtual machine for Azure Linux. If you don’t have VirtualBox installed yet, see our guide on installing VirtualBox on Ubuntu.

Click Machine > New and configure these settings:

  • Name: AzureLinux-3.0
  • Type: Linux
  • Version: Other Linux (64-bit)
  • Memory: 2048 MB (minimum 1024 MB)
  • Processors: 2 CPUs
  • Hard disk: Create a virtual hard disk now – 20 GB, VDI format, dynamically allocated

After creating the VM, adjust these additional settings before booting:

  • System > Motherboard: Enable EFI (Special OSes) – Azure Linux 3.0 supports UEFI boot
  • Network > Adapter 1: Attached to NAT (for internet access during install) or Bridged Adapter (for network-accessible VM)
  • Storage: Under Controller: IDE, click the empty disk icon and select the downloaded Azure Linux ISO

You can also create the VM from the command line using VBoxManage:

VBoxManage createvm --name "AzureLinux-3.0" --ostype "Linux_64" --register
VBoxManage modifyvm "AzureLinux-3.0" --memory 2048 --cpus 2 --firmware efi
VBoxManage createmedium disk --filename ~/VirtualBox\ VMs/AzureLinux-3.0/AzureLinux-3.0.vdi --size 20480
VBoxManage storagectl "AzureLinux-3.0" --name "SATA Controller" --add sata --controller IntelAhci
VBoxManage storageattach "AzureLinux-3.0" --storagectl "SATA Controller" --port 0 --device 0 --type hdd --medium ~/VirtualBox\ VMs/AzureLinux-3.0/AzureLinux-3.0.vdi
VBoxManage storagectl "AzureLinux-3.0" --name "IDE Controller" --add ide
VBoxManage storageattach "AzureLinux-3.0" --storagectl "IDE Controller" --port 0 --device 0 --type dvddrive --medium /path/to/AzureLinux-3.0-x86_64.iso
VBoxManage modifyvm "AzureLinux-3.0" --nic1 nat

Start the VM by clicking Start or running:

VBoxManage startvm "AzureLinux-3.0"

Step 3: Create Azure Linux VM in VMware Workstation

Open VMware Workstation and select File > New Virtual Machine. Choose Custom (advanced) to have full control over VM settings.

Walk through the wizard with these settings:

  • Hardware compatibility: Workstation 17.x (default)
  • Installer disc image file (iso): Browse to the downloaded Azure Linux ISO
  • Guest operating system: Linux – Other Linux 6.x kernel 64-bit
  • Virtual machine name: AzureLinux-3.0
  • Firmware type: UEFI
  • Processors: 2 cores
  • Memory: 2048 MB
  • Network: NAT
  • Disk: 20 GB, SCSI, store as single file

Click Finish and power on the VM. The Azure Linux installer will boot from the ISO automatically.

For VMware Player (free edition), the process is the same – select Create a New Virtual Machine and follow the same settings above.

Step 4: Install Azure Linux 3.0

Once the VM boots from the ISO, the Azure Linux installer presents a text-based interface. The installation process is straightforward and takes a few minutes.

Follow these steps in the installer:

  • Select installation type: Choose Graphical Install if available, or Text Install for the default text-mode installer
  • Accept the license agreement
  • Disk configuration: Select the virtual disk and accept the default partitioning (the installer will create EFI, boot, and root partitions automatically)
  • Set hostname: Enter a hostname like azurelinux
  • Set root password: Create a strong root password
  • Create a user account: Set up a regular user with sudo access
  • Package selection: Choose the default or full installation
  • Begin installation: Confirm and wait for the packages to install

After the installation completes, the installer prompts you to reboot. Remove the ISO from the virtual CD/DVD drive before rebooting – in VirtualBox, go to Devices > Optical Drives > Remove disk from virtual drive. In VMware, right-click the VM, go to Settings > CD/DVD, and select Use physical drive or disconnect it.

After reboot, log in with the root password or user account you created during installation. Verify the Azure Linux version:

cat /etc/os-release

The output confirms you are running Azure Linux 3.0:

NAME="Microsoft Azure Linux"
VERSION="3.0.20260304"
ID=azurelinux
VERSION_ID="3.0"
PRETTY_NAME="Microsoft Azure Linux 3.0"
ANSI_COLOR="1;34"
HOME_URL="https://aka.ms/azurelinux"
BUG_REPORT_URL="https://aka.ms/azurelinux"
SUPPORT_URL="https://aka.ms/azurelinux"

Check the kernel version to confirm the 6.6 LTS kernel:

uname -r

You should see kernel 6.6.x:

6.6.126.1-1.azl3

Step 5: Configure Networking on Azure Linux

Azure Linux uses systemd-networkd for network management. With NAT networking in VirtualBox or VMware, the VM should get an IP address automatically via DHCP.

Check the current network configuration:

ip addr show

You should see an interface (typically eth0 or enp0s3) with an assigned IP address. If the interface has no IP, enable and start systemd-networkd:

sudo systemctl enable --now systemd-networkd
sudo systemctl enable --now systemd-resolved

If DHCP is not working, create a network configuration file. First, identify your interface name:

ls /sys/class/net/

Then create a DHCP configuration for that interface:

sudo vi /etc/systemd/network/20-wired.network

Add the following configuration:

[Match]
Name=eth0

[Network]
DHCP=yes

[DHCP]
UseDNS=yes

Replace eth0 with your actual interface name. Restart the networking service:

sudo systemctl restart systemd-networkd

Verify connectivity by pinging an external host:

ping -c 3 github.com

For a static IP configuration (useful with bridged networking), use this format instead:

[Match]
Name=eth0

[Network]
Address=192.168.1.50/24
Gateway=192.168.1.1
DNS=8.8.8.8
DNS=8.8.4.4

Step 6: Package Management with tdnf

Azure Linux uses tdnf (Tiny DNF) as its package manager. It is a lightweight alternative to dnf/yum with a similar command syntax. If you have used dnf on Fedora or RHEL, you will feel right at home.

Update all installed packages to the latest versions:

sudo tdnf update -y

Search for a package:

sudo tdnf search nginx

Install a package:

sudo tdnf install -y vim curl wget tar

List installed packages:

tdnf list installed

Remove a package:

sudo tdnf remove vim

Here is a quick reference of common tdnf commands:

CommandDescription
tdnf update -yUpdate all packages
tdnf install -y pkgInstall a package
tdnf remove pkgRemove a package
tdnf search keywordSearch for packages
tdnf list installedList installed packages
tdnf info pkgShow package details
tdnf clean allClean package cache
tdnf repolistList enabled repositories

Step 7: Install Additional Packages on Azure Linux

The base Azure Linux installation is intentionally minimal. You will likely need to install additional tools depending on your use case.

Install common system administration tools:

sudo tdnf install -y openssh-server sudo less which bind-utils net-tools procps-ng

Enable and start the SSH server so you can connect remotely:

sudo systemctl enable --now sshd

Verify the SSH service is running:

sudo systemctl status sshd

The output should show the service as active (running):

● sshd.service - OpenSSH server daemon
     Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled)
     Active: active (running)

Install development tools if you plan to compile software:

sudo tdnf install -y gcc make cmake git

Check available repositories to see what packages are available:

tdnf repolist

The default repositories include the Azure Linux base and update channels from packages.microsoft.com.

Step 8: Run Containers on Azure Linux with Docker and Podman

Azure Linux is designed as a container-optimized distribution, so running containers is a primary use case. You can use either Docker or Podman – both are available in the Azure Linux repositories.

Install and Run Docker

Install the Docker engine packages:

sudo tdnf install -y moby-engine moby-cli

Azure Linux ships Moby – the open-source components that power Docker. Enable and start the Docker daemon:

sudo systemctl enable --now docker

Verify Docker is running by checking the version and running a test container:

sudo docker version

Run a test container to confirm everything works:

sudo docker run --rm hello-world

You should see the “Hello from Docker!” message confirming the engine is working correctly. To run containers without sudo, add your user to the docker group:

sudo usermod -aG docker $USER

Log out and back in for the group change to take effect. For a deeper look at Docker setup, check our guide on installing Docker and running containers.

Install and Run Podman

Podman is a daemonless container engine that runs containers without a background service. Install it with:

sudo tdnf install -y podman

Podman does not require a daemon, so no service needs starting. Run a test container:

podman run --rm docker.io/library/alpine echo "Azure Linux + Podman works"

The output confirms Podman is operational:

Azure Linux + Podman works

Podman uses the same command syntax as Docker, making it easy to switch between the two. For rootless container support, Podman is the better choice since it does not require a privileged daemon. See our guide on installing Podman on Ubuntu for more details on Podman usage.

Step 9: Azure Linux vs Other Container-Optimized Distros

Azure Linux is not the only container-optimized distribution available. Here is how it compares to other popular choices for running containers in VMs or on bare metal.

FeatureAzure Linux 3.0Fedora CoreOSFlatcar Container Linux
MaintainerMicrosoftRed Hat / FedoraMicrosoft (Kinvolk)
Package managertdnf (RPM-based)rpm-ostree (image-based)None (immutable)
Base packages~500~1000Minimal (immutable image)
Container runtimecontainerd, Moby, PodmanPodman, containerdcontainerd, Docker
Update modelPackage updates via tdnfAutomatic image-based (Zincati)Automatic image-based
Kernel6.6 LTSLatest stableLTS kernel
Init systemsystemd v255systemd (latest)systemd
Ideal use caseAzure workloads, custom container hostsSelf-updating container hostsImmutable infrastructure

Azure Linux stands out with its traditional package management approach – you can install, update, and remove individual packages just like on Fedora or RHEL. This makes it more flexible than immutable distributions like Flatcar or CoreOS when you need to customize the system beyond containers. The trade-off is that you manage updates yourself rather than relying on automatic image-based updates.

For VirtualBox and VMware testing, Azure Linux is a good fit because it boots fast, consumes minimal resources, and gives you full control over installed packages. If you are already running workloads on Azure Kubernetes Service, using Azure Linux locally gives you a consistent environment for development and testing.

Conclusion

You now have Azure Linux 3.0 running in a VirtualBox or VMware virtual machine with networking configured, packages managed through tdnf, and containers running with Docker or Podman. Azure Linux provides a lightweight, security-hardened base that works well for container workloads and development environments.

For production deployments, consider enabling the firewall with iptables or nftables, configuring SSH key-based authentication instead of passwords, and setting up automatic security updates. The Azure Linux documentation covers advanced topics like custom image building and security hardening.

Related Articles

KVM Configure Open vSwitch Bridge on KVM for Virtual Machines Proxmox Proxmox VE 9.0 Released: What are the New Features Virtualization How to Provision Vagrant VMs with Ansible KVM Installing VMs on KVM using Virt-builder

Leave a Comment

Press ESC to close