{"record":{"id":"ebcae030d574919c","repo":"Mintplex-Labs/anything-llm","slug":"efi-vars-template-not-found-file-searched-in","errorCode":null,"errorMessage":"EFI vars template not found: ${file}\nSearched in: ${QEMU_DIST || '(no QEMU_DIST set)'}\nSet OPEN_COMPUTER_QEMU_DIR to your QEMU installation directory.","messagePattern":"EFI vars template not found: (.+?)\nSearched in: (.+?)\nSet OPEN_COMPUTER_QEMU_DIR to your QEMU installation directory\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"open-computer/cli/src/config.ts","lineNumber":108,"sourceCode":"// not the CODE firmware: copying CODE into the vars slot leaves OVMF without a\n// variable store, so it never POSTs and the display stays blank.\nexport function efiVarsFileName(guestArch: 'aarch64' | 'x86_64' = GUEST_ARCH): string {\n  return guestArch === 'x86_64' ? 'edk2-i386-vars.fd' : 'edk2-arm-vars.fd';\n}\n\nexport function resolveEfiVars(): string {\n  const file = efiVarsFileName();\n  if (QEMU_DIST) {\n    // The bundled Windows build ships the vars template in share/ (not share/qemu/).\n    for (const cand of [\n      path.join(QEMU_DIST, 'share', 'qemu', file),\n      path.join(QEMU_DIST, 'share', file),\n    ]) {\n      if (fs.existsSync(cand)) return cand;\n    }\n  }\n  if (PLATFORM === 'win32') {\n    throw new Error(\n      `EFI vars template not found: ${file}\\n` +\n      `Searched in: ${QEMU_DIST || '(no QEMU_DIST set)'}\\n` +\n      `Set OPEN_COMPUTER_QEMU_DIR to your QEMU installation directory.`,\n    );\n  }\n  const shareDir = PLATFORM === 'linux' ? '/usr/share/qemu' : '/opt/homebrew/share/qemu';\n  return `${shareDir}/${file}`;\n}\n\n// Full path to the qemu-img binary\nexport function resolveQemuImgBinary(): string {\n  const binaryName = PLATFORM === 'win32' ? 'qemu-img.exe' : 'qemu-img';\n  if (QEMU_DIST) {\n    const bundled = path.join(QEMU_DIST, 'bin', binaryName);\n    if (fs.existsSync(bundled)) return bundled;\n    const direct = path.join(QEMU_DIST, binaryName);\n    if (fs.existsSync(direct)) return direct;\n  }","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/526360e320da9d1b36074be5ed64fe76e5bbfbbd/open-computer/cli/src/config.ts#L90-L126","documentation":"Thrown only on Windows by resolveEfiVars() when the EDK2 'vars' template file (edk2-i386-vars.fd for x86_64, edk2-arm-vars.fd for aarch64) is not found in either <QEMU_DIST>/share/qemu/ or <QEMU_DIST>/share/. This file is copied to become the writable pflash variable store; the code comment explicitly warns that substituting the CODE firmware here breaks UEFI (no variable store → no POST).","triggerScenarios":"The QEMU distribution ships the CODE firmware but not the VARS template (common with minimal builds), the VARS file was renamed, or QEMU_DIST is misconfigured.","commonSituations":"User copied edk2-x86_64-code.fd into the vars slot to 'fix' a missing-vars error and now the VM hangs at POST with a blank display; QEMU build only packaged the code firmware; aarch64 install missing edk2-arm-vars.fd.","solutions":["Obtain the matching VARS template (edk2-i386-vars.fd or edk2-arm-vars.fd) and place it in <QEMU_DIST>/share/qemu/.","Do NOT substitute the CODE firmware as a vars file — that produces a blank-display POST failure.","Use a complete QEMU+EDK2 distribution by setting OPEN_COMPUTER_QEMU_DIR correctly.","Verify guestArch aligns with the vars filename (i386-vars for x86_64, arm-vars for aarch64)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Verify the EDK2 vars template exists before launching.\nconst fs = require('fs'), path = require('path');\nfunction efiVarsPresent(qemuDist, file) {\n  return fs.existsSync(path.join(qemuDist, 'share', 'qemu', file))\n      || fs.existsSync(path.join(qemuDist, 'share', file));\n}","typeGuard":null,"tryCatchPattern":"try {\n  launchVm(resolveEfiVars());\n} catch (e) {\n  if (/EFI vars template not found/.test(e.message)) {\n    console.error('Install EDK2 vars template — do NOT substitute the code firmware.');\n    process.exit(2);\n  }\n  throw e;\n}","preventionTips":["Never copy the CODE firmware into the vars slot — it produces a blank-display POST failure.","Use a complete EDK2 set matching guestArch (i386-vars for x86_64, arm-vars for aarch64).","Set OPEN_COMPUTER_QEMU_DIR to a full QEMU+EDK2 installation."],"tags":["cli","config","qemu","windows","uefi","edk2","filesystem"],"backgroundTag":null,"analyzedSha":"526360e320da9d1b36074be5ed64fe76e5bbfbbd","analyzedAt":"2026-08-13T01:45:47.170Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}