GithubHelp home page GithubHelp logo

Comments (54)

ctamietto avatar ctamietto commented on June 18, 2024 1

finally i managed to install sonoma and ventura on my pc ( MSI intel i7 ) and os fedora 39

i have modified quickemu as you can see in the image

image

I hope that what I've done is correct and can help other people with the same problem

from quickemu.

TuxVinyards avatar TuxVinyards commented on June 18, 2024

It will do that. There's a some stuff about it in the qqX wiki. And a link to walk through for Ventura. Pretty much the same ...

from quickemu.

ctamietto avatar ctamietto commented on June 18, 2024

i have read and applied the suggestions of this thread

#937

but nothing changed

in this thread you talk about

"The Ventura VM that I had was built using the new, under-development, version."

is this new version already present in quickemu 4.9.3 ( i'm using that ) o is to be released in the future ?

Anyway thanks for your help

from quickemu.

TuxVinyards avatar TuxVinyards commented on June 18, 2024

Ciao Claudio.

I have two installs of Sonoma already. You need patience to install them but my memory is that they were much the same as with Ventura.

I was running a VM of Fedora 40 last night and tried to install Sonoma on that. It threw up complaints about graphics memory, so I just put that down to it being a VM. You can normally 'telescope' VM's though. ie install machines inside other machines. It's normally not a problem.

I have just tried installing Sonoma, again, a third copy, on my main machine. I use Ubuntu Mate on that one. It didn't work as well as I had expected. Didn't get the graphics memory error though. Something to do with virtio on that one probably.

I am starting to question the Mac distro which is getting downloaded. It doesn't have the 'installer' icon like you can see in the screenshots in #937 and as mentioned in the Quickemu instructions. I initially put this down to an Apple renaming exercise, but I am not sure that this is entirely the case.

I also tried starting Sonoma from the command line, by copying quickemu out of the 'freebird' builtins to the VM folder and using ./quickemu -vm macos-sonoma.conf but got the same results. Note the dot at the front ...

At this point in time, FreeBird is identical to the current Quickemu 'master' and it runs my two previously installed Sonama distros without fault.

@lj3954 did 95% of the work on adding in Sonoma. I am wondering if he might have some ideas?

from quickemu.

ctamietto avatar ctamietto commented on June 18, 2024

Ciao Alex ,
do you think that changing distro ( for example using ubuntu 22.04 ) the installation of mac os vm can work ?
i have found this video on you tube https://www.youtube.com/watch?v=wykyreQxVV8
where you can see a succesfull installation of ventura using a linux mint host ( i think based on ubuntu 22.04 )
using https://github.com/kholia/OSX-KVM ( quickemu use OVMF firmware from that project )
i'm guessing to install ubuntu 22.04 on a host and try to create the mac os vm on that system
what do you think about ?

from quickemu.

TuxVinyards avatar TuxVinyards commented on June 18, 2024

Might be worth trying an install of Ventura. See what happens there. Might give us some clues.

from quickemu.

TuxVinyards avatar TuxVinyards commented on June 18, 2024

I think this is distro. The Ventura front end has changed as well.

ventura-has-changed

This how it used to look:

old-ventura-front-end

from quickemu.

lj3954 avatar lj3954 commented on June 18, 2024

@lj3954 did 95% of the work on adding in Sonoma. I am wondering if he might have some ideas?

I did very little work inside quickemu. I added sonoma to a couple of switch cases and blocked macOS guests from using some core counts they just won't boot with. Ventura and Sonoma should be identical in nearly every way. Have you been able to install a macOS guest after you modified the CPU argument?

I am starting to question the Mac distro which is getting downloaded.

The image is downloaded in exactly the same way that macrecovery does it, and as far as I can tell, exactly the same way an Apple computer would. Also, the image is verified using a chunklist file which also contains Apple's EFI key. There is no doubt in my mind that the image is legitimate.

I'll check this out tonight. I haven't done much testing with macOS in quickemu since I finished my PR on it.

from quickemu.

TuxVinyards avatar TuxVinyards commented on June 18, 2024

I'll check this out tonight. I haven't done much testing with macOS in quickemu since I finished my PR on it.

Appreciated 👍

from quickemu.

lj3954 avatar lj3954 commented on June 18, 2024

I can't get the (sonoma) installer to even boot with your new CPU arg, nor can I get my preexisting VM to boot. Ventura kernel panics with it. Whether it works correctly on Intel CPUs or not doesn't matter, silencing a couple of irrelevant errors in the console is not worth whatever regression this has caused.

After reverting the CPU to Haswell, the installation was painless. I just selected the 2nd option "macOS base system" on the first boot, and the 3rd option on reboots. It was quite surprising to me how painless it was.

This doesn't solve the issue, though, since macOS releases prior to Ventura will use the Penryn CPU instead. I'm currently downloading Monterey to test whether this works.

from quickemu.

lj3954 avatar lj3954 commented on June 18, 2024

@ctamietto Please provide the output of lscpu. It appears to me that macOS guests work very differently depending on the host's CPU, more data points would be helpful.

from quickemu.

lj3954 avatar lj3954 commented on June 18, 2024

I completed the install of macOS Monterey with no changes to the CPU. Once again, there was no issues. Different systems clearly have very different outcomes, much more data is needed to find a solution.

from quickemu.

TuxVinyards avatar TuxVinyards commented on June 18, 2024

After reverting the CPU to Haswell, the installation was painless

I had wondered whether the Haswell line was actually correct when it added sse_4.2 ?

The original code only grepped for 4.1 and the notes in the code said 4.1.

What happens if you change the new CPU line to 4.2 on your Ryzens?

For me, on Intel, Sonoma runs faultlessly.

from quickemu.

lj3954 avatar lj3954 commented on June 18, 2024

No dice. That emulated broadwell CPU just doesn't work here

from quickemu.

cyrileek avatar cyrileek commented on June 18, 2024

I tried to install ventura and sonoma en Debian Trixie. It hang or reboot and go back to the "EFI" and "macOS Base System" menu. I used to have the ventura working on this Debian with the quickemu previous version. I agree to the fact that the installation process is not the same as the startup menu is different.

from quickemu.

TuxVinyards avatar TuxVinyards commented on June 18, 2024

No dice. That emulated broadwell CPU just doesn't work here

So, I just changed the new CPU instruction to 4.2 and it all works, for me.

And the old one. But it's plain wrong to grep for one thing and to add another.

The question now is how do fix the CPU line so that it works for everyone, Ryzen or Intel.

from quickemu.

TuxVinyards avatar TuxVinyards commented on June 18, 2024

@lj3954 Try this hybrid line. The old one with Haswell but tidied up.

CPU="-cpu Haswell-noTSX-IBRS,kvm=on,vendor=GenuineIntel,+sse3,+sse4.2,+aes,+xsave,+avx,+xsaveopt,+xsavec,+xgetbv1,+avx2,+bmi2,+smep,+bmi1,+fma,+movbe,+invtsc"

from quickemu.

lj3954 avatar lj3954 commented on June 18, 2024

That works for me.

from quickemu.

TuxVinyards avatar TuxVinyards commented on June 18, 2024

Yay. I'll push that to a PR, if that's okay. 🥳

from quickemu.

ctamietto avatar ctamietto commented on June 18, 2024

this is the output requested

I have tried again to install big-sur monterey ventura sonoma but nothing works

something is changed , practically all the images hang on first boot ( after selecting the base system )

immagine

from quickemu.

TuxVinyards avatar TuxVinyards commented on June 18, 2024

@ctamietto try qqX 1.8.03 that I have just posted 🤞

From the main https://github.com/TuxVinyards/qqX/archive/refs/heads/main.zip

from quickemu.

flexiondotorg avatar flexiondotorg commented on June 18, 2024

Fixed via #1119

from quickemu.

TuxVinyards avatar TuxVinyards commented on June 18, 2024

1.8.04

  • The new 2nd May Quickemu code 🥳

  • Raft of Quickemu fixes and updates plus a couple of qqX fixes to go with

https://github.com/TuxVinyards/qqX/releases/tag/1.8.04

from quickemu.

ctamietto avatar ctamietto commented on June 18, 2024

sorry , i have updated quickemu and qqx but nothing changed
I tried to install sonoma but the mouse does not worked so I tried to install Ventura
At the second boot after the installation I get a blank screen
After about 5 minutes it reboots

very sorry it does not work
I think that is related to my hardware

from quickemu.

ctamietto avatar ctamietto commented on June 18, 2024

I've tried to install also monterey and hang on first boot and big-sur that hang on second boot

from quickemu.

lj3954 avatar lj3954 commented on June 18, 2024

Fixed via #1119

#1116 (comment)

This issue is not resolved, that PR solves a separate issue (specifically macOS guests not booting on AMD hosts). Please re-open this.

from quickemu.

TuxVinyards avatar TuxVinyards commented on June 18, 2024

sorry , i have updated quickemu and qqx but nothing changed I tried to install sonoma but the mouse does not worked so I tried to install Ventura At the second boot after the installation I get a blank screen After about 5 minutes it reboots

very sorry it does not work I think that is related to my hardware

Try this in the .conf file:

mouse="virtio"
keyboard="usb"

This works better with Ventura and Sonoma.

Run the qqX " [tune] " option which will help advise you.

Some people have said that usb_controller="xhci" it works for them . But as this was added to the code a few weeks ago as #981 via #986 I can't see it doing anything. I did try it, to see what it did. For me, it left me completely without mouse and keyboard ....

from quickemu.

TuxVinyards avatar TuxVinyards commented on June 18, 2024

I've tried to install also monterey and hang on first boot and big-sur that hang on second boot

@ctamietto Can you supply a few more details please.

It is normal for installs to hang for several periods of time when doing the the install. You also may find yourself having to re-boot up to 3 or 4 times too. A bit of patience is needed.

https://github.com/TuxVinyards/qqX/wiki/FAQs-and-Help#macos-hangs-when-running-the-setup

from quickemu.

TuxVinyards avatar TuxVinyards commented on June 18, 2024

Fixed via #1119

#1116 (comment)

This issue is not resolved, that PR solves a separate issue (specifically macOS guests not booting on AMD hosts). Please re-open this.

@lj3954 these changes were put out for testing for several days before merging. No one found any problems.

You tested these PR's on your Ryzens didn't you? I seem to remember you have an older Ryzen notebook amongst your computer collection as well ...

I would like to see the Quickemu conf generator doing a bit of tuning to the mouse and keyboard. There's room for improvement in that area.

from quickemu.

ctamietto avatar ctamietto commented on June 18, 2024

i've tried to install sonoma again adding manually

mouse="virtio"
keyboard="usb"

to the conf file

then i've tried also qqx tune

so I get this config file

#!/usr/bin/qqX --vm

disk_size="128G"
cpu_cores="22"
ram="10G"

guest_os="macos"
disk_img="macos-sonoma/disk.qcow2"
img="macos-sonoma/RecoveryImage.img"
macos_release="sonoma"
mouse="virtio"
keyboard="usb"

but nothing changed , the mouse does not work

I've uploaded to you tube a short video to show what I have done

https://youtu.be/pUuZsgVnl94

I've tried also usb_controller="xhci" but nothing changed

from quickemu.

TuxVinyards avatar TuxVinyards commented on June 18, 2024

@ctamietto This isn't your .conf. Your video shows you going to dvd player type icons. This is a problem with the CPU line.

There are a few ways to solve this but the recent changes have no major factor that I can see. You are booting off exactly the same formula that was used before. The only change is adding is here. -cpu Haswell-noTSX-IBRS with the addition of -noTSX-IBRS.

Hopefully I can ask you for a little more patience and to try a few things. There are several ways to try to solve this and one of these should work.

Your lscpu output shows you are using an Intel CPU. An i7 1280P.

We can try changing the CPU line to plain -cpu Haswell Take off the noTSX This will probably generate warning errors but at least we will have eliminated this as a factor.

The other thing is to use -cpu host which will mean using all the features that your CPU can offer.

You have tested your set up working with Linux VM's at this point, so this should be okay.

We need to edit the quickemu file, where it says -cpu Haswell-noTSX-IBRS. You can edit this in the qqX downloads folder. Use the current "FreeSpirit" folder, which is currently the same as "FreeBird". Then either run the qqX installer to do a re-install followed by selecting "FreeSpirit" from the settings. Or copy the folder and make a Custom set-up. Instructions for that are at the end of the settings folder. It's easier than it sounds ...

Have a zoom in look at this screenshot which shows Sonoma working on my series 11 intel using the -cpu host formula which I simply copied over from a bit further down, where the Windows CPU line is.

If neither of these two work, return back to the old formula and retry but removing and replacing the instruction set lines, one by one, to see which instruction is causing the problem. Comparing the CPU instruction against your lscpu flags output will shorten this task.

You could also try copying the Penryn formula, the one with *) For that you will need to add in +avx2 and to change the +sse4.1 to +sse4.2.

cpu-host

from quickemu.

lj3954 avatar lj3954 commented on June 18, 2024

Fixed via #1119

#1116 (comment)
This issue is not resolved, that PR solves a separate issue (specifically macOS guests not booting on AMD hosts). Please re-open this.

@lj3954 these changes were put out for testing for several days before merging. No one found any problems.

You tested these PR's on your Ryzens didn't you? I seem to remember you have an older Ryzen notebook amongst your computer collection as well ...

I would like to see the Quickemu conf generator doing a bit of tuning to the mouse and keyboard. There's room for improvement in that area.

I didn't tell you that your PR caused any issue. It just did not fix this one, this is likely an unrelated issue and likely has to do with this specific user's hardware. You seem to consistently misunderstand what I've said regarding this.

from quickemu.

ctamietto avatar ctamietto commented on June 18, 2024

I made a first attempt

  1. git pull of quickemu to get the latest release

  2. modified quickemu script as you suggestion @TuxVinyards

see the picture below :

image

  1. quickget macos ventura

  2. quickemu --vm macos-ventura.conf

nothing changed , at the second boot the system hang on a blank screen for about 5 minutes and then the system crash
at this point I get the boot screen again , try again to boot and after 5 minutes the system crash again

I don't know why and I don't know what to check

so next step I'll try to install ventura using qqX

