Docker-OSX icon indicating copy to clipboard operation
Docker-OSX copied to clipboard

Sonoma won't work

Open tyu1996 opened this issue 1 year ago • 37 comments

So after the failed attempt to install Ventura (it just doesn't work even I followed #571), but I successfully installed the Monterey followed the issue mentioned. Installed Sonoma update from App Store, now it becomes an unending reboot loop.

Am going to re-install Sonoma from its recovery boot, will tell again if it works.

(I'm using Win 11 WSL2 Ubuntu Jammy for docker)

Edit: Returned a failed installation.

tyu1996 avatar Nov 15 '23 05:11 tyu1996

Working on it rn

sickcodes avatar Nov 16 '23 14:11 sickcodes

Any way we can help to debug/dissect this problem @sickcodes ? (process, specific tools..)

RichardFevrier avatar Nov 23 '23 10:11 RichardFevrier

Here are some logs just in case.

Screenshot from 2023-11-23 13-57-35 Screenshot from 2023-11-23 13-58-08

RichardFevrier avatar Nov 23 '23 13:11 RichardFevrier

@RichardFevrier I have the exact same issue with original OSX-KVM project Screenshot from 2023-11-23 19-34-09 Same for Ventura/Sonoma

khmyznikov avatar Nov 23 '23 18:11 khmyznikov

Related to #714

RichardFevrier avatar Nov 24 '23 08:11 RichardFevrier

Folks, try to install Big Sur first, then update to Sonoma, and change -cpu Penryn to -cpu host

khmyznikov avatar Nov 24 '23 16:11 khmyznikov

Folks, try to install Big Sur first, then update to Sonoma, and change -cpu Penryn to -cpu host

i tried but when it asks for reboot the installation is where it fails, i tried changing the --restart flag too when running docker but no luck, tried --restart unless-stopped but it started restarting every 10 - 15 minutes even doing nothing and don't know why.

Heryk13 avatar Nov 25 '23 00:11 Heryk13

I have this exact same problem when trying to install Sonoma in the OSX-KVM project from Kholia.

guimox avatar Nov 25 '23 01:11 guimox

I've also had this issue. The Ventura installer fails to copy bootbase.efi and crashes, Sonoma from the app store and from a recovery installer causes a bootloop regardless, and there aren't any current fixes. Having messed around with macOS in VMware for a while now, the bootlooping behaviour can be replicated by installing macOS 13 < and rebooting. From what research I've done, the reason that Ventura and above don't work for some is due to hardware limitations on Ryzen CPUs specifically, and is unavoidable save for some CPUID magic that we're unaware of. The issue most likely stems from the fact that Ventura supports M series chips as well as x86, and if there were some way to replicate an M1 CPUID that it would subvert the problem. Something to look into?

voidarclabs avatar Nov 27 '23 20:11 voidarclabs

I've also had this issue. The Ventura installer fails to copy bootbase.efi and crashes, Sonoma from the app store and from a recovery installer causes a bootloop regardless, and there aren't any current fixes. Having messed around with macOS in VMware for a while now, the bootlooping behaviour can be replicated by installing macOS 13 < and rebooting. From what research I've done, the reason that Ventura and above don't work for some is due to hardware limitations on Ryzen CPUs specifically, and is unavoidable save for some CPUID magic that we're unaware of. The issue most likely stems from the fact that Ventura supports M series chips as well as x86, and if there were some way to replicate an M1 CPUID that it would subvert the problem. Something to look into?

wow it makes sense, my computer cpu is ryzen 7 5700U

Heryk13 avatar Nov 29 '23 02:11 Heryk13

I do not think its related only to Ryzen processors. I have the same issue on my Intel Core i7-13700K processor

bluesailor45 avatar Dec 01 '23 10:12 bluesailor45

I guess no one found a fix for this

HDK101 avatar Dec 05 '23 16:12 HDK101

I guess no one found a fix for this

For me -cpu host did the trick, but need to install Big Sur first. I have 10 gen i7

khmyznikov avatar Dec 06 '23 14:12 khmyznikov

There are two problems with installing Sonoma. First, you need to change the -cpu parameter to host, otherwise it will restart indefinitely when you try to start it after installation. Second, during online installation, I don’t know why the recovery environment will try to download the installation resources of the arm series, resulting in an error that it cannot be found. bootbase.efi, just execute the following command after the disk tool formats the partition.

mkdir -p /Volumes/'partition name'/private/tmp
cp -R "/Install macOS Sonoma.app" /Volumes/'partition name'/private/tmp/
mkdir "/Volumes/'partition name'/private/tmp/Install macOS Sonoma.app/Contents/SharedSupport"
curl -L -o "/Volumes/'partition name'/private/tmp/Install macOS Sonoma.app/Contents/SharedSupport/SharedSupport.dmg" https://swcdn.apple.com/content/downloads/24/37/052-09398-A_DIKZGBNOM0/y4rz9dued01dtyl65nxqgd08wj2ar5cr6v/InstallAssistant.pkg
"/Volumes/'partition name'/private/tmp/Install macOS Sonoma.app/Contents/MacOS/InstallAssistant_springboard"

Gucan avatar Dec 06 '23 17:12 Gucan

There are two problems with installing Sonoma. First, you need to change the -cpu parameter to host, otherwise it will restart indefinitely when you try to start it after installation. Second, during online installation, I don’t know why the recovery environment will try to download the installation resources of the arm series, resulting in an error that it cannot be found. bootbase.efi, just execute the following command after the disk tool formats the partition.

mkdir -p /Volumes/'partition name'/private/tmp
cp -R "/Install macOS Sonoma.app" /Volumes/'partition name'/private/tmp/
mkdir "/Volumes/'partition name'/private/tmp/Install macOS Sonoma.app/Contents/SharedSupport"
curl -L -o "/Volumes/'partition name'/private/tmp/Install macOS Sonoma.app/Contents/SharedSupport/SharedSupport.dmg" https://swcdn.apple.com/content/downloads/24/37/052-09398-A_DIKZGBNOM0/y4rz9dued01dtyl65nxqgd08wj2ar5cr6v/InstallAssistant.pkg
"/Volumes/'partition name'/private/tmp/Install macOS Sonoma.app/Contents/MacOS/InstallAssistant_springboard"

I can confirm this works. Just did a fresh install of Sonoma using this method with kholia/OSX-KVM.

ShiftHackZ avatar Dec 07 '23 11:12 ShiftHackZ

There are two problems with installing Sonoma. First, you need to change the -cpu parameter to host, otherwise it will restart indefinitely when you try to start it after installation. Second, during online installation, I don’t know why the recovery environment will try to download the installation resources of the arm series, resulting in an error that it cannot be found. bootbase.efi, just execute the following command after the disk tool formats the partition.

mkdir -p /Volumes/'partition name'/private/tmp
cp -R "/Install macOS Sonoma.app" /Volumes/'partition name'/private/tmp/
mkdir "/Volumes/'partition name'/private/tmp/Install macOS Sonoma.app/Contents/SharedSupport"
curl -L -o "/Volumes/'partition name'/private/tmp/Install macOS Sonoma.app/Contents/SharedSupport/SharedSupport.dmg" https://swcdn.apple.com/content/downloads/24/37/052-09398-A_DIKZGBNOM0/y4rz9dued01dtyl65nxqgd08wj2ar5cr6v/InstallAssistant.pkg
"/Volumes/'partition name'/private/tmp/Install macOS Sonoma.app/Contents/MacOS/InstallAssistant_springboard"

This worked for me as well, using OSX-KVM. But using docker-osx is there anyway to override the cpu type?

Also Sonoma in OSX-KVM was much much slower and laggier than Ventura in docker-osx, on the same host and with the same resources - have others found this as well?

yaakovfeldman avatar Dec 10 '23 12:12 yaakovfeldman

I was able to install Ventura with OSX-KVM procedure after changing in the OpenCore-Boot.sh file to the '-cpu host' parameter. However I do not know how to change the -cpu parameter in the docker procedure (sickcodes/docker-OSX). In addition I do not understand how to execute the commands recommended after the disk format tool, as I understand this is the disk format tool within the MacOS Install. Is anybod pleased to explain the exact procedures using the sickcodes/docker-OSX procedures?

bluesailor45 avatar Dec 22 '23 15:12 bluesailor45

I was able to install Ventura with OSX-KVM procedure after changing in the OpenCore-Boot.sh file to the '-cpu host' parameter. However I do not know how to change the -cpu parameter in the docker procedure (sickcodes/docker-OSX). In addition I do not understand how to execute the commands recommended after the disk format tool, as I understand this is the disk format tool within the MacOS Install. Is anybod pleased to explain the exact procedures using the sickcodes/docker-OSX procedures?

To execute the commands just open Terminal, which is a menu option within the install environment.

To change the cpu parameter would probably involve rebuilding the dockerfile as it doesn’t seem to be exposed as configurable, although I assume @sickcodes will eventually update it as they are apparently working on support.

yaakovfeldman avatar Dec 23 '23 17:12 yaakovfeldman

I was able to install Ventura with sickcodes/docker-OSX only adding the "-e CORES=4 " to the docker coomand: docker run -it
--device /dev/kvm
-p 50922:10022
-v /tmp/.X11-unix:/tmp/.X11-unix
-e "DISPLAY=${DISPLAY:-:0.0}"
-e GENERATE_UNIQUE=true
-e CORES=4
-e MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom.plist'
sickcodes/docker-osx:ventura

after several 'restarts' in the install process it finally installed OK. Only two problems as so far:

  1. "Volume hash mismatch" pops up on MacOS
  2. Safary shows only contents when activating e.g the 'about Safari' popup window. or anothe popup window.

bluesailor45 avatar Dec 24 '23 13:12 bluesailor45

fwiw, i was able to install sonoma using the sonoma branch (you may need to rebuild container to get latest OSX-KVM which appears to contain some important changes?).

I did need one change, courtesy of the venerable notes.md in OSX-KVM.

diff --git a/Dockerfile b/Dockerfile
index f73c12c..6cf57c4 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -194,7 +194,7 @@ RUN touch Launch.sh \
     && tee -a Launch.sh <<< '[[ "${RAM}" = half ]] && export RAM="$(("$(head -n1 /proc/meminfo | tr -dc "[:digit:]") / 2000000"))"' \
     && tee -a Launch.sh <<< 'sudo chown -R $(id -u):$(id -g) /dev/snd 2>/dev/null || true' \
     && tee -a Launch.sh <<< 'exec qemu-system-x86_64 -m ${RAM:-4}000 \' \
-    && tee -a Launch.sh <<< '-cpu ${CPU:-Penryn},${CPUID_FLAGS:-vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check,}${BOOT_ARGS} \' \
+    && tee -a Launch.sh <<< '-cpu ${CPU:-Haswell-noTSX},${CPUID_FLAGS:-vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check,}${BOOT_ARGS} \' \
     && tee -a Launch.sh <<< '-machine q35,${KVM-"accel=kvm:tcg"} \' \
     && tee -a Launch.sh <<< '-smp ${CPU_STRING:-${SMP:-4},cores=${CORES:-4}} \' \
     && tee -a Launch.sh <<< '-usb -device usb-kbd -device usb-tablet \' \
@@ -296,7 +296,7 @@ ENV BOOT_ARGS=
 ENV BOOTDISK=

 # edit the CPU that is being emulated
-ENV CPU=Penryn
+ENV CPU=Haswell-noTSX
 ENV CPUID_FLAGS='vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check,'

 ENV DISPLAY=:0.0
diff --git a/Dockerfile.naked b/Dockerfile.naked
index 712d059..bf0e4f9 100644
--- a/Dockerfile.naked
+++ b/Dockerfile.naked
@@ -126,7 +126,7 @@ ENV BOOT_ARGS=
 ENV BOOTDISK=

 # edit the CPU that is beign emulated
-ENV CPU=Penryn
+ENV CPU=Haswell-noTSX

 ENV DISPLAY=:99

ndrewh avatar Jan 13 '24 03:01 ndrewh

I have to limit my Sonoma VM to a single CPU core/thread, otherwise it will freeze during boot. Wondering if someone else has the same issue.

awsms avatar Jan 30 '24 08:01 awsms

I have to limit my Sonoma VM to a single CPU core/thread, otherwise it will freeze during boot. Wondering if someone else has the same issue.

Nope 8 cores 2 threads for each.

RichardFevrier avatar Jan 30 '24 10:01 RichardFevrier

I have to limit my Sonoma VM to a single CPU core/thread, otherwise it will freeze during boot. Wondering if someone else has the same issue.

Same issue here: https://github.com/sickcodes/Docker-OSX/issues/380#issuecomment-1505166214 Big Sur works fine for me though, only Sonoma requires this workaround (my CPU is a Ryzen 5 5600H)

awsms avatar Jan 31 '24 08:01 awsms

On docker run, I put -e CPU=Haswell-noTSX and it works:

docker run --rm -it \
    --privileged \
    --device /dev/kvm \
    -e CPU=Haswell-noTSX \
   ...

I don't need to do the mentioned by Gucan (mkdir ...) https://github.com/sickcodes/Docker-OSX/issues/715#issuecomment-1843299658

dumabg avatar Feb 20 '24 12:02 dumabg

I can also confirm doing the -e CPU=Haswell-noTSX flag works. I have a Ryzen 5 5600G.

I found pacman to be a major blocker to building the DockerFile and had to add the following to retry packages

RUN pacman -Sy wget --noconfirm
RUn echo "DisableDownloadTimeout" >> /etc/pacman.conf
RUN echo "XferCommand = /usr/bin/wget --passive-ftp -q --show-progress -O %o %u" >> /etc/pacman.conf

So far Sonoma is installing well.

andrewcharnley avatar Feb 24 '24 21:02 andrewcharnley

Bit offtopic, but can you use Xcode with Sonoma? I still couldn't install it, getting all kind of weird errors with the installation. For example I don't have input if I use Haswell-noTSX on amd 5600g

mihalycsaba avatar Mar 08 '24 13:03 mihalycsaba

Bit offtopic, but can you use Xcode with Sonoma? I still couldn't install it, getting all kind of weird errors with the installation. For example I don't have input if I use Haswell-noTSX on amd 5600g

Yes.

dumabg avatar Mar 08 '24 14:03 dumabg

I have managed to install Sonoma with Haswell-noTSX but keyboard and mouse input doesn't work.

mihalycsaba avatar Mar 08 '24 19:03 mihalycsaba

I have managed to install Sonoma with Haswell-noTSX but keyboard and mouse input doesn't work.

Hi! I had the same problem. Have you been able to solve it?

Lorena301 avatar Mar 08 '24 21:03 Lorena301

I was able to get sonoma, after upgrading from Big Sur. But I'm having the same problem as @Lorena301 . The interface is not responding to mouse and keyboard. Any clue?

diff --git a/Dockerfile b/Dockerfile
index f73c12c..6cf57c4 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -194,7 +194,7 @@ RUN touch Launch.sh \
     && tee -a Launch.sh <<< '[[ "${RAM}" = half ]] && export RAM="$(("$(head -n1 /proc/meminfo | tr -dc "[:digit:]") / 2000000"))"' \
     && tee -a Launch.sh <<< 'sudo chown -R $(id -u):$(id -g) /dev/snd 2>/dev/null || true' \
     && tee -a Launch.sh <<< 'exec qemu-system-x86_64 -m ${RAM:-4}000 \' \
-    && tee -a Launch.sh <<< '-cpu ${CPU:-Penryn},${CPUID_FLAGS:-vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check,}${BOOT_ARGS} \' \
+    && tee -a Launch.sh <<< '-cpu ${CPU:-Haswell-noTSX},${CPUID_FLAGS:-vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check,}${BOOT_ARGS} \' \
     && tee -a Launch.sh <<< '-machine q35,${KVM-"accel=kvm:tcg"} \' \
     && tee -a Launch.sh <<< '-smp ${CPU_STRING:-${SMP:-4},cores=${CORES:-4}} \' \
     && tee -a Launch.sh <<< '-usb -device usb-kbd -device usb-tablet \' \
@@ -296,7 +296,7 @@ ENV BOOT_ARGS=
 ENV BOOTDISK=
 
 # edit the CPU that is being emulated
-ENV CPU=Penryn
+ENV CPU=Haswell-noTSX
 ENV CPUID_FLAGS='vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check,'
 
 ENV DISPLAY=:0.0
docker build -t docker-osx:local-big-sur --build-arg SHORTNAME=big-sur .

docker run -it \
    --device /dev/kvm \
    -p 50923:10022 \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -e "DISPLAY=${DISPLAY:-:0.0}" \
    -e RAM=32 \
    -e CPU=Haswell-noTSX \
    --name diogo_macos_sonoma \
    docker-osx:local-big-sur

My CPU is an AMD Ryzen 7 3800X.

dmelo avatar Mar 08 '24 23:03 dmelo