dockur / macos

OSX (macOS) inside a Docker container.
MIT License
903 stars 67 forks source link

[Question]: How can i run with more than one CPU core instead of just 1 core on Linux with and AMD processor? #61

Open Santosl2 opened 2 months ago

Santosl2 commented 2 months ago

Is your question not already answered in the FAQ?

Is this a general question and not a technical issue?

Question

So i'm trying run on Linux, my PC config is:

However, when i try to use more than one CPU core, macOS doesn't boot and gets stuck on this screen:

image

_When i change CPU_CORES to ONE works fine_

My docker.compose.yml

services:
  macos:
    image: dockurr/macos
    container_name: macos
    environment:
      DISK_SIZE: "64G"
      RAM_SIZE: "8G"
      CPU_CORES: "4"
      DEBUG: "yes"
      VERSION: "sonoma"
    devices:
      - /dev/kvm
    cap_add:
      - NET_ADMIN

    ports:
      - 8006:8006
      - 5900:5900/tcp
      - 5900:5900/udp
    stop_grace_period: 2m
    volumes:
    - ~/santosl2c/Documents/Macos/volumes/mac/shared:/shared
    - ~/santosl2c/Documents/Macos/volumes/mac/storage:/storage
SoNotMC commented 2 months ago

I get this same issue, however, I have never managed to get this to boot even with default docker compose.

Santosl2 commented 2 months ago

up

jeffmo commented 1 month ago

For what it's worth I'm able to see more than 1 CPU core on my end (at least, according to "System Report" within Sonoma):

System Report

Screenshot 2024-09-15 at 9 49 25 PM

"About This Mac"

Screenshot 2024-09-15 at 9 59 50 PM

Host system

Docker Compose Config

    image: dockurr/macos
    cap_add:
      - NET_ADMIN
    devices:
      - /dev/kvm
    environment:
      CPU_CORES: "16"
      RAM_SIZE: "8G"
      VERSION: "sonoma"
    ports:
      - 8006:8006
    restart: unless-stopped
    stop_grace_period: 2m
    volumes:
      - type: bind
        source: /data/osx-storage
        target: /storage
Santosl2 commented 1 month ago

For what it's worth I'm able to see more than 1 CPU core on my end (at least, according to "System Report" within Sonoma):

System Report Screenshot 2024-09-15 at 9 49 25 PM

"About This Mac" Screenshot 2024-09-15 at 9 59 50 PM

Host system

  • CPU: AMD Ryzen 9 5950X 16-Core
  • Mem: 64G
  • OS: Ubuntu 22.04.4 LTS

Docker Compose Config

    image: dockurr/macos
    cap_add:
      - NET_ADMIN
    devices:
      - /dev/kvm
    environment:
      CPU_CORES: "16"
      RAM_SIZE: "8G"
      VERSION: "sonoma"
    ports:
      - 8006:8006
    restart: unless-stopped
    stop_grace_period: 2m
    volumes:
      - type: bind
        source: /data/osx-storage
        target: /storage

Didn't work here... I got the same error: image

kroese commented 4 weeks ago

Are you using nested virtualization by any chance?

Santosl2 commented 3 weeks ago

Are you using nested virtualization by any chance?

How can i check this?

kroese commented 3 weeks ago

@Santosl2 If you are running your OS (and the container) inside a Virtual Machine or bare metal.

Santosl2 commented 2 weeks ago

@Santosl2 If you are running your OS (and the container) inside a Virtual Machine or bare metal.

Ooo, no