简体   繁体   English

QEMU和KVM问题

[英]QEMU AND KVM PROBLEMS

I tried to install qemu, but I should install the kvm first, and I have checked that my cpu supports virtualization, so I don't know why. 我尝试安装qemu,但我应该先安装kvm,并检查我的cpu是否支持虚拟化,所以我不知道为什么。 Here is the error, when I input kvm. 当我输入kvm时,这是错误。

open /dev/kvm: No such file or directory
Could not initialize KVM, will disable KVM support

And a new window for qemu comes out, but the boot failed....could not read the boot disk, could not read from CDROM(code 0003) qemu的新窗口出来,但启动失败....无法读取启动盘,无法从CDROM读取(代码0003)

What can I do? 我能做什么?

First, check if your CPU support VMX or SVM having a look at /proc/cpuinfo. 首先,检查您的CPU是否支持VMX或SVM查看/ proc / cpuinfo。 If yes, you have to load the KVM kernel modules: 如果是,则必须加载KVM内核模块:

modprobe kvm-amd  #if you have AMD
modprobe kvm-intel  #if you have Intel

Then Qemu/Kvm command should start without complaining about /dev/kvm. 然后Qemu / Kvm命令应该在没有抱怨/ dev / kvm的情况下启动。 If you still have problems, may be virtualization is disabled in the BIOS. 如果仍有问题,可能是BIOS中禁用了虚拟化。 I had some machines that reportes virtualization support in the /proc/cpuinfo but it was disabled in the BIOS. 我有一些机器报告/ proc / cpuinfo中的虚拟化支持,但它在BIOS中被禁用。

Then to boot KVM from a ISO image: 然后从ISO映像启动KVM:

kvm -cdrom img.iso -hda disk.img -boot d

请尝试“dmesg | grep kvm”找到原因

Try to use this command sudo modprobe kvm-intel . 尝试使用此命令sudo modprobe kvm-intel You lacked privilege to insert KVM modules. 您没有插入KVM模块的权限。

The first things to check is that your CPU has virtualization extensions and that the extensions are enabled in the BIOS/EUFI menus. 首先要检查的是CPU是否具有虚拟化扩展,并且在BIOS / EUFI菜单中启用了扩展。 These extensions are required in order to run KVM. 这些扩展是运行KVM所必需的。 Pretty much all modern AMD 64bit cpus will have it. 几乎所有现代AMD 64位cpus都会拥有它。 Some older/lower-end Intel processes do not have it, but most will. 一些较旧/较低端的英特尔进程没有它,但大多数都会。

egrep -o 'vmx|svm' /proc/cpuinfo

'vmx' will show up for Intel. 'vmx'将出现在英特尔。 'svm' for AMD. AMD的'svm'。

If your cpu supports the extensions the next thing to check is your BIOS/EUFI settings. 如果你的cpu支持扩展,接下来要检查的是你的BIOS / EUFI设置。 Many times these extensions are disabled by default. 很多时候默认情况下会禁用这些扩展。 You will want to look for the 'chipset' or 'cpu' settings and it should mention something about 'virtualization'. 你会想要寻找'芯片组'或'cpu'设置,它应该提到一些关于'虚拟化'的东西。 Make sure that those settings are enabled. 确保已启用这些设置。

After that is done then you should have KVM modules inserted automatically after a reboot. 完成后,您应该在重新启动后自动插入KVM模块。 If they don't then try the 'modprobe kvm-amd' or 'modprobe kvm-intel' as suggested by Diego Woitasen. 如果没有,那么按照Diego Woitasen的建议尝试'modprobe kvm-amd'或'modprobe kvm-intel'。 Check the 'dmesg |grep kvm' output as well. 检查'dmesg | grep kvm'输出。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM