2 Commits

13 changed files with 127 additions and 170 deletions

3
.gitmodules vendored
View File

@ -1,3 +1,6 @@
[submodule "osx-serial-generator"] [submodule "osx-serial-generator"]
path = osx-serial-generator path = osx-serial-generator
url = https://github.com/sickcodes/osx-serial-generator.git url = https://github.com/sickcodes/osx-serial-generator.git
[submodule "OSX-KVM"]
path = OSX-KVM
url = https://github.com/kholia/OSX-KVM

View File

@ -120,12 +120,4 @@ This project now uses the fantastic OpenCore bootloader from the community OpenC
[@aslafy-z](https://github.com/aslafy-z) chore(docs): update helm requirements list style #420 [@aslafy-z](https://github.com/aslafy-z) chore(docs): update helm requirements list style #420
[@kimjammer](https://github.com/kimjammer) Update Windows Installation section #422 @Mhartig - Worked out issue `Enter a number (default=1): error: invalid number: y`
[@Mhartig](https://github.com/Mhartig) - Worked out issue `Enter a number (default=1): error: invalid number: y`
[@felipestt](https://github.com/felipestt) Use more CPU Cores/SMP' broken #440
[@routmoute](https://github.com/routmoute) README: add PulseAudio with WSLg #442
[@dulatello08](https://github.com/dulatello08) Update README.md #452

View File

@ -80,15 +80,6 @@ RUN if [[ "${RANKMIRRORS}" ]]; then \
&& cat /etc/pacman.d/mirrorlist \ && cat /etc/pacman.d/mirrorlist \
; fi ; fi
# Fixes issue with invalid GPG keys: update the archlinux-keyring package to get the latest keys, then remove and regenerate gnupg keys
RUN pacman -Sy archlinux-keyring --noconfirm && rm -rf /etc/pacman.d/gnupg && pacman-key --init && pacman-key --populate
RUN tee -a /etc/pacman.d/gnupg/gpg.conf <<< 'keyserver hkp://keyserver.ubuntu.com' \
&& tee -a /etc/pacman.d/gnupg/gpg.conf <<< 'keyserver hkps://hkps.pool.sks-keyservers.net:443' \
&& tee -a /etc/pacman.d/gnupg/gpg.conf <<< 'keyserver hkp://pgp.mit.edu:11371' \
&& tee -a /etc/pacman.d/gnupg/gpg.conf <<< 'keyserver hkps://keys.openpgp.org' \
&& tee -a /etc/pacman.d/gnupg/gpg.conf <<< 'keyserver hkps://keys.mailvelope.com'
# This fails on hub.docker.com, useful for debugging in cloud # This fails on hub.docker.com, useful for debugging in cloud
# RUN [[ $(egrep -c '(svm|vmx)' /proc/cpuinfo) -gt 0 ]] || { echo KVM not possible on this host && exit 1; } # RUN [[ $(egrep -c '(svm|vmx)' /proc/cpuinfo) -gt 0 ]] || { echo KVM not possible on this host && exit 1; }
@ -99,11 +90,11 @@ RUN pacman -Syu git zip vim nano alsa-utils openssh --noconfirm \
&& ln -s /bin/vim /bin/vi \ && ln -s /bin/vim /bin/vi \
&& useradd arch -p arch \ && useradd arch -p arch \
&& tee -a /etc/sudoers <<< 'arch ALL=(ALL) NOPASSWD: ALL' \ && tee -a /etc/sudoers <<< 'arch ALL=(ALL) NOPASSWD: ALL' \
&& mkdir -p /home/arch \ && mkdir /home/arch \
&& chown arch:arch /home/arch && chown arch:arch /home/arch
# allow ssh to container # allow ssh to container
RUN mkdir -p -m 700 /root/.ssh RUN mkdir -m 700 /root/.ssh
WORKDIR /root/.ssh WORKDIR /root/.ssh
RUN touch authorized_keys \ RUN touch authorized_keys \
@ -123,14 +114,16 @@ RUN tee -a sshd_config <<< 'AllowTcpForwarding yes' \
USER arch USER arch
# download OSX-KVM # download OSX-KVM
# RUN git clone --recurse-submodules --depth 1 https://github.com/kholia/OSX-KVM.git /home/arch/OSX-KVM # RUN git clone --recurse-submodules --depth 1 https://github.com/kholia/OSX-KVM.git /home/arch/Docker-OSX/OSX-KVM
RUN git clone --recurse-submodules --depth 1 https://github.com/kholia/OSX-KVM.git /home/arch/OSX-KVM RUN git clone --recurse-submodules --depth 1 https://github.com/sickcodes/Docker-OSX.git /home/arch/Docker-OSX
# Create a symbolic link from OSX-KVM to submodule directory as we are using as a submodule instead now (redunancy proof)
RUN ln -s /home/arch/Docker-OSX/OSX-KVM /home/arch/OSX-KVM
# enable ssh # enable ssh
# docker exec .... ./enable-ssh.sh # docker exec .... ./enable-ssh.sh
USER arch
WORKDIR /home/arch/OSX-KVM WORKDIR /home/arch/Docker-OSX
RUN touch enable-ssh.sh \ RUN touch enable-ssh.sh \
&& chmod +x ./enable-ssh.sh \ && chmod +x ./enable-ssh.sh \
@ -149,10 +142,10 @@ RUN touch enable-ssh.sh \
# RUN yes | sudo pacman -Syu qemu libvirt dnsmasq virt-manager bridge-utils edk2-ovmf netctl libvirt-dbus --overwrite --noconfirm # RUN yes | sudo pacman -Syu qemu libvirt dnsmasq virt-manager bridge-utils edk2-ovmf netctl libvirt-dbus --overwrite --noconfirm
RUN yes | sudo pacman -Syu bc qemu-desktop libvirt dnsmasq virt-manager bridge-utils openresolv jack2 ebtables edk2-ovmf netctl libvirt-dbus wget --overwrite --noconfirm \ RUN yes | sudo pacman -Syu bc qemu libvirt dnsmasq virt-manager bridge-utils openresolv jack2 ebtables edk2-ovmf netctl libvirt-dbus wget --overwrite --noconfirm \
&& yes | sudo pacman -Scc && yes | sudo pacman -Scc
WORKDIR /home/arch/OSX-KVM WORKDIR /home/arch/Docker-OSX/OSX-KVM
# RUN wget https://raw.githubusercontent.com/kholia/OSX-KVM/master/fetch-macOS-v2.py # RUN wget https://raw.githubusercontent.com/kholia/OSX-KVM/master/fetch-macOS-v2.py
@ -162,17 +155,11 @@ RUN make \
&& qemu-img convert BaseSystem.dmg -O qcow2 -p -c BaseSystem.img \ && qemu-img convert BaseSystem.dmg -O qcow2 -p -c BaseSystem.img \
&& rm ./BaseSystem.dmg && rm ./BaseSystem.dmg
# fix invalid signature on old libguestfs
ARG SIGLEVEL=Never
RUN sudo tee -a /etc/pacman.conf <<< "SigLevel = ${SIGLEVEL}"
ARG LINUX=true ARG LINUX=true
# required to use libguestfs inside a docker container, to create bootdisks for docker-osx on-the-fly # required to use libguestfs inside a docker container, to create bootdisks for docker-osx on-the-fly
RUN if [[ "${LINUX}" == true ]]; then \ RUN if [[ "${LINUX}" == true ]]; then \
sudo pacman -Syu linux archlinux-keyring guestfs-tools --noconfirm \ sudo pacman -Syu linux libguestfs --noconfirm \
&& libguestfs-test-tool \
; fi ; fi
# optional --build-arg to change branches for testing # optional --build-arg to change branches for testing
@ -196,16 +183,16 @@ RUN touch Launch.sh \
&& tee -a Launch.sh <<< '-smp ${CPU_STRING:-${SMP:-4},cores=${CORES:-4}} \' \ && 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 <<< '-usb -device usb-kbd -device usb-tablet \' \
&& tee -a Launch.sh <<< '-device isa-applesmc,osk=ourhardworkbythesewordsguardedpleasedontsteal\(c\)AppleComputerInc \' \ && 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,readonly=on,file=/home/arch/Docker-OSX/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 <<< '-drive if=pflash,format=raw,file=/home/arch/Docker-OSX/OSX-KVM/OVMF_VARS-1024x768.fd \' \
&& 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/OpenCore.qcow2} \' \ && tee -a Launch.sh <<< '-drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file=${BOOTDISK:-/home/arch/Docker-OSX/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=${BASESYSTEM_FORMAT:-qcow2} \' \ && tee -a Launch.sh <<< '-drive id=InstallMedia,if=none,file=/home/arch/Docker-OSX/OSX-KVM/BaseSystem.img,format=${BASESYSTEM_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 <<< '-drive id=MacHDD,if=none,file=${IMAGE_PATH:-/home/arch/Docker-OSX/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 <<< '-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 <<< '-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 <<< '-device ${NETWORKING:-vmxnet3},netdev=net0,id=net0,mac=${MAC_ADDRESS:-52:54:00:09:49:17} \' \
@ -228,22 +215,32 @@ USER arch
ENV 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
# fix ad hoc errors from using the arch museum to get libguestfs # fix ad hoc errors from using the arch museum to get libguestfs
RUN sudo sed -i -e 's/^\#RemoteFileSigLevel/RemoteFileSigLevel/g' /etc/pacman.conf RUN sudo sed -i -e 's/^\#RemoteFileSigLevel/RemoteFileSigLevel/g' /etc/pacman.conf
RUN sudo tee -a /etc/pacman.conf <<< 'RemoteFileSigLevel = Optional' \ RUN sudo pacman -Syy \
&& sudo pacman -Syy \
&& sudo pacman -Rns linux --noconfirm \ && sudo pacman -Rns linux --noconfirm \
&& sudo pacman -S mkinitcpio pcre pcre2 --noconfirm \ ; sudo pacman -S mkinitcpio --noconfirm \
&& sudo pacman -S linux linux-headers --noconfirm || exit 1 \ && sudo pacman -U "${KERNEL_PACKAGE_URL}" --noconfirm || exit 1 \
&& sudo pacman -U "${LIBGUESTFS_PACKAGE_URL}" --noconfirm || exit 1 \
&& rm -rf /var/tmp/.guestfs-* \ && rm -rf /var/tmp/.guestfs-* \
&& yes | sudo pacman -Scc \ && yes | sudo pacman -Scc \
&& export SUPERMIN_KERNEL_VERSION="$(uname -r)" \
&& export SUPERMIN_MODULES="/lib/modules/$(uname -r)" \
&& export SUPERMIN_KERNEL=/boot/vmlinuz-linux \
&& libguestfs-test-tool || exit 1 \ && libguestfs-test-tool || exit 1 \
&& rm -rf /var/tmp/.guestfs-* && rm -rf /var/tmp/.guestfs-*
####
# 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
# Upstream removed nopicker, so we are adding it back in, at build time # Upstream removed nopicker, so we are adding it back in, at build time
@ -262,8 +259,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/OpenCore.qcow2 ARG STOCK_BOOTDISK=/home/arch/Docker-OSX/OSX-KVM/OpenCore/OpenCore.qcow2
ARG STOCK_BOOTDISK_NOPICKER=/home/arch/OSX-KVM/OpenCore/OpenCore-nopicker.qcow2 ARG STOCK_BOOTDISK_NOPICKER=/home/arch/Docker-OSX/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}" \
@ -290,7 +287,7 @@ RUN ./Docker-OSX/osx-serial-generator/generate-specific-bootdisk.sh \
; rm -rf /var/tmp/.guestfs-* ; rm -rf /var/tmp/.guestfs-*
### symlink the old directory as upstream has renamed a directory. Symlinking purely for backwards compatability! ### 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 RUN ln -s /home/arch/Docker-OSX/OSX-KVM/OpenCore /home/arch/Docker-OSX/OSX-KVM/OpenCore-Catalina || true
#### ####
#### SPECIAL RUNTIME ARGUMENTS BELOW #### SPECIAL RUNTIME ARGUMENTS BELOW
@ -323,7 +320,7 @@ ENV GENERATE_UNIQUE=false
# Boolean for generating a bootdisk with specific serials. # Boolean for generating a bootdisk with specific serials.
ENV GENERATE_SPECIFIC=false ENV GENERATE_SPECIFIC=false
ENV IMAGE_PATH=/home/arch/OSX-KVM/mac_hdd_ng.img ENV IMAGE_PATH=/home/arch/Docker-OSX/OSX-KVM/mac_hdd_ng.img
ENV IMAGE_FORMAT=qcow2 ENV IMAGE_FORMAT=qcow2
ENV KVM='accel=kvm:tcg' ENV KVM='accel=kvm:tcg'
@ -371,9 +368,12 @@ CMD sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/n
; 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/OpenCore-nopicker.qcow2}" \ && export BOOTDISK="${BOOTDISK:=/home/arch/Docker-OSX/OSX-KVM/OpenCore/OpenCore-nopicker.qcow2}" \
; } \ ; } \
|| export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \ ; [[ "$(fdisk -l /image)" ]] && { \
&& export IMAGE_PATH=/image \
; } \
|| export BOOTDISK="${BOOTDISK:=/home/arch/Docker-OSX/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}" \
@ -382,7 +382,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/OpenCore.qcow2}" \ --output-bootdisk "${BOOTDISK:=/home/arch/Docker-OSX/OSX-KVM/OpenCore/OpenCore.qcow2}" \
--output-env "${ENV:=/env}" \ --output-env "${ENV:=/env}" \
|| exit 1 ; } \ || exit 1 ; } \
; [[ "${GENERATE_SPECIFIC}" == true ]] && { \ ; [[ "${GENERATE_SPECIFIC}" == true ]] && { \
@ -396,7 +396,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/OpenCore.qcow2}" \ --output-bootdisk "${BOOTDISK:=/home/arch/Docker-OSX/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

@ -42,7 +42,7 @@
FROM sickcodes/docker-osx:latest FROM sickcodes/docker-osx:latest
LABEL maintainer='https://twitter.com/sickcodes <https://sick.codes>' MAINTAINER 'https://twitter.com/sickcodes' <https://sick.codes>
USER root USER root
@ -71,7 +71,7 @@ RUN if [[ "${RANKMIRRORS}" ]]; then \
; fi \ ; fi \
; yes | pacman -Scc ; yes | pacman -Scc
RUN pacman -Syu xorg-server-xvfb wget xterm xorg-xhost xorg-xrandr --noconfirm \ RUN pacman -Syu xorg-server-xvfb wget xterm xorg-xhost xorg-xrandr sshpass --noconfirm \
&& if [[ "${SCROT}" ]]; then \ && if [[ "${SCROT}" ]]; then \
pacman -Syu scrot base-devel --noconfirm \ pacman -Syu scrot base-devel --noconfirm \
&& git clone --recurse-submodules --depth 1 https://github.com/stolk/imcat.git \ && git clone --recurse-submodules --depth 1 https://github.com/stolk/imcat.git \
@ -88,9 +88,6 @@ RUN pacman -Syu xorg-server-xvfb wget xterm xorg-xhost xorg-xrandr --noconfirm \
; fi \ ; fi \
; yes | pacman -Scc ; yes | pacman -Scc
RUN pacman -S sshpass --noconfirm \
&& yes | pacman -Scc
USER arch USER arch
ENV USER arch ENV USER arch
@ -123,7 +120,7 @@ RUN sudo pacman -Syy \
#### ####
WORKDIR /home/arch/OSX-KVM WORKDIR /home/arch/Docker-OSX/OSX-KVM
RUN mkdir -p ~/.ssh \ RUN mkdir -p ~/.ssh \
&& touch ~/.ssh/authorized_keys \ && touch ~/.ssh/authorized_keys \
@ -148,15 +145,15 @@ ARG IMAGE_URL='https://images.sick.codes/mac_hdd_ng_auto.img'
RUN if [[ "${COMPLETE}" ]]; then \ RUN if [[ "${COMPLETE}" ]]; then \
echo "Downloading 20GB image... This step might take a while... Press Ctrl+C if you want to abort." \ echo "Downloading 20GB image... This step might take a while... Press Ctrl+C if you want to abort." \
; rm -f /home/arch/OSX-KVM/mac_hdd_ng.img \ ; rm -f /home/arch/Docker-OSX/OSX-KVM/mac_hdd_ng.img \
&& wget ${WGET_OPTIONS} -O /home/arch/OSX-KVM/mac_hdd_ng.img "${IMAGE_URL}" \ && wget ${WGET_OPTIONS} -O /home/arch/Docker-OSX/OSX-KVM/mac_hdd_ng.img "${IMAGE_URL}" \
; fi ; fi
#### ####
# symlink the old directory, for redundancy # symlink the old directory, for redundancy
RUN ln -s /home/arch/OSX-KVM/OpenCore /home/arch/OSX-KVM/OpenCore-Catalina || true RUN ln -s /home/arch/Docker-OSX/OSX-KVM/OpenCore /home/arch/Docker-OSX/OSX-KVM/OpenCore-Catalina || true
#### ####
@ -184,7 +181,7 @@ ENV GENERATE_UNIQUE=false
# Boolean for generating a bootdisk with specific serials. # Boolean for generating a bootdisk with specific serials.
ENV GENERATE_SPECIFIC=false ENV GENERATE_SPECIFIC=false
ENV IMAGE_PATH=/home/arch/OSX-KVM/mac_hdd_ng.img ENV IMAGE_PATH=/home/arch/Docker-OSX/OSX-KVM/mac_hdd_ng.img
ENV IMAGE_FORMAT=qcow2 ENV IMAGE_FORMAT=qcow2
ENV KVM='accel=kvm:tcg' ENV KVM='accel=kvm:tcg'
@ -225,9 +222,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/OpenCore-nopicker.qcow2}" \ && export BOOTDISK="${BOOTDISK:=/home/arch/Docker-OSX/OSX-KVM/OpenCore/OpenCore-nopicker.qcow2}" \
; } \ ; } \
|| export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \ || export BOOTDISK="${BOOTDISK:=/home/arch/Docker-OSX/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}" \
@ -236,7 +233,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/OpenCore.qcow2}" \ --output-bootdisk "${BOOTDISK:=/home/arch/Docker-OSX/OSX-KVM/OpenCore/OpenCore.qcow2}" \
--output-env "${ENV:=/env}" \ --output-env "${ENV:=/env}" \
|| exit 1 ; } \ || exit 1 ; } \
; [[ "${GENERATE_SPECIFIC}" == true ]] && { \ ; [[ "${GENERATE_SPECIFIC}" == true ]] && { \
@ -250,7 +247,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/OpenCore.qcow2}" \ --output-bootdisk "${BOOTDISK:=/home/arch/Docker-OSX/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

@ -21,7 +21,7 @@
FROM sickcodes/docker-osx FROM sickcodes/docker-osx
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"]

View File

@ -32,13 +32,13 @@
FROM sickcodes/docker-osx:latest FROM sickcodes/docker-osx:latest
LABEL maintainer='https://twitter.com/sickcodes <https://sick.codes>' MAINTAINER 'https://twitter.com/sickcodes' <https://sick.codes>
USER root USER root
WORKDIR /root WORKDIR /root
RUN rm -f /home/arch/OSX-KVM/mac_hdd_ng.img RUN rm -f /home/arch/Docker-OSX/OSX-KVM/mac_hdd_ng.img
# OPTIONAL: Arch Linux server mirrors for super fast builds # OPTIONAL: Arch Linux server mirrors for super fast builds
# set RANKMIRRORS to any value other that nothing, e.g. -e RANKMIRRORS=true # set RANKMIRRORS to any value other that nothing, e.g. -e RANKMIRRORS=true
@ -103,7 +103,7 @@ RUN sudo pacman -Syy \
#### ####
WORKDIR /home/arch/OSX-KVM WORKDIR /home/arch/Docker-OSX/OSX-KVM
RUN mkdir -p ~/.ssh \ RUN mkdir -p ~/.ssh \
&& touch ~/.ssh/authorized_keys \ && touch ~/.ssh/authorized_keys \
@ -118,7 +118,7 @@ RUN mkdir -p ~/.ssh \
#### ####
# symlink the old directory, for redundancy # symlink the old directory, for redundancy
RUN ln -s /home/arch/OSX-KVM/OpenCore /home/arch/OSX-KVM/OpenCore-Catalina || true RUN ln -s /home/arch/Docker-OSX/OSX-KVM/OpenCore /home/arch/Docker-OSX/OSX-KVM/OpenCore-Catalina || true
#### ####
@ -180,9 +180,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/OpenCore-nopicker.qcow2}" \ && export BOOTDISK="${BOOTDISK:=/home/arch/Docker-OSX/OSX-KVM/OpenCore/OpenCore-nopicker.qcow2}" \
; } \ ; } \
|| export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \ || export BOOTDISK="${BOOTDISK:=/home/arch/Docker-OSX/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}" \
@ -191,7 +191,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/OpenCore.qcow2}" \ --output-bootdisk "${BOOTDISK:=/home/arch/Docker-OSX/OSX-KVM/OpenCore/OpenCore.qcow2}" \
--output-env "${ENV:=/env}" \ --output-env "${ENV:=/env}" \
|| exit 1 ; } \ || exit 1 ; } \
; [[ "${GENERATE_SPECIFIC}" == true ]] && { \ ; [[ "${GENERATE_SPECIFIC}" == true ]] && { \
@ -205,6 +205,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/OpenCore.qcow2}" \ --output-bootdisk "${BOOTDISK:=/home/arch/Docker-OSX/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

@ -18,13 +18,13 @@
FROM sickcodes/docker-osx:latest FROM sickcodes/docker-osx:latest
LABEL maintainer='https://twitter.com/sickcodes <https://sick.codes>' MAINTAINER 'https://twitter.com/sickcodes' <https://sick.codes>
USER root USER root
WORKDIR /root WORKDIR /root
RUN rm -f /home/arch/OSX-KVM/mac_hdd_ng.img RUN rm -f /home/arch/Docker-OSX/OSX-KVM/mac_hdd_ng.img
# For taking screenshots of the Xfvb screen, useful during development. # For taking screenshots of the Xfvb screen, useful during development.
ARG SCROT ARG SCROT
@ -52,7 +52,7 @@ RUN if [[ "${RANKMIRRORS}" ]]; then \
# For taking screenshots of the Xfvb screen, useful during development. # For taking screenshots of the Xfvb screen, useful during development.
ARG SCROT ARG SCROT
RUN pacman -Syu xorg-server-xvfb wget xterm xorg-xhost xorg-xrandr --noconfirm \ RUN pacman -Syu xorg-server-xvfb wget xterm xorg-xhost xorg-xrandr sshpass --noconfirm \
&& if [[ "${SCROT}" ]]; then \ && if [[ "${SCROT}" ]]; then \
pacman -Syu scrot base-devel --noconfirm \ pacman -Syu scrot base-devel --noconfirm \
&& git clone --recurse-submodules --depth 1 https://github.com/stolk/imcat.git \ && git clone --recurse-submodules --depth 1 https://github.com/stolk/imcat.git \
@ -69,9 +69,6 @@ RUN pacman -Syu xorg-server-xvfb wget xterm xorg-xhost xorg-xrandr --noconfirm \
; fi \ ; fi \
; yes | pacman -Scc ; yes | pacman -Scc
RUN pacman -S sshpass --noconfirm \
&& yes | pacman -Scc
USER arch USER arch
ENV USER arch ENV USER arch
@ -103,7 +100,7 @@ RUN sudo pacman -Syy \
#### ####
WORKDIR /home/arch/OSX-KVM WORKDIR /home/arch/Docker-OSX/OSX-KVM
RUN mkdir -p ~/.ssh \ RUN mkdir -p ~/.ssh \
&& touch ~/.ssh/authorized_keys \ && touch ~/.ssh/authorized_keys \
@ -128,14 +125,14 @@ ARG IMAGE_URL=
RUN if [[ "${COMPLETE}" ]]; then \ RUN if [[ "${COMPLETE}" ]]; then \
echo "Downloading your image... This step might take a while... Press Ctrl+C if you want to abort." \ echo "Downloading your image... This step might take a while... Press Ctrl+C if you want to abort." \
; rm -f /home/arch/OSX-KVM/mac_hdd_ng.img \ ; rm -f /home/arch/Docker-OSX/OSX-KVM/mac_hdd_ng.img \
&& wget ${WGET_OPTIONS} -O /home/arch/OSX-KVM/mac_hdd_ng.img "${IMAGE_URL}" \ && wget ${WGET_OPTIONS} -O /home/arch/Docker-OSX/OSX-KVM/mac_hdd_ng.img "${IMAGE_URL}" \
; fi ; fi
#### ####
# symlink the old directory, for redundancy # symlink the old directory, for redundancy
RUN ln -s /home/arch/OSX-KVM/OpenCore /home/arch/OSX-KVM/OpenCore-Catalina || true RUN ln -s /home/arch/Docker-OSX/OSX-KVM/OpenCore /home/arch/Docker-OSX/OSX-KVM/OpenCore-Catalina || true
#### ####
@ -204,9 +201,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/OpenCore-nopicker.qcow2}" \ && export BOOTDISK="${BOOTDISK:=/home/arch/Docker-OSX/OSX-KVM/OpenCore/OpenCore-nopicker.qcow2}" \
; } \ ; } \
|| export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \ || export BOOTDISK="${BOOTDISK:=/home/arch/Docker-OSX/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}" \
@ -215,7 +212,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/OpenCore.qcow2}" \ --output-bootdisk "${BOOTDISK:=/home/arch/Docker-OSX/OSX-KVM/OpenCore/OpenCore.qcow2}" \
--output-env "${ENV:=/env}" \ --output-env "${ENV:=/env}" \
|| exit 1 ; } \ || exit 1 ; } \
; [[ "${GENERATE_SPECIFIC}" == true ]] && { \ ; [[ "${GENERATE_SPECIFIC}" == true ]] && { \
@ -229,7 +226,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/OpenCore.qcow2}" \ --output-bootdisk "${BOOTDISK:=/home/arch/Docker-OSX/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 \

1
OSX-KVM Submodule

Submodule OSX-KVM added at 307cdd7c98

View File

@ -57,31 +57,40 @@ First time here? try [initial setup](#initial-setup), otherwise try the instruct
### Catalina [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/latest?label=sickcodes%2Fdocker-osx%3Alatest](https://img.shields.io/docker/image-size/sickcodes/docker-osx/latest?label=sickcodes%2Fdocker-osx%3Alatest)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated) ### Catalina [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/latest?label=sickcodes%2Fdocker-osx%3Alatest](https://img.shields.io/docker/image-size/sickcodes/docker-osx/latest?label=sickcodes%2Fdocker-osx%3Alatest)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
```bash ```bash
qemu-img create -f qcow2 image.img 512G
docker run -it \ docker run -it \
--device /dev/kvm \ --device /dev/kvm \
-p 50922:10022 \ -p 50922:10022 \
-v /tmp/.X11-unix:/tmp/.X11-unix \ -v /tmp/.X11-unix:/tmp/.X11-unix \
-e "DISPLAY=${DISPLAY:-:0.0}" \ -e "DISPLAY=${DISPLAY:-:0.0}" \
-v "${PWD}/image.img:/image" \
sickcodes/docker-osx:latest sickcodes/docker-osx:latest
# docker build -t docker-osx . # docker build -t docker-osx .
# if you want to keep everything inside the container, remove "${PWD}/image.img:/image" which will tell the Dockerfile to use the image at /image
``` ```
### Big Sur [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/big-sur?label=sickcodes%2Fdocker-osx%3Abig-sur](https://img.shields.io/docker/image-size/sickcodes/docker-osx/big-sur?label=sickcodes%2Fdocker-osx%3Abig-sur)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated) ### Big Sur [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/big-sur?label=sickcodes%2Fdocker-osx%3Abig-sur](https://img.shields.io/docker/image-size/sickcodes/docker-osx/big-sur?label=sickcodes%2Fdocker-osx%3Abig-sur)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
```bash ```bash
qemu-img create -f qcow2 image.img 512G
docker run -it \ docker run -it \
--device /dev/kvm \ --device /dev/kvm \
-p 50922:10022 \ -p 50922:10022 \
-v /tmp/.X11-unix:/tmp/.X11-unix \ -v /tmp/.X11-unix:/tmp/.X11-unix \
-e "DISPLAY=${DISPLAY:-:0.0}" \ -e "DISPLAY=${DISPLAY:-:0.0}" \
-v "${PWD}/image.img:/image" \
sickcodes/docker-osx:big-sur sickcodes/docker-osx:big-sur
# docker build -t docker-osx --build-arg SHORTNAME=big-sur . # docker build -t docker-osx --build-arg SHORTNAME=big-sur .
# if you want to keep everything inside the container, remove "${PWD}/image.img:/image" which will tell the Dockerfile to use the image at /image
``` ```
### Monterey [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/monterey?label=sickcodes%2Fdocker-osx%3Amonterey](https://img.shields.io/docker/image-size/sickcodes/docker-osx/monterey?label=sickcodes%2Fdocker-osx%3Amonterey)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated) ### Monterey [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/monterey?label=sickcodes%2Fdocker-osx%3Amonterey](https://img.shields.io/docker/image-size/sickcodes/docker-osx/monterey?label=sickcodes%2Fdocker-osx%3Amonterey)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
```bash ```bash
qemu-img create -f qcow2 image.img 512G
docker run -it \ docker run -it \
--device /dev/kvm \ --device /dev/kvm \
@ -90,27 +99,12 @@ docker run -it \
-e "DISPLAY=${DISPLAY:-:0.0}" \ -e "DISPLAY=${DISPLAY:-:0.0}" \
-e GENERATE_UNIQUE=true \ -e GENERATE_UNIQUE=true \
-e MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom.plist' \ -e MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom.plist' \
-v "${PWD}/image.img:/image" \
sickcodes/docker-osx:monterey sickcodes/docker-osx:monterey
# docker build -t docker-osx --build-arg SHORTNAME=monterey . # docker build -t docker-osx --build-arg SHORTNAME=monterey .
``` ```
### Ventura [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/ventura?label=sickcodes%2Fdocker-osx%3Aventura](https://img.shields.io/docker/image-size/sickcodes/docker-osx/ventura?label=sickcodes%2Fdocker-osx%3Aventura)](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 MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom.plist' \
sickcodes/docker-osx:ventura
# docker build -t docker-osx --build-arg SHORTNAME=ventura .
```
#### Run Catalina Pre-Installed [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/auto?label=sickcodes%2Fdocker-osx%3Aauto](https://img.shields.io/docker/image-size/sickcodes/docker-osx/auto?label=sickcodes%2Fdocker-osx%3Aauto)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated) #### Run Catalina Pre-Installed [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/auto?label=sickcodes%2Fdocker-osx%3Aauto](https://img.shields.io/docker/image-size/sickcodes/docker-osx/auto?label=sickcodes%2Fdocker-osx%3Aauto)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
```bash ```bash
@ -135,12 +129,14 @@ docker run -it \
### High Sierra [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/high-sierra?label=sickcodes%2Fdocker-osx%3Ahigh-sierra](https://img.shields.io/docker/image-size/sickcodes/docker-osx/high-sierra?label=sickcodes%2Fdocker-osx%3Ahigh-sierra)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated) ### High Sierra [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/high-sierra?label=sickcodes%2Fdocker-osx%3Ahigh-sierra](https://img.shields.io/docker/image-size/sickcodes/docker-osx/high-sierra?label=sickcodes%2Fdocker-osx%3Ahigh-sierra)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
```bash ```bash
qemu-img create -f qcow2 image.img 512G
docker run -it \ docker run -it \
--device /dev/kvm \ --device /dev/kvm \
-p 50922:10022 \ -p 50922:10022 \
-v /tmp/.X11-unix:/tmp/.X11-unix \ -v /tmp/.X11-unix:/tmp/.X11-unix \
-e "DISPLAY=${DISPLAY:-:0.0}" \ -e "DISPLAY=${DISPLAY:-:0.0}" \
-v "${PWD}/image.img:/image" \
sickcodes/docker-osx:high-sierra sickcodes/docker-osx:high-sierra
# docker build -t docker-osx --build-arg SHORTNAME=high-sierra . # docker build -t docker-osx --build-arg SHORTNAME=high-sierra .
@ -149,12 +145,14 @@ docker run -it \
### Mojave [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/mojave?label=sickcodes%2Fdocker-osx%3Amojave](https://img.shields.io/docker/image-size/sickcodes/docker-osx/mojave?label=sickcodes%2Fdocker-osx%3Amojave)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated) ### Mojave [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/mojave?label=sickcodes%2Fdocker-osx%3Amojave](https://img.shields.io/docker/image-size/sickcodes/docker-osx/mojave?label=sickcodes%2Fdocker-osx%3Amojave)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
```bash ```bash
qemu-img create -f qcow2 image.img 512G
docker run -it \ docker run -it \
--device /dev/kvm \ --device /dev/kvm \
-p 50922:10022 \ -p 50922:10022 \
-v /tmp/.X11-unix:/tmp/.X11-unix \ -v /tmp/.X11-unix:/tmp/.X11-unix \
-e "DISPLAY=${DISPLAY:-:0.0}" \ -e "DISPLAY=${DISPLAY:-:0.0}" \
-v "${PWD}/image.img:/image" \
sickcodes/docker-osx:mojave sickcodes/docker-osx:mojave
# docker build -t docker-osx --build-arg SHORTNAME=mojave . # docker build -t docker-osx --build-arg SHORTNAME=mojave .
@ -194,15 +192,12 @@ Enable SSH in network sharing inside the guest first. Change `-e "USERNAME=user"
Since you can't see the screen, use the PLIST with nopicker, for example: Since you can't see the screen, use the PLIST with nopicker, for example:
```bash ```bash
# Catalina wget https://images2.sick.codes/mac_hdd_ng_auto.img
# wget https://images2.sick.codes/mac_hdd_ng_auto.img
# Monterey
wget https://images.sick.codes/mac_hdd_ng_auto_monterey.img
docker run -it \ docker run -it \
--device /dev/kvm \ --device /dev/kvm \
-p 50922:10022 \ -p 50922:10022 \
-v "${PWD}/mac_hdd_ng_auto_monterey:/image" \ -v "${PWD}/mac_hdd_ng_auto.img:/image" \
-v /tmp/.X11-unix:/tmp/.X11-unix \ -v /tmp/.X11-unix:/tmp/.X11-unix \
-e "DISPLAY=${DISPLAY:-:0.0}" \ -e "DISPLAY=${DISPLAY:-:0.0}" \
-e "USERNAME=user" \ -e "USERNAME=user" \
@ -212,17 +207,6 @@ docker run -it \
sickcodes/docker-osx:naked-auto 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
# 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
```
# (VFIO) iPhone USB passthrough (VFIO) # (VFIO) iPhone USB passthrough (VFIO)
If you have a laptop see the next usbfluxd section. If you have a laptop see the next usbfluxd section.
@ -372,7 +356,6 @@ Pick one of these while **building**, irrelevant when using docker pull:
--build-arg SHORTNAME=catalina --build-arg SHORTNAME=catalina
--build-arg SHORTNAME=big-sur --build-arg SHORTNAME=big-sur
--build-arg SHORTNAME=monterey --build-arg SHORTNAME=monterey
--build-arg SHORTNAME=ventura
``` ```
@ -385,7 +368,6 @@ There currently multiple images, each with different use cases (explained [below
- Catalina - Catalina
- Big Sur - Big Sur
- Monterey - Monterey
- Ventura
- Auto (pre-made Catalina) - Auto (pre-made Catalina)
- Naked (use your own .img) - Naked (use your own .img)
- Naked-Auto (user your own .img and SSH in) - Naked-Auto (user your own .img and SSH in)
@ -522,7 +504,6 @@ Create your personal image using `:latest` or `big-sur`. Then, pull the image ou
- `sickcodes/docker-osx:naked` - [I need iMessage/iCloud for security research.](#generating-serial-numbers) - `sickcodes/docker-osx:naked` - [I need iMessage/iCloud for security research.](#generating-serial-numbers)
- `sickcodes/docker-osx:big-sur` - [I want to run Big Sur.](#quick-start-docker-osx) - `sickcodes/docker-osx:big-sur` - [I want to run Big Sur.](#quick-start-docker-osx)
- `sickcodes/docker-osx:monterey` - [I want to run Monterey.](#quick-start-docker-osx) - `sickcodes/docker-osx:monterey` - [I want to run Monterey.](#quick-start-docker-osx)
- `sickcodes/docker-osx:ventura` - [I want to run Ventura.](#quick-start-docker-osx)
- `sickcodes/docker-osx:high-sierra` - I want to run High Sierra. - `sickcodes/docker-osx:high-sierra` - I want to run High Sierra.
- `sickcodes/docker-osx:mojave` - I want to run Mojave. - `sickcodes/docker-osx:mojave` - I want to run Mojave.
@ -571,7 +552,7 @@ wsl --install
If you have previously installed WSL1, upgrade to WSL 2. Check [this link to upgrade from WSL1 to WSL2](https://docs.microsoft.com/en-us/windows/wsl/install#upgrade-version-from-wsl-1-to-wsl-2). If you have previously installed WSL1, upgrade to WSL 2. Check [this link to upgrade from WSL1 to WSL2](https://docs.microsoft.com/en-us/windows/wsl/install#upgrade-version-from-wsl-1-to-wsl-2).
After WSL installation, go to `C:/Users/<Your_Name>/.wslconfig` and add `nestedVirtualization=true` to the end of the file (If the file doesn't exist, create it). For more information about the `.wslconfig` file check [this link](https://docs.microsoft.com/en-us/windows/wsl/wsl-config#wslconfig). Verify that you have selected "Show Hidden Files" and "Show File Extensions" in File Explorer options. After WSL installation, go to `C:/Users/<Your_Name>/.wslconfig` and add `nestedVirtualization=true` to the end of the file (If the file doesn't exist, create it). You may need to select "Show Hidden Files" and "Show File Extensions" in File Explorer options.
The result should be like this: The result should be like this:
``` ```
[wsl2] [wsl2]
@ -602,19 +583,11 @@ Finally, there are 3 ways to get video output:
To use WSLg's built-in X-11 server, change these two lines in the docker run command to point Docker-OSX to WSLg. To use WSLg's built-in X-11 server, change these two lines in the docker run command to point Docker-OSX to WSLg.
``` ```bash
-e "DISPLAY=${DISPLAY:-:0.0}" \
-v /mnt/wslg/.X11-unix:/tmp/.X11-unix \
```
Or try:
```
-e "DISPLAY=${DISPLAY:-:0}" \ -e "DISPLAY=${DISPLAY:-:0}" \
-v /mnt/wslg/.X11-unix:/tmp/.X11-unix \ -v /mnt/wslg/.X11-unix:/tmp/.X11-unix \
``` ```
For Ubuntu 20.x on Windows, see [https://github.com/sickcodes/Docker-OSX/discussions/458](https://github.com/sickcodes/Docker-OSX/discussions/458)
- VNC: See the [VNC section](#building-a-headless-container-which-allows-insecure-vnc-on-localhost-for-local-use-only) for more information. You could also add -vnc argument to qemu. Connect to your mac VM via a VNC Client. [Here is a how to](https://wiki.archlinux.org/title/QEMU#VNC) - VNC: See the [VNC section](#building-a-headless-container-which-allows-insecure-vnc-on-localhost-for-local-use-only) for more information. You could also add -vnc argument to qemu. Connect to your mac VM via a VNC Client. [Here is a how to](https://wiki.archlinux.org/title/QEMU#VNC)
- Desktop Environment: This will give you a full desktop linux experiencem but it will use a bit more of the computer's resources. Here is an example guide, but there are other guides that help set up a desktop environment. [DE Example](https://www.makeuseof.com/tag/linux-desktop-windows-subsystem/) - Desktop Environment: This will give you a full desktop linux experiencem but it will use a bit more of the computer's resources. Here is an example guide, but there are other guides that help set up a desktop environment. [DE Example](https://www.makeuseof.com/tag/linux-desktop-windows-subsystem/)
@ -675,15 +648,13 @@ Or
#### Use more CPU Cores/SMP #### Use more CPU Cores/SMP
Examples: This will use all available cores; adjust accordingly to the day of the week:
`-e EXTRA='-smp 6,sockets=3,cores=2'` ```
-e CPU_STRING=$(nproc) \
```
`-e EXTRA='-smp 8,sockets=4,cores=2'` This will use `-smp $(nproc)`
`-e EXTRA='-smp 16,sockets=8,cores=2'`
Note, unlike memory, CPU usage is shared. so you can allocate all of your CPU's to the container.
### Confirm your user is part of the the Docker group, KVM group, libvirt group ### Confirm your user is part of the the Docker group, KVM group, libvirt group
@ -1893,3 +1864,4 @@ You may when initialising or booting into a container see errors from the `(qemu
`ALSA lib blahblahblah: (function name) returned error: no such file or directory`. These are more or less expected. As long as you are able to boot into the container and everything is working, no reason to worry about these. `ALSA lib blahblahblah: (function name) returned error: no such file or directory`. These are more or less expected. As long as you are able to boot into the container and everything is working, no reason to worry about these.
See also: [here](https://github.com/sickcodes/Docker-OSX/issues/174). See also: [here](https://github.com/sickcodes/Docker-OSX/issues/174).

View File

@ -16,7 +16,6 @@
# scrot -o catalina_master.png # scrot -o catalina_master.png
# scrot -o big-sur_master.png # scrot -o big-sur_master.png
# scrot -o monterey_master.png # scrot -o monterey_master.png
# scrot -o ventura_master.png
# pull off remote server to the tests folder # pull off remote server to the tests folder
# REMOTE_SERVER= # REMOTE_SERVER=
# scp root@"${REMOTE_SERVER}":~/*_master.png . # scp root@"${REMOTE_SERVER}":~/*_master.png .
@ -29,7 +28,6 @@ TESTS=(
catalina catalina
big-sur big-sur
monterey monterey
ventura
) )
# test each docker image to see if they boot to their unique respective installation screens. # test each docker image to see if they boot to their unique respective installation screens.

View File

@ -119,12 +119,6 @@ MIRROR_COUNTRY="${MIRROR_COUNTRY:=US}"
NO_CACHE="${NO_CACHE:=--no-cache}" NO_CACHE="${NO_CACHE:=--no-cache}"
TEST_BUILDS=(
'docker-osx:naked'
'docker-osx:naked-auto'
'docker-osx:auto'
)
TEST_BUILDS=( TEST_BUILDS=(
'docker-osx:naked' 'docker-osx:naked'
'docker-osx:naked-auto' 'docker-osx:naked-auto'
@ -137,23 +131,8 @@ VERSION_BUILDS=(
'catalina' 'catalina'
'big-sur' 'big-sur'
'monterey' 'monterey'
'ventura'
) )
warning () {
clear
for j in {15..1}; do
echo "############# WARNING: THIS SCRIPT IS NOT INTENDED FOR USE BY ################"
echo "############# IT IS USED BY THE PROJECT TO BUILD AND PUSH TO DOCKERHUB #######"
echo ""
echo " Press Ctrl C to stop. "
MAX_COLS=$((${COLUMNS}/2))
printf "$j %.0s" {1..20}
echo
sleep 1
done
}
install_docker () { install_docker () {
apt remove docker docker-engine docker.io containerd runc -y \ apt remove docker docker-engine docker.io containerd runc -y \
; apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common -y \ ; apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common -y \
@ -291,7 +270,6 @@ EOF
systemctl enable --now docker systemctl enable --now docker
} }
warning
tee -a ~/.bashrc <<EOF tee -a ~/.bashrc <<EOF
export DEBIAN_FRONTEND=noninteractive export DEBIAN_FRONTEND=noninteractive
export TZ=UTC export TZ=UTC

View File

@ -95,8 +95,8 @@ RUN if [[ "${RANKMIRRORS}" ]]; then { pacman -Sy wget --noconfirm || pacman -Syu
USER arch USER arch
RUN yes | sudo pacman -Syyuu --noconfirm \ RUN sudo pacman -Syyuu --noconfirm \
&& yes | sudo pacman -S tigervnc xterm xorg-xhost xdotool ufw --noconfirm \ && sudo pacman -S tigervnc xterm xorg-xhost xdotool ufw --noconfirm \
&& mkdir -p ${HOME}/.vnc \ && mkdir -p ${HOME}/.vnc \
&& touch ~/.vnc/config \ && touch ~/.vnc/config \
&& tee -a ~/.vnc/config <<< 'geometry=1920x1080' \ && tee -a ~/.vnc/config <<< 'geometry=1920x1080' \

View File

@ -57,6 +57,12 @@ RUN if [[ "${RANKMIRRORS}" ]]; then { pacman -Sy wget --noconfirm || pacman -Syu
&& tee -a /etc/pacman.d/mirrorlist <<< 'Server = https://mirror.rackspace.com/archlinux/$repo/os/$arch' \ && tee -a /etc/pacman.d/mirrorlist <<< 'Server = https://mirror.rackspace.com/archlinux/$repo/os/$arch' \
&& cat /etc/pacman.d/mirrorlist ; fi && cat /etc/pacman.d/mirrorlist ; fi
# TEMP-FIX for pacman issue
RUN patched_glibc=glibc-linux4-2.33-4-x86_64.pkg.tar.zst \
&& curl -LO "https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/${patched_glibc}" \
&& bsdtar -C / -xvf "${patched_glibc}" || echo "Everything is fine."
# TEMP-FIX for pacman issue
# For taking screenshots of the Xfvb screen, useful during development. # For taking screenshots of the Xfvb screen, useful during development.
ARG SCROT ARG SCROT
@ -77,6 +83,12 @@ RUN pacman -Syu xorg-server-xvfb wget xterm xorg-xhost xorg-xrandr sshpass --noc
; fi \ ; fi \
; yes | pacman -Scc ; yes | pacman -Scc
# TEMP-FIX for pacman issue
RUN patched_glibc=glibc-linux4-2.33-4-x86_64.pkg.tar.zst \
&& curl -LO "https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/${patched_glibc}" \
&& bsdtar -C / -xvf "${patched_glibc}" || echo "Everything is fine."
# TEMP-FIX for pacman issue
USER arch USER arch
WORKDIR /home/arch/OSX-KVM WORKDIR /home/arch/OSX-KVM
@ -180,14 +192,21 @@ CMD sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/
WORKDIR /home/arch/OSX-KVM WORKDIR /home/arch/OSX-KVM
RUN yes | sudo pacman -Syyuu --noconfirm \ RUN sudo pacman -Syyuu --noconfirm \
&& yes | sudo pacman -S tigervnc xterm xorg-xhost xdotool ufw --noconfirm \ && sudo pacman -S tigervnc xterm xorg-xhost xdotool ufw --noconfirm \
&& mkdir -p ${HOME}/.vnc \ && mkdir -p ${HOME}/.vnc \
&& touch ~/.vnc/config \ && touch ~/.vnc/config \
&& tee -a ~/.vnc/config <<< 'geometry=1920x1080' \ && tee -a ~/.vnc/config <<< 'geometry=1920x1080' \
&& tee -a ~/.vnc/config <<< 'localhost' \ && tee -a ~/.vnc/config <<< 'localhost' \
&& tee -a ~/.vnc/config <<< 'alwaysshared' && tee -a ~/.vnc/config <<< 'alwaysshared'
# TEMP-FIX for file 5.40 libguestfs issue
RUN yes | sudo pacman -U https://archive.archlinux.org/packages/f/file/file-5.39-1-x86_64.pkg.tar.zst \
&& patched_glibc=glibc-linux4-2.33-4-x86_64.pkg.tar.zst \
&& curl -LO "https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/${patched_glibc}" \
&& bsdtar -C / -xvf "${patched_glibc}" || echo "Everything is fine."
# TEMP-FIX for file 5.40 libguestfs issue
RUN printf '\n%s\n' \ RUN printf '\n%s\n' \
'sudo rm -f /tmp/.X99-lock' \ 'sudo rm -f /tmp/.X99-lock' \
'export DISPLAY=:99' \ 'export DISPLAY=:99' \