from quickemu.

TuxVinyards avatar TuxVinyards commented on June 18, 2024

@ctamietto you may find qqX's [rtv] utility useful.

MacOS seems to record things in the Tiano Core components. This includes when it has decided that it doesn't like the look of the machine that it's meant to be installing on.

The 'rtv' utility Refreshes the Tiano Variables.

from quickemu.

TuxVinyards avatar TuxVinyards commented on June 18, 2024

@ctamietto something else that I just spotted was that lscpu is reporting your CPU as vulnerable and missing microcode

This is what I have, for me:

lscpu | grep -i microcode
Vulnerability Gather data sampling: Mitigation; Microcode

Probably should be sorted, even if this is not the cause. Is a firmware update needed?

from quickemu.

TuxVinyards avatar TuxVinyards commented on June 18, 2024

@lj3954 @flexiondotorg et al

The CPU line that we are using has +invtsc which is there from time back, as in the original.

If I run lscpu | grep -i inv I get invpcid and invpcid_single the same as @ctamietto does.

Wondering what that is about ....

from quickemu.

TuxVinyards avatar TuxVinyards commented on June 18, 2024

I've been testing FULL installs over the last few days. Not just "does the installer boot".

I've been finding delays of over an hour at the 'just a minute' point.

from quickemu.

