Mintplex-Labs/anything-llm · critical · Error
EFI firmware not found
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 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.
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
Example fix
# before: QEMU extracted as open-computer/master/qemu/qemu-win-x64/ (wrong name) -> throw # after: rename so the resolver finds share/edk2-x86_64-code.fd mv open-computer/master/qemu/qemu-win-x64 open-computer/master/qemu/win-x64 # or point at any full QEMU install: export OPEN_COMPUTER_QEMU_DIR="/c/QEMU" # must contain share/qemu/edk2-x86_64-code.fd
Defensive patterns
Strategy: validation
Validate before calling
const fs = require('fs');
const path = require('path');
function efiCodeExists(qemuDir, arch) {
const file = arch === 'x86_64' ? 'edk2-x86_64-code.fd' : 'edk2-aarch64-code.fd';
return [path.join(qemuDir, 'share', 'qemu', file), path.join(qemuDir, 'share', file)]
.some((p) => fs.existsSync(p));
}
// before spawning the VM:
if (process.platform === 'win32' && !efiCodeExists(process.env.OPEN_COMPUTER_QEMU_DIR || defaultDir, 'x86_64')) {
console.error('Set OPEN_COMPUTER_QEMU_DIR to a QEMU install containing share/qemu/edk2-*-code.fd');
} Try / catch
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; } Prevention
- 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
When it happens
Trigger: 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/.
Common situations: 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/.
Related errors
- EFI vars template not found
- QEMU directory not found
- click requires coordinates
- Command aborted
- Command timed out after
AI-assisted analysis of Mintplex-Labs/anything-llm@3aec848f28 (2026-08-18).
Data as JSON: /api/errors/203c87bb4831c882.
Report an issue: GitHub.
Appendix: 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 3aec848f28)