sickcodes / Docker-OSX

Run macOS VM in a Docker! Run near native OSX-KVM in Docker! X11 Forwarding! CI/CD for OS X Security Research! Docker mac Containers.
https://hub.docker.com/r/sickcodes/docker-osx
GNU General Public License v3.0
36.1k stars 1.78k forks source link

Error while installing macOS Ventura #667

Open pedroreglero opened 1 year ago

pedroreglero commented 1 year ago

OS related issued, please help us identify the issue by posting the output of this

Linux 8fcdbf348545 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 GNU/Linux :0 tee: /sys/module/kvm/parameters/ignore_msrs: Read-only file system 1 NAME="Arch Linux" PRETTY_NAME="Arch Linux" Filesystem Size Used Avail Use% Mounted on overlay 1007G 29G 927G 4% / QEMU emulator version 7.1.0 Copyright (c) 2003-2022 Fabrice Bellard and the QEMU Project developers libvirtd (libvirt) 8.9.0 total used free shared buff/cache available Mem: 11Gi 5.2Gi 152Mi 17Mi 6.3Gi 6.2Gi Swap: 3.0Gi 494Mi 2.5Gi 16 egrep: warning: egrep is obsolescent; using grep -E 16 crw-rw-rw- 1 arch arch 10, 232 Jun 8 12:16 /dev/kvm total 8.0K drwxrwxrwx 2 root root 60 Jun 8 08:34 . drwxrwxrwt 1 root root 4.0K Jun 8 12:17 .. srwxrwxrwx 1 arch arch 0 Jun 8 08:34 X0 arch 1066 0.0 0.0 3976 2112 pts/1 S+ 12:56 0:00 grep dockerd sh: docker: command not found kvm:x:992:libvirt-qemu,qemu libvirt:x:973: libvirt-qemu:x:970: libvirtdbus:x:969:

When running the macOS Ventura installation, at the end I get this error:

image Longer Log: image

Running in Windows 11 Clean Docker installation.

pedroreglero commented 1 year ago

Installation works fine for macOS Monterey

LiushuiXiaoxia commented 1 year ago

me too

image

image

singpolyma commented 1 year ago

yes, I get this same

meloandrefilipe commented 1 year ago

I'm getting the same issue here, already tried on Windows 11 with wsl, last version of Arch Linux and now Ubuntu 23.04. All with the same issue. Screenshot from 2023-06-09 16-54-43

djpfs commented 1 year ago

same error here, i'm using ubuntu 22.04

LiushuiXiaoxia commented 1 year ago

use offline install maby be success.

image

1: download macos 13, https://mrmacintosh.com/macos-ventura-13-full-installer-database-download-directly-from-apple/

2: clone this repo, https://github.com/kholia/OSX-KVM

3: make ventura img by sh create_dmg_ventura.sh

image

4: repace BaseSystem.img to Ventura.dmg in OpenCore-Boot.sh

5: ./OpenCore-Boot.sh to install, may be alos fail, just retry

#!/usr/bin/env bash

# Special thanks to:
# https://github.com/Leoyzen/KVM-Opencore
# https://github.com/thenickdude/KVM-Opencore/
# https://github.com/qemu/qemu/blob/master/docs/usb2.txt
#
# qemu-img create -f qcow2 mac_hdd_ng.img 128G
#
# echo 1 > /sys/module/kvm/parameters/ignore_msrs (this is required)

############################################################################
# NOTE: Tweak the "MY_OPTIONS" line in case you are having booting problems!
############################################################################

MY_OPTIONS="+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check"

# This script works for Big Sur, Catalina, Mojave, and High Sierra. Tested with
# macOS 10.15.6, macOS 10.14.6, and macOS 10.13.6.

#ALLOCATED_RAM="4096" # MiB
ALLOCATED_RAM="8192" # MiB
CPU_SOCKETS="1"
CPU_CORES="2"
CPU_THREADS="4"

REPO_PATH="."
OVMF_DIR="."

