OSX (macOS) inside a Docker container.
Find a file
2024-06-05 17:58:22 +02:00
.github build: Update links (#15) 2024-06-04 11:57:27 +02:00
src feat: Change installation order (#22) 2024-06-05 17:58:22 +02:00
.dockerignore fix: Delete ISO when extraction fails (#372) 2024-04-13 16:58:04 +02:00
.gitignore build: Initial Dockerfile (#3) 2024-01-14 14:41:19 +01:00
compose.yml feat: Add support for AMD CPU's (#21) 2024-06-05 14:16:56 +02:00
Dockerfile feat: Add support for AMD CPU's (#21) 2024-06-05 14:16:56 +02:00
kubernetes.yml build: Update links (#15) 2024-06-04 11:57:27 +02:00
license.md Create license.md 2024-01-14 17:17:26 +01:00
readme.md feat: Add support for AMD CPU's (#21) 2024-06-05 14:16:56 +02:00

OSX

Build Version Size Pulls

OSX (macOS) inside a Docker container.

Features

  • KVM acceleration
  • Image downloader
  • Web-based viewer

Usage

Via Docker Compose:

services:
  macos:
    image: dockurr/macos
    container_name: macos
    environment:
      VERSION: "sonoma"
    devices:
      - /dev/kvm
    cap_add:
      - NET_ADMIN
    ports:
      - 8006:8006
      - 5900:5900/tcp
      - 5900:5900/udp
    stop_grace_period: 2m

Via Docker CLI:

docker run -it --rm -p 8006:8006 --device=/dev/kvm --cap-add NET_ADMIN --stop-timeout 120 dockurr/macos

Via Kubernetes:

kubectl apply -f kubernetes.yml

FAQ

  • How do I use it?

    Very simple! These are the steps:

    • Start the container and connect to port 8006 using your web browser.

    • Select macOS Base System using your keyboard to begin the installation.

    • Select Disk Utility and then select the largest Apple Inc. VirtIO Block Media disk.

    • Click Erase to format the disk, and give it any recognizable name you like.

    • Close the window and proceed the installation by clicking Reinstall macOS.

    • When prompted where to install the OS, select the disk you just created.

    • There will be several reboots during the installation, keep selecting macOS Installer until it offers the option to select the disk you created.

    • Keep selecting your own disk each reboot from now on.

    • You will be guided through the installation. Select your region, account name, and other options.

    • Once you see the desktop, your macOS installation is ready for use.

    Enjoy your brand new machine, and don't forget to star this repo!

  • How do I select the macOS version?

    By default, macOS Sonoma will be installed. But you can add the VERSION environment variable to your compose file, in order to specify an alternative macOS version to be downloaded:

    environment:
      VERSION: "sonoma"
    

    Select from the values below:

    Value Version
    sonoma macOS Sonoma
    ventura macOS Ventura
    monterey macOS Monterey
    big-sur macOS Big Sur
  • How do I change the storage location?

    To change the storage location, include the following bind mount in your compose file:

    volumes:
      - /var/macos:/storage
    

    Replace the example path /var/macos with the desired storage folder.

  • How do I change the size of the disk?

    To expand the default size of 32 GB, add the DISK_SIZE setting to your compose file and set it to your preferred capacity:

    environment:
      DISK_SIZE: "256G"
    

    This can also be used to resize the existing disk to a larger capacity without any data loss.

  • How do I change the amount of CPU or RAM?

    By default, the container will be allowed to use a maximum of 2 CPU cores and 3 GB of RAM.

    If you want to adjust this, you can specify the desired amount using the following environment variables:

    environment:
      RAM_SIZE: "8G"
      CPU_CORES: "4"
    

    Please note that macOS requires the CPU core count to always be a power of 2.

  • How do I verify if my system supports KVM?

    To verify if your system supports KVM, run the following commands:

    sudo apt install cpu-checker
    sudo kvm-ok
    

    If you receive an error from kvm-ok indicating that KVM acceleration can't be used, check the virtualization settings in the BIOS.

  • Yes, this project contains only open-source code and does not distribute any copyrighted material. So under all applicable laws, this project will be considered legal.

Acknowledgements

Special thanks to seitenca and OSX-KVM, this project would not exist without their invaluable work.

Stars

Stars

Disclaimer

The product names, logos, brands, and other trademarks referred to within this project are the property of their respective trademark holders. This project is not affiliated, sponsored, or endorsed by Apple Inc.