{"record":{"id":"c2688b4c39d36c2f","repo":"lima-vm/lima","slug":"unexpected-architecture-q","errorCode":null,"errorMessage":"unexpected architecture: %#q","messagePattern":"unexpected architecture: %#q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/driver/qemu/qemu.go","lineNumber":1267,"sourceCode":"\tvar (\n\t\tstdout bytes.Buffer\n\t\tstderr bytes.Buffer\n\t)\n\tcmd := exec.CommandContext(ctx, qemuExe, \"--version\")\n\tcmd.Stdout = &stdout\n\tcmd.Stderr = &stderr\n\tif err := cmd.Run(); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to run %v: stdout=%#q, stderr=%#q\", cmd.Args, stdout.String(), stderr.String())\n\t}\n\n\treturn parseQemuVersion(stdout.String())\n}\n\nfunc getFirmware(qemuExe string, arch limatype.Arch) (string, error) {\n\tswitch arch {\n\tcase limatype.X8664, limatype.AARCH64, limatype.ARMV7L, limatype.RISCV64:\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"unexpected architecture: %#q\", arch)\n\t}\n\n\thomeDir, err := os.UserHomeDir()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tbinDir := filepath.Dir(qemuExe)                  // \"/usr/local/bin\"\n\tlocalDir := filepath.Dir(binDir)                 // \"/usr/local\"\n\tuserLocalDir := filepath.Join(homeDir, \".local\") // \"$HOME/.local\"\n\n\trelativePath := fmt.Sprintf(\"share/qemu/edk2-%s-code.fd\", qemuEdk2Arch(arch))\n\trelativePathWin := fmt.Sprintf(\"share/edk2-%s-code.fd\", qemuEdk2Arch(arch))\n\tcandidates := []string{\n\t\tfilepath.Join(userLocalDir, relativePath), // XDG-like\n\t\tfilepath.Join(localDir, relativePath),     // macOS (homebrew)\n\t\tfilepath.Join(binDir, relativePathWin),    // Windows installer\n\t}","sourceCodeStart":1249,"sourceCodeEnd":1285,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/pkg/driver/qemu/qemu.go#L1249-L1285","documentation":"getFirmware() selects an EDK2/BIOS firmware file for the QEMU VM based on the instance architecture. It only knows how to find firmware for x86_64, aarch64, armv7l, and riscv64. Any other arch value reaching it (e.g. s390x, ppc64le, or an unset/garbage value) causes this error.","triggerScenarios":"Calling Cmdline (or anything that resolves firmware) with a limatype.Arch that is not one of X8664, AARCH64, ARMV7L, RISCV64 — typically from a lima.yaml `arch:` field set to an unsupported value, or a corrupted/invalid arch string that survived validation.","commonSituations":"Typo in `arch:` in the YAML (e.g. `arch: x86`, `arch: aarch`); running on/for an architecture Lima's QEMU driver has no firmware mapping for; programmatically constructing an Instance with an unset arch.","solutions":["Set `arch` in the instance config to one of: x86_64, aarch64, armv7l, riscv64 (or remove the field to use the host default).","Check for typos: use exactly `x86_64` / `aarch64`, not `x86`, `arm64`, etc.","If you truly need another architecture, use a different driver/virtualization backend; the QEMU driver firmware lookup does not support it."],"exampleFix":"// before (lima.yaml)\narch: arm64\n// after\narch: aarch64","handlingStrategy":"validation","validationCode":"const supported = [\"x86_64\", \"aarch64\", \"armv7l\", \"riscv64\"]\nif !supported.Contains(cfg.Arch) {\n    return fmt.Errorf(\"arch %q unsupported by QEMU driver; must be one of %v\", cfg.Arch, supported)\n}","typeGuard":"func isSupportedArch(a limatype.Arch) bool {\n    switch a {\n    case limatype.X8664, limatype.AARCH64, limatype.ARMV7L, limatype.RISCV64:\n        return true\n    }\n    return false\n}","tryCatchPattern":null,"preventionTips":["Omit the `arch:` field in lima.yaml unless cross-arch — Lima defaults to the host arch.","Use exact arch strings: x86_64 (not x86, amd64, arm64) and aarch64.","Run `limactl validate <file>` before starting."],"tags":["qemu","firmware","architecture","config"],"backgroundTag":"unsupported-architecture","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}