# shellcheck disable=SC2054
args=(
  -enable-kvm -m "$ALLOCATED_RAM" -cpu Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,"$MY_OPTIONS"
  -machine q35
  -usb -device usb-kbd -device usb-tablet
  #-smp "$CPU_THREADS",cores="$CPU_CORES",sockets="$CPU_SOCKETS"
  -smp threads="$CPU_THREADS",cores="$CPU_CORES",sockets="$CPU_SOCKETS"
  -device usb-ehci,id=ehci
  # -device usb-kbd,bus=ehci.0
  # -device usb-mouse,bus=ehci.0
  -device nec-usb-xhci,id=xhci
  -global nec-usb-xhci.msi=off
  -global ICH9-LPC.acpi-pci-hotplug-with-bridge-support=off
  # -device usb-host,vendorid=0x8086,productid=0x0808  # 2 USD USB Sound Card
  # -device usb-host,vendorid=0x1b3f,productid=0x2008  # Another 2 USD USB Sound Card
  -device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
  -drive if=pflash,format=raw,readonly=on,file="$REPO_PATH/$OVMF_DIR/OVMF_CODE.fd"
  #-drive if=pflash,format=raw,file="$REPO_PATH/$OVMF_DIR/OVMF_VARS-1920x1080.fd"
  -drive if=pflash,format=raw,file="$REPO_PATH/$OVMF_DIR/OVMF_VARS.fd"
  -smbios type=2
  -device ich9-intel-hda -device hda-duplex
  -device ich9-ahci,id=sata
  -drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file="$REPO_PATH/OpenCore/OpenCore.qcow2"
  -device ide-hd,bus=sata.2,drive=OpenCoreBoot
  #-device ide-hd,bus=sata.3,drive=InstallMedia
  #-drive id=InstallMedia,if=none,file="$REPO_PATH/BaseSystem.img",format=raw
  -drive id=InstallMedia,if=virtio,file="$REPO_PATH/Ventura.dmg",format=raw
  -drive id=MacHDD,if=virtio,file="$REPO_PATH/mac_hdd_ng.img",format=qcow2
  #-drive id=MacHDD,if=none,file="$REPO_PATH/mac_hdd_ng.img",format=qcow2
  #-device ide-hd,bus=sata.4,drive=MacHDD
  # -netdev tap,id=net0,ifname=tap0,script=no,downscript=no -device virtio-net-pci,netdev=net0,id=net0,mac=52:54:00:c9:18:27
  -netdev user,id=net0 -device virtio-net-pci,netdev=net0,id=net0,mac=52:54:00:c9:18:27
  # -netdev user,id=net0 -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:c9:18:27  # Note: Use this line for High Sierra
  #-monitor stdio
  #-device vmware-svga
  -vga virtio
)

qemu-system-x86_64 "${args[@]}"
singpolyma commented 1 year ago

@LiushuiXiaoxia one needs to already be on MacOS to use hdiutil and thus the create_dmg_ventura.sh script

LiushuiXiaoxia commented 1 year ago

@LiushuiXiaoxia one needs to already be on MacOS to use hdiutil and thus the create_dmg_ventura.sh script

that is the problem. you can install the old version first, such as macos Monterey

singpolyma commented 1 year ago

I tried that, it installs but doesn't boot #668

LiushuiXiaoxia commented 1 year ago

I tried that, it installs but doesn't boot #668

I mean, you install macos Monterey at first.

then, download OSX-KVM to create ventura.dmg (on montery )

copy ventura.dmg to linux os,

finally to install ventura on linux os (use osx-kvm, not docker-osx)

pedroreglero commented 1 year ago

I tried that, it installs but doesn't boot #668

I mean, you install macos Monterey at first.

then, download OSX-KVM to create ventura.dmg (on montery )

copy ventura.dmg to linux os,

finally to install ventura on linux os (use osx-kvm, not docker-osx)

I already tried that and it gets past that point but still doesn't boot.

LiushuiXiaoxia commented 1 year ago

I tried that, it installs but doesn't boot #668

I mean, you install macos Monterey at first. then, download OSX-KVM to create ventura.dmg (on montery ) copy ventura.dmg to linux os, finally to install ventura on linux os (use osx-kvm, not docker-osx)

I already tried that and it gets past that point but still doesn't boot.

I tried and it was okay,

First you need to get mac_hdd_ng.img by osx-kvm

The second is to launch docker by Docker-OSX,such as

docker run -it \
    --device /dev/kvm \
    -p 50922:10022 \
    -v "${PWD}/mac_hdd_ng.img:/image" \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -e "DISPLAY=${DISPLAY:-:0.0}" \
    -e GENERATE_UNIQUE=true \
    -e MASTER_PLIST_URL=https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/custom/config-nopicker-custom.plist \
    sickcodes/docker-osx:naked

Maybe this step is a failure because the osx-kvm in sickcodes/docker-osx:naked is old

LiushuiXiaoxia commented 1 year ago

