我正在关注麻省理工学院操作系统工程讲座。我已经安装了 Qemu 并成功运行了它,我可以在该文件夹“make clean”“make”和“make qemu”中使用这些命令。 还有一个单独的实验室文件夹...根据说明,我们必须在实验室文件夹中使用“make”命令,但是当我在实验室文件夹中使用 make 命令时 我收到以下错误
*** 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 conf/env.mk?
***
***
*** 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 conf/env.mk?
***
+ as kern/entry.S
+ cc kern/entrypgdir.c
+ cc kern/init.c
+ cc kern/console.c
+ cc kern/monitor.c
+ cc kern/printf.c
+ cc kern/kdebug.c
+ cc lib/printfmt.c
+ cc lib/readline.c
+ cc lib/string.c
+ ld obj/kern/kernel
+ as boot/boot.S
+ cc -Os boot/main.c
+ ld boot/boot
boot block is 390 bytes (max 510)
+ mk obj/kern/kernel.img
我在某处读到,我应该在 conf/env.mk 文件中设置路径,我已经找到了 conf/env.mk 文件,但我不确定如何设置 PATH。 conf/env.mk 文件内容如下:
# env.mk - configuration variables for the JOS lab
# '$(V)' controls whether the lab makefiles print verbose commands (the
# actual shell commands run by Make), as well as the "overview" commands
# (such as '+ cc lib/readline.c').
#
# For overview commands only, the line should read 'V = @'.
# For overview and verbose commands, the line should read 'V ='.
V = @
# If your system-standard GNU toolchain is ELF-compatible, then comment
# out the following line to use those tools (as opposed to the i386-jos-elf
# tools that the 6.828 make system looks for by default).
#
# GCCPREFIX=''
# If the makefile cannot find your QEMU binary, uncomment the
# following line and set it to the full path to QEMU.
#
# QEMU=
我使用的是ubuntu 16.04 预先感谢!!
要运行具有超过 2 GB RAM 的客户机,您必须拥有 64 位主机系统。
在继续安装之前,请确保您的 Ubuntu 主机支持 KVM 虚拟化。系统应配备具有 VT-x (vmx) 的 Intel 处理器,或具有 AMD-V (svm) 技术支持的 AMD 处理器。
运行以下 grep 命令来验证您的处理器是否支持硬件虚拟化:
grep -Eoc '(vmx|svm)' /proc/cpuinfo
如果CPU支持硬件虚拟化,该命令将输出一个大于零的数字,即CPU核心数。否则,如果输出为0,则表示CPU不支持硬件虚拟化。
运行以下命令安装 KVM 和其他虚拟化管理包:
sudo apt install qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils virtinst virt-manager
安装软件包后,libvirt 守护进程将自动启动。您可以通过输入来验证:
sudo systemctl is-active libvirtd
输出:主动
为了能够创建和管理虚拟机,您需要将用户添加到“libvirt”和“kvm”组。为此,请输入:
sudo usermod -aG libvirt $USER
sudo usermod -aG kvm $USER
1 - 打开终端并找到 qemu 路径。 $ which qemu-system-x86_64 (复制路径)
2- 转到 lab 文件夹并打开 conf/env.mk 打开文件进行编辑。 3-转到第 20 行并删除 # 并粘贴您复制的路径。 它应该看起来像这样。 QEMU=你的路径
4-保存文件并完成。