{"record":{"id":"b73c5816b104e52d","repo":"Mintplex-Labs/anything-llm","slug":"qemu-directory-not-found-dir-contents-of-par","errorCode":null,"errorMessage":"QEMU directory not found: ${dir}\nContents of ${parent}: ${contents}\nMake sure the QEMU archive is extracted so that the folder is named \"${variant}\" (not \"qemu-${variant}\" or a nested subfolder). You can also set OPEN_COMPUTER_QEMU_DIR to point to your QEMU installation.","messagePattern":"QEMU directory not found: (.+?)\nContents of (.+?): (.+?)\nMake sure the QEMU archive is extracted so that the folder is named \"(.+?)\" \\(not \"qemu-(.+?)\" or a nested subfolder\\)\\. You can also set OPEN_COMPUTER_QEMU_DIR to point to your QEMU installation\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"open-computer/cli/src/config.ts","lineNumber":35,"sourceCode":"// On Windows x64      the guest is x86_64  (WHPX + amd64 Debian).\n// On Windows arm64    the guest is aarch64 (WHPX + ARM64 Debian).\nexport const GUEST_ARCH: 'aarch64' | 'x86_64' = ARCH === 'x64' ? 'x86_64' : 'aarch64';\n\nexport const QEMU_BINARY =\n  GUEST_ARCH === 'aarch64' ? 'qemu-system-aarch64' : 'qemu-system-x86_64';\n\nfunction defaultQemuDir(): string {\n  if (PLATFORM === 'darwin') {\n    const darwinVariant = ARCH === 'x64' ? 'darwin-x64' : 'darwin-arm64';\n    return path.join(OPEN_COMPUTER_DIR, 'master', 'qemu', darwinVariant);\n  }\n  if (PLATFORM === 'win32') {\n    const variant = ARCH === 'x64' ? 'win-x64' : 'win-arm64';\n    const dir = path.join(OPEN_COMPUTER_DIR, 'master', 'qemu', variant);\n    if (!fs.existsSync(dir)) {\n      const parent = path.join(OPEN_COMPUTER_DIR, 'master', 'qemu');\n      const contents = fs.existsSync(parent) ? fs.readdirSync(parent).join(', ') : '(directory missing)';\n      throw new Error(\n        `QEMU directory not found: ${dir}\\n` +\n        `Contents of ${parent}: ${contents}\\n` +\n        `Make sure the QEMU archive is extracted so that the folder is named \"${variant}\" ` +\n        `(not \"qemu-${variant}\" or a nested subfolder). ` +\n        `You can also set OPEN_COMPUTER_QEMU_DIR to point to your QEMU installation.`\n      );\n    }\n    return dir;\n  }\n  // Linux: assume system QEMU\n  return '';\n}\n\nexport const QEMU_DIST = process.env.OPEN_COMPUTER_QEMU_DIR ?? defaultQemuDir();\n\n// Full path to the QEMU binary (with .exe on Windows)\nexport function resolveQemuBinary(): string {\n  const binaryName = PLATFORM === 'win32' ? `${QEMU_BINARY}.exe` : QEMU_BINARY;","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/526360e320da9d1b36074be5ed64fe76e5bbfbbd/open-computer/cli/src/config.ts#L17-L53","documentation":"Thrown only on Windows by defaultQemuDir() when the expected QEMU distribution folder (<OPEN_COMPUTER_DIR>/master/qemu/<variant>) does not exist. The message is intentionally verbose: it dumps the parent directory's contents to help diagnose archive-extraction layout mistakes, and tells the user the exact expected folder name and the OPEN_COMPUTER_QEMU_DIR escape hatch. Linux returns '' (system QEMU); macOS does not pre-check.","triggerScenarios":"Running the open-computer CLI on Windows where the QEMU archive was extracted with a wrapper folder (e.g. qemu-win-x64/qemu-win-x64/...), extracted to the wrong location, or never downloaded at all.","commonSituations":"User extracted qemu-win-x64.zip and got a top-level 'qemu-win-x64' folder instead of 'win-x64' directly under master/qemu/; the master/qemu directory is missing entirely; the user is on Windows ARM64 but downloaded the x64 archive (variant mismatch).","solutions":["Re-extract the QEMU archive so the folder is named exactly win-x64 or win-arm64 directly under master/qemu/.","If the layout is correct but in a custom location, set OPEN_COMPUTER_QEMU_DIR to that absolute path.","Verify ARCH matches the downloaded archive (x64 vs arm64).","Use the parent-directory contents printed in the error to identify the wrapper folder, then move/rename it."],"exampleFix":"// before — archive extracted with wrapper folder\n// master/qemu/qemu-win-x64/bin/qemu-system-x86_64.exe\n\n// after — flatten so the variant folder is direct\n// master/qemu/win-x64/bin/qemu-system-x86_64.exe\n// or: set env var\n// OPEN_COMPUTER_QEMU_DIR=C:\\path\\to\\qemu-win-x64","handlingStrategy":"validation","validationCode":"// Pre-flight check on Windows before running the CLI.\nconst fs = require('fs'), path = require('path');\nfunction qemuDirOk(dir, variant) {\n  return fs.existsSync(path.join(dir, 'master', 'qemu', variant));\n}","typeGuard":null,"tryCatchPattern":"try {\n  runCli();\n} catch (e) {\n  if (/QEMU directory not found/.test(e.message)) {\n    console.error(e.message); // contains the parent-dir listing for diagnosis\n    process.exit(2);\n  }\n  throw e;\n}","preventionTips":["Always set OPEN_COMPUTER_QEMU_DIR if your QEMU install is non-standard.","After extracting the QEMU archive, verify the variant folder (win-x64/win-arm64) sits directly under master/qemu/.","Match the downloaded archive's arch to process.arch."],"tags":["cli","config","qemu","windows","filesystem","setup"],"backgroundTag":null,"analyzedSha":"526360e320da9d1b36074be5ed64fe76e5bbfbbd","analyzedAt":"2026-08-13T01:45:47.170Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}