flexiondotorg avatar flexiondotorg commented on June 18, 2024

This issue needs re-titling or something. I can not reproduce this error, I've installed several macOS releases without issue.

I think what is required here is quickemu to detect when the host hardware is not capable of running macOS and fails with a clear indication to the user.

from quickemu.

flexiondotorg avatar flexiondotorg commented on June 18, 2024

finally i managed to install sonoma and ventura on my pc ( MSI intel i7 ) and os fedora 39

I'll test your changes on Ryzen a bit later

from quickemu.

TuxVinyards avatar TuxVinyards commented on June 18, 2024

This issue needs re-titling or something. I can not reproduce this error, I've installed several macOS releases without issue.

I think what is required here is quickemu to detect when the host hardware is not capable of running macOS and fails with a clear indication to the user.

I have been working on exactly that. I have quite a bit of further research too.

Bear with me and I will PR something before long.

what is required here is quickemu to detect when the host hardware

Does that exactly. But I want to test really thoroughly ....

from quickemu.

TuxVinyards avatar TuxVinyards commented on June 18, 2024

Work so far:

    macos)
        # https://www.nicksherlock.com/2020/04/installing-macos-catalina-on-proxmox-with-opencore/
        # https://www.nicksherlock.com/2022/10/installing-macos-13-ventura-on-proxmox/
        # Penryn  https://github.com/search?q=repo%3Akholia%2FOSX-KVM%20%20GenuineIntel&type=code
        # https://en.wikipedia.org/wiki/MacOS_version_history#Releases
        # quickget current list: high-sierra mojave catalina big-sur monterey ventura sonoma
        # A CPU with SSE4.1 support is required for >= macOS Sierra
        # A CPU with SSE4.2 support is required for >= macOS Catalina
        # A CPU with AVX2 support is required for >= macOS Ventura
        case ${macos_release} in
        ventura|sonoma)
            if check_cpu_flag sse4_2 && check_cpu_flag avx2; then
                # noTSX stops cpuid errors https://duckduckgo.com/?t=ffab&q=CPUID.07H%3AEBX.rtm+%5Bbit+11%5D&ia=web also cited by NickSherlock for Ventura install
                #CPU="-cpu Haswell-noTSX-IBRS,kvm=on,vendor=GenuineIntel,+sse3,+sse4.2,+aes,+xsave,+avx,+xsaveopt,+xsavec,+xgetbv1,+avx2,+bmi2,+smep,+bmi1,+fma,+movbe,+invtsc"
                # https://www.techpowerup.com/cpu-specs/?mfgr=Intel&codename=Haswell&sort=name
                # https://www.techpowerup.com/cpu-specs/core-i7-4790k.c1761
                if [[ $MAC_CPU == "skylake1" ]]; then CPU="-cpu Skylake-Server-v1,kvm=on,vendor=GenuineIntel,+avx,+avx2,+sse,+sse2,+sse3,+sse4.2" 
                elif [[ $MAC_CPU == "skylake5" ]]; then CPU="-cpu Skylake-Server-v5,kvm=on,vendor=GenuineIntel,+avx,+avx2,+sse,+sse2,+sse3,+sse4.2" 
                elif [[ $MAC_CPU == "haswell5" ]]; then CPU="-cpu Haswell-v5,kvm=on,vendor=GenuineIntel,+avx,+avx2,+sse,+sse2,+sse3,+sse4.2" 
                else CPU="-cpu Haswell-v1,kvm=on,vendor=GenuineIntel,+avx,+avx2,+sse,+sse2,+sse3,+sse4.2" 
                fi
                # https://www.techpowerup.com/cpu-specs/xeon-w-2140b.c2953  8 cores 16 threads # skylake server
                # https://en.wikipedia.org/wiki/IMac_Pro#Technical_specifications Orig: High Sierra  Max: Sonoma
                # https://en.wikipedia.org/wiki/MacOS#Hardware_compatibility needs 8GB RAM
                # https://qemu.readthedocs.io/en/v9.0.0/system/qemu-cpu-models.html#important-cpu-features-for-amd-x86-hosts
                # https://www.reddit.com/r/hackintosh/comments/141wnjk/state_of_macos_14_sonoma_on_x86/
                # qemu-system-x86_64 -cpu help | grep pdpe1gb etc
                if check_cpu_flag pdpe1gb ; then CPU+=",+pdpe1gb" ; fi
                if check_cpu_flag amd-ssbd ; then CPU+=",+amd-ssbd" ; fi
                if check_cpu_flag mmx ; then CPU+=",+mmx" ; fi
                if check_cpu_flag eist ; then CPU+=",+eist" ; fi
                if check_cpu_flag aes ; then CPU+=",+aes" ; fi
                if check_cpu_flag vaes ; then CPU+=",+vaes" ; fi
                if check_cpu_flag fma ; then CPU+=",+fma" ; fi
                if check_cpu_flag f16c ; then CPU+=",+f16c" ; fi
                if check_cpu_flag abm ; then CPU+=",+abm" ; fi
                if check_cpu_flag adx ; then CPU+=",+adx" ; fi
                if check_cpu_flag bmi1 ; then CPU+=",+bmi1" ; fi
                if check_cpu_flag bmi2 ; then CPU+=",+bmi2" ; fi
                if check_cpu_flag vbmi2 ; then CPU+=",+vbmi2" ; fi
                if check_cpu_flag vpclmulqdq ; then CPU+=",+vpclmulqdq" ; fi
                if check_cpu_flag mpx ; then CPU+=",+mpx" ; fi
                if check_cpu_flag smep ; then CPU+=",+smep" ; fi
                if check_cpu_flag cx8 ; then CPU+=",+cx8" ; fi
                if check_cpu_flag xsave ; then CPU+=",+xsave" ; fi
                if check_cpu_flag xsaveopt ; then CPU+=",+xsaveopt" ; fi
                if check_cpu_flag xgetbv1 ; then CPU+=",+xgetbv1" ; fi
                if check_cpu_flag movbe ; then CPU+=",+movbe" ; fi
                if check_cpu_flag ept ; then CPU+=",+vmx-ept" ; fi
                if check_cpu_flag invtsc ; then CPU+=",+invtsc" ; fi
            else
                echo "ERROR! macOS ${macos_release} requires a CPU with SSE 4.2 and AVX2 support."
                exit 1
            fi
            ;;
        -usb-controller|--usb-controller)
            USB_CONTROLLER="${2}"
            shift;
            shift;;
        -mac-cpu|--mac-cpu)
            if [[ $2 == "skylake"* || $2 == "haswell"* ]]; then 
                MAC_CPU="${2}" ; shift
            fi
            shift;;
        -extra_args|--extra_args)
            EXTRA_ARGS="${2}"
            shift;
            shift;;