osx-kvm in sickcodes/docker-osx:naked is earlier version

  1. copy origin Launch.sh from naked
    docker cp {containerId}:/home/arch/OSX-KVM/Launch.sh  ./LaunchReal.sh
  2. Add Launch.sh in local
#!/bin/bash
cd /home/arch

# 方法1
git clone --depth 1 --recursive https://github.com/kholia/OSX-KVM.git OSX-KVM2
cd OSX-KVM2

# 方法2
# cp -r OSX-KVM OSX-KVM2
# cd OSX-KVM2
# git add .
# git reset --hard HEAD
# git fetch --depth 1
# git reset --hard origin/HEAD

echo "use new opencore"
cp ../LaunchReal.sh ./LaunchReal.sh
sh LaunchReal.sh
  1. restart docker such as (replace origin Launch.sh)
docker run -it \
    --device /dev/kvm \
    -p 50922:10022 \
    -v "${PWD}/mac_hdd_ng.img:/image" \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -e "DISPLAY=${DISPLAY:-:0.0}" \
    -e GENERATE_UNIQUE=true \
    -e MASTER_PLIST_URL=https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/custom/config-nopicker-custom.plist \
    -v "${PWD}/Launch.sh:/home/arch/OSX-KVM/Launch.sh" \
    -v "${PWD}/LaunchReal.sh:/home/arch/LaunchReal.sh" \
    sickcodes/docker-osx:naked
pedroreglero commented 1 year ago

osx-kvm in sickcodes/docker-osx:naked is earlier version

  1. copy origin Launch.sh from naked
docker cp {containerId}:/home/arch/OSX-KVM/Launch.sh  ./LaunchReal.sh
  1. Add Launch.sh in local
#!/bin/bash
cd /home/arch

# 方法1
git clone --depth 1 --recursive https://github.com/kholia/OSX-KVM.git OSX-KVM2
cd OSX-KVM2

# 方法2
# cp -r OSX-KVM OSX-KVM2
# cd OSX-KVM2
# git add .
# git reset --hard HEAD
# git fetch --depth 1
# git reset --hard origin/HEAD

echo "use new opencore"
cp ../LaunchReal.sh ./LaunchReal.sh
sh LaunchReal.sh
  1. restart docker such as (replace origin Launch.sh)
docker run -it \
    --device /dev/kvm \
    -p 50922:10022 \
    -v "${PWD}/mac_hdd_ng.img:/image" \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -e "DISPLAY=${DISPLAY:-:0.0}" \
    -e GENERATE_UNIQUE=true \
    -e MASTER_PLIST_URL=https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/custom/config-nopicker-custom.plist \
    -v "${PWD}/Launch.sh:/home/arch/OSX-KVM/Launch.sh" \
    -v "${PWD}/LaunchReal.sh:/home/arch/LaunchReal.sh" \
    sickcodes/docker-osx:naked

Thanks for the help, I get a black screen when booting. Can you do a complete explanation on how to run that? I think I might be missing steps.

Greetings.

pedroreglero commented 1 year ago

Updating to Ventura from Moajve I can't boot image

LiushuiXiaoxia commented 1 year ago

I use this project as the ios ci system, so I don't need a gui.

Updating to Ventura from Moajve I can't boot image

just reboot ?

pedroreglero commented 1 year ago

I use this project as the ios ci system, so I don't need a gui.

Updating to Ventura from Moajve I can't boot image

just reboot ?

The same happens every time I boot, it gets stuck there.

LiushuiXiaoxia commented 1 year ago

you can not upgrade from Moajve (hackintosh) to Ventura,

Iook this

https://github.com/sickcodes/Docker-OSX/issues/667#issuecomment-1590510541

ni need create ventura .img in Moajve (macos). and then use osx-kvm do upgrading (linux).

https://www.youtube.com/watch?v=_5XVYF4CwR4&ab_channel=HikmatEUstad

pedroreglero commented 1 year ago

you can not upgrade from Moajve (hackintosh) to Ventura,

Iook this

#667 (comment)

ni need create ventura .img in Moajve (macos). and then use osx-kvm do upgrading (linux).

https://www.youtube.com/watch?v=_5XVYF4CwR4&ab_channel=HikmatEUstad

I downloaded the Ventura installer inside Mojave, used the create_dmg_ventura.sh script and got the Ventura.dmg file back to linux. But when I run "dmg2img -i BaseSystem.dmg BaseSystem.img" I get "ERROR: dmg image is corrupted"

LiushuiXiaoxia commented 1 year ago

