13 Commits

Author SHA1 Message Date
24033387a3 Fixes #368 Downgrade kernel for the subsystem to 5.12, and hold back libguestfs at libguestfs-1.44.1 2021-10-29 17:25:51 +00:00
7dfd04eafd OpenCore-Catalina/OpenCore.qcow2 was moved to OpenCore/OpenCore.qcow2, symlink it anyway 2021-10-28 23:17:44 +00:00
5806f862d3 Merge pull request #367 from TheHackerCoding/patch-1
Typo in README
2021-10-28 21:27:12 +00:00
5a159c19e9 Typo in README 2021-10-28 13:35:36 -04:00
50c5dce110 squash naked images for hub.docker.com 2021-10-24 16:11:16 +00:00
ff250fa0ca Merge pull request #361 from Buthrakaur/improve-readme-windows
readme - improve instructions for running on windows
2021-10-22 08:43:14 +00:00
302885dc08 WSL2 + Ubuntu note - credits 2021-10-22 08:42:09 +00:00
fcfba30086 readme - improve instructions for running on windows 2021-10-19 08:48:24 +02:00
df10b3c651 Merge pull request #352 from chirag350/master
use LABEL instead of MAINTAINER since MAINTAINER is deprecated
2021-10-10 22:20:34 +00:00
e265065e31 Fix weird image 2021-10-06 00:29:08 +00:00
beef908d4c Add YouTube tutorial video 2021-10-06 00:26:41 +00:00
12b8ce7a2b Update Dockerfile 2021-10-02 21:42:41 +05:30
9c8d70c9da Merge pull request #343 from sickcodes/stock-images-in-dockerfile
Build the missing nopicker stock image at runtime. Add a nopicker stock images in dockerfile.
2021-10-01 00:19:50 +00:00
10 changed files with 180 additions and 92 deletions

View File