I am going to be to be away for a couple of days, so posting work so far here.

I built Sonoma today using haswell1 but then launched and set it up as skylake5.

I think waiting the time at 'finished in a minute' is the key. I still want to test as skylake5 but wait longer.

Have a play.

from quickemu.

flexiondotorg avatar flexiondotorg commented on June 18, 2024

@TuxVinyards Thanks! I'll submit (and likely merge) a pull request that incorporates a some of what you've shared here.

Although this particular issue will be closed by that PR, I do appreciate your work in this area and welcome any improvements you might propose in the future.

from quickemu.

flexiondotorg avatar flexiondotorg commented on June 18, 2024

Prior to the commit above, I could reproduce the very long "just a minute" during the install, but following the change above I've successfully installed Mojave, Catalina, Big Sur, Monterey, Ventura and Sonoma without any undue delays.

I've removed High Sierra because the recovery servers are no longer available for that release and therefore it can't be installed.

from quickemu.

TuxVinyards avatar TuxVinyards commented on June 18, 2024

SUCCESS 🥳

            case ${macos_release} in
                ventura|sonoma)
                    if check_cpu_flag sse4_2 && check_cpu_flag avx2; then
                        CPU="-cpu Haswell-v2,kvm=on,vendor=GenuineIntel,+avx,+avx2,+sse,+sse2,+ssse3,+sse4.1,+sse4.2,+rdtscp"
                        #CPU="-cpu Skylake-Server-v3,kvm=on,vendor=GenuineIntel,+avx,+avx2,+sse,+sse2,+ssse3,+sse4.1,+sse4.2,+rdtscp"
                        #if check_cpu_flag pdpe1gb ; then CPU+=",+pdpe1gb" ; fi
                        #if check_cpu_flag smap ; then CPU+=",+smap" ; fi
                        #if check_cpu_flag clwb ; then CPU+=",+clwb" ; fi
                        #if check_cpu_flag adx ; then CPU+=",+adx" ; fi
                    else
                        echo "ERROR! macOS ${macos_release} requires a CPU with SSE 4.2 and AVX2 support."
                        exit 1
                    fi ;;
                catalina|big-sur|monterey)
                    if check_cpu_flag sse4_2; then
                        CPU="-cpu Haswell-v2,kvm=on,vendor=GenuineIntel,+avx,+sse,+sse2,+ssse3,+sse4.1,+sse4.2,+rdtscp"
                    else
                        echo "ERROR! macOS ${macos_release} requires a CPU with SSE 4.2 support."
                        exit 1
                    fi ;;
                *)
                    if check_cpu_flag sse4_1; then
                        CPU="-cpu Penryn,kvm=on,vendor=GenuineIntel,+sse,+sse2,+ssse3,+sse4.1"
                    else
                        echo "ERROR! macOS ${macos_release} requires a CPU with SSE 4.1 support."
                        exit 1
                    fi ;;
            esac

            local FLAG=""

            if [[ $CPU == *'Penryn'* ]]; then
                for FLAG in tsc vme fxsr mmx clflush pse36 pat cmov mca pge mtrr sep apic cx8 \
                            mce pae msr pse de fp87 cx16 lm nx syscall ; do
                    if check_cpu_flag "${FLAG}"; then CPU+=",+${FLAG}" ; fi
                done
                if check_cpu_flag lahf_lm ; then CPU+=",+lahf-lm" ; fi
            else
                if ! check_cpu_flag fma || ! check_cpu_flag rdtscp; then
                    echo "ERROR! macOS requires a CPU with FMA and TSC support."
                    exit 1
                fi
                for FLAG in vmx abm aes bmi1 bmi2 cx8 eist f16c fma \
                            mmx movbe mpx popcnt smep vaes vbmi2 vpclmulqdq \
                            fxsr clflush pse36 pat cmov mca pge mtrr sep apic cx8 \
                            mce pae msr tsc pse de fp87 x2apic cx16 \
                            pcid f16c rdrand lm nx syscall fsgsbase erms invpcid arat \
                            xgetbv1 xsave xsaveopt ; do
                    if check_cpu_flag "${FLAG}"; then CPU+=",+${FLAG}" ; fi
                done
                if check_cpu_flag tsc_adjust ; then CPU+=",+tsc-adjust" ; fi
                if check_cpu_flag lahf_lm ; then CPU+=",+lahf-lm" ; fi
                if check_cpu_flag amd_ssbd ; then CPU+=",+amd-ssbd" ; fi
            fi

