{"record":{"id":"203c87bb4831c882","repo":"Mintplex-Labs/anything-llm","slug":"efi-firmware-not-found-efi-firmware-file-searc","errorCode":null,"errorMessage":"EFI firmware not found: ${EFI_FIRMWARE_FILE}\nSearched in: ${QEMU_DIST || '(no QEMU_DIST set)'}\nSet OPEN_COMPUTER_QEMU_DIR to your QEMU installation directory.","messagePattern":"EFI firmware 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":79,"sourceCode":"  // Fall back to system PATH\n  return binaryName;\n}\n\n// EFI firmware — filename depends on the guest architecture\nconst EFI_FIRMWARE_FILE =\n  GUEST_ARCH === 'x86_64' ? 'edk2-x86_64-code.fd' : 'edk2-aarch64-code.fd';\n\nexport function resolveEfiCode(): string {\n  if (QEMU_DIST) {\n    for (const cand of [\n      path.join(QEMU_DIST, 'share', 'qemu', EFI_FIRMWARE_FILE),\n      path.join(QEMU_DIST, 'share', EFI_FIRMWARE_FILE),\n    ]) {\n      if (fs.existsSync(cand)) return cand;\n    }\n  }\n  if (PLATFORM === 'win32') {\n    throw new Error(\n      `EFI firmware not found: ${EFI_FIRMWARE_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}/${EFI_FIRMWARE_FILE}`;\n}\n\n// EFI variable store template (the writable pflash). This MUST be the VARS file,\n// 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();","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/open-computer/cli/src/config.ts#L61-L97","documentation":"Thrown by resolveEfiCode() in the open-computer CLI when, on Windows only, the EDK2/OVMF code firmware (edk2-x86_64-code.fd or edk2-aarch64-code.fd depending on GUEST_ARCH) cannot be found under ${QEMU_DIST}/share/qemu/ or ${QEMU_DIST}/share/. QEMU_DIST comes from the OPEN_COMPUTER_QEMU_DIR env var, falling back to the bundled master/qemu/win-x64|win-arm64 folder. Without this pflash image the UEFI VM cannot boot, so the CLI aborts startup. On Linux/macOS the function instead returns /usr/share/qemu/... or /opt/homebrew/share/qemu/... without checking existence, so this error is Windows-specific.","triggerScenarios":"Running the open-computer CLI on Windows when the extracted QEMU archive is misnamed (e.g. 'qemu-win-x64' instead of 'win-x64') or nested one level too deep, so QEMU_DIST points at a folder without share/edk2-*-code.fd; or OPEN_COMPUTER_QEMU_DIR is set to a QEMU install (e.g. a minimal/choco build) that does not ship EDK2 firmware; or the vars/firmware files were moved out of share/.","commonSituations":"Fresh Windows setup where the QEMU zip was extracted with an extra folder level; pointing OPEN_COMPUTER_QEMU_DIR at qemu-system binaries installed via a package manager that splits firmware into a separate edk2 package; a partial download/copy of the master/qemu bundle that includes bin/ but omits share/.","solutions":["Set OPEN_COMPUTER_QEMU_DIR to the QEMU installation directory that contains share/qemu/edk2-x86_64-code.fd (or share/edk2-... on the bundled build), e.g. set OPEN_COMPUTER_QEMU_DIR=C:\\qemu","If using the bundled dist, rename the extracted folder to exactly win-x64 or win-arm64 under open-computer/master/qemu/ (no 'qemu-' prefix, no nested subfolder)","Copy the edk2 .fd files into ${QEMU_DIST}/share/qemu/ (or ${QEMU_DIST}/share/) from any EDK2/OVMF distribution matching your guest arch","Install a full QEMU Windows build (qemu.weilnetz.de installer includes share/qemu firmware) and point OPEN_COMPUTER_QEMU_DIR at it"],"exampleFix":"# before: QEMU extracted as open-computer/master/qemu/qemu-win-x64/ (wrong name) -> throw\n# after: rename so the resolver finds share/edk2-x86_64-code.fd\nmv open-computer/master/qemu/qemu-win-x64 open-computer/master/qemu/win-x64\n# or point at any full QEMU install:\nexport OPEN_COMPUTER_QEMU_DIR=\"/c/QEMU\"   # must contain share/qemu/edk2-x86_64-code.fd","handlingStrategy":"validation","validationCode":"const fs = require('fs');\nconst path = require('path');\nfunction efiCodeExists(qemuDir, arch) {\n  const file = arch === 'x86_64' ? 'edk2-x86_64-code.fd' : 'edk2-aarch64-code.fd';\n  return [path.join(qemuDir, 'share', 'qemu', file), path.join(qemuDir, 'share', file)]\n    .some((p) => fs.existsSync(p));\n}\n// before spawning the VM:\nif (process.platform === 'win32' && !efiCodeExists(process.env.OPEN_COMPUTER_QEMU_DIR || defaultDir, 'x86_64')) {\n  console.error('Set OPEN_COMPUTER_QEMU_DIR to a QEMU install containing share/qemu/edk2-*-code.fd');\n}","typeGuard":null,"tryCatchPattern":"try { vm.start({ efiCode: resolveEfiCode() }); } catch (e) { if (/EFI firmware not found/.test(e.message)) { /* fix OPEN_COMPUTER_QEMU_DIR / bundle, then restart — do not retry unchanged */ } else throw e; }","preventionTips":["Pin OPEN_COMPUTER_QEMU_DIR in your environment/setup script to a known-complete QEMU install instead of relying on the bundled folder layout","After extracting the QEMU archive, verify share/qemu/edk2-*-code.fd exists before first run","On Linux/macOS remember resolveEfiCode does NOT check existence — install qemu-system + ovmf/edk2 packages or the boot fails later with a confusing QEMU error"],"tags":["qemu","efi","edk2","firmware","windows","path-resolution","open-computer"],"backgroundTag":"missing-firmware-file","analyzedSha":"3aec848f2885144aa8f1e53b9731a04310d5d558","analyzedAt":"2026-08-18T10:02:21.017Z","contentChangedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}