Skip to content

OSX

Docker-OSX

Run Mac OS X in Docker with near-native performance! X11 Forwarding! iMessage security research! iPhone USB working! macOS in a Docker container!

Arrenca una màquina Windows Subsytem for Linux (WSL).

Crea el fitxer .wslconfig en el teu “home”:

Terminal window
nano /mnt/c/Users/david/.wslconfig

Add nestedVirtualization=true to the end of the file (If the file doesn’t exist, create it).

[wsl2]
nestedVirtualization=true

For more information about the .wslconfig file check this [link](https://docs.microsoft.com/en-us/windows/wsl/wsl-config#wslconfig.

Check if KVM is enabled by using the kvm-ok command.

Terminal window
sudo apt install -y cpu-checker
kvm-ok

The output should look like this:

Terminal window
INFO: /dev/kvm exists
KVM acceleration can be used
Terminal window
sudo apt -y install bridge-utils cpu-checker libvirt-clients libvirt-daemon qemu-system qemu-kvm

Instal·la Docker:

Terminal window
curl -L sh.xtec.dev/docker.sh | sh

Ensure x11-apps is installed. Use the command sudo apt install x11-apps -y to install it if it isn’t.

Finally, to get video output:

WSLg: This is the simplest and easiest option to use. There may be some issues such as the keyboard not being fully passed through or seeing a second mouse on the desktop - Issue on WSLg - but this option is recommended.

To use WSLg’s built-in X-11 server:

Terminal window
docker run -it \
--device /dev/kvm \
-p 50922:10022 \
-v /mnt/wslg/.X11-unix:/tmp/.X11-unix \
-e "DISPLAY=${DISPLAY:-:0.0}" \
sickcodes/docker-osx:latest
Play

boot instructions for when you are creating your container:

  • Boot the macOS Base System (Press Enter)
  • Click Disk Utility
  • Erase the BIGGEST disk (around 200gb default), DO NOT MODIFY THE SMALLER DISKS. — if you can’t click erase, you may need to reduce the disk size by 1kb
  • (optional) Create a partition using the unused space to house the OS and your files if you want to limit the capacity. (For Xcode 12 partition at least 60gb.)
  • Click Reinstall macOS
  • The system may require multiple reboots during installation

El contingut d'aquest lloc web té llicència CC BY-NC-ND 4.0.

©2022-2025 xtec.dev