Tested with FULL complete installs of Sonoma, Catalina and Mojave. Full setup with login and preferences set. Shutdown and re-login as working.

Much faster than previously with 4.9.2 through 4.9.4 etc. Fully working, no hangs, no stalls.

Of new, now requires the installer icon to be pressed on the restarts. This now happens a couple of times. But this all flows smoothly.

CAVEAT: not yet tested on Ryzen. Volunteers please ...

Additionally note the Skylake version is also working. This is commented out but has been tested on Sonoma. cpu_cores="8" should be placed in the .conf before running.

A conf selector for skylake should be considered, or at least noted and archived in case of future problems.

Also see notes and comments in #1214

from quickemu.

lj3954 avatar lj3954 commented on June 18, 2024

A couple of CPU flags are named differently in QEMU, beware. vbmi2, for example, is avx512vbmi2

from quickemu.

lj3954 avatar lj3954 commented on June 18, 2024

Note that PCID appears to be enabled by default with this cpu arg. CPUs which don't support this legacy flag, including the latest Ryzen CPUs, will get warnings. I've included disabling PCID on CPUs which don't support it in my rust quickemu.

from quickemu.

TuxVinyards avatar TuxVinyards commented on June 18, 2024

Note that PCID appears to be enabled by default with this cpu arg. CPUs which don't support this legacy flag, including the latest Ryzen CPUs, will get warnings. I've included disabling PCID on CPUs which don't support it in my rust quickemu.

