How to configure libvirt, so qemu-kvm support nested virtualization, virtual machine installed operating system is windows_7_ultimate_sp1_x64_dvd_618537.iso, configure libvirt xml file is as follows: <cpu mode='custom' match='exact'> <model fallback='allow'>core2duo</model> <feature policy='require' name='vmx'/> </cpu> or <cpu mode='host-model'> <model fallback='allow'/> </cpu> or <cpu mode='host-passthrough'> <topology sockets='2' cores='2' threads='2'/> </cpu> We install libvirt in centos 7, qemu-kvm version is: [Root @ localhost libexec] # ./qemu-kvm --version QEMU emulator version 2.6.0 (qemu-kvm-ev-2.6.0-27.1.el7), Copyright (c) 2003-2008 Fabrice Bellard Above is the basic environment and libvirt configuration, but in this environment to install the internal implementation of the following windows7 virtual machine kernel interface calls are as follows: if (!FeatrueControlMsr.fields.enable_vmxon) { MyWriteFile(FileHanle, "Bios设置没有开启虚拟化\n", strlen("Bios设置没有开启虚拟化\n"), &ReturnLen); MyCloseFile(FileHanle); KdPrint(("Bios设置没有开启虚拟化")); return FALSE; } in conclusion: Through this kernel interface to determine the result is: Bios settings do not turn on virtualization How to solve this problem? Hope to get your help. thank you very much。
NB, in future please don't CC all possible mailing lists at once. Just pick the most appropriate mailing list for your question. I've dropped libvirt-list & libvirt-announce from the CC, since this is a question most suited for libvirt-users. On Thu, Jan 05, 2017 at 11:44:29AM +0800, 放牛班的春天 wrote:> How to configure libvirt, so qemu-kvm support nested virtualization, virtual machine installed operating system is windows_7_ultimate_sp1_x64_dvd_618537.iso, configure libvirt xml file is as follows: > > <cpu mode='custom' match='exact'> > <model fallback='allow'>core2duo</model> > <feature policy='require' name='vmx'/> > </cpu> > > > or > > <cpu mode='host-model'> > <model fallback='allow'/> > </cpu> > > or > <cpu mode='host-passthrough'> > <topology sockets='2' cores='2' threads='2'/> > </cpu>Yes, that's the key guest configuration step - exposing the 'vmx' feature to the guest. In addition to that though, you need to make sure the kvm-intel kernel module in your host has the "nested=1" parameter set. eg in /etc/modprobe.d/kvm.conf you want options kvm_intel nested=1 If loaded correctly you should see # cat /sys/module/kvm_intel/parameters/nested Y if it says "N", then nested VMX will be disabled. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://entangle-photo.org -o- http://search.cpan.org/~danberr/ :|
thanks your mail,now below: If the KVM supports nested VMX and QEMU starts with the arguments -enable-kvm and -cpu ..., + vmx, then the LOCK bit of the guest MSR_IA32_FEATURE_CONTROL and Enable VMX out of SMX operation bit will be set. Well, I should add -enable-kvm parameters of the document which xml position, the exact stresses, how Canada? ------------------ 原始邮件 ------------------ 发件人: "Daniel P. Berrange";<berrange@redhat.com>; 发送时间: 2017年1月5日(星期四) 晚上8:53 收件人: "放牛班的春天"<446844717@qq.com>; 抄送: "libvirt-users"<libvirt-users@redhat.com>; 主题: Re: [libvirt] xml config nested NB, in future please don't CC all possible mailing lists at once. Just pick the most appropriate mailing list for your question. I've dropped libvirt-list & libvirt-announce from the CC, since this is a question most suited for libvirt-users. On Thu, Jan 05, 2017 at 11:44:29AM +0800, 放牛班的春天 wrote:> How to configure libvirt, so qemu-kvm support nested virtualization, virtual machine installed operating system is windows_7_ultimate_sp1_x64_dvd_618537.iso, configure libvirt xml file is as follows: > > <cpu mode='custom' match='exact'> > <model fallback='allow'>core2duo</model> > <feature policy='require' name='vmx'/> > </cpu> > > > or > > <cpu mode='host-model'> > <model fallback='allow'/> > </cpu> > > or > <cpu mode='host-passthrough'> > <topology sockets='2' cores='2' threads='2'/> > </cpu>Yes, that's the key guest configuration step - exposing the 'vmx' feature to the guest. In addition to that though, you need to make sure the kvm-intel kernel module in your host has the "nested=1" parameter set. eg in /etc/modprobe.d/kvm.conf you want options kvm_intel nested=1 If loaded correctly you should see # cat /sys/module/kvm_intel/parameters/nested Y if it says "N", then nested VMX will be disabled. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://entangle-photo.org -o- http://search.cpan.org/~danberr/ :|