[GH-ISSUE #754] The way to customize cpu core number in Readme not working #579

Open
opened 2026-02-27 23:01:10 +03:00 by kerem · 0 comments
Owner

Originally created by @7feigao on GitHub (Mar 16, 2024).
Original GitHub issue: https://github.com/sickcodes/Docker-OSX/issues/754

Hi,
I have tried to provide more cpu cores to container by follow the description in Readme, but it don't work, here is my full container creation cmd:

docker run -it \
    --device /dev/kvm \
    -p 43276:10022 \
    --name 'Macos' \
    -v /mnt/wslg/.X11-unix:/tmp/.X11-unix \
    -e "DISPLAY=${DISPLAY:-:0.0}" \
    -e GENERATE_UNIQUE=true \
    -e WIDTH=2560 \
    -e HEIGHT=1440 \
    -e RAM=24 \
    -v "/mnt/c/Users/qigao:/mnt/hostshare" \
    -e EXTRA='-smp 16,sockets=8,cores=2' \
    sickcodes/docker-osx:latest

After review the Launch.sh script in container:

exec qemu-system-x86_64 -m ${RAM:-4}000 \
-cpu ${CPU:-Penryn},${CPUID_FLAGS:-vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check,}${BOOT_ARGS} \
-machine q35,${KVM-"accel=kvm:tcg"} \
-smp ${CPU_STRING:-${SMP:-4},cores=${CORES:-4}} \
-usb -device usb-kbd -device usb-tablet \
-device isa-applesmc,osk=ourhardworkbythesewordsguardedpleasedontsteal\(c\)AppleComputerInc \
-drive if=pflash,format=raw,readonly=on,file=/home/arch/OSX-KVM/OVMF_CODE.fd \
-drive if=pflash,format=raw,file=/home/arch/OSX-KVM/OVMF_VARS-1024x768.fd \
-smbios type=2 \
-audiodev ${AUDIO_DRIVER:-alsa},id=hda -device ich9-intel-hda -device hda-duplex,audiodev=hda \
-device ich9-ahci,id=sata \
-drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file=${BOOTDISK:-/home/arch/OSX-KVM/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=/home/arch/OSX-KVM/BaseSystem.img,format=${BASESYSTEM_FORMAT:-qcow2} \
-drive id=MacHDD,if=none,file=${IMAGE_PATH:-/home/arch/OSX-KVM/mac_hdd_ng.img},format=${IMAGE_FORMAT:-qcow2} \
-device ide-hd,bus=sata.4,drive=MacHDD \
-netdev user,id=net0,hostfwd=tcp::${INTERNAL_SSH_PORT:-10022}-:22,hostfwd=tcp::${SCREEN_SHARE_PORT:-5900}-:5900,${ADDITIONAL_PORTS} \
-device ${NETWORKING:-vmxnet3},netdev=net0,id=net0,mac=${MAC_ADDRESS:-52:54:00:09:49:17} \
-monitor stdio \
-boot menu=on \
-vga vmware \
${EXTRA:-} 

I find we need customize the cpu core number by provide ENV CPU_STRING or SMP and CORES, and all setting related to smp provided in ENV EXTRA will not working in my case.
so the workable container creation cmd can be looks like:

docker run -it \
    --device /dev/kvm \
    -p 43276:10022 \
    --name 'Macos' \
    -v /mnt/wslg/.X11-unix:/tmp/.X11-unix \
    -e "DISPLAY=${DISPLAY:-:0.0}" \
    -e GENERATE_UNIQUE=true \
    -e WIDTH=2560 \
    -e HEIGHT=1440 \
    -e SMP=16 \
    -e CORES=16 \
    -e RAM=24 \
    sickcodes/docker-osx:latest

Please help correct me if my miss something or we may can update the Readme?

Regards,

Originally created by @7feigao on GitHub (Mar 16, 2024). Original GitHub issue: https://github.com/sickcodes/Docker-OSX/issues/754 Hi, I have tried to provide more cpu cores to container by follow the description in Readme, but it don't work, here is my full container creation cmd: ```shell docker run -it \ --device /dev/kvm \ -p 43276:10022 \ --name 'Macos' \ -v /mnt/wslg/.X11-unix:/tmp/.X11-unix \ -e "DISPLAY=${DISPLAY:-:0.0}" \ -e GENERATE_UNIQUE=true \ -e WIDTH=2560 \ -e HEIGHT=1440 \ -e RAM=24 \ -v "/mnt/c/Users/qigao:/mnt/hostshare" \ -e EXTRA='-smp 16,sockets=8,cores=2' \ sickcodes/docker-osx:latest ``` After review the `Launch.sh` script in container: ``` exec qemu-system-x86_64 -m ${RAM:-4}000 \ -cpu ${CPU:-Penryn},${CPUID_FLAGS:-vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check,}${BOOT_ARGS} \ -machine q35,${KVM-"accel=kvm:tcg"} \ -smp ${CPU_STRING:-${SMP:-4},cores=${CORES:-4}} \ -usb -device usb-kbd -device usb-tablet \ -device isa-applesmc,osk=ourhardworkbythesewordsguardedpleasedontsteal\(c\)AppleComputerInc \ -drive if=pflash,format=raw,readonly=on,file=/home/arch/OSX-KVM/OVMF_CODE.fd \ -drive if=pflash,format=raw,file=/home/arch/OSX-KVM/OVMF_VARS-1024x768.fd \ -smbios type=2 \ -audiodev ${AUDIO_DRIVER:-alsa},id=hda -device ich9-intel-hda -device hda-duplex,audiodev=hda \ -device ich9-ahci,id=sata \ -drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file=${BOOTDISK:-/home/arch/OSX-KVM/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=/home/arch/OSX-KVM/BaseSystem.img,format=${BASESYSTEM_FORMAT:-qcow2} \ -drive id=MacHDD,if=none,file=${IMAGE_PATH:-/home/arch/OSX-KVM/mac_hdd_ng.img},format=${IMAGE_FORMAT:-qcow2} \ -device ide-hd,bus=sata.4,drive=MacHDD \ -netdev user,id=net0,hostfwd=tcp::${INTERNAL_SSH_PORT:-10022}-:22,hostfwd=tcp::${SCREEN_SHARE_PORT:-5900}-:5900,${ADDITIONAL_PORTS} \ -device ${NETWORKING:-vmxnet3},netdev=net0,id=net0,mac=${MAC_ADDRESS:-52:54:00:09:49:17} \ -monitor stdio \ -boot menu=on \ -vga vmware \ ${EXTRA:-} ``` I find we need customize the cpu core number by provide ENV `CPU_STRING` or `SMP` and `CORES`, and all setting related to smp provided in ENV `EXTRA` will not working in my case. so the workable container creation cmd can be looks like: ```shell docker run -it \ --device /dev/kvm \ -p 43276:10022 \ --name 'Macos' \ -v /mnt/wslg/.X11-unix:/tmp/.X11-unix \ -e "DISPLAY=${DISPLAY:-:0.0}" \ -e GENERATE_UNIQUE=true \ -e WIDTH=2560 \ -e HEIGHT=1440 \ -e SMP=16 \ -e CORES=16 \ -e RAM=24 \ sickcodes/docker-osx:latest ``` Please help correct me if my miss something or we may can update the Readme? Regards,
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Docker-OSX#579
No description provided.