在我已经虚拟化的主机中,尝试传递选项 -enable-kvm -m 1024 将失败:
qemu-system-x86_64 -vga std -enable-kvm -m 1024 -monitor telnet:localhost:9313,server,nowait -drive file=my_img.img,cache=none
# Could not access KVM kernel module: No such file or directory
# failed to initialize KVM: No such file or directory
如果我删除该选项 -enable-kvm -m 1024 ,qemu将加载(但它将需要永远,因为它使用软件模拟):
qemu-system-x86_64 -vga std -monitor telnet:localhost:9313,server,nowait -drive file=my_img.img,cache=none
# qemu running, OK, but image taking forever to load.
当然,我的这个虚拟化主机具有嵌套自己的虚拟化的能力 . 无处不在,我找到有关它的信息[像这里:https://docs.openstack.org/developer/devstack/guides/devstack-with-nested-kvm.html]告诉我,我必须检查文件 /sys/module/kvm_intel/parameters/nested 这根本不可用,因为 kvm-intel isn 't and can' t从图像内部加载:
sudo modprobe kvm-intel
# modprobe: ERROR: could not insert 'kvm_intel': Operation not supported
调试嵌套虚拟化的方法可能仅适用于裸机 . So, how do I enable (forward the support of) kvm from inside a kvm?
附加信息:
lscpu # from inside the virtualized host
# Architecture: x86_64
# ...
# Vendor ID: GenuineIntel
# CPU family: 6
# Model: 13
# Model name: QEMU Virtual CPU version (cpu64-rhel6)
# Stepping: 3
# ...
# Hypervisor vendor: KVM
qemu ltrace :
# open64("/dev/kvm", 524290, 00) = -1
# __errno_location() = 0x7f958673c730
# __fprintf_chk(0x7f957fd81060, 1, 0x7f9586474ce0, 0Could not access KVM kernel module: No such file or directory