In this tutorial, we will create a bootable ISO image for installing Azure Linux to either a physical machine or virtual hard drive.
The toolkit ships with several image configurations. The image config files define how an Azure Linux image is laid out once built or installed. Each image config will also include a list of packages to install.
Build the default ISO by invoking the following build command from the azurelinux-tutorials/toolkit folder.
sudo make iso -j20 CONFIG_FILE=./imageconfigs/full.json
The first time make image
is invoked, the toolkit downloads the necessary toolchain packages from the Azure Linux package repo at packages.microsoft.com. These toolchain packages are the standard set needed to build any local packages. Once the toolchain is ready, make
automatically proceeds to build any local packages. In this case, the core repo's image configs do not use any of the packages located in the Tutorial repo so nothing will be built. make
will then assemble the packages gathered from the package server to build the specified image.
The resulting ISO is placed in the azurelinux-tutorials/out/images/full
folder.
See Use Hyper-V to Boot Your ISO Installer for instructions on using Hyper-V to boot the ISO.
The tools can also create offline images that can be directly booted.
The tools can also build offline images for direct use in VMs or as containers:
# VHDX
sudo make image -j20 CONFIG_FILE=./imageconfigs/core-efi.json
# VHD
sudo make image -j20 CONFIG_FILE=./imageconfigs/core-legacy.json
The resulting images are placed in the azurelinux-tutorials/out
folder:
VHDX:
azurelinux-tutorials/out/images/core-efi/
VHD:azurelinux-tutorials/out/images/core-legacy/
No user account is provisioned by default. To sign-in to these images at runtime, the sample meta-user-data.iso image must also be built and installed in your VM's CD drive. The cloud-init service will detect the ISO and provision a user account and password or SSH Key.
Before you can build the meta-user-data.iso image you will need to customize the user-data configuration file. From the toolkit folder, the file can be found in ./resources/assets/meta-user-data/user-data. Using an editor set a username and password or SSH Key. After applying your edits generate the meta-user-data.iso file as follows:
# Build the cloud-init configuration image
# The output image is ../out/images/meta-user-data.iso
sudo make -j20 meta-user-data
See Use Hyper-V to Boot Your Offline Image for instructions on using Hyper-V to boot the image and add a user profile with the meta-user-data.iso
file.