@ -92,4 +92,6 @@ This project now uses the fantastic OpenCore bootloader from the community OpenC
[@cybik](https://github.com/cybik) Spice fix #337 [@cybik](https://github.com/cybik) Spice fix #337
[@Silfalion](https://github.com/Silfalion) - [https://github.com/Silfalion/Iphone_docker_osx_passthrough](https://github.com/Silfalion/Iphone_docker_osx_passthrough) [@Silfalion](https://github.com/Silfalion) - [https://github.com/Silfalion/Iphone_docker_osx_passthrough](https://github.com/Silfalion/Iphone_docker_osx_passthrough)
[@Buthrakaur](https://github.com/Buthrakaur) readme - improve instructions for running on windows #361

View File

@ -52,8 +52,7 @@
# # you will also need to pass the device to the container # # you will also need to pass the device to the container
FROM archlinux:base-devel FROM archlinux:base-devel
LABEL maintainer='https://twitter.com/sickcodes <https://sick.codes>'
MAINTAINER 'https://twitter.com/sickcodes' <https://sick.codes>
SHELL ["/bin/bash", "-c"] SHELL ["/bin/bash", "-c"]
@ -167,13 +166,6 @@ RUN [[ "${VERSION%%.*}" -ge 11 ]] && { wget "${FETCH_MAC_OS_RAW}" \
WORKDIR /home/arch/OSX-KVM WORKDIR /home/arch/OSX-KVM
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 -Syu linux libguestfs --noconfirm \
; fi
# optional --build-arg to change branches for testing # optional --build-arg to change branches for testing
ARG BRANCH=master ARG BRANCH=master
ARG REPO='https://github.com/sickcodes/Docker-OSX.git' ARG REPO='https://github.com/sickcodes/Docker-OSX.git'
@ -200,7 +192,7 @@ RUN touch Launch.sh \
&& tee -a Launch.sh <<< '-smbios type=2 \' \ && 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 <<< '-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 <<< '-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-Catalina/OpenCore.qcow2} \' \ && 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.2,drive=OpenCoreBoot \' \
&& tee -a Launch.sh <<< '-device ide-hd,bus=sata.3,drive=InstallMedia \' \ && 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=InstallMedia,if=none,file=/home/arch/OSX-KVM/BaseSystem.img,format=qcow2 \' \
@ -216,27 +208,38 @@ RUN touch Launch.sh \
# docker exec containerid mv ./Launch-nopicker.sh ./Launch.sh # docker exec containerid mv ./Launch-nopicker.sh ./Launch.sh
# This is now a legacy command. # This is now a legacy command.
# You can use -e BOOTDISK=/bootdisk with -v ./bootdisk.img:/bootdisk # You can use -e BOOTDISK=/bootdisk with -v ./bootdisk.img:/bootdisk
### LEGACY CODE
RUN grep -v InstallMedia ./Launch.sh > ./Launch-nopicker.sh \ RUN grep -v InstallMedia ./Launch.sh > ./Launch-nopicker.sh \
&& chmod +x ./Launch-nopicker.sh \ && chmod +x ./Launch-nopicker.sh \
&& sed -i -e s/OpenCore\.qcow2/OpenCore\-nopicker\.qcow2/ ./Launch-nopicker.sh && sed -i -e s/OpenCore\.qcow2/OpenCore\-nopicker\.qcow2/ ./Launch-nopicker.sh
###
USER arch USER arch
ENV USER arch ENV USER arch
# 5.13 problem #### 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_KERNEL=/boot/vmlinuz-linux
ENV SUPERMIN_MODULES=/lib/modules/5.12.14-arch1-1 ENV SUPERMIN_MODULES=/lib/modules/5.12.14-arch1-1
ENV SUPERMIN_KERNEL_VERSION=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 LIBGUESTFS_PACKAGE_URL=https://archive.archlinux.org/packages/l/libguestfs/libguestfs-1.44.1-6-x86_64.pkg.tar.zst
RUN sudo pacman -Rns linux --noconfirm \ ARG LINUX=true
; sudo pacman -Syy \
; sudo pacman -S mkinitcpio --noconfirm \ # required to use libguestfs inside a docker container, to create bootdisks for docker-osx on-the-fly
; sudo pacman -U https://archive.archlinux.org/packages/l/linux/linux-5.12.14.arch1-1-x86_64.pkg.tar.zst --noconfirm \ RUN if [[ "${LINUX}" == true ]]; then \
; sudo rm -rf /var/tmp/.guestfs-* \ sudo pacman -U "${KERNEL_PACKAGE_URL}" --noconfirm \
; libguestfs-test-tool ; sudo pacman -U "${LIBGUESTFS_PACKAGE_URL}" --noconfirm \
; sudo libguestfs-test-tool \
; sudo rm -rf /var/tmp/.guestfs-* \
; fi
####
# These are hardcoded serials for non-iMessage related research # These are hardcoded serials for non-iMessage related research
# Overwritten by using GENERATE_UNIQUE=true # Overwritten by using GENERATE_UNIQUE=true
@ -252,8 +255,8 @@ ARG STOCK_WIDTH=1920
ARG STOCK_HEIGHT=1080 ARG STOCK_HEIGHT=1080
ARG STOCK_MASTER_PLIST_URL=https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom.plist ARG STOCK_MASTER_PLIST_URL=https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom.plist
ARG STOCK_MASTER_PLIST_URL_NOPICKER=https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-nopicker-custom.plist ARG STOCK_MASTER_PLIST_URL_NOPICKER=https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-nopicker-custom.plist
ARG STOCK_BOOTDISK=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2 ARG STOCK_BOOTDISK=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2
ARG STOCK_BOOTDISK_NOPICKER=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore-nopicker.qcow2 ARG STOCK_BOOTDISK_NOPICKER=/home/arch/OSX-KVM/OpenCore/OpenCore-nopicker.qcow2
RUN ./Docker-OSX/osx-serial-generator/generate-specific-bootdisk.sh \ RUN ./Docker-OSX/osx-serial-generator/generate-specific-bootdisk.sh \
--master-plist-url="${STOCK_MASTER_PLIST_URL}" \ --master-plist-url="${STOCK_MASTER_PLIST_URL}" \
@ -266,7 +269,6 @@ RUN ./Docker-OSX/osx-serial-generator/generate-specific-bootdisk.sh \
--height "${STOCK_HEIGHT}" \ --height "${STOCK_HEIGHT}" \
--output-bootdisk "${STOCK_BOOTDISK}" --output-bootdisk "${STOCK_BOOTDISK}"
RUN ./Docker-OSX/osx-serial-generator/generate-specific-bootdisk.sh \ RUN ./Docker-OSX/osx-serial-generator/generate-specific-bootdisk.sh \
--master-plist-url="${STOCK_MASTER_PLIST_URL_NOPICKER}" \ --master-plist-url="${STOCK_MASTER_PLIST_URL_NOPICKER}" \
--model "${STOCK_DEVICE_MODEL}" \ --model "${STOCK_DEVICE_MODEL}" \
@ -278,8 +280,11 @@ RUN ./Docker-OSX/osx-serial-generator/generate-specific-bootdisk.sh \
--height "${STOCK_HEIGHT}" \ --height "${STOCK_HEIGHT}" \
--output-bootdisk "${STOCK_BOOTDISK_NOPICKER}" --output-bootdisk "${STOCK_BOOTDISK_NOPICKER}"
#### SPECIAL RUNTIME ARGUMENTS BELOW ### symlink the old directory as upstream has renamed a directory. Symlinking purely for backwards compatability!
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 # env -e ADDITIONAL_PORTS with a comma
# for example, -e ADDITIONAL_PORTS=hostfwd=tcp::23-:23, # for example, -e ADDITIONAL_PORTS=hostfwd=tcp::23-:23,
ENV ADDITIONAL_PORTS= ENV ADDITIONAL_PORTS=
@ -349,16 +354,16 @@ VOLUME ["/tmp/.X11-unix"]
# /bootdisk is a useful persistent place to store the 15Mb serial number bootdisk. # /bootdisk is a useful persistent place to store the 15Mb serial number bootdisk.
# if you don't set any of the above: # if you don't set any of the above:
# the default serial numbers are already contained in ./OpenCore-Catalina/OpenCore.qcow2 # the default serial numbers are already contained in ./OpenCore/OpenCore.qcow2
# And the default serial numbers # And the default serial numbers
CMD sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/null || true \ 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 \ ; sudo chown -R $(id -u):$(id -g) /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/null || true \
; [[ "${NOPICKER}" == true ]] && { \ ; [[ "${NOPICKER}" == true ]] && { \
sed -i '/^.*InstallMedia.*/d' Launch.sh \ sed -i '/^.*InstallMedia.*/d' Launch.sh \
&& export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore-nopicker.qcow2}" \ && export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore-nopicker.qcow2}" \
; } \ ; } \
|| export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \ || export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
; [[ "${GENERATE_UNIQUE}" == true ]] && { \ ; [[ "${GENERATE_UNIQUE}" == true ]] && { \
./Docker-OSX/osx-serial-generator/generate-unique-machine-values.sh \ ./Docker-OSX/osx-serial-generator/generate-unique-machine-values.sh \
--master-plist-url="${MASTER_PLIST_URL}" \ --master-plist-url="${MASTER_PLIST_URL}" \
@ -367,7 +372,7 @@ CMD sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/n
--bootdisks \ --bootdisks \
--width "${WIDTH:-1920}" \ --width "${WIDTH:-1920}" \
--height "${HEIGHT:-1080}" \ --height "${HEIGHT:-1080}" \
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \ --output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
--output-env "${ENV:=/env}" \ --output-env "${ENV:=/env}" \
|| exit 1 ; } \ || exit 1 ; } \
; [[ "${GENERATE_SPECIFIC}" == true ]] && { \ ; [[ "${GENERATE_SPECIFIC}" == true ]] && { \
@ -381,7 +386,7 @@ CMD sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/n
--mac-address "${MAC_ADDRESS}" \ --mac-address "${MAC_ADDRESS}" \
--width "${WIDTH:-1920}" \ --width "${WIDTH:-1920}" \
--height "${HEIGHT:-1080}" \ --height "${HEIGHT:-1080}" \
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \ --output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
|| exit 1 ; } \ || exit 1 ; } \
; ./enable-ssh.sh && /bin/bash -c ./Launch.sh ; ./enable-ssh.sh && /bin/bash -c ./Launch.sh

View File

@ -92,19 +92,29 @@ USER arch
ENV USER arch ENV USER arch
# 5.13 problem
#### 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_KERNEL=/boot/vmlinuz-linux
ENV SUPERMIN_MODULES=/lib/modules/5.12.14-arch1-1 ENV SUPERMIN_MODULES=/lib/modules/5.12.14-arch1-1
ENV SUPERMIN_KERNEL_VERSION=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 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 libguestfs-test-tool \
; sudo rm -rf /var/tmp/.guestfs-* \
; fi
####
RUN sudo pacman -Rns linux --noconfirm \
; sudo pacman -Syy \
; sudo pacman -S mkinitcpio --noconfirm \
; sudo pacman -U https://archive.archlinux.org/packages/l/linux/linux-5.12.14.arch1-1-x86_64.pkg.tar.zst --noconfirm \
; sudo rm -rf /var/tmp/.guestfs-* \
; libguestfs-test-tool
WORKDIR /home/arch/OSX-KVM WORKDIR /home/arch/OSX-KVM
@ -135,6 +145,14 @@ RUN if [[ "${COMPLETE}" ]]; then \
&& wget ${WGET_OPTIONS} -O /home/arch/OSX-KVM/mac_hdd_ng.img "${IMAGE_URL}" \ && wget ${WGET_OPTIONS} -O /home/arch/OSX-KVM/mac_hdd_ng.img "${IMAGE_URL}" \
; fi ; fi
####
# 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 #### SPECIAL RUNTIME ARGUMENTS BELOW
ENV ADDITIONAL_PORTS= ENV ADDITIONAL_PORTS=
@ -200,9 +218,9 @@ CMD echo "${BOILERPLATE}" \
; sudo chown -R $(id -u):$(id -g) /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 ]] && { \ ; [[ "${NOPICKER}" == true ]] && { \
sed -i '/^.*InstallMedia.*/d' Launch.sh \ sed -i '/^.*InstallMedia.*/d' Launch.sh \
&& export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore-nopicker.qcow2}" \ && export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore-nopicker.qcow2}" \
; } \ ; } \
|| export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \ || export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
; [[ "${GENERATE_UNIQUE}" == true ]] && { \ ; [[ "${GENERATE_UNIQUE}" == true ]] && { \
./Docker-OSX/osx-serial-generator/generate-unique-machine-values.sh \ ./Docker-OSX/osx-serial-generator/generate-unique-machine-values.sh \
--master-plist-url="${MASTER_PLIST_URL}" \ --master-plist-url="${MASTER_PLIST_URL}" \
@ -211,7 +229,7 @@ CMD echo "${BOILERPLATE}" \
--bootdisks \ --bootdisks \
--width "${WIDTH:-1920}" \ --width "${WIDTH:-1920}" \
--height "${HEIGHT:-1080}" \ --height "${HEIGHT:-1080}" \
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \ --output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
--output-env "${ENV:=/env}" \ --output-env "${ENV:=/env}" \
|| exit 1 ; } \ || exit 1 ; } \
; [[ "${GENERATE_SPECIFIC}" == true ]] && { \ ; [[ "${GENERATE_SPECIFIC}" == true ]] && { \
@ -225,7 +243,7 @@ CMD echo "${BOILERPLATE}" \
--mac-address "${MAC_ADDRESS}" \ --mac-address "${MAC_ADDRESS}" \
--width "${WIDTH:-1920}" \ --width "${WIDTH:-1920}" \
--height "${HEIGHT:-1080}" \ --height "${HEIGHT:-1080}" \
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \ --output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
|| exit 1 ; } \ || exit 1 ; } \
; { [[ "${DISPLAY}" = ':99' ]] || [[ "${HEADLESS}" == true ]] ; } && { \ ; { [[ "${DISPLAY}" = ':99' ]] || [[ "${HEADLESS}" == true ]] ; } && { \
nohup Xvfb :99 -screen 0 1920x1080x16 \ nohup Xvfb :99 -screen 0 1920x1080x16 \

View File

@ -73,7 +73,7 @@ RUN touch Launch.sh \
&& tee -a Launch.sh <<< '-smbios type=2 \' \ && 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 <<< '-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 <<< '-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-Catalina/OpenCore.qcow2} \' \ && 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.2,drive=OpenCoreBoot \' \
&& tee -a Launch.sh <<< '-device ide-hd,bus=sata.3,drive=InstallMedia \' \ && 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=InstallMedia,if=none,file=/home/arch/OSX-KVM/BaseSystem.img,format=qcow2 \' \
@ -97,19 +97,33 @@ USER arch
ENV USER arch ENV USER arch
# 5.13 problem
#### 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_KERNEL=/boot/vmlinuz-linux
ENV SUPERMIN_MODULES=/lib/modules/5.12.14-arch1-1 ENV SUPERMIN_MODULES=/lib/modules/5.12.14-arch1-1
ENV SUPERMIN_KERNEL_VERSION=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 LIBGUESTFS_PACKAGE_URL=https://archive.archlinux.org/packages/l/libguestfs/libguestfs-1.44.1-6-x86_64.pkg.tar.zst
RUN sudo pacman -Rns linux --noconfirm \ ARG LINUX=true
; sudo pacman -Syy \
; sudo pacman -S mkinitcpio --noconfirm \ # required to use libguestfs inside a docker container, to create bootdisks for docker-osx on-the-fly
; sudo pacman -U https://archive.archlinux.org/packages/l/linux/linux-5.12.14.arch1-1-x86_64.pkg.tar.zst --noconfirm \ RUN if [[ "${LINUX}" == true ]]; then \
; sudo rm -rf /var/tmp/.guestfs-* \ sudo pacman -U "${KERNEL_PACKAGE_URL}" --noconfirm \
; libguestfs-test-tool ; sudo pacman -U "${LIBGUESTFS_PACKAGE_URL}" --noconfirm \
; sudo libguestfs-test-tool \
; sudo rm -rf /var/tmp/.guestfs-* \
; fi
####
# 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 #### SPECIAL RUNTIME ARGUMENTS BELOW
@ -182,16 +196,16 @@ VOLUME ["/tmp/.X11-unix"]
# /bootdisk is a useful persistent place to store the 15Mb serial number bootdisk. # /bootdisk is a useful persistent place to store the 15Mb serial number bootdisk.
# if you don't set any of the above: # if you don't set any of the above:
# the default serial numbers are already contained in ./OpenCore-Catalina/OpenCore.qcow2 # the default serial numbers are already contained in ./OpenCore/OpenCore.qcow2
# And the default serial numbers # And the default serial numbers
CMD sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/null || true \ 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 \ ; sudo chown -R $(id -u):$(id -g) /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/null || true \
; [[ "${NOPICKER}" == true ]] && { \ ; [[ "${NOPICKER}" == true ]] && { \
sed -i '/^.*InstallMedia.*/d' Launch.sh \ sed -i '/^.*InstallMedia.*/d' Launch.sh \
&& export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore-nopicker.qcow2}" \ && export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore-nopicker.qcow2}" \
; } \ ; } \
|| export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \ || export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
; [[ "${GENERATE_UNIQUE}" == true ]] && { \ ; [[ "${GENERATE_UNIQUE}" == true ]] && { \
./Docker-OSX/osx-serial-generator/generate-unique-machine-values.sh \ ./Docker-OSX/osx-serial-generator/generate-unique-machine-values.sh \
--master-plist-url="${MASTER_PLIST_URL}" \ --master-plist-url="${MASTER_PLIST_URL}" \
@ -200,7 +214,7 @@ CMD sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/n
--bootdisks \ --bootdisks \
--width "${WIDTH:-1920}" \ --width "${WIDTH:-1920}" \
--height "${HEIGHT:-1080}" \ --height "${HEIGHT:-1080}" \
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \ --output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
--output-env "${ENV:=/env}" \ --output-env "${ENV:=/env}" \
|| exit 1 ; } \ || exit 1 ; } \
; [[ "${GENERATE_SPECIFIC}" == true ]] && { \ ; [[ "${GENERATE_SPECIFIC}" == true ]] && { \
@ -214,7 +228,7 @@ CMD sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/n
--mac-address "${MAC_ADDRESS}" \ --mac-address "${MAC_ADDRESS}" \
--width "${WIDTH:-1920}" \ --width "${WIDTH:-1920}" \
--height "${HEIGHT:-1080}" \ --height "${HEIGHT:-1080}" \
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \ --output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
|| exit 1 ; } \ || exit 1 ; } \
; ./enable-ssh.sh && /bin/bash -c ./Launch.sh ; ./enable-ssh.sh && /bin/bash -c ./Launch.sh

View File

@ -81,19 +81,29 @@ USER arch
ENV USER arch ENV USER arch
# 5.13 problem
#### 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_KERNEL=/boot/vmlinuz-linux
ENV SUPERMIN_MODULES=/lib/modules/5.12.14-arch1-1 ENV SUPERMIN_MODULES=/lib/modules/5.12.14-arch1-1
ENV SUPERMIN_KERNEL_VERSION=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 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 libguestfs-test-tool \
; sudo rm -rf /var/tmp/.guestfs-* \
; fi
####
RUN sudo pacman -Rns linux --noconfirm \
; sudo pacman -Syy \
; sudo pacman -S mkinitcpio --noconfirm \
; sudo pacman -U https://archive.archlinux.org/packages/l/linux/linux-5.12.14.arch1-1-x86_64.pkg.tar.zst --noconfirm \
; sudo rm -rf /var/tmp/.guestfs-* \
; libguestfs-test-tool
WORKDIR /home/arch/OSX-KVM WORKDIR /home/arch/OSX-KVM
@ -107,6 +117,13 @@ RUN mkdir -p ~/.ssh \
&& tee -a ~/.ssh/config <<< ' StrictHostKeyChecking no' \ && tee -a ~/.ssh/config <<< ' StrictHostKeyChecking no' \
&& tee -a ~/.ssh/config <<< ' UserKnownHostsFile=/dev/null' && tee -a ~/.ssh/config <<< ' UserKnownHostsFile=/dev/null'
####
# 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 #### SPECIAL RUNTIME ARGUMENTS BELOW
ENV ADDITIONAL_PORTS= ENV ADDITIONAL_PORTS=
@ -165,9 +182,9 @@ CMD sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/n
; } \ ; } \
; [[ "${NOPICKER}" == true ]] && { \ ; [[ "${NOPICKER}" == true ]] && { \
sed -i '/^.*InstallMedia.*/d' Launch.sh \ sed -i '/^.*InstallMedia.*/d' Launch.sh \
&& export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore-nopicker.qcow2}" \ && export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore-nopicker.qcow2}" \
; } \ ; } \
|| export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \ || export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
; [[ "${GENERATE_UNIQUE}" == true ]] && { \ ; [[ "${GENERATE_UNIQUE}" == true ]] && { \
./Docker-OSX/osx-serial-generator/generate-unique-machine-values.sh \ ./Docker-OSX/osx-serial-generator/generate-unique-machine-values.sh \
--master-plist-url="${MASTER_PLIST_URL}" \ --master-plist-url="${MASTER_PLIST_URL}" \
@ -176,7 +193,7 @@ CMD sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/n
--bootdisks \ --bootdisks \
--width "${WIDTH:-1920}" \ --width "${WIDTH:-1920}" \
--height "${HEIGHT:-1080}" \ --height "${HEIGHT:-1080}" \
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \ --output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
--output-env "${ENV:=/env}" \ --output-env "${ENV:=/env}" \
|| exit 1 ; } \ || exit 1 ; } \
; [[ "${GENERATE_SPECIFIC}" == true ]] && { \ ; [[ "${GENERATE_SPECIFIC}" == true ]] && { \
@ -190,6 +207,6 @@ CMD sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/n
--mac-address "${MAC_ADDRESS}" \ --mac-address "${MAC_ADDRESS}" \
--width "${WIDTH:-1920}" \ --width "${WIDTH:-1920}" \
--height "${HEIGHT:-1080}" \ --height "${HEIGHT:-1080}" \
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \ --output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
|| exit 1 ; } \ || exit 1 ; } \
; ./enable-ssh.sh && /bin/bash -c ./Launch.sh ; ./enable-ssh.sh && /bin/bash -c ./Launch.sh

