You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu下运行xv6执行make qemu-nox找不到QEMU执行文件报错求解

报错根因

*** Error: Couldn't find a working QEMU executable.
*** Is the directory containing the qemu binary in your PATH
*** or have you tried setting the QEMU variable in Makefile?


nographic -drive file=fs.img,index=1,media=disk,format=raw -drive file=xv6.img,index=0,media=disk,format=raw -smp 2 -m 512
make: nographic: Command not found
make: [Makefile:231: qemu-nox] Error 127 (ignored)

上述报错本质是两个关联问题:

  1. Ubuntu默认安装的qemu元包不包含x86架构的系统模拟器,xv6运行依赖的qemu-system-i386/qemu-system-x86_64二进制不存在
  2. Makefile找不到QEMU可执行文件后,命令拼接逻辑断裂,把参数nographic识别为了独立命令执行,触发127错误码
解决步骤
  • 安装完整的x86架构QEMU组件
    执行命令:
    sudo apt install qemu-system-x86
    
  • 配置QEMU路径(二选一即可)
    方案1:修改Makefile永久生效
    进入xv6-public目录,打开Makefile找到QEMU变量定义行,将默认的
    QEMU = qemu
    
    修改为:
    QEMU = qemu-system-x86_64
    
    方案2:运行时临时指定变量,无需修改文件
    执行运行命令时直接传入QEMU参数:
    make QEMU=qemu-system-x86_64 qemu-nox
    
  • 重新编译运行(如果使用方案1需要执行)
    先清理旧编译缓存:
    make clean
    
    再重新编译启动:
    make
    make qemu-nox
    
生效验证

启动成功后会进入xv6的命令行界面,输入ls可列出xv6内置的工具列表即代表配置正常。

内容的提问来源于stack exchange,提问作者Gopi Sai

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.06 19:45:03