Home

Awesome

<h1 align="center">OSX<br /> <div align="center"> <a href="https://github.com/dockur/macos/"><img src="https://github.com/dockur/macos/raw/master/.github/logo.png" title="Logo" style="max-width:100%;" width="128" /></a> </div> <div align="center">

Build Version Size Package Pulls

</div></h1>

OSX (macOS) inside a Docker container.

Features ✨

Usage 🐳

Via Docker Compose:

services:
  macos:
    image: dockurr/macos
    container_name: macos
    environment:
      VERSION: "13"
    devices:
      - /dev/kvm
      - /dev/net/tun
    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 --device=/dev/net/tun --cap-add NET_ADMIN --stop-timeout 120 dockurr/macos

Via Kubernetes:

kubectl apply -f https://raw.githubusercontent.com/dockur/macos/refs/heads/master/kubernetes.yml

Compatibility ⚙️

ProductPlatform
Docker EngineLinux
Docker DesktopLinux
Docker DesktopmacOS
Docker DesktopWindows 11
Docker DesktopWindows 10

FAQ 💬

How do I use it?

Very simple! These are the steps:

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

How do I select the macOS version?

By default, macOS 13 (Ventura) will be installed, as it offers the best performance.

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: "13"

Select from the values below:

ValueVersionName
15macOS 15Sequoia
14macOS 14Sonoma
13macOS 13Ventura
12macOS 12Monterey
11macOS 11Big Sur

How do I change the storage location?

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

volumes:
  - /var/osx:/storage

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

How do I change the size of the disk?

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

environment:
  DISK_SIZE: "256G"

[!TIP] 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 4 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"

How do I pass-through a USB device?

To pass-through a USB device, first lookup its vendor and product id via the lsusb command, then add them to your compose file like this:

environment:
  ARGUMENTS: "-device usb-host,vendorid=0x1234,productid=0x1234"
devices:
  - /dev/bus/usb

How do I verify if my system supports KVM?

Only Linux and Windows 11 support KVM virtualization, macOS and Windows 10 do not unfortunately.

You can run the following commands in Linux to check your system:

sudo apt install cpu-checker
sudo kvm-ok

If you receive an error from kvm-ok indicating that KVM cannot be used, please check whether:

If you do not receive any error from kvm-ok but the container still complains about KVM, please check whether:

How do I run Windows in a container?

You can use dockur/windows for that. It shares many of the same features, and even has completely automatic installation.

Is this project legal?

Yes, this project contains only open-source code and does not distribute any copyrighted material. Neither does it try to circumvent any copyright protection measures. So under all applicable laws, this project will be considered legal.

However, by installing Apple's macOS, you must accept their end-user license agreement, which does not permit installation on non-official hardware. So only run this container on hardware sold by Apple, as any other use will be a violation of their terms and conditions.

Acknowledgements 🙏

Special thanks to seitenca, this project would not exist without her invaluable work.

Stars 🌟

Stars

Disclaimer ⚖️

Only run this container on Apple hardware, any other use is not permitted by their EULA. 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.