Mintplex-Labs/anything-llm · critical · Error

EFI firmware not found: ${EFI_FIRMWARE_FILE} Searched in: ${

Error message

EFI firmware not found: ${EFI_FIRMWARE_FILE}
Searched in: ${QEMU_DIST || '(no QEMU_DIST set)'}
Set OPEN_COMPUTER_QEMU_DIR to your QEMU installation directory.

What it means

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.

Source

Thrown at open-computer/cli/src/config.ts:79

  // Fall back to system PATH
  return binaryName;
}

// EFI firmware — filename depends on the guest architecture
const EFI_FIRMWARE_FILE =
  GUEST_ARCH === 'x86_64' ? 'edk2-x86_64-code.fd' : 'edk2-aarch64-code.fd';

export function resolveEfiCode(): string {
  if (QEMU_DIST) {
    for (const cand of [
      path.join(QEMU_DIST, 'share', 'qemu', EFI_FIRMWARE_FILE),
      path.join(QEMU_DIST, 'share', EFI_FIRMWARE_FILE),
    ]) {
      if (fs.existsSync(cand)) return cand;
    }
  }
  if (PLATFORM === 'win32') {
    throw new Error(
      `EFI firmware not found: ${EFI_FIRMWARE_FILE}\n` +
      `Searched in: ${QEMU_DIST || '(no QEMU_DIST set)'}\n` +
      `Set OPEN_COMPUTER_QEMU_DIR to your QEMU installation directory.`,
    );
  }
  const shareDir = PLATFORM === 'linux' ? '/usr/share/qemu' : '/opt/homebrew/share/qemu';
  return `${shareDir}/${EFI_FIRMWARE_FILE}`;
}

// EFI variable store template (the writable pflash). This MUST be the VARS file,
// not the CODE firmware: copying CODE into the vars slot leaves OVMF without a
// variable store, so it never POSTs and the display stays blank.
export function efiVarsFileName(guestArch: 'aarch64' | 'x86_64' = GUEST_ARCH): string {
  return guestArch === 'x86_64' ? 'edk2-i386-vars.fd' : 'edk2-arm-vars.fd';
}

export function resolveEfiVars(): string {
  const file = efiVarsFileName();

View on GitHub (pinned to 526360e320)

Solutions

  1. Download the full EDK2 firmware set into <QEMU_DIST>/share/qemu/ (edk2-x86_64-code.fd or edk2-aarch64-code.fd matching GUEST_ARCH).
  2. Point OPEN_COMPUTER_QEMU_DIR at a complete QEMU installation that includes share/qemu/.
  3. Verify the file is not blocked/quarantined by antivirus.
  4. Confirm GUEST_ARCH vs firmware filename alignment (x86_64 guest needs edk2-x86_64-code.fd).
Defensive patterns

Strategy: validation

Validate before calling

// Verify the EDK2 code firmware exists before launching the VM.
const fs = require('fs'), path = require('path');
function efiCodePresent(qemuDist, file) {
  return fs.existsSync(path.join(qemuDist, 'share', 'qemu', file))
      || fs.existsSync(path.join(qemuDist, 'share', file));
}

Try / catch

try {
  launchVm(resolveEfiCode());
} catch (e) {
  if (/EFI firmware not found/.test(e.message)) {
    console.error('Install EDK2 firmware into QEMU share/qemu/.');
    process.exit(2);
  }
  throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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/.

Related errors


AI-assisted analysis of Mintplex-Labs/anything-llm@526360e320 (2026-08-13). Data as JSON: /api/errors/203c87bb4831c882. Report an issue: GitHub.