Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
---
title: Create an Azure Linux 3.0 virtual machine with Cobalt 100 processors

draft: true
cascade:
draft: true
minutes_to_complete: 120

minutes_to_complete: 120

who_is_this_for: This Learning Path explains how to create a virtual machine on Azure running Azure Linux 3.0 on Cobalt 100 processors.
who_is_this_for: This is an advanced topic for developers who want to run Azure Linux 3.0 on Arm-based Cobalt 100 processors in a custom virtual machine.


learning_objectives:
- Use QEMU to create a raw disk image, boot a VM using an Aarch64 ISO, install the OS, and convert the raw disk image to VHD format.
- Upload the VHD file to Azure and use the Azure Shared Image Gallery (SIG) to create a custom image.
- Use the Azure CLI to create an Azure Linux 3.0 VM for Arm, using the custom image from the Azure SIG.
- Use QEMU to create a raw disk image
- Boot a virtual machine using an AArch64 ISO and install Azure Linux 3.0
- Convert the raw disk image to VHD format
- Upload the VHD file to Azure
- Use Azure Shared Image Gallery (SIG) to create a custom image
- Create an Azure Linux 3.0 virtual machine on Arm using the Azure CLI and the custom image

prerequisites:
- A [Microsoft Azure](https://azure.microsoft.com/) account with permission to create resources, including instances using Cobalt 100 processors.
- A Linux machine with [QEMU](https://www.qemu.org/download/) and the [Azure CLI](/install-guides/azure-cli/) installed and authenticated.
- A [Microsoft Azure](https://azure.microsoft.com/) account with permission to create resources, including instances using Cobalt 100 processors
- A Linux machine with [QEMU](https://www.qemu.org/download/) and the [Azure CLI](/install-guides/azure-cli/) installed and authenticated

author: Jason Andrews

Expand All @@ -38,19 +37,19 @@ operatingsystems:

further_reading:
- resource:
title: Azure Virtual Machines documentation
title: Virtual machines in Azure
link: https://learn.microsoft.com/en-us/azure/virtual-machines/
type: documentation
- resource:
title: Azure Shared Image Gallery documentation
title: Store and share images in an Azure Compute Gallery
link: https://learn.microsoft.com/en-us/azure/virtual-machines/shared-image-galleries
type: documentation
- resource:
title: QEMU User Documentation
title: QEMU Documentation
link: https://wiki.qemu.org/Documentation
type: documentation
- resource:
title: Upload a VHD to Azure and create an image
title: Upload a VHD to Azure or copy a managed disk to another region - Azure CLI
link: https://learn.microsoft.com/en-us/azure/virtual-machines/linux/upload-vhd
type: documentation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,74 +6,74 @@ weight: 3
layout: learningpathall
---

You can view the Azure Linux 3.0 project on [GitHub](https://github.com/microsoft/azurelinux). There are links to the ISO downloads in the project README.
## How do I create an Azure Linux image for Arm?

Using QEMU, you can create a raw disk image and boot a virtual machine with the ISO to install the OS on the disk.
You can view the Azure Linux 3.0 project on [GitHub](https://github.com/microsoft/azurelinux). The project README includes links to ISO downloads.

Once the installation is complete, you can convert the raw disk to a fixed-size VHD, upload it to Azure Blob Storage, and then use the Azure CLI to create a custom Arm image.
Using [QEMU](https://www.qemu.org/), you can create a raw disk image, boot a virtual machine with the ISO, and install the operating system. After installation is complete, you'll convert the image to a fixed-size VHD, upload it to Azure Blob Storage, and use the Azure CLI to create a custom Arm image.

## Download and create a virtual disk file
## How do I download the Azure Linux ISO and create a raw disk image?

Use `wget` to download the Azure Linux ISO image file.
Use `wget` to download the Azure Linux ISO image file:

```bash
wget https://aka.ms/azurelinux-3.0-aarch64.iso
```

Use `qemu-img` to create a 32 GB empty raw disk image to install the OS.

You can increase the disk size by modifying the value passed to `qemu-img`.
Create a 32 GB empty raw disk image to install the OS:

```bash
qemu-img create -f raw azurelinux-arm64.raw 34359738368
```

## Boot and install the OS
{{% notice Note %}}
You can change the disk size by adjusting the value passed to `qemu-img`. Ensure it meets the minimum disk size requirements for Azure (typically at least 30 GB).
{{% /notice %}}


## How do I install Azure Linux on a raw disk image using QEMU?

Use QEMU to boot the operating system in an emulated Arm VM.

```bash
qemu-system-aarch64 \
-machine virt \
-cpu cortex-a72 \
-m 4096 \
-nographic \
-bios /usr/share/qemu-efi-aarch64/QEMU_EFI.fd \
-drive if=none,file=azurelinux-arm64.raw,format=raw,id=hd0 \
-device virtio-blk-device,drive=hd0 \
-cdrom azurelinux-3.0-aarch64.iso \
-netdev user,id=net0 \
qemu-system-aarch64 \
-machine virt \
-cpu cortex-a72 \
-m 4096 \
-nographic \
-bios /usr/share/qemu-efi-aarch64/QEMU_EFI.fd \
-drive if=none,file=azurelinux-arm64.raw,format=raw,id=hd0 \
-device virtio-blk-device,drive=hd0 \
-cdrom azurelinux-3.0-aarch64.iso \
-netdev user,id=net0 \
-device virtio-net-device,netdev=net0
```

Navigate through the installer by entering the hostname, username, and password for the custom image.
You should use the username of `azureuser` if you want match the instructions on the following pages.

Be patient, it takes some time to complete the full installation.
Follow the installer prompts to enter the hostname, username, and password. Use `azureuser` as the username to ensure compatibility with later steps.

At the end of installation you are prompted for confirmation to reboot the system.
{{% notice Note %}}The installation process takes several minutes.{{% /notice %}}

Once the newly installed OS boots successfully, install the Azure Linux Agent for VM provisioning, and power off the VM.
At the end of installation, confirm the reboot prompt. After rebooting into the newly-installed OS, install and enable the Azure Linux Agent:

```bash
sudo dnf install WALinuxAgent -y
sudo systemctl enable waagent
sudo systemctl start waagent
sudo dnf install WALinuxAgent -y
sudo systemctl enable waagent
sudo systemctl start waagent
sudo poweroff
```

Be patient, it takes some time to install the packages and power off.
{{% notice Note %}} It can take a few minutes to install the agent and power off the VM.{{% /notice %}}

## Convert the raw disk to VHD Format
## How do I convert a raw disk image to a fixed-size VHD for Azure?

Now that the raw disk image is ready to be used, convert the image to fixed-size VHD, making it compatible with Azure.
Now that the raw disk image is ready for you to use, convert it to fixed-size VHD, which makes it compatible with Azure.

```bash
qemu-img convert -f raw -o subformat=fixed,force_size -O vpc azurelinux-arm64.raw azurelinux-arm64.vhd
```

{{% notice Note %}}
VHD files have 512 bytes of footer attached at the end. The `force_size` flag ensures that the exact virtual size specified is used for the final VHD file. Without this, QEMU may round the size or adjust for footer overhead (especially when converting from raw to VHD). The `force_size` flag forces the final image to match the original size. This flag makes the final VHD size a whole number in MB or GB, which is required for Azure.
VHD files include a 512-byte footer at the end. The `force_size` flag ensures the final image size matches the requested virtual size. Without this, QEMU might round the size or adjust for footer overhead (especially when converting from raw to VHD). The `force_size` flag forces the final image to match the original size. This is required for Azure compatibility, as it avoids rounding errors and ensures the VHD ends at a whole MB or GB boundary.
{{% /notice %}}

Next, you can save the image in your Azure account.
In the next step, you'll upload the VHD image to Azure and register it as a custom image for use with Arm-based virtual machines.
Original file line number Diff line number Diff line change
@@ -1,38 +1,56 @@
---
title: "About Azure Linux"
title: "Build and run Azure Linux 3.0 on an Arm-based Azure virtual machine"

weight: 2

layout: "learningpathall"
---

## What is Azure Linux 3.0?
## What is Azure Linux 3.0 and how can I use it?

Azure Linux 3.0 is a Linux distribution developed and maintained by Microsoft, specifically designed for use on the Azure cloud platform. It is optimized for running cloud-native workloads, such as containers, microservices, and Kubernetes clusters, and emphasizes performance, security, and reliability. Azure Linux 3.0 provides native support for the Arm (AArch64) architecture, enabling efficient, scalable, and cost-effective deployments on Arm-based infrastructure within Azure.
Azure Linux 3.0 is a Microsoft-developed Linux distribution designed for cloud-native workloads on the Azure platform. It is optimized for running containers, microservices, and Kubernetes clusters, with a focus on performance, security, and reliability.

Currently, Azure Linux 3.0 is not available as a ready-made virtual machine image for Arm-based VMs in the Azure Marketplace. Only x86_64 images, published by Ntegral Inc., are offered. This means you cannot directly create an Azure Linux 3.0 VM for Arm from the Azure portal or CLI.
Azure Linux 3.0 includes native support for the Arm architecture (AArch64), enabling efficient, scalable, and cost-effective deployments on Arm-based Azure infrastructure.

However, you can still run Azure Linux 3.0 on Arm-based Azure VMs by creating your own disk image. Using QEMU, an open-source machine emulator and virtualizer, you can build a custom Azure Linux 3.0 Arm image locally. After building the image, you can upload it to your Azure account as a managed disk or custom image. This process allows you to deploy and manage Azure Linux 3.0 VMs on Arm infrastructure, even before official images are available.
## Can I run Azure Linux 3.0 on Arm-based Azure virtual machines?

This Learning Path guides you through the steps to build an Azure Linux 3.0 disk image with QEMU, upload it to Azure, and prepare it for use in creating virtual machines.
At the time of writing, Azure Linux 3.0 isn't available as a prebuilt virtual machine image for Arm-based VMs in the Azure Marketplace. Only x86_64 images (published by Ntegral Inc.) are available. This means you can't directly create an Azure Linux 3.0 VM for Arm from the Azure portal or CLI.

Following this process, you'll be able to create and run Azure Linux 3.0 VMs on Arm-based Azure infrastructure.
## How can I create and use a custom Azure Linux image for Arm?

To get started install the dependencies on your local Linux machine. The instructions work for both Arm or x86 running Ubuntu.
To run Azure Linux 3.0 on an Arm-based VM, you'll need to build a custom image manually. Using [QEMU](https://www.qemu.org/), an open-source machine emulator and virtualizer, you can build the image locally. After the build completes, upload the resulting image to your Azure account as either a managed disk or a custom image resource. This process lets you deploy and manage Azure Linux 3.0 VMs on Arm-based Azure infrastructure, even before official images are published in the Marketplace. This gives you full control over image configuration and early access to Arm-native workloads.

This Learning Path guides you through the steps to:

- Build an Azure Linux 3.0 disk image with QEMU
- Upload the image to Azure
- Create a virtual machine from the custom image

By the end of this process, you'll be able to run Azure Linux 3.0 VMs on Arm-based Azure infrastructure.

## What tools do I need to build the Azure Linux image locally?

You can build the image on either an Arm or x86 Ubuntu system. First, install the required tools:

Install QEMU and related tools:

```bash
sudo apt update && sudo apt install qemu-system-arm qemu-system-aarch64 qemu-efi-aarch64 qemu-utils ovmf -y
```

You also need to install the Azure CLI. Refer to [How to install the Azure CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest). You can also use the [Azure CLI install guide](/install-guides/azure-cli/) for Arm Linux systems.
You'll also need the Azure CLI. To install it, follow the [Azure CLI install guide](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest).

If you're using an Arm Linux machine, see the [Azure CLI install guide](/install-guides/azure-cli/).

## How do I verify the Azure CLI installation?

Make sure the CLI is working by running the version command and confirm the version is printed.
After installing the CLI, verify it's working by running the following command:

```bash
az version
```

You should see an output similar to:
You should see an output similar to the following:

```output
{
Expand All @@ -43,4 +61,4 @@ You should see an output similar to:
}
```

Continue to learn how to prepare the Azure Linux disk image.
In the next section, you'll learn how to build the Azure Linux 3.0 disk image using QEMU.
Loading