close

[Solved] qemu-system-x86_64: failed to initialize HAX: Operation not supported by device in Big Sur

Hello Guys, How are you all? Hope You all Are Fine. Today I updated my mac to Big Sur 11.3 and then whenever I try to run an emulated device and it has been silently failing each time in macOS. and give error message qemu-system-x86_64: failed to initialize HAX: Operation not supported by device in Big Sur. So Here I am Explain to you all the possible solutions here.

Without Wasting your time, Lets start This Article to Solve This Error.

How qemu-system-x86_64: failed to initialize HAX: Operation not supported by device in Big Sur Error Occurs ?

I Just updated my mac to Big Sur 11.3 and then whenever I Try o run an emulated device and it has been silently failing each time in macOS.

Also I tried to Run emulator through my Terminal And I get this below error message:

handleCpuAcceleration: feature check for hvf
cannot add library /Users/dream/Library/Android/sdk/emulator/qemu/darwin-x86_64/lib64/vulkan/libvulkan.dylib: failed
added library /Users/dream/Library/Android/sdk/emulator/lib64/vulkan/libvulkan.dylib
cannot add library /Users/dream/Library/Android/sdk/emulator/qemu/darwin-x86_64/lib64/vulkan/libMoltenVK.dylib: failed
HVF error: HV_ERROR
qemu-system-x86_64: failed to initialize HVF: Invalid argument
Failed to open the hax module
No accelerator found.
qemu-system-x86_64: failed to initialize HAX: Operation not supported by device
added library /Users/dream/Library/Android/sdk/emulator/lib64/vulkan/libMoltenVK.dylib

How To Solve qemu-system-x86_64: failed to initialize HAX: Operation not supported by device in Big Sur ?

Question: Why Android Device Manager fails to launch after updating to macOS Big Sur 11.3?
Answer: Here Apple has changed hypervisor entitlements (permissions), deprecating com.apple.vm.hypervisor with com.apple.security.hypervisor. Before Google fixes emulator code signing with the new entitlements you can work around the issue by granting the entitlement yourself. Than Just Create a file entitlements.xml with the following content.

Solution 1

Apple has made changes to the hypervisor entitlements. Entitlements are key-value pairs that grant an executable permission to use a service or technology. In this case the QEMU binary is missing the entitlement to create and manage virtual machines.

That’s Why This Error Occurs. To solve the error all we have to do is add the entitlement to the qemu-system-x86_64 binary. First create an xml file named entitlements.xml with this content:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>com.apple.security.hypervisor</key>
    <true/>
</dict>
</plist>

Then Run This Command.

codesign -s - --entitlements entitlements.xml --force /usr/local/bin/qemu-system-x86_64

If you get entitlements.xml: cannot read entitlement data error you should start the terminal at folder which include qemu-system-x86_64 file.

For example my qemu-system-x86_64 file is in this location : /Users/yourusername/Library/Android/sdk/emulator/qemu/darwin-x86_64/qemu-system-x86_64

Now right click on darwin-x86_64 the folder and click New terminal Tab at Folder. Don’t forget the copy your entitlements.xml file into the darwin-x86_64 folder. Now in this terminal run the command

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?

Also Read

Please Rate Our Solution to Motivate Us For Give Our Best

Leave a Comment