nested virtualization in kvm

7,421

Solution 1

So I'm managed to run the nested Hypervisor inside KVM and it turns out to me that the Red Hat Kernel 2.6.32 did not support the nested keyword when it was passed using kvm-intel.nested=1

so that is the reason there was no file such as /sys/module/kvm_intel/parameters/nested

It worked for me in kernel 3.10

I installed it set the nested parameter. Created new VM, modified it's cpu and set as per the host CPU so that it can detect vmx extension Started Red Hat hypervisor and it detected the hardware.

hope it helps others.

Thanks,

Solution 2

  1. Your CPU needs to support either VMX (Intel) or SVM (AMD) - Check grep ^flags /proc/cpuinfo
  2. The kvm kernel module needs to have nested=Y set - check cat /sys/module/kvm_*/parameters/nested
  3. The virtual guest CPU has to export the VMX flag - check virsh dump <vm name> for a stanza like
  <cpu match='exact'>
    <model>Westmere</model>
    <feature policy='require' name='vmx'/>
  </cpu>

Solution 3

Recently,i'm trying to run xen hypervisor inside kvm .

I found that RHEL6 did not support Nested virtualization. see this redhat maillist

----- Original Message -----

From: "Gilles Dubreuil" To: rhos-list redhat com Sent: Monday, November 25, 2013 9:59:58 PM Subject: [rhos-list] RHEL6: Nested virtualization support for kvm_intel?

Hi,

Maybe I'm dreaming but I thought soon we'll able to go Inception level 3, well at least that's how I explain to my partner what we're doing.

I'm not sure if any previous OpenStack kernels did have the feature. But latest RHEL6.5 kernel seems not to support nested virtualization on kvm_intel kernel module.

I'm not 100% sure if CPU support is required besides normal vmx flag. But I can't see any flag advertising such feature or not while comparing Intel specs as well with my laptop where it works with Fedora.

If there is no specific CPU support needed then the blocker will be the module. In such case, do there is any road map for the feature? Didn't find much rhel6 support for it (google/BZ) either.

Not until RHEL 7, however it does work (but not supported) on AMD hardware.


But centos6 support. see howto

Share:
7,421

Related videos on Youtube

sandeep.s85
Author by

sandeep.s85

Red Hat Certified Architect Red Hat Certified Data Centre Specialist Red Hat Certified Virtualization Administrator Red Hat Certified Engineer Red Hat Certified System Administrator

Updated on September 18, 2022

Comments

  • sandeep.s85
    sandeep.s85 almost 2 years

    I am looking for some advice on configuring KVM on Red Hat 6.5 so that it is able to run Red Hat Hypervisor as a virtual guest.

    When I am running Red Hat Virtialization Hypervisor as KVM guest then it is not detaching underlying hardware and thus shows a message that Virtualization Hardware not detected.

    I'm sure there is a way to run Hypervisors as Nested KVM guests but can't really get hold of the exact configuration.

    Can anyone out there help in that.

    Thanks, Sandeep

    • alexus
      alexus almost 10 years
      I'm just curios, why would you need to nest virtualization? why not run your VM on original hypervisor instead?
    • sandeep.s85
      sandeep.s85 almost 10 years
      I installed it on the box itself first but as you know the Red Hat Hypervisor once installed on a physical box won't let you use that box for any other purpose.
    • sandeep.s85
      sandeep.s85 almost 10 years
      so I Installed RHEL6.5 on physical box with 8GB RAM and 4 CPU and if I can run RHEV-H inside KVM then I can setup another virtual machine which will run as RHEV-M the Hypervisor manager. Once I have Hypervisor and Manager both up and running inside KVM then I can do the testing with other stuff. I'm preparing for the Red Hat Virtualization exam and for that I have to setup this way. I can't afford to buy multiple hardwares to run hypervisor and then Hypervisor manager and then manage those from my laptop
    • alexus
      alexus almost 10 years
      use RHEL not RHH, or install RHH and run RHEL as VM!
  • sandeep.s85
    sandeep.s85 almost 10 years
    thanks for the info. the cpu does have the vmx flag set. the only issue i am facing right now is to enable nested=Y flag with kvm_intel kernel module. there is no file such as /sys/module/kvm*/parameter/nested in kernel version 2.6.32-431 I have tried everything with enabling kvm_intel.nested=1 in /boot/grub/grub.conf but seems like the present kernel does not recognise the nested parameter
  • al.
    al. over 9 years
    I'm wondering why this answer is getting downvoted. If it is wrong, please let me know.
  • suprjami
    suprjami over 9 years
    Nested KVM is not supported on EL6. The module option isn't even there. It's in Fedora/EL7 but not 6, and the OP is using 6.
  • al.
    al. over 9 years
    I see. I'd still argue that the answer is correct, as it describes the canonical way of finding the cause of the problem (missing support in kernel module).