{"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/526360e320da9d1b36074be5ed64fe76e5bbfbbd/open-computer/cli/src/config.ts#L61-L97","documentation":"Thrown only on Windows by resolveEfiCode() when neither <QEMU_DIST>/share/qemu/<EFI_FIRMWARE_FILE> nor <QEMU_DIST>/share/<EFI_FIRMWARE_FILE> exists. The file is the EDK2/OVMF 'code' firmware (edk2-x86_64-code.fd or edk2-aarch64-code.fd) that QEMU uses as the read-only pflash for UEFI boot. On Linux/macOS the function returns a best-effort system path without checking. Without this file the VM cannot UEFI-boot.","triggerScenarios":"The QEMU distribution is missing the edk2 firmware (incomplete archive, custom minimal QEMU build, antivirus quarantine of .fd files), or QEMU_DIST points at the wrong directory.","commonSituations":"User installed a stripped-down QEMU build that omits EDK2; the .fd file was deleted by cleanup tooling; ARCH is aarch64 but only the x86_64 firmware shipped; QEMU_DIST env var pointing at a bin-only folder without share/.","solutions":["Download the full EDK2 firmware set into <QEMU_DIST>/share/qemu/ (edk2-x86_64-code.fd or edk2-aarch64-code.fd matching GUEST_ARCH).","Point OPEN_COMPUTER_QEMU_DIR at a complete QEMU installation that includes share/qemu/.","Verify the file is not blocked/quarantined by antivirus.","Confirm GUEST_ARCH vs firmware filename alignment (x86_64 guest needs edk2-x86_64-code.fd)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Verify the EDK2 code firmware exists before launching the VM.\nconst fs = require('fs'), path = require('path');\nfunction efiCodePresent(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(resolveEfiCode());\n} catch (e) {\n  if (/EFI firmware not found/.test(e.message)) {\n    console.error('Install EDK2 firmware into QEMU share/qemu/.');\n    process.exit(2);\n  }\n  throw e;\n}","preventionTips":["Use a complete QEMU distribution that ships EDK2 firmware.","Keep the firmware filename aligned with GUEST_ARCH (edk2-x86_64-code.fd vs edk2-aarch64-code.fd).","Set OPEN_COMPUTER_QEMU_DIR to a full installation to avoid partial-share-dir issues."],"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"}