Boot an Azure Linux image in a QEMU VM
Boot an Azure Linux image in a QEMU virtual machine.
This command starts a QEMU VM with the specified disk image and/or bootable ISO. SSH is forwarded to the host on the specified port (default 8888). If cloud-init credentials are provided, a NoCloud seed ISO is generated and attached; the guest will consume it only if cloud-init is installed and enabled.
Image sources (at least one is required):
- IMAGE_NAME (positional): Look up a built image in the project output directory.
- '--image-path': Explicit path to a disk image (may also be combined with IMAGE_NAME to override the default location).
- '--iso': Bootable ISO (livecd, installer, rescue). May be combined with a disk image, or used alone to boot an empty disk.
When '--iso' is used without a disk image, an empty qcow2 disk is created (size set via '--disk-size') for the live/installer ISO to install onto. The VM console is serial-only (-nographic), so the ISO must support serial console interaction.
Requirements:
- qemu-system-x86_64/qemu-system-aarch64 (QEMU emulator)
- genisoimage (only when cloud-init credentials are provided)
- qemu-img (only when creating an empty disk for '--iso')
- sudo (for running QEMU with KVM)
- OVMF firmware (for UEFI boot)
azldev image boot [IMAGE_NAME] [flags]
# Boot an image by name
azldev image boot my-image --test-password-file ~/.azl-test-pw
# Boot from an explicit image path
azldev image boot --image-path ./out/my-image.qcow2 --test-password secret
# Boot with SSH on a custom port and extra memory
azldev image boot my-image --test-password-file ~/.azl-test-pw --ssh-port 2222 --memory 8G
# Boot from an ISO (livecd / installer) onto a new empty 20G disk
azldev image boot --iso ~/Downloads/azurelinux.iso --disk-size 20G
# Boot an existing disk image with a rescue ISO attached
azldev image boot --image-path ./out/my-image.qcow2 --iso ~/Downloads/rescue.iso
# Boot from a live ISO with cloud-init credentials (consumed if the live image
# has cloud-init installed; otherwise harmlessly ignored)
azldev image boot --iso ~/Downloads/livecd.iso --test-password secret
--arch arch Target architecture (x86_64, aarch64). Defaults to host arch.
--authorized-public-key string Path to public key authorized for SSH to test user account
--cpus int Number of CPU cores for the VM (default 8)
--disk-size string Size of the empty virtual disk created for ISO boot (e.g., 10G, 20G, 512M) (default "10G")
-f, --format format Image format to boot (raw, qcow2, vhdx, vhd). Auto-detected if not specified.
-h, --help help for boot
-i, --image-path string Path to the disk image file (overrides positional image name)
--iso string Path to an ISO file to boot from (livecd, installer, or rescue media)
--memory string Amount of memory for the VM (e.g., 4G, 8192M) (default "4G")
--rwdisk Allow writes to persist to the disk image
--secure-boot Enable secure boot for the VM
--ssh-port uint16 Host port to forward to guest SSH (port 22) (default 8888)
--test-password string Password for the test account (visible in process list; prefer --test-password-file)
--test-password-file string Path to file containing the password for the test account
--test-user string Name for the test account (default "test")
-y, --accept-all accept all prompts
--color mode output colorization mode {always, auto, never} (default auto)
--config-file stringArray additional TOML config file(s) to merge (may be repeated)
-n, --dry-run dry run only (do not take action)
--network-retries int maximum number of attempts for network operations (minimum 1) (default 3)
--no-default-config disable default configuration
-O, --output-format fmt output format {csv, json, markdown, table} (default table)
--permissive-config do not fail on unknown fields in TOML config files
-C, --project string path to Azure Linux project
-q, --quiet only enable minimal output
-v, --verbose enable verbose output
- azldev image - Manage Azure Linux images