Skip to content

Latest commit

 

History

History
120 lines (93 loc) · 4.63 KB

File metadata and controls

120 lines (93 loc) · 4.63 KB

ISO Installer in Local VM

The Azure Linux ISO may work in some bare-metal scenarios, but is generally intended for installation to a Virtual Machine.

The ISO boots the Anaconda installer (run in text mode). Follow its prompts to partition disks, set a root password, create a user, and complete the installation. A serial console is preconfigured at ttyS0/115200.

Note: Azure Linux 4.0 ISOs are currently in Preview and not Secure Boot signed. Disable Secure Boot in your VM's firmware settings before booting the installer.

This guide covers two local virtualization options:

Using ISO Installer in Hyper-V VM

From a Windows PC:

Create Generation 2 Virtual Machine with Hyper-V

  1. From Hyper-V Manager, select Action->New->Virtual Machine.
  2. Provide a name for your VM and press Next >.
  3. Select Generation 2, then press Next >.
  4. Uncheck Use Dynamic Memory for this virtual machine, then press Next >.
  5. Select a virtual switch, then press Next >.
  6. Select Create a virtual hard disk, choose a location for your VHDX and set your desired disk size. Then press Next >.
  7. Select Install an operating system from a bootable image file and browse to your Azure Linux ISO.
  8. Press Finish.

Adjust VM Settings

  1. Right click your virtual machine from Hyper-V Manager.
  2. Select Settings...
  3. Select Security and uncheck Enable Secure Boot.
    • Note: Secure Boot will be supported in a future release of Azure Linux.
  4. Select Apply to apply all changes.

Boot ISO Installer

  1. Right click your VM and select Connect....
  2. Select Start.
  3. Follow the installer prompts to install your image.
    • During installation menu, ensure all [!] are addressed in order to continue.
  4. When installation completes, press Enter to reboot the machine.
  5. When prompted, sign in to your new Azure Linux installation using the username and password provisioned through the installer.

Using ISO Installer in QEMU/KVM

On a Linux host you can boot the ISO with QEMU using KVM acceleration and UEFI firmware (OVMF/edk2). This example uses the x86_64 ISO; for aarch64, install the matching firmware and use qemu-system-aarch64.

Prerequisites

  • An x86_64 host with KVM available (/dev/kvm accessible to your user).
  • qemu-system-x86_64 and OVMF/edk2 firmware installed. The commands below assume firmware at /usr/share/edk2/ovmf/; adjust if your distro installs it elsewhere (common alternative: /usr/share/OVMF/).
  • Recommended sizing: 2+ vCPUs, 16 GiB+ disk.

Setup

Create an empty virtual disk and a private, writable copy of the UEFI variable store:

qemu-img create -f qcow2 azl4.qcow2 16G
cp /usr/share/edk2/ovmf/OVMF_VARS.fd ./azl4_VARS.fd

Boot the ISO

qemu-system-x86_64 \
  -name azl4-live \
  -machine q35,accel=kvm \
  -cpu host \
  -smp 2 \
  -m 4096 \
  -drive if=pflash,format=raw,readonly=on,file=/usr/share/edk2/ovmf/OVMF_CODE.fd \
  -drive if=pflash,format=raw,file=./azl4_VARS.fd \
  -device virtio-blk-pci,drive=disk0,bootindex=0 \
  -drive id=disk0,if=none,file=azl4.qcow2,format=qcow2 \
  -device ide-cd,drive=cd0,bootindex=1 \
  -drive id=cd0,if=none,file=azurelinux-4.0-x86_64.iso,media=cdrom,readonly=on \
  -netdev user,id=net0 -device virtio-net-pci,netdev=net0 \
  -nographic \
  -serial mon:stdio

Notes:

  • -nographic -serial mon:stdio attaches your terminal to the guest serial console. GRUB and the Anaconda text installer appear inline.
    • Ctrl-a c — switch to the QEMU monitor
    • Ctrl-a x — quit QEMU

Follow the Anaconda installer prompts to complete the installation:

  • During installation menu, ensure all [!] are addressed in order to continue.
  • When installation completes, press Enter to reboot the machine.
  • When prompted, sign in to your new Azure Linux installation using the username and password provisioned through the installer.

Boot the installed system

After installation completes, you can safely boot from the virtual disk without the ISO, e.g.:

qemu-system-x86_64 \
  -name azl4 \
  -machine q35,accel=kvm \
  -cpu host \
  -smp 2 \
  -m 4096 \
  -drive if=pflash,format=raw,readonly=on,file=/usr/share/edk2/ovmf/OVMF_CODE.fd \
  -drive if=pflash,format=raw,file=./azl4_VARS.fd \
  -device virtio-blk-pci,drive=disk0 \
  -drive id=disk0,if=none,file=azl4.qcow2,format=qcow2 \
  -netdev user,id=net0 -device virtio-net-pci,netdev=net0 \
  -nographic \
  -serial mon:stdio