You've already forked Docker-OSX
mirror of
https://github.com/sickcodes/Docker-OSX.git
synced 2025-07-01 18:32:35 -05:00
Compare commits
25 Commits
mouse-fix
...
7f31e91099
Author | SHA1 | Date | |
---|---|---|---|
7f31e91099 | |||
0b3e586b26 | |||
fa7baa5fc8 | |||
74d8498ea6 | |||
b282993a4a | |||
69f6e7d0cf | |||
e962dce97f | |||
2d4cc60572 | |||
3259824617 | |||
730d6f294a | |||
93c2119ebc | |||
fb8aa4b248 | |||
b5a70782cc | |||
61b21421f6 | |||
342c09eb2a | |||
2dc1d615b1 | |||
19915de799 | |||
a1df7c5a65 | |||
55fe01bb97 | |||
7c635c0d20 | |||
b653f292a5 | |||
c1b834fbb0 | |||
d13bae59e4 | |||
1c10fc4301 | |||
0c8e5f3923 |
52
.github/workflows/docker-build.yml
vendored
Normal file
52
.github/workflows/docker-build.yml
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
name: Push Docker Image to Docker Hub
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
push_to_docker_hub:
|
||||
name: Push Docker Image to Docker Hub
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
id: checkout_code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Login to Docker Hub
|
||||
id: login_docker_hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_HUB_USER_NAME }}
|
||||
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
||||
|
||||
- name: Echo Docker Hub Username
|
||||
run: echo ${{ secrets.DOCKER_HUB_USER_NAME }}
|
||||
|
||||
- name: Echo GitHub SHA
|
||||
run: echo $GITHUB_SHA
|
||||
|
||||
- name: Build Docker image
|
||||
id: build_image
|
||||
run: |
|
||||
docker build "$GITHUB_WORKSPACE" -t sickcodes/docker-osx:master --label dockerfile-path="Dockerfile"
|
||||
|
||||
- name: Label Master Docker Image as Latest
|
||||
id: label_image
|
||||
run: |
|
||||
docker tag sickcodes/docker-osx:master sickcodes/docker-osx:latest
|
||||
|
||||
- name: Push Docker image master
|
||||
id: push_master
|
||||
run: docker push sickcodes/docker-osx:master
|
||||
|
||||
- name: Push Docker image latest
|
||||
id: push_latest
|
||||
run: docker push sickcodes/docker-osx:latest
|
||||
|
||||
- name: Logout from Docker Hub
|
||||
run: docker logout
|
||||
|
||||
- name: End
|
||||
run: echo "Docker image pushed to Docker Hub successfully"
|
24
Dockerfile
24
Dockerfile
@ -159,13 +159,6 @@ RUN yes | sudo pacman -Syu bc qemu-desktop libvirt dnsmasq virt-manager bridge-u
|
||||
|
||||
WORKDIR /home/arch/OSX-KVM
|
||||
|
||||
# shortname default is catalina, which means :latest is catalina
|
||||
ARG SHORTNAME=catalina
|
||||
|
||||
RUN make \
|
||||
&& qemu-img convert BaseSystem.dmg -O qcow2 -p -c BaseSystem.img \
|
||||
&& rm ./BaseSystem.dmg
|
||||
|
||||
# fix invalid signature on old libguestfs
|
||||
ARG SIGLEVEL=Never
|
||||
|
||||
@ -235,7 +228,7 @@ RUN grep -v InstallMedia ./Launch.sh > ./Launch-nopicker.sh \
|
||||
|
||||
USER arch
|
||||
|
||||
ENV USER arch
|
||||
ENV USER=arch
|
||||
|
||||
# These are hardcoded serials for non-iMessage related research
|
||||
# Overwritten by using GENERATE_UNIQUE=true
|
||||
@ -360,7 +353,20 @@ VOLUME ["/tmp/.X11-unix"]
|
||||
# the default serial numbers are already contained in ./OpenCore/OpenCore.qcow2
|
||||
# And the default serial numbers
|
||||
|
||||
CMD sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/null || true \
|
||||
# DMCA compliant download process
|
||||
# If BaseSystem.img does not exist, download ${SHORTNAME}
|
||||
|
||||
# shortname default is below
|
||||
ENV SHORTNAME=sequoia
|
||||
|
||||
ENV BASESYSTEM_IMAGE=BaseSystem.img
|
||||
|
||||
CMD ! [[ -e "${BASESYSTEM_IMAGE:-BaseSystem.img}" ]] \
|
||||
&& printf '%s\n' "No BaseSystem.img available, downloading ${SHORTNAME}" \
|
||||
&& make \
|
||||
&& qemu-img convert BaseSystem.dmg -O qcow2 -p -c ${BASESYSTEM_IMAGE:-BaseSystem.img} \
|
||||
&& rm ./BaseSystem.dmg \
|
||||
; sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/null || true \
|
||||
; sudo chown -R $(id -u):$(id -g) /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/null || true \
|
||||
; [[ "${NOPICKER}" == true ]] && { \
|
||||
sed -i '/^.*InstallMedia.*/d' Launch.sh \
|
||||
|
@ -206,7 +206,20 @@ ENV TERMS_OF_USE=i_agree
|
||||
|
||||
ENV BOILERPLATE="By using this Dockerfile, you hereby agree that you are a security reseacher or developer and agree to use this Dockerfile to make the world a safer place. Examples include: making your apps safer, finding your mobile phone, compiling security products, etc. You understand that Docker-OSX is an Open Source project, which is released to the public under the GNU Pulic License version 3 and above. You acknowledge that the Open Source project is absolutely unaffiliated with any third party, in any form whatsoever. Any trademarks or intelectual property which happen to be mentioned anywhere in or around the project are owned by their respective owners. By using this Dockerfile, you agree to agree to the EULA of each piece of upstream or downstream software. The following code is released for the sole purpose of security research, under the GNU Public License version 3. If you are concerned about the licensing, please note that this project is not AGPL. A copy of the license is available online: https://github.com/sickcodes/Docker-OSX/blob/master/LICENSE. In order to use the following Dockerfile you must read and understand the terms. Once you have read the terms, use the -e TERMS_OF_USE=i_agree or -e TERMS_OF_USE=i_disagree"
|
||||
|
||||
CMD echo "${BOILERPLATE}" \
|
||||
# DMCA compliant download process
|
||||
# If BaseSystem.img does not exist, download ${SHORTNAME}
|
||||
|
||||
# shortname default is catalina, which means :latest is catalina
|
||||
ENV SHORTNAME=sonoma
|
||||
|
||||
ENV BASESYSTEM_IMAGE=BaseSystem.img
|
||||
|
||||
CMD ! [[ -e "${BASESYSTEM_IMAGE:-BaseSystem.img}" ]] \
|
||||
&& printf '%s\n' "No BaseSystem.img available, downloading ${SHORTNAME}" \
|
||||
&& make \
|
||||
&& qemu-img convert BaseSystem.dmg -O qcow2 -p -c ${BASESYSTEM_IMAGE:-BaseSystem.img} \
|
||||
&& rm ./BaseSystem.dmg \
|
||||
; echo "${BOILERPLATE}" \
|
||||
; [[ "${TERMS_OF_USE}" = i_agree ]] || exit 1 \
|
||||
; echo "Disk is being copied between layers... Please wait a minute..." \
|
||||
; sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/null || true \
|
||||
|
@ -1,255 +0,0 @@
|
||||
#!/usr/bin/docker
|
||||
# ____ __ ____ ______ __
|
||||
# / __ \____ _____/ /_____ _____/ __ \/ ___/ |/ /
|
||||
# / / / / __ \/ ___/ //_/ _ \/ ___/ / / /\__ \| /
|
||||
# / /_/ / /_/ / /__/ ,< / __/ / / /_/ /___/ / |
|
||||
# /_____/\____/\___/_/|_|\___/_/ \____//____/_/|_| [MONTEREY]
|
||||
#
|
||||
# Title: Docker-OSX (Mac on Docker)
|
||||
# Author: Sick.Codes https://twitter.com/sickcodes
|
||||
# Version: 6.0
|
||||
# License: GPLv3+
|
||||
# Repository: https://github.com/sickcodes/Docker-OSX
|
||||
# Website: https://sick.codes
|
||||
#
|
||||
# Notes: Uses a self-hosted BaseSystem.img from a USB installer.
|
||||
# If you want to DIY, use https://github.com/corpnewt/gibMacOS
|
||||
# Set seed as developer, and install the Install Assistant on Big Sur
|
||||
# Burn to a USB, and pull out BaseSystem.img
|
||||
# Or download from https://images.sick.codes/BaseSystem_Monterey.dmg
|
||||
#
|
||||
|
||||
FROM sickcodes/docker-osx
|
||||
|
||||
LABEL maintainer='https://twitter.com/sickcodes <https://sick.codes>'
|
||||
|
||||
SHELL ["/bin/bash", "-c"]
|
||||
|
||||
# change disk size here or add during build, e.g. --build-arg VERSION=10.14.5 --build-arg SIZE=50G
|
||||
ARG SIZE=200G
|
||||
ARG BASE_SYSTEM='https://images.sick.codes/BaseSystem_Monterey.dmg'
|
||||
|
||||
WORKDIR /home/arch/OSX-KVM
|
||||
|
||||
RUN wget -O BaseSystem.dmg "${BASE_SYSTEM}" \
|
||||
&& qemu-img convert BaseSystem.dmg -O qcow2 -p -c BaseSystem.img \
|
||||
&& rm -f BaseSystem.dmg
|
||||
|
||||
RUN qemu-img create -f qcow2 /home/arch/OSX-KVM/mac_hdd_ng.img "${SIZE}"
|
||||
|
||||
WORKDIR /home/arch/OSX-KVM
|
||||
|
||||
#### libguestfs versioning
|
||||
|
||||
# 5.13+ problem resolved by building the qcow2 against 5.12 using libguestfs-1.44.1-6
|
||||
|
||||
ENV SUPERMIN_KERNEL=/boot/vmlinuz-linux
|
||||
ENV SUPERMIN_MODULES=/lib/modules/5.12.14-arch1-1
|
||||
ENV SUPERMIN_KERNEL_VERSION=5.12.14-arch1-1
|
||||
ENV KERNEL_PACKAGE_URL=https://archive.archlinux.org/packages/l/linux/linux-5.12.14.arch1-1-x86_64.pkg.tar.zst
|
||||
ENV KERNEL_HEADERS_PACKAGE_URL=https://archive.archlinux.org/packages/l/linux/linux-headers-5.12.14.arch1-1-x86_64.pkg.tar.zst
|
||||
ENV LIBGUESTFS_PACKAGE_URL=https://archive.archlinux.org/packages/l/libguestfs/libguestfs-1.44.1-6-x86_64.pkg.tar.zst
|
||||
|
||||
ARG LINUX=true
|
||||
|
||||
# required to use libguestfs inside a docker container, to create bootdisks for docker-osx on-the-fly
|
||||
RUN if [[ "${LINUX}" == true ]]; then \
|
||||
sudo pacman -U "${KERNEL_PACKAGE_URL}" --noconfirm \
|
||||
; sudo pacman -U "${LIBGUESTFS_PACKAGE_URL}" --noconfirm \
|
||||
; sudo pacman -U "${KERNEL_HEADERS_PACKAGE_URL}" --noconfirm \
|
||||
; sudo pacman -S mkinitcpio --noconfirm \
|
||||
; sudo libguestfs-test-tool \
|
||||
; sudo rm -rf /var/tmp/.guestfs-* \
|
||||
; fi
|
||||
|
||||
####
|
||||
|
||||
|
||||
# optional --build-arg to change branches for testing
|
||||
ARG BRANCH=master
|
||||
ARG REPO='https://github.com/sickcodes/Docker-OSX.git'
|
||||
# RUN git clone --recurse-submodules --depth 1 --branch "${BRANCH}" "${REPO}"
|
||||
RUN rm -rf ./Docker-OSX \
|
||||
&& git clone --recurse-submodules --depth 1 --branch "${BRANCH}" "${REPO}"
|
||||
|
||||
RUN touch Launch.sh \
|
||||
&& chmod +x ./Launch.sh \
|
||||
&& tee -a Launch.sh <<< '#!/bin/bash' \
|
||||
&& tee -a Launch.sh <<< 'set -eux' \
|
||||
&& tee -a Launch.sh <<< 'sudo chown $(id -u):$(id -g) /dev/kvm 2>/dev/null || true' \
|
||||
&& tee -a Launch.sh <<< 'sudo chown -R $(id -u):$(id -g) /dev/snd 2>/dev/null || true' \
|
||||
&& tee -a Launch.sh <<< '[[ "${RAM}" = max ]] && export RAM="$(("$(head -n1 /proc/meminfo | tr -dc "[:digit:]") / 1000000"))"' \
|
||||
&& tee -a Launch.sh <<< '[[ "${RAM}" = half ]] && export RAM="$(("$(head -n1 /proc/meminfo | tr -dc "[:digit:]") / 2000000"))"' \
|
||||
&& tee -a Launch.sh <<< 'sudo chown -R $(id -u):$(id -g) /dev/snd 2>/dev/null || true' \
|
||||
&& tee -a Launch.sh <<< 'exec qemu-system-x86_64 -m ${RAM:-2}000 \' \
|
||||
&& tee -a Launch.sh <<< '-cpu ${CPU:-Penryn},${CPUID_FLAGS:-vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check,}${BOOT_ARGS} \' \
|
||||
&& tee -a Launch.sh <<< '-machine q35,${KVM-"accel=kvm:tcg"} \' \
|
||||
&& tee -a Launch.sh <<< '-smp ${CPU_STRING:-${SMP:-4},cores=${CORES:-4}} \' \
|
||||
&& tee -a Launch.sh <<< '-usb -device usb-kbd -device usb-tablet \' \
|
||||
&& tee -a Launch.sh <<< '-device isa-applesmc,osk=ourhardworkbythesewordsguardedpleasedontsteal\(c\)AppleComputerInc \' \
|
||||
&& tee -a Launch.sh <<< '-drive if=pflash,format=raw,readonly=on,file=/home/arch/OSX-KVM/OVMF_CODE.fd \' \
|
||||
&& tee -a Launch.sh <<< '-drive if=pflash,format=raw,file=/home/arch/OSX-KVM/OVMF_VARS-1024x768.fd \' \
|
||||
&& tee -a Launch.sh <<< '-smbios type=2 \' \
|
||||
&& tee -a Launch.sh <<< '-audiodev ${AUDIO_DRIVER:-alsa},id=hda -device ich9-intel-hda -device hda-duplex,audiodev=hda \' \
|
||||
&& tee -a Launch.sh <<< '-device ich9-ahci,id=sata \' \
|
||||
&& tee -a Launch.sh <<< '-drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file=${BOOTDISK:-/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2} \' \
|
||||
&& tee -a Launch.sh <<< '-device ide-hd,bus=sata.2,drive=OpenCoreBoot \' \
|
||||
&& tee -a Launch.sh <<< '-device ide-hd,bus=sata.3,drive=InstallMedia \' \
|
||||
&& tee -a Launch.sh <<< '-drive id=InstallMedia,if=none,file=/home/arch/OSX-KVM/BaseSystem.img,format=qcow2 \' \
|
||||
&& tee -a Launch.sh <<< '-drive id=MacHDD,if=none,file=${IMAGE_PATH:-/home/arch/OSX-KVM/mac_hdd_ng.img},format=${IMAGE_FORMAT:-qcow2} \' \
|
||||
&& tee -a Launch.sh <<< '-device ide-hd,bus=sata.4,drive=MacHDD \' \
|
||||
&& tee -a Launch.sh <<< '-netdev user,id=net0,hostfwd=tcp::${INTERNAL_SSH_PORT:-10022}-:22,hostfwd=tcp::${SCREEN_SHARE_PORT:-5900}-:5900,${ADDITIONAL_PORTS} \' \
|
||||
&& tee -a Launch.sh <<< '-device ${NETWORKING:-vmxnet3},netdev=net0,id=net0,mac=${MAC_ADDRESS:-52:54:00:09:49:17} \' \
|
||||
&& tee -a Launch.sh <<< '-monitor stdio \' \
|
||||
&& tee -a Launch.sh <<< '-boot menu=on \' \
|
||||
&& tee -a Launch.sh <<< '-vga vmware \' \
|
||||
&& tee -a Launch.sh <<< '${EXTRA:-}'
|
||||
|
||||
# docker exec containerid mv ./Launch-nopicker.sh ./Launch.sh
|
||||
# This is now a legacy command.
|
||||
# You can use -e BOOTDISK=/bootdisk with -v ./bootdisk.img:/bootdisk
|
||||
RUN grep -v InstallMedia ./Launch.sh > ./Launch-nopicker.sh \
|
||||
&& chmod +x ./Launch-nopicker.sh \
|
||||
&& sed -i -e s/OpenCore\.qcow2/OpenCore\-nopicker\.qcow2/ ./Launch-nopicker.sh
|
||||
|
||||
USER arch
|
||||
|
||||
ENV USER arch
|
||||
|
||||
|
||||
#### libguestfs versioning
|
||||
|
||||
# 5.13+ problem resolved by building the qcow2 against 5.12 using libguestfs-1.44.1-6
|
||||
|
||||
ENV SUPERMIN_KERNEL=/boot/vmlinuz-linux
|
||||
ENV SUPERMIN_MODULES=/lib/modules/5.12.14-arch1-1
|
||||
ENV SUPERMIN_KERNEL_VERSION=5.12.14-arch1-1
|
||||
ENV KERNEL_PACKAGE_URL=https://archive.archlinux.org/packages/l/linux/linux-5.12.14.arch1-1-x86_64.pkg.tar.zst
|
||||
ENV KERNEL_HEADERS_PACKAGE_URL=https://archive.archlinux.org/packages/l/linux/linux-headers-5.12.14.arch1-1-x86_64.pkg.tar.zst
|
||||
ENV LIBGUESTFS_PACKAGE_URL=https://archive.archlinux.org/packages/l/libguestfs/libguestfs-1.44.1-6-x86_64.pkg.tar.zst
|
||||
|
||||
RUN sudo pacman -Syy \
|
||||
&& sudo pacman -Rns linux --noconfirm \
|
||||
; sudo pacman -S mkinitcpio --noconfirm \
|
||||
&& sudo pacman -U "${KERNEL_PACKAGE_URL}" --noconfirm \
|
||||
&& sudo pacman -U "${LIBGUESTFS_PACKAGE_URL}" --noconfirm \
|
||||
&& rm -rf /var/tmp/.guestfs-* \
|
||||
; libguestfs-test-tool || exit 1
|
||||
|
||||
####
|
||||
|
||||
# symlink the old directory, for redundancy
|
||||
RUN ln -s /home/arch/OSX-KVM/OpenCore /home/arch/OSX-KVM/OpenCore-Catalina || true
|
||||
|
||||
####
|
||||
|
||||
#### SPECIAL RUNTIME ARGUMENTS BELOW
|
||||
|
||||
# env -e ADDITIONAL_PORTS with a comma
|
||||
# for example, -e ADDITIONAL_PORTS=hostfwd=tcp::23-:23,
|
||||
ENV ADDITIONAL_PORTS=
|
||||
|
||||
# add additional QEMU boot arguments
|
||||
ENV BOOT_ARGS=
|
||||
|
||||
ENV BOOTDISK=
|
||||
|
||||
# edit the CPU that is being emulated
|
||||
ENV CPU=Penryn
|
||||
ENV CPUID_FLAGS='vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check,'
|
||||
|
||||
ENV DISPLAY=:0.0
|
||||
|
||||
# Deprecated
|
||||
ENV ENV=/env
|
||||
|
||||
# Boolean for generating a bootdisk with new random serials.
|
||||
ENV GENERATE_UNIQUE=false
|
||||
|
||||
# Boolean for generating a bootdisk with specific serials.
|
||||
ENV GENERATE_SPECIFIC=false
|
||||
|
||||
ENV IMAGE_PATH=/home/arch/OSX-KVM/mac_hdd_ng.img
|
||||
ENV IMAGE_FORMAT=qcow2
|
||||
|
||||
ENV KVM='accel=kvm:tcg'
|
||||
|
||||
ENV MASTER_PLIST_URL="https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom.plist"
|
||||
|
||||
# ENV NETWORKING=e1000-82545em
|
||||
ENV NETWORKING=vmxnet3
|
||||
|
||||
# boolean for skipping the disk selection menu at in the boot process
|
||||
ENV NOPICKER=false
|
||||
|
||||
# dynamic RAM options for runtime
|
||||
ENV RAM=3
|
||||
# ENV RAM=max
|
||||
# ENV RAM=half
|
||||
|
||||
# The x and y coordinates for resolution.
|
||||
# Must be used with either -e GENERATE_UNIQUE=true or -e GENERATE_SPECIFIC=true.
|
||||
ENV WIDTH=1920
|
||||
ENV HEIGHT=1080
|
||||
|
||||
# libguestfs verbose
|
||||
ENV LIBGUESTFS_DEBUG=1
|
||||
ENV LIBGUESTFS_TRACE=1
|
||||
|
||||
VOLUME ["/tmp/.X11-unix"]
|
||||
|
||||
# check if /image is a disk image or a directory. This allows you to optionally use -v disk.img:/image
|
||||
# NOPICKER is used to skip the disk selection screen
|
||||
# GENERATE_UNIQUE is used to generate serial numbers on boot.
|
||||
# /env is a file that you can generate and save using -v source.sh:/env
|
||||
# the env file is a file that you can carry to the next container which will supply the serials numbers.
|
||||
# GENERATE_SPECIFIC is used to either accept the env serial numbers OR you can supply using:
|
||||
# -e DEVICE_MODEL="iMacPro1,1" \
|
||||
# -e SERIAL="C02TW0WAHX87" \
|
||||
# -e BOARD_SERIAL="C027251024NJG36UE" \
|
||||
# -e UUID="5CCB366D-9118-4C61-A00A-E5BAF3BED451" \
|
||||
# -e MAC_ADDRESS="A8:5C:2C:9A:46:2F" \
|
||||
|
||||
# the output will be /bootdisk.
|
||||
# /bootdisk is a useful persistent place to store the 15Mb serial number bootdisk.
|
||||
|
||||
# if you don't set any of the above:
|
||||
# the default serial numbers are already contained in ./OpenCore/OpenCore.qcow2
|
||||
# And the default serial numbers
|
||||
|
||||
CMD sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/null || true \
|
||||
; sudo chown -R $(id -u):$(id -g) /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/null || true \
|
||||
; [[ "${NOPICKER}" == true ]] && { \
|
||||
sed -i '/^.*InstallMedia.*/d' Launch.sh \
|
||||
&& export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore-nopicker.qcow2}" \
|
||||
; } \
|
||||
|| export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
|
||||
; [[ "${GENERATE_UNIQUE}" == true ]] && { \
|
||||
./Docker-OSX/osx-serial-generator/generate-unique-machine-values.sh \
|
||||
--master-plist-url="${MASTER_PLIST_URL}" \
|
||||
--count 1 \
|
||||
--tsv ./serial.tsv \
|
||||
--bootdisks \
|
||||
--width "${WIDTH:-1920}" \
|
||||
--height "${HEIGHT:-1080}" \
|
||||
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
|
||||
--output-env "${ENV:=/env}" \
|
||||
|| exit 1 ; } \
|
||||
; [[ "${GENERATE_SPECIFIC}" == true ]] && { \
|
||||
source "${ENV:=/env}" 2>/dev/null \
|
||||
; ./Docker-OSX/osx-serial-generator/generate-specific-bootdisk.sh \
|
||||
--master-plist-url="${MASTER_PLIST_URL}" \
|
||||
--model "${DEVICE_MODEL}" \
|
||||
--serial "${SERIAL}" \
|
||||
--board-serial "${BOARD_SERIAL}" \
|
||||
--uuid "${UUID}" \
|
||||
--mac-address "${MAC_ADDRESS}" \
|
||||
--width "${WIDTH:-1920}" \
|
||||
--height "${HEIGHT:-1080}" \
|
||||
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
|
||||
|| exit 1 ; } \
|
||||
; ./enable-ssh.sh && /bin/bash -c ./Launch.sh
|
||||
|
||||
# virt-manager mode: eta son
|
||||
# CMD virsh define <(envsubst < Docker-OSX.xml) && virt-manager || virt-manager
|
||||
# CMD virsh define <(envsubst < macOS-libvirt-Catalina.xml) && virt-manager || virt-manager
|
@ -166,7 +166,20 @@ ENV HEIGHT=1080
|
||||
ENV LIBGUESTFS_DEBUG=1
|
||||
ENV LIBGUESTFS_TRACE=1
|
||||
|
||||
CMD sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/null || true \
|
||||
# DMCA compliant download process
|
||||
# If BaseSystem.img does not exist, download ${SHORTNAME}
|
||||
|
||||
# shortname default is catalina, which means :latest is catalina
|
||||
ENV SHORTNAME=sonoma
|
||||
|
||||
ENV BASESYSTEM_IMAGE=BaseSystem.img
|
||||
|
||||
CMD ! [[ -e "${BASESYSTEM_IMAGE:-BaseSystem.img}" ]] \
|
||||
&& printf '%s\n' "No BaseSystem.img available, downloading ${SHORTNAME}" \
|
||||
&& make \
|
||||
&& qemu-img convert BaseSystem.dmg -O qcow2 -p -c ${BASESYSTEM_IMAGE:-BaseSystem.img} \
|
||||
&& rm ./BaseSystem.dmg \
|
||||
; sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/null || true \
|
||||
; sudo chown -R $(id -u):$(id -g) /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/null || true \
|
||||
; { [[ "${DISPLAY}" = ':99' ]] || [[ "${HEADLESS}" == true ]] ; } && { \
|
||||
nohup Xvfb :99 -screen 0 1920x1080x16 \
|
||||
|
@ -183,7 +183,20 @@ ENV TERMS_OF_USE=i_agree
|
||||
|
||||
ENV BOILERPLATE="By using this Dockerfile, you hereby agree that you are a security reseacher or developer and agree to use this Dockerfile to make the world a safer place. Examples include: making your apps safer, finding your mobile phone, compiling security products, etc. You understand that Docker-OSX is an Open Source project, which is released to the public under the GNU Pulic License version 3 and above. You acknowledge that the Open Source project is absolutely unaffiliated with any third party, in any form whatsoever. Any trademarks or intelectual property which happen to be mentioned anywhere in or around the project are owned by their respective owners. By using this Dockerfile, you agree to agree to the EULA of each piece of upstream or downstream software. The following code is released for the sole purpose of security research, under the GNU Public License version 3. If you are concerned about the licensing, please note that this project is not AGPL. A copy of the license is available online: https://github.com/sickcodes/Docker-OSX/blob/master/LICENSE. In order to use the following Dockerfile you must read and understand the terms. Once you have read the terms, use the -e TERMS_OF_USE=i_agree or -e TERMS_OF_USE=i_disagree"
|
||||
|
||||
CMD echo "${BOILERPLATE}" \
|
||||
# DMCA compliant download process
|
||||
# If BaseSystem.img does not exist, download ${SHORTNAME}
|
||||
|
||||
# shortname default is catalina, which means :latest is catalina
|
||||
ENV SHORTNAME=sonoma
|
||||
|
||||
ENV BASESYSTEM_IMAGE=BaseSystem.img
|
||||
|
||||
CMD ! [[ -e "${BASESYSTEM_IMAGE:-BaseSystem.img}" ]] \
|
||||
&& printf '%s\n' "No BaseSystem.img available, downloading ${SHORTNAME}" \
|
||||
&& make \
|
||||
&& qemu-img convert BaseSystem.dmg -O qcow2 -p -c ${BASESYSTEM_IMAGE:-BaseSystem.img} \
|
||||
&& rm ./BaseSystem.dmg \
|
||||
; echo "${BOILERPLATE}" \
|
||||
; [[ "${TERMS_OF_USE}" = i_agree ]] || exit 1 \
|
||||
; echo "Disk is being copied between layers... Please wait a minute..." \
|
||||
; sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/null || true \
|
||||
|
179
FAQ.md
179
FAQ.md
@ -160,6 +160,185 @@ If you wind up in the installer again after you've installed macOS it means you
|
||||
|
||||
Congratulations, you got a macOS VM up and running! Now what?
|
||||
|
||||
# Fixing Apple ID Login Issues in macOS Virtual Machines
|
||||
|
||||
## Problem Overview
|
||||
|
||||
When running macOS in a virtual machine, you may encounter problems logging into Apple services including:
|
||||
- Apple ID
|
||||
- iMessage
|
||||
- iCloud
|
||||
- App Store
|
||||
|
||||
This happens because Apple's services can detect that macOS is running in a virtual environment and block access. The solution is to apply a kernel patch that hides the VM presence from Apple's detection mechanism.
|
||||
|
||||
NOTE as per forum post: Unfortunately, this would very possibly break qemu-guest-agent, which is necessary for the host getting VM status or taking hot snapshot while the VM is running. This is because qemu-guest-agent also checks the hv_vmm_present flag, but only works if it is true (=1).
|
||||
|
||||
Use at your own risk. Hope it would help.
|
||||
|
||||
## Solution: Kernel Patching
|
||||
|
||||
This guide provides three methods to apply the necessary kernel patch. All methods implement the same fix originally described in [this forum post](https://forum.proxmox.com/threads/anyone-can-make-bluetooth-work-on-sonoma.153301/#post-697832).
|
||||
|
||||
### Prerequisites
|
||||
|
||||
Before proceeding with any method:
|
||||
- Make sure you can access your EFI partition
|
||||
- Locate your OpenCore `config.plist` file (typically in the `EFI/OC` folder)
|
||||
- Back up your current `config.plist` before making changes
|
||||
|
||||
## Method 1: Using the Utility Script (Simplest Approach)
|
||||
|
||||
This is the fastest and easiest way to apply the patch.
|
||||
|
||||
1. Mount your EFI partition using Clover Configurator or another EFI mounting tool
|
||||
2. Download the patch script:
|
||||
```bash
|
||||
curl -o apply_appleid_kernelpatch.py https://raw.githubusercontent.com/sickcodes/Docker-OSX/scripts/apply_appleid_kernelpatch.py
|
||||
```
|
||||
3. Run the script with your `config.plist` file path:
|
||||
```bash
|
||||
python3 apply_appleid_kernelpatch.py /path/to/config.plist
|
||||
```
|
||||
|
||||
**Pro Tip**: You can drag and drop the `config.plist` file into your terminal after typing `python3 apply_appleid_kernelpatch.py` for an easy path insertion.
|
||||
|
||||
**Note**: If you encounter a "permission denied" error, run the command with `sudo`:
|
||||
```bash
|
||||
sudo python3 apply_appleid_kernelpatch.py /path/to/config.plist
|
||||
```
|
||||
|
||||
## Method 2: Using OCAT (OpenCore Auxiliary Tools) GUI
|
||||
|
||||
If you prefer a graphical approach:
|
||||
|
||||
1. Open OCAT and load your `config.plist`
|
||||
2. Navigate to the **Kernel** section
|
||||
3. Go to the **Patch** subsection
|
||||
4. Add two new patch entries with the following details:
|
||||
|
||||
### Patch 1
|
||||
| Setting | Value |
|
||||
|---------|-------|
|
||||
| **Identifier** | `kernel` |
|
||||
| **Base** | *(leave empty)* |
|
||||
| **Count** | `1` |
|
||||
| **Find (Hex)** | `68696265726E61746568696472656164790068696265726E617465636F756E7400` |
|
||||
| **Limit** | `0` |
|
||||
| **Mask** | *(leave empty)* |
|
||||
| **Replace (Hex)** | `68696265726E61746568696472656164790068765F766D6D5F70726573656E7400` |
|
||||
| **Skip** | `0` |
|
||||
| **Arch** | `x86_64` |
|
||||
| **MinKernel** | `20.4.0` |
|
||||
| **MaxKernel** | *(leave empty)* |
|
||||
| **Enabled** | `True` |
|
||||
| **Comment** | `Sonoma VM BT Enabler - PART 1 of 2 - Patch kern.hv_vmm_present=0` |
|
||||
|
||||
### Patch 2
|
||||
| Setting | Value |
|
||||
|---------|-------|
|
||||
| **Identifier** | `kernel` |
|
||||
| **Base** | *(leave empty)* |
|
||||
| **Count** | `1` |
|
||||
| **Find (Hex)** | `626F6F742073657373696F6E20555549440068765F766D6D5F70726573656E7400` |
|
||||
| **Limit** | `0` |
|
||||
| **Mask** | *(leave empty)* |
|
||||
| **Replace (Hex)** | `626F6F742073657373696F6E20555549440068696265726E617465636F756E7400` |
|
||||
| **Skip** | `0` |
|
||||
| **Arch** | `x86_64` |
|
||||
| **MinKernel** | `22.0.0` |
|
||||
| **MaxKernel** | *(leave empty)* |
|
||||
| **Enabled** | `True` |
|
||||
| **Comment** | `Sonoma VM BT Enabler - PART 2 of 2 - Patch kern.hv_vmm_present=0` |
|
||||
|
||||
5. Save the configuration
|
||||
6. Reboot your VM
|
||||
|
||||
## Method 3: Direct `config.plist` Editing
|
||||
|
||||
For users who prefer to manually edit the configuration file:
|
||||
|
||||
1. Mount your EFI partition
|
||||
2. Locate and open your `config.plist` file in a text editor
|
||||
3. Find the `<key>Kernel</key>` → `<dict>` → `<key>Patch</key>` → `<array>` section
|
||||
4. Add these two `<dict>` entries within the `<array>`:
|
||||
|
||||
```xml
|
||||
<dict>
|
||||
<key>Arch</key>
|
||||
<string>x86_64</string>
|
||||
<key>Base</key>
|
||||
<string></string>
|
||||
<key>Comment</key>
|
||||
<string>Sonoma VM BT Enabler - PART 1 of 2 - Patch kern.hv_vmm_present=0</string>
|
||||
<key>Count</key>
|
||||
<integer>1</integer>
|
||||
<key>Enabled</key>
|
||||
<true/>
|
||||
<key>Find</key>
|
||||
<data>aGliZXJuYXRlaGlkcmVhZHkAaGliZXJuYXRlY291bnQA</data>
|
||||
<key>Identifier</key>
|
||||
<string>kernel</string>
|
||||
<key>Limit</key>
|
||||
<integer>0</integer>
|
||||
<key>Mask</key>
|
||||
<data></data>
|
||||
<key>MaxKernel</key>
|
||||
<string></string>
|
||||
<key>MinKernel</key>
|
||||
<string>20.4.0</string>
|
||||
<key>Replace</key>
|
||||
<data>aGliZXJuYXRlaGlkcmVhZHkAaHZfdm1tX3ByZXNlbnQA</data>
|
||||
<key>ReplaceMask</key>
|
||||
<data></data>
|
||||
<key>Skip</key>
|
||||
<integer>0</integer>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Arch</key>
|
||||
<string>x86_64</string>
|
||||
<key>Base</key>
|
||||
<string></string>
|
||||
<key>Comment</key>
|
||||
<string>Sonoma VM BT Enabler - PART 2 of 2 - Patch kern.hv_vmm_present=0</string>
|
||||
<key>Count</key>
|
||||
<integer>1</integer>
|
||||
<key>Enabled</key>
|
||||
<true/>
|
||||
<key>Find</key>
|
||||
<data>Ym9vdCBzZXNzaW9uIFVVSUQAaHZfdm1tX3ByZXNlbnQA</data>
|
||||
<key>Identifier</key>
|
||||
<string>kernel</string>
|
||||
<key>Limit</key>
|
||||
<integer>0</integer>
|
||||
<key>Mask</key>
|
||||
<data></data>
|
||||
<key>MaxKernel</key>
|
||||
<string></string>
|
||||
<key>MinKernel</key>
|
||||
<string>22.0.0</string>
|
||||
<key>Replace</key>
|
||||
<data>Ym9vdCBzZXNzaW9uIFVVSUQAaGliZXJuYXRlY291bnQA</data>
|
||||
<key>ReplaceMask</key>
|
||||
<data></data>
|
||||
<key>Skip</key>
|
||||
<integer>0</integer>
|
||||
</dict>
|
||||
```
|
||||
|
||||
5. Save the file
|
||||
6. Reboot your VM
|
||||
|
||||
## Important Notes
|
||||
|
||||
- The `MinKernel` values (`20.4.0` and `22.0.0`) may need adjustment depending on your specific macOS version (Monterey, Ventura, Sonoma, etc.)
|
||||
- If you encounter issues, consult the [OpenCore documentation](https://dortania.github.io/docs/) for appropriate values for your setup
|
||||
- Always back up your configuration before making changes
|
||||
- After applying the patch and rebooting, try signing into Apple services again
|
||||
|
||||
## What This Patch Does
|
||||
|
||||
This patch tricks macOS into believing it's running on physical hardware by redirecting the `hv_vmm_present` kernel variable, which normally indicates VM presence. After applying the patch, Apple services should function normally within your virtual environment.
|
||||
### Slow UI
|
||||
|
||||
The macOS UI expects and relies on GPU acceleration, and there is (currently) no way to provide GPU acceleration in the virtual hardware. See [osx-optimizer](https://github.com/sickcodes/osx-optimizer) for macOS configuration to speed things up.
|
||||
|
96
README.md
96
README.md
@ -54,7 +54,9 @@ First time here? try [initial setup](#initial-setup), otherwise try the instruct
|
||||
## Any questions, ideas, or just want to hang out?
|
||||
# [https://discord.gg/sickchat](https://discord.gg/sickchat)
|
||||
|
||||
### Catalina [](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||
Release names and their version:
|
||||
|
||||
### Catalina (10.15) [](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||
|
||||
```bash
|
||||
docker run -it \
|
||||
@ -62,11 +64,12 @@ docker run -it \
|
||||
-p 50922:10022 \
|
||||
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
||||
-e "DISPLAY=${DISPLAY:-:0.0}" \
|
||||
-e SHORTNAME=catalina \
|
||||
sickcodes/docker-osx:latest
|
||||
|
||||
# docker build -t docker-osx .
|
||||
```
|
||||
### Big Sur [](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||
### Big Sur (11) [](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||
|
||||
```bash
|
||||
docker run -it \
|
||||
@ -74,12 +77,13 @@ docker run -it \
|
||||
-p 50922:10022 \
|
||||
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
||||
-e "DISPLAY=${DISPLAY:-:0.0}" \
|
||||
sickcodes/docker-osx:big-sur
|
||||
-e SHORTNAME=big-sur \
|
||||
sickcodes/docker-osx:latest
|
||||
|
||||
# docker build -t docker-osx --build-arg SHORTNAME=big-sur .
|
||||
# docker build -t docker-osx .
|
||||
```
|
||||
|
||||
### Monterey [](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||
### Monterey (12) [](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||
|
||||
```bash
|
||||
|
||||
@ -90,12 +94,13 @@ docker run -it \
|
||||
-e "DISPLAY=${DISPLAY:-:0.0}" \
|
||||
-e GENERATE_UNIQUE=true \
|
||||
-e MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom.plist' \
|
||||
sickcodes/docker-osx:monterey
|
||||
-e SHORTNAME=monterey \
|
||||
sickcodes/docker-osx:latest
|
||||
|
||||
# docker build -t docker-osx --build-arg SHORTNAME=monterey .
|
||||
# docker build -t docker-osx .
|
||||
```
|
||||
|
||||
### Ventura [](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||
### Ventura (13) [](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||
|
||||
```bash
|
||||
|
||||
@ -106,12 +111,13 @@ docker run -it \
|
||||
-e "DISPLAY=${DISPLAY:-:0.0}" \
|
||||
-e GENERATE_UNIQUE=true \
|
||||
-e MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom.plist' \
|
||||
sickcodes/docker-osx:ventura
|
||||
-e SHORTNAME=ventura \
|
||||
sickcodes/docker-osx:latest
|
||||
|
||||
# docker build -t docker-osx --build-arg SHORTNAME=ventura .
|
||||
# docker build -t docker-osx .
|
||||
```
|
||||
|
||||
### Sonoma [](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||
### Sonoma (14) [](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||
|
||||
```bash
|
||||
|
||||
@ -124,12 +130,32 @@ docker run -it \
|
||||
-e CPU='Haswell-noTSX' \
|
||||
-e CPUID_FLAGS='kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on' \
|
||||
-e MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom-sonoma.plist' \
|
||||
sickcodes/docker-osx:sonoma
|
||||
-e SHORTNAME=sonoma \
|
||||
sickcodes/docker-osx:latest
|
||||
|
||||
# docker build -t docker-osx --build-arg SHORTNAME=sonoma .
|
||||
# docker build -t docker-osx .
|
||||
```
|
||||
|
||||
#### Run Catalina Pre-Installed [](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||
### Sequoia (15) [](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||
|
||||
```bash
|
||||
|
||||
docker run -it \
|
||||
--device /dev/kvm \
|
||||
-p 50922:10022 \
|
||||
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
||||
-e "DISPLAY=${DISPLAY:-:0.0}" \
|
||||
-e GENERATE_UNIQUE=true \
|
||||
-e CPU='Haswell-noTSX' \
|
||||
-e CPUID_FLAGS='kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on' \
|
||||
-e MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom-sonoma.plist' \
|
||||
-e SHORTNAME=sequoia \
|
||||
sickcodes/docker-osx:latest
|
||||
|
||||
# docker build -t docker-osx .
|
||||
```
|
||||
|
||||
<!-- #### Run Catalina Pre-Installed [](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||
|
||||
```bash
|
||||
# 40GB disk space required: 20GB original image 20GB your container.
|
||||
@ -145,12 +171,12 @@ docker run -it \
|
||||
sickcodes/docker-osx:auto
|
||||
|
||||
# username is user
|
||||
# passsword is alpine
|
||||
```
|
||||
# password is alpine
|
||||
``` -->
|
||||
|
||||
### Older Systems
|
||||
|
||||
### High Sierra [](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||
### High Sierra [](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||
|
||||
```bash
|
||||
|
||||
@ -159,12 +185,13 @@ docker run -it \
|
||||
-p 50922:10022 \
|
||||
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
||||
-e "DISPLAY=${DISPLAY:-:0.0}" \
|
||||
sickcodes/docker-osx:high-sierra
|
||||
-e SHORTNAME=high-sierra \
|
||||
sickcodes/docker-osx:latest
|
||||
|
||||
# docker build -t docker-osx --build-arg SHORTNAME=high-sierra .
|
||||
# docker build -t docker-osx .
|
||||
```
|
||||
|
||||
### Mojave [](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||
### Mojave [](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||
|
||||
```bash
|
||||
|
||||
@ -173,9 +200,10 @@ docker run -it \
|
||||
-p 50922:10022 \
|
||||
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
||||
-e "DISPLAY=${DISPLAY:-:0.0}" \
|
||||
sickcodes/docker-osx:mojave
|
||||
-e SHORTNAME=mojave \
|
||||
sickcodes/docker-osx:latest
|
||||
|
||||
# docker build -t docker-osx --build-arg SHORTNAME=mojave .
|
||||
# docker build -t docker-osx .
|
||||
```
|
||||
|
||||
|
||||
@ -198,11 +226,12 @@ docker run -it \
|
||||
-e "DISPLAY=${DISPLAY:-:0.0}" \
|
||||
-e GENERATE_UNIQUE=true \
|
||||
-e MASTER_PLIST_URL=https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/custom/config-nopicker-custom.plist \
|
||||
-e SHORTNAME=catalina \
|
||||
sickcodes/docker-osx:naked
|
||||
```
|
||||
|
||||
|
||||
#### Use your own image and manually and automatically log into a shell
|
||||
<!-- #### Use your own image and manually and automatically log into a shell
|
||||
|
||||
[](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||
|
||||
@ -227,15 +256,16 @@ docker run -it \
|
||||
-e "PASSWORD=alpine" \
|
||||
-e GENERATE_UNIQUE=true \
|
||||
-e MASTER_PLIST_URL=https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/custom/config-nopicker-custom.plist \
|
||||
-e SHORTNAME=monterey \
|
||||
sickcodes/docker-osx:naked-auto
|
||||
```
|
||||
``` -->
|
||||
|
||||
# Share directories, sharing files, shared folder, mount folder
|
||||
The easiest and most secure way is `sshfs`
|
||||
```bash
|
||||
# on Linux/Windows
|
||||
mkdir ~/mnt/osx
|
||||
sshfs user@localhost:/ -p 50922 ~/mnt/osx
|
||||
sshfs user@localhost: -p 50922 ~/mnt/osx
|
||||
# wait a few seconds, and ~/mnt/osx will have full rootfs mounted over ssh, and in userspace
|
||||
# automated: sshpass -p <password> sshfs user@localhost:/ -p 50922 ~/mnt/osx
|
||||
```
|
||||
@ -399,13 +429,13 @@ Pick one of these while **building**, irrelevant when using docker pull:
|
||||
|
||||
There are currently multiple images, each with different use cases (explained [below](#container-images)):
|
||||
|
||||
- High Sierra
|
||||
- Mojave
|
||||
- Catalina
|
||||
- Big Sur
|
||||
- Monterey
|
||||
- Ventura
|
||||
- Sonoma
|
||||
- High Sierra (10.13)
|
||||
- Mojave (10.14)
|
||||
- Catalina (10.15)
|
||||
- Big Sur (11)
|
||||
- Monterey (12)
|
||||
- Ventura (13)
|
||||
- Sonoma (14)
|
||||
- Auto (pre-made Catalina)
|
||||
- Naked (use your own .img)
|
||||
- Naked-Auto (user your own .img and SSH in)
|
||||
@ -1816,7 +1846,7 @@ docker run -it \
|
||||
sickcodes/docker-osx:auto
|
||||
|
||||
# username is user
|
||||
# passsword is alpine
|
||||
# password is alpine
|
||||
# Wait 2-3 minutes until you drop into the shell.
|
||||
```
|
||||
|
||||
|
92
scripts/apply_appleid_kernelpatch.py
Normal file
92
scripts/apply_appleid_kernelpatch.py
Normal file
@ -0,0 +1,92 @@
|
||||
#!/usr/bin/env python3
|
||||
import plistlib
|
||||
import base64
|
||||
import os
|
||||
import sys
|
||||
|
||||
def add_kernel_patches(config_path):
|
||||
# Make a backup of the original file
|
||||
backup_path = config_path + '.backup'
|
||||
os.system(f'cp "{config_path}" "{backup_path}"')
|
||||
print(f"Backup created at {backup_path}")
|
||||
|
||||
# Read the plist file
|
||||
with open(config_path, 'rb') as f:
|
||||
config = plistlib.load(f)
|
||||
|
||||
# Prepare the patch entries
|
||||
patch1 = {
|
||||
'Arch': 'x86_64',
|
||||
'Base': '',
|
||||
'Comment': 'Sonoma VM BT Enabler - PART 1 of 2 - Patch kern.hv_vmm_present=0',
|
||||
'Count': 1,
|
||||
'Enabled': True,
|
||||
'Find': base64.b64decode('aGliZXJuYXRlaGlkcmVhZHkAaGliZXJuYXRlY291bnQA'),
|
||||
'Identifier': 'kernel',
|
||||
'Limit': 0,
|
||||
'Mask': b'',
|
||||
'MaxKernel': '',
|
||||
'MinKernel': '20.4.0',
|
||||
'Replace': base64.b64decode('aGliZXJuYXRlaGlkcmVhZHkAaHZfdm1tX3ByZXNlbnQA'),
|
||||
'ReplaceMask': b'',
|
||||
'Skip': 0,
|
||||
}
|
||||
|
||||
patch2 = {
|
||||
'Arch': 'x86_64',
|
||||
'Base': '',
|
||||
'Comment': 'Sonoma VM BT Enabler - PART 2 of 2 - Patch kern.hv_vmm_present=0',
|
||||
'Count': 1,
|
||||
'Enabled': True,
|
||||
'Find': base64.b64decode('Ym9vdCBzZXNzaW9uIFVVSUQAaHZfdm1tX3ByZXNlbnQA'),
|
||||
'Identifier': 'kernel',
|
||||
'Limit': 0,
|
||||
'Mask': b'',
|
||||
'MaxKernel': '',
|
||||
'MinKernel': '22.0.0',
|
||||
'Replace': base64.b64decode('Ym9vdCBzZXNzaW9uIFVVSUQAaGliZXJuYXRlY291bnQA'),
|
||||
'ReplaceMask': b'',
|
||||
'Skip': 0,
|
||||
}
|
||||
|
||||
# Add patches to the kernel patch section
|
||||
if 'Kernel' in config and 'Patch' in config['Kernel']:
|
||||
# Check if patches already exist
|
||||
patch_exists = False
|
||||
for patch in config['Kernel']['Patch']:
|
||||
if isinstance(patch, dict) and 'Comment' in patch:
|
||||
if 'Sonoma VM BT Enabler' in patch['Comment']:
|
||||
patch_exists = True
|
||||
print(f"Patch already exists: {patch['Comment']}")
|
||||
|
||||
if not patch_exists:
|
||||
config['Kernel']['Patch'].append(patch1)
|
||||
config['Kernel']['Patch'].append(patch2)
|
||||
print("Added both Sonoma VM BT Enabler patches to config.plist")
|
||||
|
||||
else:
|
||||
print("Error: Could not find Kernel -> Patch section in config.plist")
|
||||
return False
|
||||
|
||||
# Write the updated plist file
|
||||
with open(config_path, 'wb') as f:
|
||||
plistlib.dump(config, f)
|
||||
|
||||
print(f"Successfully updated {config_path}")
|
||||
return True
|
||||
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) != 2:
|
||||
print("Usage: python apply_appleid_kernelpatch.py /path/to/config.plist")
|
||||
sys.exit(1)
|
||||
|
||||
config_path = sys.argv[1]
|
||||
if not os.path.exists(config_path):
|
||||
print(f"Error: File {config_path} does not exist")
|
||||
sys.exit(1)
|
||||
|
||||
success = add_kernel_patches(config_path)
|
||||
if success:
|
||||
print("Patches applied successfully. Please reboot to apply changes.")
|
||||
else:
|
||||
print("Failed to apply patches.")
|
@ -125,4 +125,17 @@ RUN printf '\n\n\n\n%s\n%s\n\n\n\n' '===========VNC_PASSWORD========== ' "$(<vnc
|
||||
|
||||
WORKDIR /home/arch/OSX-KVM
|
||||
|
||||
CMD ./enable-ssh.sh && envsubst < ./Launch_custom.sh | bash
|
||||
# DMCA compliant download process
|
||||
# If BaseSystem.img does not exist, download ${SHORTNAME}
|
||||
|
||||
# shortname default is catalina, which means :latest is catalina
|
||||
ENV SHORTNAME=sonoma
|
||||
|
||||
ENV BASESYSTEM_IMAGE=BaseSystem.img
|
||||
|
||||
CMD ! [[ -e "${BASESYSTEM_IMAGE:-BaseSystem.img}" ]] \
|
||||
&& printf '%s\n' "No BaseSystem.img available, downloading ${SHORTNAME}" \
|
||||
&& make \
|
||||
&& qemu-img convert BaseSystem.dmg -O qcow2 -p -c ${BASESYSTEM_IMAGE:-BaseSystem.img} \
|
||||
&& rm ./BaseSystem.dmg \
|
||||
; ./enable-ssh.sh && envsubst < ./Launch_custom.sh | bash
|
||||
|
@ -203,5 +203,18 @@ RUN vncpasswd -f < vncpasswd_file > ${HOME}/.vnc/passwd
|
||||
RUN chmod 600 ~/.vnc/passwd
|
||||
RUN printf '\n\n\n\n%s\n%s\n\n\n\n' '===========VNC_PASSWORD========== ' "$(<vncpasswd_file)"
|
||||
|
||||
CMD ./enable-ssh.sh && envsubst < ./Launch_custom.sh | bash
|
||||
# DMCA compliant download process
|
||||
# If BaseSystem.img does not exist, download ${SHORTNAME}
|
||||
|
||||
# shortname default is catalina, which means :latest is catalina
|
||||
ENV SHORTNAME=sonoma
|
||||
|
||||
ENV BASESYSTEM_IMAGE=BaseSystem.img
|
||||
|
||||
CMD ! [[ -e "${BASESYSTEM_IMAGE:-BaseSystem.img}" ]] \
|
||||
&& printf '%s\n' "No BaseSystem.img available, downloading ${SHORTNAME}" \
|
||||
&& make \
|
||||
&& qemu-img convert BaseSystem.dmg -O qcow2 -p -c ${BASESYSTEM_IMAGE:-BaseSystem.img} \
|
||||
&& rm ./BaseSystem.dmg \
|
||||
; ./enable-ssh.sh && envsubst < ./Launch_custom.sh | bash
|
||||
|
||||
|
Reference in New Issue
Block a user