Nested VMS Unraid 6.7.2 VMX Performance


Recommended Posts

Hello guys,

 

is it possible to activate VMX for Qemu in Unraid 6.7.2.?

 

Iam using Passtrough-Mode with the "kvm_intel nested=1" in Autostart to run MS Hyper-V 2016 on my Unraid Setup.

Inside the HyperV 2016 Server i can use nested VMs without hassle when HyperV option enabled and pc-i440fx .

But the performance is absolutely horrible and everthing is lagging  behind.

 

When i switch do QMEU64 / KVM  CPU mode the Performance of my MS Hyper Server increases drastically. But the Intel VD-X Features are not exposed to it anymore, hence i cannot run nested VMs.

 

How can i expose VMX to my HyperV Host running on QEMU CPU Mode.

 

I Found the following:

 

https://ahelpme.com/howto/qemu-full-virtualization-cpu-emulations-enable-disable-cpu-flags-instruction-sets/

https://stackoverflow.com/questions/39154850/how-do-i-emulate-the-vmx-feature-with-qemu

https://stackoverflow.com/questions/43942033/nested-virtualization-with-kvm-enable-kvm-in-qemu-in-nested-virtualization?rq=1

 

Somehow it should be possible to make the CPUS Features visible to the VM.

 

The XML commands above, mentioned by Siwat, do not work anymore.

Error: XML error: Non-empty feature list specified without CPU model

 

Cpu Mode "custom" does not exist anymore. But there is a mode called "Host-Model".

 

How can i use QEMU emulated CPU Cores for my MS HyperV Server and passtrough the VMX Features to its VMS for nested Virtualization.

 

best regards

 

lukas

Link to comment
  • 2 weeks later...
On 7/30/2019 at 2:25 PM, Jagadguru said:

Just adding +vmx to the cpu features supported worked for me with a nested guest on  a MacOS VM. Like this:


<qemu:commandline>
    <qemu:arg value='-cpu'/>
    <qemu:arg value='Penryn,vendor=GenuineIntel,kvm=on,+invtsc,vmware-cpuid-freq=on,+vmx'/>
</qemu:commandline>

  

in here?

  <cpu mode='host-passthrough' check='none'>
    <topology sockets='1' cores='10' threads='2'/>
  </cpu>

 

My CPU is Sandy Bridge EP though, should it still be Penryn? E5 2650

Link to comment

At the very end of the XML.  It's for when you use a QEMU emulated CPU like the OP. Yours should be Penryn if you're running MacOS in a VM. 

 

What OS are you trying to run in your VM? And what guest within that guest are you trying to run? And with what Virtualization software (within the VM)?

Link to comment

where can i find the right xml file guys?

my vm xml only got this short cpu section:

 

Quote

  <vcpu placement='static'>24</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='0'/>
    <vcpupin vcpu='1' cpuset='12'/>
    <vcpupin vcpu='2' cpuset='1'/>
    <vcpupin vcpu='3' cpuset='13'/>
    <vcpupin vcpu='4' cpuset='2'/>
    <vcpupin vcpu='5' cpuset='14'/>
    <vcpupin vcpu='6' cpuset='3'/>
    <vcpupin vcpu='7' cpuset='15'/>
    <vcpupin vcpu='8' cpuset='4'/>
    <vcpupin vcpu='9' cpuset='16'/>
    <vcpupin vcpu='10' cpuset='5'/>
    <vcpupin vcpu='11' cpuset='17'/>
    <vcpupin vcpu='12' cpuset='6'/>
    <vcpupin vcpu='13' cpuset='18'/>
    <vcpupin vcpu='14' cpuset='7'/>
    <vcpupin vcpu='15' cpuset='19'/>
    <vcpupin vcpu='16' cpuset='8'/>
    <vcpupin vcpu='17' cpuset='20'/>
    <vcpupin vcpu='18' cpuset='9'/>
    <vcpupin vcpu='19' cpuset='21'/>
    <vcpupin vcpu='20' cpuset='10'/>
    <vcpupin vcpu='21' cpuset='22'/>
    <vcpupin vcpu='22' cpuset='11'/>
    <vcpupin vcpu='23' cpuset='23'/>
  </cputune>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-i440fx-3.1'>hvm</type>
  </os>
  <features>
    <acpi/>
    <apic/>
    <hyperv>
      <relaxed state='on'/>
      <vapic state='on'/>
      <spinlocks state='on' retries='8191'/>
      <vendor_id state='on' value='none'/>
    </hyperv>
  </features>
  <cpu mode='host-passthrough' check='none'>
    <topology sockets='1' cores='12' threads='2'/>
  </cpu>

 

you probably edit some qemu config xml right? not the vm itself

Edited by EDV Dave
missing
Link to comment
  • 4 weeks later...

OK it worked. Just added your Lines within the "domain" tag:

 

 

    </hostdev>
    <memballoon model='none'/>
  </devices>
  <seclabel type='dynamic' model='dac' relabel='yes'>
    <label>+0:+100</label>
    <imagelabel>+0:+100</imagelabel>
  </seclabel>
  <qemu:commandline>
    <qemu:arg value='-cpu'/>
    <qemu:arg value='Penryn,vendor=GenuineIntel,kvm=on,+invtsc,vmware-cpuid-freq=on,+vmx'/>
  </qemu:commandline>
</domain>

 

 

 

Performance is way better now and nested VMS do start with QEMU Penryn now, but still not performing as well as when i just tick QMEMU CPU without speccifying Penryn type.

 

 Are there other choices?

 

best regards

Link to comment
  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.