you can not upgrade from Moajve (hackintosh) to Ventura, Iook this #667 (comment) ni need create ventura .img in Moajve (macos). and then use osx-kvm do upgrading (linux). https://www.youtube.com/watch?v=_5XVYF4CwR4&ab_channel=HikmatEUstad

I downloaded the Ventura installer inside Mojave, used the create_dmg_ventura.sh script and got the Ventura.dmg file back to linux. But when I run "dmg2img -i BaseSystem.dmg BaseSystem.img" I get "ERROR: dmg image is corrupted"

you did not need to convert dmg to img

#-drive id=InstallMedia,if=none,file="$REPO_PATH/BaseSystem.img",format=raw
  -drive id=InstallMedia,if=virtio,file="$REPO_PATH/Ventura.dmg",format=raw
pedroreglero commented 1 year ago

you can not upgrade from Moajve (hackintosh) to Ventura, Iook this #667 (comment) ni need create ventura .img in Moajve (macos). and then use osx-kvm do upgrading (linux). https://www.youtube.com/watch?v=_5XVYF4CwR4&ab_channel=HikmatEUstad

I downloaded the Ventura installer inside Mojave, used the create_dmg_ventura.sh script and got the Ventura.dmg file back to linux. But when I run "dmg2img -i BaseSystem.dmg BaseSystem.img" I get "ERROR: dmg image is corrupted"

you did not need to convert dmg to img

#-drive id=InstallMedia,if=none,file="$REPO_PATH/BaseSystem.img",format=raw
  -drive id=InstallMedia,if=virtio,file="$REPO_PATH/Ventura.dmg",format=raw

Had to change: "-drive id=InstallMedia,if=virtio,file="$REPO_PATH/Ventura.dmg",format=raw" to "-drive id=InstallMedia,if=none,file="$REPO_PATH/Ventura.dmg",format=raw" but after that, worked like a charm 😁.

Thanks a lot for your help!!!!

LiushuiXiaoxia commented 1 year ago

😆

jordankoehn commented 1 year ago

Confirmed workaround by using offline install @LiushuiXiaoxia

LiushuiXiaoxia commented 1 year ago

Confirmed workaround by using offline install @LiushuiXiaoxia

😄

mingjing33us commented 10 months ago

osx-kvm in sickcodes/docker-osx:naked is earlier version

  1. copy origin Launch.sh from naked
docker cp {containerId}:/home/arch/OSX-KVM/Launch.sh  ./LaunchReal.sh
  1. Add Launch.sh in local
#!/bin/bash
cd /home/arch

# 方法1
git clone --depth 1 --recursive https://github.com/kholia/OSX-KVM.git OSX-KVM2
cd OSX-KVM2

# 方法2
# cp -r OSX-KVM OSX-KVM2
# cd OSX-KVM2
# git add .
# git reset --hard HEAD
# git fetch --depth 1
# git reset --hard origin/HEAD

echo "use new opencore"
cp ../LaunchReal.sh ./LaunchReal.sh
sh LaunchReal.sh
  1. restart docker such as (replace origin Launch.sh)
docker run -it \
    --device /dev/kvm \
    -p 50922:10022 \
    -v "${PWD}/mac_hdd_ng.img:/image" \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -e "DISPLAY=${DISPLAY:-:0.0}" \
    -e GENERATE_UNIQUE=true \
    -e MASTER_PLIST_URL=https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/custom/config-nopicker-custom.plist \
    -v "${PWD}/Launch.sh:/home/arch/OSX-KVM/Launch.sh" \
    -v "${PWD}/LaunchReal.sh:/home/arch/LaunchReal.sh" \
    sickcodes/docker-osx:naked

Hello

I am trying to follow the steps, I was able to create image in OSX-KVM and I am lost the these steps, first step I could fire up naked container, but How to perform the second step, Could you please elaborate the step 2, add launcher.sh locally? Appreciate it. Thanks

LiushuiXiaoxia commented 10 months ago

osx-kvm in sickcodes/docker-osx:naked is earlier version

  1. copy origin Launch.sh from naked
docker cp {containerId}:/home/arch/OSX-KVM/Launch.sh  ./LaunchReal.sh
  1. Add Launch.sh in local
#!/bin/bash
cd /home/arch

# 方法1
git clone --depth 1 --recursive https://github.com/kholia/OSX-KVM.git OSX-KVM2
cd OSX-KVM2

# 方法2
# cp -r OSX-KVM OSX-KVM2
# cd OSX-KVM2
# git add .
# git reset --hard HEAD
# git fetch --depth 1
# git reset --hard origin/HEAD

