utmapp / UTM

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

Way to set Hypervisor Vendor in guest OS #5565

Closed joshtbernstein closed 2 months ago

joshtbernstein commented 1 year ago

I have a virtual appliance that looks at the hw.hv_vendor kernel parameter (FreeBSD) to determine which hypervisor it's running on.

When using TCG this is set to "TCGTCGTCGTCG" and when using HVF this is blank. Is there a way to provide an override so that I could set this to "KVMKVMKVM" (what it's set to on a machine running KVM)? The appliance doesn't actually need KVM, it just uses that to determine it's virtual and not physical.

osy commented 1 year ago

Can you figure out how to do this in QEMU? If it's possible in QEMU, we can probably add an option.

joshtbernstein commented 1 year ago

@osy Sorry for the delay, it seems that there's a -cpu option that should do this, but I couldn't get it to work.

-cpu kvm64,hv-avic,hv-vendor-id=KVMKVMKVM

I'm not sure if I'm misunderstanding what it does or if it's not implemented in UTM.

osy commented 1 year ago

So it is currently not implemented in UTM but I need a reference on how to do it in QEMU in order to implement it. That means installing brew install qemu and running with the right command line options to achieve what you want to do and then pasting that command here.

joshtbernstein commented 1 year ago

It looks like this won't work without changing the code in QEMU. Want me to close this out?

osy commented 1 year ago

Feel free to keep it open if you want just know that it’ll be blocked on QEMU’s implementation.