qemu KVM kernel module no such file or directory

南楼画角 提交于 2020-01-01 09:03:08

问题


I am currently taking an operating systems class and I need to use qemu to run a small operating system that my professor provided. I am trying to use qemu within an ubuntu 12.04 virtual machine on virtualbox on my macbook air 5.2. I know the problems I am having probably have to do with nested virtualization but the specific error I get when I try to run qemu is:

Could not access the KVM kernel module: No such file or directory

failed to initialize KVM: no such file or directory Back to tcg accelerator.

qemu does start up the os but the window flickers quite a lot and I would like to fix the KVM problem if possible. I've done research but I can't find a solution I can understand or that works so any help would be greatly appreciated.

Also for the ubuntu virtual machine in virtualbox I have both Enable VT-x/AMD-V and Enable Nested Paging checked under Hardware Virtualization. I've also tried using

modprobe kvm-intel

and I get this error:

FATAL: Error inserting kvm_intel (/lib/modules.3.5.0-22-generic/kernel/arch/x86/kvm/kvm-intel.ko): Operation not permitted.


回答1:


Try with sudo modprobe kvm-intel.

In order to have the module automatically loaded at the startup of the virtual machine, do the following:

  1. Edit the corresponding file from the shell with sudo vim /etc/modules.conf
  2. Possibly enter your username password.
  3. Press the key G to go to the end of the document and then o to begin inserting.
  4. Write kvm-intel and press Enter, producing a new line.
  5. Press Esc to return to the Normal mode of vim. "--INSERT--" will disappear from the bottom.
  6. Save the file and exit vim by writing :wq.

You are done. Try to reboot and load the nested virtual machine.




回答2:


In my case, the virtualization was disabled.

So sudo modprobe kvm-intel kept giving me the following error

could not insert 'kvm_intel': Operation not supported

I just had to go in the BIOS and enable Virtualization.



来源:https://stackoverflow.com/questions/14542754/qemu-kvm-kernel-module-no-such-file-or-directory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!