@lj3954 Thank you for that.

I wasn't fully sure about the inclusion of if check_cpu_flag amd_ssbd ; then CPU+=",+amd-ssbd" ; fi but Qemu docs say this makes things run faster and it follows along in the line of removal of IBRS via haswell-v2, which was key to getting things working for me.

@flexiondotorg you are missing the point of the one-liners. As @lj3954 has also pointed out, some of the flags are need special treatment. This is why I hesitated to write a loop in my initial work. I hadn't determined what was required at that stage. lscpu output sse4_1 needs translating to sse4.1 for Qemu, for example. But also

                if check_cpu_flag tsc_adjust ; then CPU+=",+tsc-adjust" ; fi
                if check_cpu_flag lahf_lm ; then CPU+=",+lahf-lm" ; fi

need the the underscores translating to hyphens.

Edit: also needed for the underscore in the amd_ssbd flag, so this flag won't have worked when it was:

" Tested full installs of Mojave, Catalina, Big Sur, Monterey, Ventura and Sonoma on AMD Ryzen 5950X. "

unfortunately.

from quickemu.

TuxVinyards avatar TuxVinyards commented on June 18, 2024

The following flags are not found in Haswell

                        #if check_cpu_flag pdpe1gb ; then CPU+=",+pdpe1gb" ; fi
                        #if check_cpu_flag smap ; then CPU+=",+smap" ; fi
                        #if check_cpu_flag clwb ; then CPU+=",+clwb" ; fi
                        #if check_cpu_flag adx ; then CPU+=",+adx" ; fi