echo "use new opencore"
cp ../LaunchReal.sh ./LaunchReal.sh
sh LaunchReal.sh
  1. restart docker such as (replace origin Launch.sh)
docker run -it \
    --device /dev/kvm \
    -p 50922:10022 \
    -v "${PWD}/mac_hdd_ng.img:/image" \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -e "DISPLAY=${DISPLAY:-:0.0}" \
    -e GENERATE_UNIQUE=true \
    -e MASTER_PLIST_URL=https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/custom/config-nopicker-custom.plist \
    -v "${PWD}/Launch.sh:/home/arch/OSX-KVM/Launch.sh" \
    -v "${PWD}/LaunchReal.sh:/home/arch/LaunchReal.sh" \
    sickcodes/docker-osx:naked

Hello

I am trying to follow the steps, I was able to create image in OSX-KVM and I am lost the these steps, first step I could fire up naked container, but How to perform the second step, Could you please elaborate the step 2, add launcher.sh locally? Appreciate it. Thanks

just create file Launch.sh

mingjing33us commented 10 months ago

osx-kvm in sickcodes/docker-osx:naked is earlier version

  1. copy origin Launch.sh from naked
docker cp {containerId}:/home/arch/OSX-KVM/Launch.sh  ./LaunchReal.sh
  1. Add Launch.sh in local
#!/bin/bash
cd /home/arch

# 方法1
git clone --depth 1 --recursive https://github.com/kholia/OSX-KVM.git OSX-KVM2
cd OSX-KVM2

# 方法2
# cp -r OSX-KVM OSX-KVM2
# cd OSX-KVM2
# git add .
# git reset --hard HEAD
# git fetch --depth 1
# git reset --hard origin/HEAD

echo "use new opencore"
cp ../LaunchReal.sh ./LaunchReal.sh
sh LaunchReal.sh
  1. restart docker such as (replace origin Launch.sh)
docker run -it \
    --device /dev/kvm \
    -p 50922:10022 \
    -v "${PWD}/mac_hdd_ng.img:/image" \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -e "DISPLAY=${DISPLAY:-:0.0}" \
    -e GENERATE_UNIQUE=true \
    -e MASTER_PLIST_URL=https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/custom/config-nopicker-custom.plist \
    -v "${PWD}/Launch.sh:/home/arch/OSX-KVM/Launch.sh" \
    -v "${PWD}/LaunchReal.sh:/home/arch/LaunchReal.sh" \
    sickcodes/docker-osx:naked

Hello I am trying to follow the steps, I was able to create image in OSX-KVM and I am lost the these steps, first step I could fire up naked container, but How to perform the second step, Could you please elaborate the step 2, add launcher.sh locally? Appreciate it. Thanks

just create file Launch.sh

Thanks for your reply...

I am just stuck at create file Launch.sh For step2 , it only create LaunchReal.sh, maybe I missed step to create the file?

That leads to the step 3 -v "${PWD}/Launch.sh:/home/arch/OSX-KVM/Launch.sh" \ Current Folder, there is no Launch.sh -v "${PWD}/LaunchReal.sh:/home/arch/LaunchReal.sh" \

Also Step 3 , restart Docker, following command will create a new container docker run -it \

Any suggestions? Appreciate your help and time. Thanks!

LiushuiXiaoxia commented 10 months ago
  1. Linux 系统上创建一个空的文件夹,如 test-osx

  2. 使用 终端进入test-osx 文件夹

  3. 正常启动Docker实例,然后从实例中复制 Launch.sh 到本地 Linux 机器上,然后重命名为 ./LaunchReal.sh docker cp {containerId}:/home/arch/OSX-KVM/Launch.sh ./LaunchReal.sh

  4. test-osx 文件中,使用终端新建一个 Launch.sh 的文件,并把以下内容复制到文件中

    #!/bin/bash
    cd /home/arch
    git clone --depth 1 --recursive https://github.com/kholia/OSX-KVM.git OSX-KVM2
    cd OSX-KVM2
    echo "use new opencore"
    cp ../LaunchReal.sh ./LaunchReal.sh
    sh LaunchReal.sh
  5. 按照以下命令重新启动docker

