utmapp / UTM

Virtual machines for iOS and macOS
https://getutm.app
Apache License 2.0
26.39k stars 1.32k forks source link

Can't use HVF hypervisor on Mac version. #570

Closed Andrupka closed 3 years ago

Andrupka commented 3 years ago

When I go to preferences and check "Use hypervisor" box and boot VM I get Internal error. Version is 2.0.10

To Reproduce Steps to reproduce the behavior:

  1. Go to preferences
  2. Click on "try to use hardware hypervisor when possible.
  3. Boot x86_64 VM
  4. See error

Expected behavior It should boot with HVF enabled

Screenshots

Снимок экрана 2020-11-23 в 15 46 07
Andrupka commented 3 years ago

Here is log: debug.log

osy commented 3 years ago

It’s currently broken in QEMU.

Andrupka commented 3 years ago

oh, ok. Thank you anyway

brunocastello commented 3 years ago

Just a note, I can use HVF on normal QEMU 5.1.0 for x86_64, but not i386. It speeds up XP for me.

osy commented 3 years ago

@brunocastello on Big Sur? That’s what the issue here is about.

brunocastello commented 3 years ago

@brunocastello on Big Sur? That’s what the issue here is about.

Yes, Big Sur.

Andrupka commented 3 years ago

Yes, HVF on Big Sur (normal QEMU) works just fine and allows installing and running Win10 faster than on VirtualBox. It is strange that it does not work here.

nicahokie commented 3 years ago

I don't think this is working correctly on UTM 2.0.14 and in the automatically generated QEMU Arguments it is still trying to use -accel tcg even though its should default to hypervisor framework hvf instead since I am on a x86_64 host running an x86_64 guest and have preferences in default.

osy commented 3 years ago

@nicahokie post your debug log

nicahokie commented 3 years ago

Thanks for the quick response. I love the work you guys are doing - major props! QEMU needed a modern frontend for Apple platforms specially now with Apple Silicon out. I had independently thought of this concept myself. I have gotten AQEMU to run on macOS as well as JavaQemu but both seem a bit dated and not as Apple focused as your which already has metal support from spice and qxl - kudos! I might be interested in contributing once I get some free time on my hands. The NUC Hackintosh also seems neat. Now unto the matter at hand:

Here is a debug log of a fresh install of UTM 2.0.14 from the releases dmg running default options and your stock ubuntu 18.0.4 vm (X86_64) on an x86_64 macOS 11 Big Sur MacBook Pro as you can see it is still using tcg as the -accel option instead of hvf:

Running: -L /Applications/UTM.app/Contents/Resources/qemu -S -qmp tcp:localhost:4000,server,nowait -spice port=4001,addr=127.0.0.1,disable-ticketing,image-compression=off,playback-compression=off,streaming-video=off -smp cpus=1,sockets=1,cores=1,threads=1 -machine pc,vmport=off -accel tcg -vga qxl -global PIIX4_PM.disable_s3=1 -global ICH9-LPC.disable_s3=1 -boot order=d -m 1024 -soundhw ac97 -name "Ubuntu 18.04" -device usb-ehci -device usb-tablet -device usb-mouse -device usb-kbd -drive "if=ide,media=disk,id=drive0,file=/Users/pchamorro/Documents/Ubuntu 18.04.utm/Images/ubuntu-18.04.qcow2" -device rtl8139,netdev=net0 -netdev user,id=net0 -device virtio-serial -device virtserialport,chardev=vdagent,name=com.redhat.spice.0 -chardev spicevmc,id=vdagent,debug=0,name=vdagent -uuid 3ECBCF7E-CB97-4A76-91A7-FEC8F1052A49 -rtc base=localtime qemu-system-x86_64: warning: '-soundhw ac97' is deprecated, please use '-device AC97' instead

nicahokie commented 3 years ago

Dear osy, thanks for your efforts on this issue but the issue persists in 2.0.15

Please also note the URLs for User Guide and Browse UTM Library on the main window are broken links.

Running: -L /Applications/UTM.app/Contents/Resources/qemu -S -qmp tcp:127.0.0.1:4000,server,nowait -spice port=4001,addr=127.0.0.1,disable-ticketing,image-compression=off,playback-compression=off,streaming-video=off -smp cpus=2,sockets=1,cores=2,threads=1 -machine pc,vmport=off -accel hvf -cpu host -accel tcg -vga qxl -global PIIX4_PM.disable_s3=1 -global ICH9-LPC.disable_s3=1 -boot order=d -m 2048 -soundhw ac97 -name "Ubuntu 18.04" -device usb-ehci -device usb-tablet -device usb-mouse -device usb-kbd -drive "if=ide,media=disk,id=drive0,file=/Users/pchamorro/Documents/Ubuntu 18.04.utm/Images/ubuntu-18.04.qcow2,cache=writethrough" -device rtl8139,netdev=net0 -netdev user,id=net0 -device virtio-serial -device virtserialport,chardev=vdagent,name=com.redhat.spice.0 -chardev spicevmc,id=vdagent,debug=0,name=vdagent -uuid 3ECBCF7E-CB97-4A76-91A7-FEC8F1052A49 -rtc base=localtime qemu-system-x86_64: warning: '-soundhw ac97' is deprecated, please use '-device AC97' instead

nicahokie commented 3 years ago

Now it is putting both parameters -accel hvf and -accel tcg when they should be mutually exclusive

osy commented 3 years ago

Now it is putting both parameters -accel hvf and -accel tcg when they should be mutually exclusive

That’s fine, the options are parsed in order and tcg is only used it hvf fails.

It worked fine on my Intel mac. What model mac do you have?

nicahokie commented 3 years ago

Thanks for the quick response. Noted, that this is by design and that the first -accel parameter will take precedence. I have a MacBookPro11,5 My comment was just based on the two parameters but judging by the performance it appears to be using hvf now.