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, setting up a test user via cloud-init for access. SSH is forwarded to the host on the specified port (default 8888).
The image can be specified either by name (positional argument) which will look up the built image in the output directory, or by explicit path using --image-path.
Requirements:
- qemu-system-x86_64/qemu-system-aarch64 (QEMU emulator)
- genisoimage (for creating cloud-init 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
--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)
-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)
--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