docker run -it \
    --device /dev/kvm \
    -p 50922:10022 \
    -v "${PWD}/mac_hdd_ng.img:/image" \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -e "DISPLAY=${DISPLAY:-:0.0}" \
    -e GENERATE_UNIQUE=true \
    -e MASTER_PLIST_URL=https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/custom/config-nopicker-custom.plist \
    -v "${PWD}/Launch.sh:/home/arch/OSX-KVM/Launch.sh" \
    -v "${PWD}/LaunchReal.sh:/home/arch/LaunchReal.sh" \
    sickcodes/docker-osx:naked
mingjing33us commented 10 months ago

./OpenCore-Boot.sh

Thanks for the detailed information, I was able to follow your instruction to boot up the system. Thanks again!

stonemaster commented 8 months ago

Some notes on how I got Ventura running locally:

  1. I used the OSX-KVM repository following the documentation to install Ventura. I had to use the following tweaks in the provided OpenCore-Boot.sh to get things running: a. set ALLOCATED_RAM=8192 b. set CPU_CORES=1, CPU_SOCKETS=1 and CPU_THREADS=1 (yep it's going to be slow) c. and set the CPU to Haswell-noTSX (Penryn is the default)

For some reason in that setup I never could increase the number of cores withouth the VM crashing (or hanging). So I tried it with sickcodes naked image where it works without problems:

  1. Copy resulting mac_hdd_ng.img use nakedinstructions to mount it as per documentation. a. additionally set environment variable CPU=Haswell-noTSX

Works on fine on my machine(tm)!

EDIT: A few runs later I found out that when my machine booted and had an unstable tsc, multi-core support wouldn't work. Check sudo dmesg -T | grep -i -e tsc -e clocksource which should give clocksource: Switched to clocksource tsc. Otherwise a cold boot might help.

MockyBang commented 7 months ago

Some notes on how I got Ventura running locally:

1. I used the [OSX-KVM repository](https://github.com/kholia/OSX-KVM) following the documentation to install Ventura. I had to use the following tweaks in the provided `OpenCore-Boot.sh` to get things running:
   a. set `ALLOCATED_RAM=8192`
   b. set `CPU_CORES=1`, `CPU_SOCKETS=1` and `CPU_THREADS=1` (yep it's going to be slow)
   c. and set the CPU to `Haswell-noTSX` (`Penryn` is the default)

For some reason in that setup I never could increase the number of cores withouth the VM crashing (or hanging). So I tried it with sickcodes naked image where it works without problems:

2. Copy resulting `mac_hdd_ng.img` use `naked`instructions to mount it as per documentation.
   a. additionally set environment variable `CPU=Haswell-noTSX`

Works on fine on my machine(tm)!

EDIT: A few runs later I found out that when my machine booted and had an unstable tsc, multi-core support wouldn't work. Check sudo dmesg -T | grep -i -e tsc -e clocksource which should give clocksource: Switched to clocksource tsc. Otherwise a cold boot might help.

Just set CPU to Haswell-noTSX (Penryn is the default), I can boot into Sonoma! Thanks for your advice.

awsms commented 5 months ago

Some notes on how I got Ventura running locally:

  1. I used the OSX-KVM repository following the documentation to install Ventura. I had to use the following tweaks in the provided OpenCore-Boot.sh to get things running: a. set ALLOCATED_RAM=8192 b. set CPU_CORES=1, CPU_SOCKETS=1 and CPU_THREADS=1 (yep it's going to be slow) c. and set the CPU to Haswell-noTSX (Penryn is the default)

For some reason in that setup I never could increase the number of cores withouth the VM crashing (or hanging). So I tried it with sickcodes naked image where it works without problems:

  1. Copy resulting mac_hdd_ng.img use nakedinstructions to mount it as per documentation. a. additionally set environment variable CPU=Haswell-noTSX

Works on fine on my machine(tm)!

EDIT: A few runs later I found out that when my machine booted and had an unstable tsc, multi-core support wouldn't work. Check sudo dmesg -T | grep -i -e tsc -e clocksource which should give clocksource: Switched to clocksource tsc. Otherwise a cold boot might help.

Thanks, I couldn't boot the VM untill I set the CPU to 1 core/socket/thread. Hope someone will find a workaround :/

LesterKraft commented 1 month ago

The following settings helped me(ryzen 5 3550h ram:2x8g):

MY_OPTIONS="+sse3,+sse4.2,+aes,+xsave,+avx,+xsaveopt,+xsavec,+xgetbv1,+avx2,+bmi2,+smep,+bmi1,+fma,+movbe,check"
ALLOCATED_RAM="6144"
-enable-kvm -m "$ALLOCATED_RAM" -cpu Haswell-noTSX,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,"$MY_OPTIONS"
-smp $(nproc)