0

I have host Ubuntu 18 with QEMU KVM. Virtual Machine Windows 10 (hyper-v enabled)

I want to run Android Studio emulator on Windows VM.

On host I have kvm_amd nested=1

VM settings #1:

<vcpu placement='static'>8</vcpu>

<cpu mode='host-model' check='partial'>
  <model fallback='allow'/>
  <feature policy='disable' name='hypervisor'/>
</cpu>

with this settings Windows VM has:

  • Virtualization in Firmaware: Yes
  • VM Monitor Mode extension: No

VM Settings #2:

<vcpu placement='static'>8</vcpu>
<cpu mode='host-passthrough' check='none'/>

with this settings VM has:

  • Virtualization in Firmaware: Yes
  • VM Monitor Mode extension: Yes
  • but VM is very slow, can't work on it
  • if i change topology to something else than default, VM get into boot loop

Please, let me know if additional information would be needed. Could you help me ?

5
  • 1
    Android studio doesn’t support being ran from within a VM.
    – Ramhound
    Commented May 21, 2019 at 11:59
  • Which VM is slow and what do you define as slow? What hardware does the VM have available?
    – Seth
    Commented May 21, 2019 at 12:29
  • My hardware: Ryzen 5 and 16 GB RAM + SSD disk I said slow, because without host-passthrough VM run much faster Commented May 21, 2019 at 12:35
  • And you can just run Android Studio on Linux anyway. That said, even with hardware acceleration, nested virtualization has a noticeable performance penalty. Commented May 21, 2019 at 19:02
  • Yes, but i cant set topology manually. I read that this should help with performance. Commented May 22, 2019 at 7:03

1 Answer 1

0

I finally got qemu-kvm working with a Windows 11 Professional client with Hyper-V and Docker Desktop running smoothly.

This is my setup, maybe it helps others. NO ADVERTISMENT INTENDED! Hardware:

Gigabyte X570 I AORUS PRO WIFI
BIOS-Version F37a (Virtualization enabled, Hyperthreading disabled)
AMD Ryzen 9 3950X 16-Core Processor
64Gb RAM

Software:

OS: Centos Stream 8
Kernel: 4.18.0-448.el8.x86_64
libvirt 8.0.0
QEMU 6.2.0

/etc/modprobe.d/kvm.conf

options kvm ignore_msrs=1
options kvm_amd nested=1

virsh settings:

<memory unit='KiB'>16777216</memory>
<currentMemory unit='KiB'>16777216</currentMemory>
<vcpu placement='static'>12</vcpu>
<resource>
  <partition>/machine</partition>
</resource>
<os>
  <type arch='x86_64' machine='pc-q35-rhel8.2.0'>hvm</type>
</os>
<features>
  <acpi/>
  <apic/>
  <hyperv mode='custom'>
    <relaxed state='on'/>
    <vapic state='on'/>
    <spinlocks state='on' retries='8191'/>
    <vpindex state='on'/>
    <runtime state='on'/>
    <synic state='on'/>
    <stimer state='on'/>
    <reset state='on'/>
    <vendor_id state='on' value='1234567890ab'/>
    <frequencies state='on'/>
    <reenlightenment state='on'/>
    <tlbflush state='on'/>
    <ipi state='on'/>
    <evmcs state='off'/>
  </hyperv>
  <kvm>
    <hidden state='on'/>
    <hint-dedicated state='on'/>
    <poll-control state='on'/> 
  </kvm>
  <vmport state='off'/>
  <smm state='on'/>
</features>
<cpu mode='host-passthrough' check='none' migratable='off'>
  <topology sockets='1' dies='1' cores='12' threads='1'/>
  <cache mode='passthrough'/>
  <feature policy='require' name='topoext'/>
  <feature policy='require' name='svm'/>
  <feature policy='require' name='x2apic'/>
  <feature policy='require' name='hypervisor'/>
  <feature policy='require' name='invtsc'/>
</cpu>
<clock offset='localtime'>
  <timer name='rtc' tickpolicy='catchup'/>
  <timer name='pit' tickpolicy='delay'/>
  <timer name='hpet' present='no'/>
  <timer name='hypervclock' present='yes'/>
  <timer name='tsc' present='yes' mode='native'/>
</clock>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<pm>
  <suspend-to-mem enabled='no'/>
  <suspend-to-disk enabled='no'/>
</pm>

I installed Windows 11 Pro without SecureBoot and TPM. Google details pls.

Shift+F10 to launch cmd in windows setup regedit goto “HKEY_LOCAL_MACHINE\SYSTEM\Setup” 
right-click “New ⇒ Key ⇒ LabConfig” “New ⇒ DWORD (32-bit) ⇒ 
BypassTPMCheck ⇒ 1” same for “BypassRAMCheck” and “BypassSecureBootCheck”

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .