keks411 / linux-images-azure

Packer on Azure Pipelines for fresh Azure images of Arch and Kali Linux

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Linux Azure Images

This project uses Azure Pipelines to create brand new image VHDs for Azure from ISOs through Packer. All image creation and deployment automation code is provided by the project.

Overview

Why?

Microsoft and Azure Marketplace publishers only provide a few Linux images for Azure. There are no Arch Linux images and the Kali image is severely outdated

Why Azure?

Azure is a large cloud provider with first-class Linux support. While there are cheaper options for hobbyists, many developers and IT staff receive monthly Azure credits through MSDN for testing and development.

Why Packer?

There are more efficient methods to create Linux images - or even to change a regular Azure Ubuntu VM into Arch or Kali. The Packer-from-ISO method was chosen for fun and educational purposes.

Where are the images?

This project does NOT provide VM images to the general public. Never use OS images from untrusted publishers.

Automation Process

  1. Azure Pipelines triggers a build when I update the ISO version information in GitHub.
  2. It first checks if the specified version already exists in my Shared Image Gallery. If it exists, the process ends.
  3. If not, HashiCorp Packer downloads and installs the OS ISO in a QEMU VM.
  4. The VM image is converted to VHD format for Azure and uploaded to my Blob Storage.
  5. This image is tagged and replicated to specified regions in my Shared Image Gallery for easy deployment.

Notes

  • The VMs are pretty much standard installations with the addition of Cloud-Init and Microsoft Azure Linux Agent
  • The Azure Pipelines build agents use Ubuntu 20.04 images in an VM Scale Set
  • The build VMs need a size that supports KVM for QEMU during the installation process with Packer. I use Azure's D4s_v3
  • The Packer and setup Shell scripts do not rely on Azure Pipelines and can be used on other platforms, or locally

To Do

  • Migrate to UEFI-based boot and Azure Gen2 VMs
    • Installing Debian on UEFI does not seem to support Preseed files.
  • Implement full disk encryption for VMs with dm-crypt
  • Auto-create swap with cloud-init on Kali VM. It works by default on Arch

About

Packer on Azure Pipelines for fresh Azure images of Arch and Kali Linux

License:MIT License


Languages

Language:Shell 67.0%Language:HCL 33.0%