Which is why they were treated separately.

Edit: The commit has `pdpe1gb' with a minus but probably could just be omitted, to avoid confusion

smap and clwb are not present but adx is.

from quickemu.

TuxVinyards avatar TuxVinyards commented on June 18, 2024

CPU="-cpu ${CPU_MODEL},vendor=GenuineIntel,-pdpe1gb,+avx,+sse,+sse2,+sse3,vmware-cpuid-freq=on"

Again sse3 is not a valid qemu parameter:

 qemu-system-x86_64 -cpu help | grep -A 100 flags | tr ' ' '\n' | grep sse | cat -s 
misalignsse
sse
sse2
sse4.1
sse4.2
sse4a
ssse3

from quickemu.

lj3954 avatar lj3954 commented on June 18, 2024

Again sse3 is not a valid qemu parameter:

QEMU appears to refer to sse3 as pni. For many of these flags, though, I think it's likely they're enabled by default when you specify Haswell or whatever other architecture. SSE3, for example, was introduced in 2004. Surely anything expecting a Haswell CPU would require it.

from quickemu.

TuxVinyards avatar TuxVinyards commented on June 18, 2024

Again sse3 is not a valid qemu parameter:

QEMU appears to refer to sse3 as pni. For many of these flags, though, I think it's likely they're enabled by default when you specify Haswell or whatever other architecture. SSE3, for example, was introduced in 2004. Surely anything expecting a Haswell CPU would require it.

It works the other way round. ssse3 includes sse3 Try lscpu | grep sse or :

lscpu | grep -i flags | tr ' ' '\n' | grep sse
sse
sse2
ssse3
sse4_1
sse4_2

from quickemu.

TuxVinyards avatar TuxVinyards commented on June 18, 2024

A couple of CPU flags are named differently in QEMU, beware. vbmi2, for example, is avx512vbmi2

Well spotted. Not sure where that came from.

lscpu | grep -i flags | tr ' ' '\n' | grep bmi
bmi1
bmi2
avx512vbmi
avx512_vbmi2

qemu-system-x86_64 -cpu help | grep -A 100 flags | tr ' ' '\n' | grep bmi | cat -s
avx512vbmi
avx512vbmi2
bmi1
bmi2

from quickemu.

flexiondotorg avatar flexiondotorg commented on June 18, 2024

I've incorporated the feedback in my feature branch, macos-host and created a new function, configure_cpu_flag(), which converts the appropriate flag to QEMU format.

What I have implemented does deviate slightly from the discussion because it also works for running macOS VMs on macOS hosts, and therefore handles macOS CPU flag conversions too.

If the host CPU is "GenuineIntel" then quickemu passes the host CPU model features, model, stepping, exactly to the guest. This is what the broader macOS on QEMU community recommends. I've tested this on Linux with Intel Xeon E-2176M and on macOS with Intel Core i7-4770HQ. If the host is not "GenuineIntel" then configure_cpu_flag() does its thing, including outright disabling pcid on "AuthenticAMD". I've tested this in Linux with Ryzen 5950X and 5900X using VMs of macOS Mojave, Catalina, Big Sur, Monterey, Ventura and Sonoma. All works well.

Fully disabling huge pages (,-pdpe1gb) is absolutely required on macOS to prevent crashes on every attempted boot:

Therefore, because it is now possible to run a macOS VM that, in turn, can run a VM, huge pages are always disabled on macOS hosts and guests.

from quickemu.

TuxVinyards avatar TuxVinyards commented on June 18, 2024

Wow

from quickemu.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.