View File

@ -73,19 +73,28 @@ USER arch
ENV USER arch ENV USER arch
# 5.13 problem #### 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_KERNEL=/boot/vmlinuz-linux
ENV SUPERMIN_MODULES=/lib/modules/5.12.14-arch1-1 ENV SUPERMIN_MODULES=/lib/modules/5.12.14-arch1-1
ENV SUPERMIN_KERNEL_VERSION=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 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 libguestfs-test-tool \
; sudo rm -rf /var/tmp/.guestfs-* \
; fi
####
RUN sudo pacman -Rns linux --noconfirm \
; sudo pacman -Syy \
; sudo pacman -S mkinitcpio --noconfirm \
; sudo pacman -U https://archive.archlinux.org/packages/l/linux/linux-5.12.14.arch1-1-x86_64.pkg.tar.zst --noconfirm \
; sudo rm -rf /var/tmp/.guestfs-* \
; libguestfs-test-tool
WORKDIR /home/arch/OSX-KVM WORKDIR /home/arch/OSX-KVM
@ -116,6 +125,13 @@ RUN if [[ "${COMPLETE}" ]]; then \
&& wget ${WGET_OPTIONS} -O /home/arch/OSX-KVM/mac_hdd_ng.img "${IMAGE_URL}" \ && wget ${WGET_OPTIONS} -O /home/arch/OSX-KVM/mac_hdd_ng.img "${IMAGE_URL}" \
; fi ; fi
####
# 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 #### SPECIAL RUNTIME ARGUMENTS BELOW
ENV ADDITIONAL_PORTS= ENV ADDITIONAL_PORTS=
@ -181,9 +197,9 @@ CMD echo "${BOILERPLATE}" \
; sudo chown -R $(id -u):$(id -g) /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 ]] && { \ ; [[ "${NOPICKER}" == true ]] && { \
sed -i '/^.*InstallMedia.*/d' Launch.sh \ sed -i '/^.*InstallMedia.*/d' Launch.sh \
&& export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore-nopicker.qcow2}" \ && export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore-nopicker.qcow2}" \
; } \ ; } \
|| export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \ || export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
; [[ "${GENERATE_UNIQUE}" == true ]] && { \ ; [[ "${GENERATE_UNIQUE}" == true ]] && { \
./Docker-OSX/osx-serial-generator/generate-unique-machine-values.sh \ ./Docker-OSX/osx-serial-generator/generate-unique-machine-values.sh \
--master-plist-url="${MASTER_PLIST_URL}" \ --master-plist-url="${MASTER_PLIST_URL}" \
@ -192,7 +208,7 @@ CMD echo "${BOILERPLATE}" \
--bootdisks \ --bootdisks \
--width "${WIDTH:-1920}" \ --width "${WIDTH:-1920}" \
--height "${HEIGHT:-1080}" \ --height "${HEIGHT:-1080}" \
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \ --output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
--output-env "${ENV:=/env}" \ --output-env "${ENV:=/env}" \
|| exit 1 ; } \ || exit 1 ; } \
; [[ "${GENERATE_SPECIFIC}" == true ]] && { \ ; [[ "${GENERATE_SPECIFIC}" == true ]] && { \
@ -206,7 +222,7 @@ CMD echo "${BOILERPLATE}" \
--mac-address "${MAC_ADDRESS}" \ --mac-address "${MAC_ADDRESS}" \
--width "${WIDTH:-1920}" \ --width "${WIDTH:-1920}" \
--height "${HEIGHT:-1080}" \ --height "${HEIGHT:-1080}" \
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \ --output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
|| exit 1 ; } \ || exit 1 ; } \
; { [[ "${DISPLAY}" = ':99' ]] || [[ "${HEADLESS}" == true ]] ; } && { \ ; { [[ "${DISPLAY}" = ':99' ]] || [[ "${HEADLESS}" == true ]] ; } && { \
nohup Xvfb :99 -screen 0 1920x1080x16 \ nohup Xvfb :99 -screen 0 1920x1080x16 \

View File

@ -8,7 +8,12 @@ Run Mac OS X in Docker with near-native performance! X11 Forwarding! iMessage se
The Discord is active on #docker-osx and anyone is welcome to come and ask questions, ideas, etc. The Discord is active on #docker-osx and anyone is welcome to come and ask questions, ideas, etc.
[![https://discord.gg/mx8pPw39Yg](/discord-logo.svg?raw=true "Join Sick Codes Discord Server")](https://discord.gg/mx8pPw39Yg) <p align="center">
<a href="https://hub.docker.com/r/sickcodes/docker-osx"><img src="https://dockeri.co/image/sickcodes/docker-osx"/></a><a href="https://discord.gg/mx8pPw39Yg"><a href="https://discord.gg/mx8pPw39Yg" target="_blank"><img src="https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/discord-logo.svg"></a></a>
</p>
### Click to join the Discord server [https://discord.gg/mx8pPw39Yg](https://discord.gg/mx8pPw39Yg) ### Click to join the Discord server [https://discord.gg/mx8pPw39Yg](https://discord.gg/mx8pPw39Yg)
@ -34,10 +39,14 @@ Extra special thanks to the OpenCore team over at: https://github.com/acidanther
If you like this project, consider contributing here or upstream! If you like this project, consider contributing here or upstream!
<a href="https://hub.docker.com/r/sickcodes/docker-osx"><img src="https://dockeri.co/image/sickcodes/docker-osx"/></a>
## Quick Start Docker-OSX ## Quick Start Docker-OSX
Video setup tutorial is also available here: https://www.youtube.com/watch?v=wLezYl77Ll8
<p align="center">
<a href="https://www.youtube.com/watch?v=wLezYl77Ll8" target="_blank"><img src="https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/Youtube-Screenshot-Docker-OSX-Setup.png"></a>
</p>
First time here? try [initial setup](#initial-setup), otherwise try the instructions below to use either Catalina or Big Sur. First time here? try [initial setup](#initial-setup), otherwise try the instructions below to use either Catalina or Big Sur.
## Any questions, ideas, or just want to hang out? ## Any questions, ideas, or just want to hang out?
@ -1085,7 +1094,9 @@ Or tell the container to use specific ones using `-e GENERATE_SPECIFIC=true`
-e MAC_ADDRESS="A8:5C:2C:9A:46:2F" \ -e MAC_ADDRESS="A8:5C:2C:9A:46:2F" \
``` ```
### I'd like to run Docker-OSX with WSL2 (Windows, Ubuntu) ### I'd like to run Docker-OSX on Windows
Running Docker-OSX on windows is possible just in WSL2 (Windows, Ubuntu).
Ensure KVM is enabled and `x11-apps` is installed. Ensure KVM is enabled and `x11-apps` is installed.
@ -1401,9 +1412,6 @@ docker run -it \
# Boots in a minute or two! # Boots in a minute or two!
``` ```
```bash
OR if you have an image already and just want to log in and execute arbitrary commands: OR if you have an image already and just want to log in and execute arbitrary commands:
```bash ```bash

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

View File

@ -215,6 +215,7 @@ docker-osx:latest () {
docker-osx:naked () { docker-osx:naked () {
docker build ${NO_CACHE} \ docker build ${NO_CACHE} \
--squash \
--build-arg RANKMIRRORS=true \ --build-arg RANKMIRRORS=true \
--build-arg MIRROR_COUNTRY="${MIRROR_COUNTRY}" \ --build-arg MIRROR_COUNTRY="${MIRROR_COUNTRY}" \
-f ./Dockerfile.naked \ -f ./Dockerfile.naked \
@ -225,6 +226,7 @@ docker-osx:naked () {
docker-osx:naked-auto () { docker-osx:naked-auto () {
docker build ${NO_CACHE} \ docker build ${NO_CACHE} \
--squash \
--build-arg RANKMIRRORS=true \ --build-arg RANKMIRRORS=true \
--build-arg MIRROR_COUNTRY="${MIRROR_COUNTRY}" \ --build-arg MIRROR_COUNTRY="${MIRROR_COUNTRY}" \
-f ./Dockerfile.naked-auto \ -f ./Dockerfile.naked-auto \
@ -272,6 +274,12 @@ docker-osx:auto-big-sur () {
} }
reset_docker_hard () { reset_docker_hard () {
tee /etc/docker/daemon.json <<'EOF'
{
"experimental": true
}
EOF
systemctl disable --now docker systemctl disable --now docker
systemctl disable --now docker.socket systemctl disable --now docker.socket
systemctl stop docker systemctl stop docker
@ -298,7 +306,7 @@ export DEBIAN_FRONTEND=noninteractive \
; echo start_xvfb \ ; echo start_xvfb \
; start_vnc \ ; start_vnc \
; enable_kvm \ ; enable_kvm \
; echo reset_docker_hard \ ; reset_docker_hard \
; echo killall Xvfb \ ; echo killall Xvfb \
; clone_repo "${BRANCH}" "${REPO}" \ ; clone_repo "${BRANCH}" "${REPO}" \
; cd Docker-OSX \ ; cd Docker-OSX \