lima-vm/lima · warning
%w: archVariant mismatch (expected %q, got %q)
Error message
%w: archVariant mismatch (expected %q, got %q)
What it means
Analogous to the variant mismatch, but for --arch-variant: each image whose ArchVariant field differs from the requested targetArchVariant is skipped with a fileutils.ErrSkipped "archVariant mismatch" error and collected in errs.
Source
Thrown at pkg/instance/start.go:127
if img.Arch == *inst.Config.Arch {
targetVariant = img.Variant
targetArchVariant = img.ArchVariant
targetVariantSet = true
break
}
}
if len(inst.Config.Images) == 0 {
return nil, errors.New("no images are configured (did you set --image-variant or --arch-variant to a value not present in the template?)")
}
errs := make([]error, len(inst.Config.Images))
for i, f := range inst.Config.Images {
if targetVariantSet && f.Variant != targetVariant {
errs[i] = fmt.Errorf("%w: variant mismatch (expected %q, got %q)", fileutils.ErrSkipped, targetVariant, f.Variant)
continue
}
if targetVariantSet && f.ArchVariant != targetArchVariant {
errs[i] = fmt.Errorf("%w: archVariant mismatch (expected %q, got %q)", fileutils.ErrSkipped, targetArchVariant, f.ArchVariant)
continue
}
if _, err := fileutils.DownloadFile(ctx, imagePath, f.File, true, "the image", *inst.Config.Arch, supportedImageFormats); err != nil {
errs[i] = err
continue
}
if f.Kernel != nil {
// ensure decompress kernel because vz expects it to be decompressed
if _, err := fileutils.DownloadFile(ctx, kernel, f.Kernel.File, true, "the kernel", *inst.Config.Arch, nil); err != nil {
errs[i] = err
continue
}
if f.Kernel.Cmdline != "" {
if err := os.WriteFile(kernelCmdline, []byte(f.Kernel.Cmdline), 0o644); err != nil {
errs[i] = err
continue
}
}View on GitHub (pinned to dd909d0973)
Solutions
- Check the template's images[].archVariant values and pass one that exists.
- Drop --arch-variant to accept the default image for your arch.
- Use an updated or alternative template that publishes the requested arch variant.
- Verify your host arch actually needs the variant you requested.
Example fix
// before limactl create template://ubuntu-24.04 --arch-variant=9 // after limactl create template://ubuntu-24.04 --arch-variant=8 # or omit the flag
Defensive patterns
Strategy: validation
Validate before calling
// confirm an image with the requested archVariant exists
var found bool
for _, img := range tmpl.Images {
if string(img.ArchVariant) == requestedArchVariant { found = true }
}
if !found { return fmt.Errorf("--arch-variant %q not offered by template", requestedArchVariant) } Prevention
- Check the template's images[].archVariant values (e.g. v8/v9 for arm64)
- Only set --arch-variant when you specifically need a CPU-level variant
- Update templates/images when hardware changes (e.g. new ARM servers)
- Fall back to omitting the flag on mismatch
When it happens
Trigger: `limactl create/start --arch-variant=<v>` (e.g. v8 vs v9 for arm64) where the template's images declare a different ArchVariant, or the field is unset while you request one.
Common situations: Requesting arm64 v9 images on templates that only publish v8 (or vice versa) on Apple Silicon / ARM servers; CI scripts pinning an arch-variant removed in a newer template.
Related errors
- no images are configured (did you set --image-variant or --a
- %w: variant mismatch (expected %q, got %q)
- field `images` must be set
- images[%d].kernel has unexpected architecture %#q, must be %
- images[%d].initrd has unexpected architecture %#q, must be %
AI-assisted analysis of lima-vm/lima@dd909d0973 (2026-09-01).
Data as JSON: /api/errors/9cd65b505242429d.
Report an issue: GitHub.