traderepublic / Cilicon

🛠️ Self-Hosted ephemeral macOS CI on Apple Silicon
MIT License
969 stars 29 forks source link

Nested virtualisation on M1/M2 #15

Closed chrisns closed 1 year ago

chrisns commented 1 year ago

I don't think this is an issue with Cilicon

Unless I've misunderstood the docs, it doesn't appear to be possible to create a vm with the Apple Hypervisor that has nested virtualisation enabled. What this means is that things like android studio booting an emulator will fail, and provide errors like

HVF error: HV_UNSUPPORTED
qemu-system-aarch64: failed to initialize HVF: Invalid argument

Which google will rightly point you at code signing qemu and some other bits, until if you're like me you've spent hours falling down reddit+stackoverflow rabbit holes before it dawns on you whats going on, and what might be needed for it to be possible

🤦

Anyway, leaving this here to pay it forward hopefully with enough words that google finds it.

Please close issue unless you can see anyway to do nested virtualisation, vmware fusion and parallels appear to have something from google, but I'm not sure what workaround they've got for it.

Now to go build a amd64 box for android e2e testing :(

Thanks!

Marcocanc commented 1 year ago

Hi Chris, I can neither confirm or deny if nested virtualization works, as we don't have a use-case for it and haven't tested it. We're relying entirely on Apple's native Virtualization Framework and the features it provides. I will close this issue as Cilicon doesn't deal with lower level virtualization topics and has no impact on the availability of nested virtualization.

chrisns commented 1 year ago

Yeah it was only a thing of raising here in case it was a similar config param like how much memory to give the vm.

Thanks for the response :)