quickemu-project / quickemu

Quickly create and run optimised Windows, macOS and Linux virtual machines
MIT License
9.91k stars 438 forks source link

feat: add support for running quickemu on macOS hosts #1225

Closed flexiondotorg closed 2 months ago

flexiondotorg commented 2 months ago

Support for macOS hosts

This pull request makes Quickemu compatible with macOS hosts, meaning that quickemu can now be used to create and run virtual machines on macOS hosts.

Intel and Apple Silicon CPUs on the host are supported. However, Quickemu currently only has x86 OS images available, so Apple Silicon Macs are currently provisioned with x86 virtual machines. This will be addressed in the future.

Improved compatibility for macOS guests

In addition, this pull request significantly improves the compatibility and performance when running macOS guest VMs, particularly if your host has an Intel CPU. Thanks to @TuxVinyards and @lj3954 for their research in this area.

lj3954 commented 2 months ago

Does the accel option make it redundant to add 'kvm=on' to the CPU flag?

flexiondotorg commented 2 months ago

Does the accel option make it redundant to add 'kvm=on' to the CPU flag?

I believe so.

lj3954 commented 2 months ago

According to QEMU's docs, SDL and GTK are both supported on macOS hosts. https://wiki.qemu.org/Hosts/Mac.

flexiondotorg commented 2 months ago

According to QEMU's docs, SDL and GTK are both supported on macOS hosts. https://wiki.qemu.org/Hosts/Mac.

Only if qemu is built and linked against them. Which the homebrew version is not.

lj3954 commented 2 months ago

Why do we need to disable topoext on macOS guests? I've been using it on my AMD systems and the VMs still boot just fine. The changes in 505e98a are also contrary to the commit text. The VM architecture is hardcoded, while the host architecture is determined through uname.

TuxVinyards commented 2 months ago
                for FLAG in abm aes amd_ssbd apic arat bmi1 bmi2 clflush cmov cx8 cx16 de \
                            eist erms f16c fma fp87 fsgsbase fxsr invpcid invtsc lahf_lm lm \
                            mca mce mmx movbe mpx msr mtrr nx pae pat pcid pge pse popcnt pse36 \
                            rdrand rdtscp sep smep syscall tsc tsc_adjust vaes vbmi2 vpclmulqdq \
                            x2apic xgetbv1 xsave xsaveopt; do

Remove adx as is Skylake

Remove vmx as is Intel

amd_ssbd should have had an underscore. But, edit, should be removed too. That's neither Haswell nor Intel.

Couple of things that I spotted