lima-vm/lima · error

unsupported arch: %#q

Error message

unsupported arch: %#q

What it means

The VZ driver can only emulate the host's native CPU architecture (Virtualization.framework provides no binary translation). validateConfig rejects any configured `arch` that is not the native architecture of the Mac (`limatype.IsNativeArch`). The `%#q` verb prints the offending arch value back to the user.

Source

Thrown at pkg/driver/vz/vz_driver_darwin.go:301

		return errors.New("currently Windows guest OS is only supported on QEMU")
	}
	if *cfg.Firmware.LegacyBIOS {
		logrus.Warnf("vmType %s: ignoring `firmware.legacyBIOS`", *cfg.VMType)
	}
	for _, f := range cfg.Firmware.Images {
		switch f.VMType {
		case "", limatype.VZ:
			if f.Arch == *cfg.Arch {
				return errors.New("`firmware.images` configuration is not supported for VZ driver")
			}
		}
	}
	if unknown := reflectutil.UnknownNonEmptyFields(cfg, knownYamlProperties...); cfg.VMType != nil && len(unknown) > 0 {
		logrus.Warnf("vmType %s: ignoring %+v", *cfg.VMType, unknown)
	}

	if !limatype.IsNativeArch(*cfg.Arch) {
		return fmt.Errorf("unsupported arch: %#q", *cfg.Arch)
	}

	for i, image := range cfg.Images {
		if unknown := reflectutil.UnknownNonEmptyFields(image, "File", "Kernel", "Initrd", "Variant", "ArchVariant"); len(unknown) > 0 {
			logrus.Warnf("vmType %s: ignoring images[%d]: %+v", *cfg.VMType, i, unknown)
		}
	}

	for i, mount := range cfg.Mounts {
		if unknown := reflectutil.UnknownNonEmptyFields(mount, "Location",
			"MountPoint",
			"Writable",
			"SSHFS",
			"NineP",
		); len(unknown) > 0 {
			logrus.Warnf("vmType %s: ignoring mounts[%d]: %+v", *cfg.VMType, i, unknown)
		}
	}

View on GitHub (pinned to dd909d0973)

Solutions

  1. Remove the explicit `arch` field so it defaults to the native architecture
  2. Set `arch` to the native arch (aarch64 on Apple Silicon, amd64 on Intel)
  3. Use vmType 'qemu' if a non-native arch is truly required

Example fix

# before (on Apple Silicon)
arch: amd64
vmType: vz
# after
arch: aarch64
vmType: vz
Defensive patterns

Strategy: validation

Validate before calling

var cfg LimaYAML
_ = yaml.Unmarshal(data, &cfg)
if cfg.Arch != nil && cfg.Arch != runtime.GOARCH {
    // remove arch or switch vmType to qemu before starting
}

Type guard

func isNativeArch(arch string) bool {
    return arch == "" || arch == runtime.GOARCH
}

Prevention

When it happens

Trigger: Setting `arch: amd64` on an Apple Silicon Mac, or `arch: aarch64` on an Intel Mac, then starting or validating a vmType 'vz' instance.

Common situations: Copying a template authored for a different machine; explicitly pinning arch in lima.yaml copied from a CI config for the other CPU; confusion after switching between Intel and Apple Silicon hardware.

Related errors


AI-assisted analysis of lima-vm/lima@dd909d0973 (2026-09-01). Data as JSON: /api/errors/7bf23684597e90e6. Report an issue: GitHub.