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
81 Commits
persistent
...
e962dce97f
Author | SHA1 | Date | |
---|---|---|---|
e962dce97f | |||
2d4cc60572 | |||
730d6f294a | |||
93c2119ebc | |||
fb8aa4b248 | |||
b5a70782cc | |||
61b21421f6 | |||
342c09eb2a | |||
2dc1d615b1 | |||
19915de799 | |||
a1df7c5a65 | |||
55fe01bb97 | |||
7c635c0d20 | |||
b653f292a5 | |||
c1b834fbb0 | |||
d13bae59e4 | |||
1c10fc4301 | |||
0c8e5f3923 | |||
9a229b87ce | |||
476de8d2d1 | |||
42263d90fc | |||
756a1c03b9 | |||
37aad0460d | |||
54c96557c0 | |||
e17ee6c90a | |||
a208578bf0 | |||
88343e730c | |||
a13f61bded | |||
d09fa38b47 | |||
b09155a612 | |||
669bea269d | |||
d3129a83d5 | |||
846cf8fdaf | |||
bc0be6b6c7 | |||
bb1e992916 | |||
51f1c1ce14 | |||
ac3fe529a8 | |||
0daf0ff5d4 | |||
8f555f085d | |||
924fa68088 | |||
237a286e44 | |||
de142e8e49 | |||
fc8f78ff0f | |||
6dc83cebc2 | |||
9b10a306db | |||
fbe5dba618 | |||
2265bb5a3f | |||
86452e6da3 | |||
e612ca3229 | |||
dab7fc884c | |||
c0ea46aab5 | |||
bb75dc4669 | |||
9aac2dbe7f | |||
cedfbf521c | |||
671c46046a | |||
e5ca81ee6e | |||
ed5e50da7c | |||
306961a107 | |||
917e091798 | |||
1e00c9cfd7 | |||
f794cac0e2 | |||
e0d753030b | |||
586e093ba6 | |||
160489b0e3 | |||
a43fc57188 | |||
ab54b75ab8 | |||
49b86bec9a | |||
40a7e0d200 | |||
e6763761c0 | |||
1fa728b08d | |||
d7f0c289fc | |||
1103007c8d | |||
41b07267b2 | |||
fa0e336c7d | |||
55293cbb6c | |||
f9bfddbb5b | |||
4501c6a854 | |||
524749cbb8 | |||
73d84d28dd | |||
2d6d4b670a | |||
43a4c0b0d9 |
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"
|
14
CREDITS.md
14
CREDITS.md
@ -30,7 +30,7 @@ This project now uses the fantastic OpenCore bootloader from the community OpenC
|
||||
|
||||
[@jviotti](https://github.com/jviotti) - Auto-boot thru ShowPicker
|
||||
|
||||
[@MrBenFTW](https://github.com/MrBenFTW) - Updated macOS version 10.15.5 -> 10.15.6, Enabled screen sharing port forwarding, Removed the need to remove 1gb from the partition.
|
||||
[@IAmBenMitchell]([https://github.com/MrBenFTW](https://github.com/iambenmitchell)) - Updated macOS version 10.15.5 -> 10.15.6, Enabled screen sharing port forwarding, Removed the need to remove 1gb from the partition.
|
||||
|
||||
[@hoantp](https://github.com/hoantp) - Initialized TigerVNC 1.11.0 fix
|
||||
|
||||
@ -120,4 +120,14 @@ 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
|
||||
|
||||
@Mhartig - Worked out issue `Enter a number (default=1): error: invalid number: y`
|
||||
[@kimjammer](https://github.com/kimjammer) Update Windows Installation section #422
|
||||
|
||||
[@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
|
||||
|
||||
[@Anthropohedron](https://github.com/Anthropohedron) Added FAQ.md
|
||||
|
||||
|
100
Dockerfile
100
Dockerfile
@ -24,6 +24,7 @@
|
||||
#
|
||||
# docker build -t docker-osx .
|
||||
# docker build -t docker-osx --build-arg VERSION=10.15.5 --build-arg SIZE=200G .
|
||||
# docker build -t docker-osx-sonoma --build-arg BRANCH=sonoma --build-arg SHORTNAME=sonoma .
|
||||
#
|
||||
# Basic Run:
|
||||
#
|
||||
@ -58,28 +59,42 @@ 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 PARALLEL_DOWNLOADS=30
|
||||
|
||||
# OPTIONAL: Arch Linux server mirrors for super fast builds
|
||||
# set RANKMIRRORS to any value other that nothing, e.g. -e RANKMIRRORS=true
|
||||
RUN perl -i -p -e s/^\#Color/Color$'\n'ParallelDownloads\ =\ ${PARALLEL_DOWNLOADS:=30}/g /etc/pacman.conf
|
||||
|
||||
RUN perl -i -p -e s/^\#Color/Color$'\n'ParallelDownloads\ =\ 30/g /etc/pacman.conf
|
||||
ARG RANKMIRRORS
|
||||
ARG MIRROR_COUNTRY=US
|
||||
ARG MIRROR_COUNT=10
|
||||
|
||||
RUN tee /etc/pacman.d/mirrorlist <<< 'Server = https://geo.mirror.pkgbuild.com/$repo/os/$arch' \
|
||||
&& tee -a /etc/pacman.d/mirrorlist <<< 'Server = http://mirror.rackspace.com/archlinux/$repo/os/$arch' \
|
||||
&& tee -a /etc/pacman.d/mirrorlist <<< 'Server = https://mirror.rackspace.com/archlinux/$repo/os/$arch'
|
||||
|
||||
# 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 archlinux
|
||||
|
||||
RUN if [[ "${RANKMIRRORS}" ]]; then \
|
||||
{ pacman -Sy wget --noconfirm || pacman -Syu wget --noconfirm ; } \
|
||||
; wget -O ./rankmirrors "https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/rankmirrors" \
|
||||
; wget -O ./rankmirrors "https://raw.githubusercontent.com/sickcodes/Docker-OSX/${BRANCH:=master}/rankmirrors" \
|
||||
; wget -O- "https://www.archlinux.org/mirrorlist/?country=${MIRROR_COUNTRY:-US}&protocol=https&use_mirror_status=on" \
|
||||
| sed -e 's/^#Server/Server/' -e '/^#/d' \
|
||||
| head -n "$((${MIRROR_COUNT:-10}+1))" \
|
||||
| bash ./rankmirrors --verbose --max-time 5 - > /etc/pacman.d/mirrorlist \
|
||||
&& tee -a /etc/pacman.d/mirrorlist <<< 'Server = http://mirrors.evowise.com/archlinux/$repo/os/$arch' \
|
||||
&& tee -a /etc/pacman.d/mirrorlist <<< 'Server = http://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
|
||||
|
||||
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
|
||||
# RUN [[ $(egrep -c '(svm|vmx)' /proc/cpuinfo) -gt 0 ]] || { echo KVM not possible on this host && exit 1; }
|
||||
|
||||
@ -90,11 +105,11 @@ RUN pacman -Syu git zip vim nano alsa-utils openssh --noconfirm \
|
||||
&& ln -s /bin/vim /bin/vi \
|
||||
&& useradd arch -p arch \
|
||||
&& tee -a /etc/sudoers <<< 'arch ALL=(ALL) NOPASSWD: ALL' \
|
||||
&& mkdir /home/arch \
|
||||
&& mkdir -p /home/arch \
|
||||
&& chown arch:arch /home/arch
|
||||
|
||||
# allow ssh to container
|
||||
RUN mkdir -m 700 /root/.ssh
|
||||
RUN mkdir -p -m 700 /root/.ssh
|
||||
|
||||
WORKDIR /root/.ssh
|
||||
RUN touch authorized_keys \
|
||||
@ -113,8 +128,7 @@ RUN tee -a sshd_config <<< 'AllowTcpForwarding yes' \
|
||||
|
||||
USER arch
|
||||
|
||||
# download OSX-KVM
|
||||
# RUN git clone --recurse-submodules --depth 1 https://github.com/kholia/OSX-KVM.git /home/arch/OSX-KVM
|
||||
# download OSX-KVM for the submodules
|
||||
RUN git clone --recurse-submodules --depth 1 https://github.com/kholia/OSX-KVM.git /home/arch/OSX-KVM
|
||||
|
||||
# enable ssh
|
||||
@ -140,31 +154,33 @@ 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 bc qemu libvirt dnsmasq virt-manager bridge-utils openresolv jack2 ebtables edk2-ovmf netctl libvirt-dbus wget --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 scrot --overwrite --noconfirm \
|
||||
&& yes | sudo pacman -Scc
|
||||
|
||||
WORKDIR /home/arch/OSX-KVM
|
||||
|
||||
# RUN wget https://raw.githubusercontent.com/kholia/OSX-KVM/master/fetch-macOS-v2.py
|
||||
# fix invalid signature on old libguestfs
|
||||
ARG SIGLEVEL=Never
|
||||
|
||||
ARG SHORTNAME=catalina
|
||||
|
||||
RUN make \
|
||||
&& qemu-img convert BaseSystem.dmg -O qcow2 -p -c BaseSystem.img \
|
||||
&& rm ./BaseSystem.dmg
|
||||
RUN sudo tee -a /etc/pacman.conf <<< "SigLevel = ${SIGLEVEL}" \
|
||||
&& sudo tee -a /etc/pacman.conf <<< 'RemoteFileSigLevel = Optional' \
|
||||
&& sudo sed -i -e 's/^\#RemoteFileSigLevel/RemoteFileSigLevel/g' /etc/pacman.conf
|
||||
|
||||
ARG LINUX=true
|
||||
|
||||
# required to use libguestfs inside a docker container, to create bootdisks for docker-osx on-the-fly
|
||||
# reminder this is what makes :naked image larger than expected
|
||||
RUN if [[ "${LINUX}" == true ]]; then \
|
||||
sudo pacman -Syu linux libguestfs --noconfirm \
|
||||
sudo pacman -Syu linux linux-headers archlinux-keyring guestfs-tools mkinitcpio pcre pcre2 --noconfirm \
|
||||
&& libguestfs-test-tool \
|
||||
&& rm -rf /var/tmp/.guestfs-* \
|
||||
&& yes | sudo pacman -Scc \
|
||||
; 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 git clone --recurse-submodules --depth 1 --branch "${BRANCH}" "${REPO}"
|
||||
RUN git clone --recurse-submodules --depth 1 --branch "${BRANCH:=master}" "${REPO:=https://github.com/sickcodes/Docker-OSX.git}"
|
||||
|
||||
RUN touch Launch.sh \
|
||||
&& chmod +x ./Launch.sh \
|
||||
@ -179,7 +195,8 @@ RUN touch Launch.sh \
|
||||
&& 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 qemu-xhci,id=xhci \' \
|
||||
&& tee -a Launch.sh <<< '-device usb-kbd,bus=xhci.0 -device usb-tablet,bus=xhci.0 \' \
|
||||
&& 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 \' \
|
||||
@ -211,33 +228,7 @@ RUN grep -v InstallMedia ./Launch.sh > ./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
|
||||
|
||||
# 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 pacman -Syy \
|
||||
&& sudo pacman -Rns linux --noconfirm \
|
||||
; sudo pacman -S mkinitcpio --noconfirm \
|
||||
&& sudo pacman -U "${KERNEL_PACKAGE_URL}" --noconfirm || exit 1 \
|
||||
&& sudo pacman -U "${LIBGUESTFS_PACKAGE_URL}" --noconfirm || exit 1 \
|
||||
&& rm -rf /var/tmp/.guestfs-* \
|
||||
&& yes | sudo pacman -Scc \
|
||||
&& libguestfs-test-tool || exit 1 \
|
||||
&& rm -rf /var/tmp/.guestfs-*
|
||||
|
||||
####
|
||||
ENV USER=arch
|
||||
|
||||
# These are hardcoded serials for non-iMessage related research
|
||||
# Overwritten by using GENERATE_UNIQUE=true
|
||||
@ -362,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 \
|
||||
|
@ -42,7 +42,7 @@
|
||||
|
||||
FROM sickcodes/docker-osx:latest
|
||||
|
||||
MAINTAINER 'https://twitter.com/sickcodes' <https://sick.codes>
|
||||
LABEL maintainer='https://twitter.com/sickcodes <https://sick.codes>'
|
||||
|
||||
USER root
|
||||
|
||||
@ -53,25 +53,41 @@ ARG SCROT
|
||||
|
||||
# OPTIONAL: Arch Linux server mirrors for super fast builds
|
||||
# set RANKMIRRORS to any value other that nothing, e.g. -e RANKMIRRORS=true
|
||||
RUN perl -i -p -e s/^\#Color/Color$'\n'ParallelDownloads\ =\ 30/g /etc/pacman.conf
|
||||
ARG RANKMIRRORS
|
||||
ARG MIRROR_COUNTRY=US
|
||||
ARG MIRROR_COUNT=10
|
||||
|
||||
RUN tee /etc/pacman.d/mirrorlist <<< 'Server = https://geo.mirror.pkgbuild.com/$repo/os/$arch' \
|
||||
&& tee -a /etc/pacman.d/mirrorlist <<< 'Server = http://mirror.rackspace.com/archlinux/$repo/os/$arch' \
|
||||
&& tee -a /etc/pacman.d/mirrorlist <<< 'Server = https://mirror.rackspace.com/archlinux/$repo/os/$arch'
|
||||
|
||||
# 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 archlinux
|
||||
|
||||
RUN if [[ "${RANKMIRRORS}" ]]; then \
|
||||
{ pacman -Sy wget --noconfirm || pacman -Syu wget --noconfirm ; } \
|
||||
; wget -O ./rankmirrors "https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/rankmirrors" \
|
||||
; wget -O ./rankmirrors "https://raw.githubusercontent.com/sickcodes/Docker-OSX/${BRANCH:=master}/rankmirrors" \
|
||||
; wget -O- "https://www.archlinux.org/mirrorlist/?country=${MIRROR_COUNTRY:-US}&protocol=https&use_mirror_status=on" \
|
||||
| sed -e 's/^#Server/Server/' -e '/^#/d' \
|
||||
| head -n "$((${MIRROR_COUNT:-10}+1))" \
|
||||
| bash ./rankmirrors --verbose --max-time 5 - > /etc/pacman.d/mirrorlist \
|
||||
&& tee -a /etc/pacman.d/mirrorlist <<< 'Server = http://mirrors.evowise.com/archlinux/$repo/os/$arch' \
|
||||
&& tee -a /etc/pacman.d/mirrorlist <<< 'Server = http://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 \
|
||||
; yes | pacman -Scc
|
||||
|
||||
RUN pacman -Syu xorg-server-xvfb wget xterm xorg-xhost xorg-xrandr sshpass --noconfirm \
|
||||
|
||||
|
||||
&& cat /etc/pacman.d/mirrorlist \
|
||||
; fi
|
||||
|
||||
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'
|
||||
|
||||
RUN pacman -Syu xorg-server-xvfb wget xterm xorg-xhost xorg-xrandr --noconfirm \
|
||||
&& if [[ "${SCROT}" ]]; then \
|
||||
pacman -Syu scrot base-devel --noconfirm \
|
||||
&& git clone --recurse-submodules --depth 1 https://github.com/stolk/imcat.git \
|
||||
@ -88,38 +104,13 @@ RUN pacman -Syu xorg-server-xvfb wget xterm xorg-xhost xorg-xrandr sshpass --noc
|
||||
; fi \
|
||||
; yes | pacman -Scc
|
||||
|
||||
RUN pacman -S sshpass --noconfirm \
|
||||
&& yes | pacman -Scc
|
||||
|
||||
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
|
||||
RUN sudo sed -i -e 's/^\#RemoteFileSigLevel/RemoteFileSigLevel/g' /etc/pacman.conf
|
||||
|
||||
RUN sudo pacman -Syy \
|
||||
&& sudo pacman -Rns linux --noconfirm \
|
||||
; sudo pacman -S mkinitcpio --noconfirm \
|
||||
&& sudo pacman -U "${KERNEL_PACKAGE_URL}" --noconfirm || exit 1 \
|
||||
&& sudo pacman -U "${LIBGUESTFS_PACKAGE_URL}" --noconfirm || exit 1 \
|
||||
&& rm -rf /var/tmp/.guestfs-* \
|
||||
&& yes | sudo pacman -Scc \
|
||||
&& libguestfs-test-tool || exit 1 \
|
||||
&& rm -rf /var/tmp/.guestfs-*
|
||||
|
||||
####
|
||||
|
||||
|
||||
WORKDIR /home/arch/OSX-KVM
|
||||
|
||||
RUN mkdir -p ~/.ssh \
|
||||
@ -215,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
|
||||
|
||||
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
|
@ -32,7 +32,7 @@
|
||||
|
||||
FROM sickcodes/docker-osx:latest
|
||||
|
||||
MAINTAINER 'https://twitter.com/sickcodes' <https://sick.codes>
|
||||
LABEL maintainer='https://twitter.com/sickcodes <https://sick.codes>'
|
||||
|
||||
USER root
|
||||
|
||||
@ -42,21 +42,37 @@ RUN rm -f /home/arch/OSX-KVM/mac_hdd_ng.img
|
||||
|
||||
# OPTIONAL: Arch Linux server mirrors for super fast builds
|
||||
# set RANKMIRRORS to any value other that nothing, e.g. -e RANKMIRRORS=true
|
||||
RUN perl -i -p -e s/^\#Color/Color$'\n'ParallelDownloads\ =\ 30/g /etc/pacman.conf
|
||||
ARG RANKMIRRORS
|
||||
ARG MIRROR_COUNTRY=US
|
||||
ARG MIRROR_COUNT=10
|
||||
RUN if [[ "${RANKMIRRORS}" ]]; then { pacman -Sy wget --noconfirm || pacman -Syu wget --noconfirm ; } \
|
||||
; wget -O ./rankmirrors "https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/rankmirrors" \
|
||||
|
||||
RUN tee /etc/pacman.d/mirrorlist <<< 'Server = https://geo.mirror.pkgbuild.com/$repo/os/$arch' \
|
||||
&& tee -a /etc/pacman.d/mirrorlist <<< 'Server = http://mirror.rackspace.com/archlinux/$repo/os/$arch' \
|
||||
&& tee -a /etc/pacman.d/mirrorlist <<< 'Server = https://mirror.rackspace.com/archlinux/$repo/os/$arch'
|
||||
|
||||
# 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 archlinux
|
||||
|
||||
RUN if [[ "${RANKMIRRORS}" ]]; then \
|
||||
{ pacman -Sy wget --noconfirm || pacman -Syu wget --noconfirm ; } \
|
||||
; wget -O ./rankmirrors "https://raw.githubusercontent.com/sickcodes/Docker-OSX/${BRANCH:=master}/rankmirrors" \
|
||||
; wget -O- "https://www.archlinux.org/mirrorlist/?country=${MIRROR_COUNTRY:-US}&protocol=https&use_mirror_status=on" \
|
||||
| sed -e 's/^#Server/Server/' -e '/^#/d' \
|
||||
| head -n "$((${MIRROR_COUNT:-10}+1))" \
|
||||
| bash ./rankmirrors --verbose --max-time 5 - > /etc/pacman.d/mirrorlist \
|
||||
&& tee -a /etc/pacman.d/mirrorlist <<< 'Server = http://mirrors.evowise.com/archlinux/$repo/os/$arch' \
|
||||
&& tee -a /etc/pacman.d/mirrorlist <<< 'Server = http://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
|
||||
|
||||
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'
|
||||
|
||||
# For taking screenshots of the Xfvb screen, useful during development.
|
||||
ARG SCROT
|
||||
|
||||
@ -81,28 +97,6 @@ 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
|
||||
|
||||
####
|
||||
|
||||
|
||||
WORKDIR /home/arch/OSX-KVM
|
||||
|
||||
RUN mkdir -p ~/.ssh \
|
||||
@ -172,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 \
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
FROM sickcodes/docker-osx:latest
|
||||
|
||||
MAINTAINER 'https://twitter.com/sickcodes' <https://sick.codes>
|
||||
LABEL maintainer='https://twitter.com/sickcodes <https://sick.codes>'
|
||||
|
||||
USER root
|
||||
|
||||
@ -31,28 +31,41 @@ ARG SCROT
|
||||
|
||||
# OPTIONAL: Arch Linux server mirrors for super fast builds
|
||||
# set RANKMIRRORS to any value other that nothing, e.g. -e RANKMIRRORS=true
|
||||
RUN perl -i -p -e s/^\#Color/Color$'\n'ParallelDownloads\ =\ 30/g /etc/pacman.conf
|
||||
ARG RANKMIRRORS
|
||||
ARG MIRROR_COUNTRY=US
|
||||
ARG MIRROR_COUNT=10
|
||||
|
||||
RUN tee /etc/pacman.d/mirrorlist <<< 'Server = https://geo.mirror.pkgbuild.com/$repo/os/$arch' \
|
||||
&& tee -a /etc/pacman.d/mirrorlist <<< 'Server = http://mirror.rackspace.com/archlinux/$repo/os/$arch' \
|
||||
&& tee -a /etc/pacman.d/mirrorlist <<< 'Server = https://mirror.rackspace.com/archlinux/$repo/os/$arch'
|
||||
|
||||
# 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 archlinux
|
||||
|
||||
RUN if [[ "${RANKMIRRORS}" ]]; then \
|
||||
{ pacman -Sy wget --noconfirm || pacman -Syu wget --noconfirm ; } \
|
||||
; wget -O ./rankmirrors "https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/rankmirrors" \
|
||||
; wget -O ./rankmirrors "https://raw.githubusercontent.com/sickcodes/Docker-OSX/${BRANCH:=master}/rankmirrors" \
|
||||
; wget -O- "https://www.archlinux.org/mirrorlist/?country=${MIRROR_COUNTRY:-US}&protocol=https&use_mirror_status=on" \
|
||||
| sed -e 's/^#Server/Server/' -e '/^#/d' \
|
||||
| head -n "$((${MIRROR_COUNT:-10}+1))" \
|
||||
| bash ./rankmirrors --verbose --max-time 5 - > /etc/pacman.d/mirrorlist \
|
||||
&& tee -a /etc/pacman.d/mirrorlist <<< 'Server = http://mirrors.evowise.com/archlinux/$repo/os/$arch' \
|
||||
&& tee -a /etc/pacman.d/mirrorlist <<< 'Server = http://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 \
|
||||
; yes | pacman -Scc
|
||||
; fi
|
||||
|
||||
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'
|
||||
|
||||
# For taking screenshots of the Xfvb screen, useful during development.
|
||||
ARG SCROT
|
||||
|
||||
RUN pacman -Syu xorg-server-xvfb wget xterm xorg-xhost xorg-xrandr sshpass --noconfirm \
|
||||
RUN pacman -Syu xorg-server-xvfb wget xterm xorg-xhost xorg-xrandr --noconfirm \
|
||||
&& if [[ "${SCROT}" ]]; then \
|
||||
pacman -Syu scrot base-devel --noconfirm \
|
||||
&& git clone --recurse-submodules --depth 1 https://github.com/stolk/imcat.git \
|
||||
@ -69,37 +82,13 @@ RUN pacman -Syu xorg-server-xvfb wget xterm xorg-xhost xorg-xrandr sshpass --noc
|
||||
; fi \
|
||||
; yes | pacman -Scc
|
||||
|
||||
RUN pacman -S sshpass --noconfirm \
|
||||
&& yes | pacman -Scc
|
||||
|
||||
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
|
||||
RUN sudo sed -i -e 's/^\#RemoteFileSigLevel/RemoteFileSigLevel/g' /etc/pacman.conf
|
||||
|
||||
RUN sudo pacman -Syy \
|
||||
&& sudo pacman -Rns linux --noconfirm \
|
||||
; sudo pacman -S mkinitcpio --noconfirm \
|
||||
&& sudo pacman -U "${KERNEL_PACKAGE_URL}" --noconfirm || exit 1 \
|
||||
&& sudo pacman -U "${LIBGUESTFS_PACKAGE_URL}" --noconfirm || exit 1 \
|
||||
&& rm -rf /var/tmp/.guestfs-* \
|
||||
&& yes | sudo pacman -Scc \
|
||||
&& libguestfs-test-tool || exit 1 \
|
||||
&& rm -rf /var/tmp/.guestfs-*
|
||||
|
||||
####
|
||||
|
||||
|
||||
WORKDIR /home/arch/OSX-KVM
|
||||
|
||||
RUN mkdir -p ~/.ssh \
|
||||
@ -194,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 \
|
||||
|
178
FAQ.md
Normal file
178
FAQ.md
Normal file
@ -0,0 +1,178 @@
|
||||
# Frequently Asked Questions
|
||||
|
||||
These questions come up regularly, so here are the answers.
|
||||
|
||||
## Basics
|
||||
|
||||
### Is this legal?
|
||||
|
||||
The [macOS software license](https://www.apple.com/legal/sla/) allows running (some versions of) macOS in a virtual machine only on Apple hardware. The [Apple Security Bounty terms and conditions](https://security.apple.com/terms-and-conditions/) make an exception to that (and essentially anything in the macOS software license) under some specific circumstances.
|
||||
|
||||
Therefore, yes, there is a legal use for Docker-OSX. If your use doesn't fall under the license or the security bounty terms, then you are/will be violating the macOS software license. **Note that this is not provided as legal advice, and you should consult with your own counsel for legal guidance.**
|
||||
|
||||
You may also be interested in this [deeper dive into the subject](https://sick.codes/is-hackintosh-osx-kvm-or-docker-osx-legal/).
|
||||
|
||||
### What does Docker-OSX do?
|
||||
|
||||
Docker-OSX is an approach to setting up and launching a macOS virtual machine (VM) under [docker](https://en.wikipedia.org/wiki/Docker_(software)). The [Dockerfile](Dockerfile) is essentially a docker image building script that:
|
||||
1. validates a few things about the environment
|
||||
2. installs VM software (qemu) and creates a virtual disk within the docker container
|
||||
3. generates a serial number and firmware to make the VM look (enough) like Mac hardware
|
||||
4. downloads a macOS installer disk image
|
||||
5. generates a shell script to start the VM
|
||||
|
||||
The default configuration is intended to create an ephemeral but repeatably bootable macOS that can be probed for security research.
|
||||
|
||||
### Why docker?
|
||||
|
||||
Docker provides a straightforward way to package a flexible turnkey solution to setting up a macOS VM. It is not the only way to do so, nor is it necessarily the best approach to setting up a long-lived, persistent macOS VM. You may prefer to study the [Dockerfile](Dockerfile) and/or [OSX-KVM](https://github.com/kholia/OSX-KVM) to prepare a VM to run under [proxmox](https://en.wikipedia.org/wiki/Proxmox_Virtual_Environment) or [libvirt](https://en.wikipedia.org/wiki/Libvirt).
|
||||
|
||||
## Can I...
|
||||
|
||||
### ...run BlueBubbles/AirMessage/Beeper on it?
|
||||
|
||||
Yes. Make sure you [make serial numbers persist across reboots](README.md#making-serial-numbers-persist-across-reboots) after generating a unique serial number for yourself; don't use the default serial number. There is, of course, no guarantee that Apple won't block/disable your account, or inflict other consequences. See also the [legal considerations](#is-this-legal).
|
||||
|
||||
### ...develop iPhone apps on it?
|
||||
|
||||
Yes. You will probably find Xcode's UI frustratingly slow, but yes. Compiling apps (e.g. React Native) from the command line is likely to be less frustrating. There is, of course, no guarantee that Apple won't block/disable your account, remove you from the Apple Developer program, or inflict other consequences. See also the [legal considerations](#is-this-legal).
|
||||
|
||||
### ...connect my iPhone or other USB device to it?
|
||||
|
||||
Yes, at least if your host OS is Linux. See [instructions](README.md#vfio-iphone-usb-passthrough-vfio). It may or may not be possible if your host OS is Windows.
|
||||
|
||||
### ...run CI/CD processes with it?
|
||||
|
||||
Maybe, but there are several reasons not to:
|
||||
1. There are [legal considerations](#is-this-legal).
|
||||
2. Nested virtualization is generally unavailable on cloud-hosted CI/CD and therefore Docker-OSX doesn't run.
|
||||
3. You are almost always better off using your own macOS runners (on virtual or actual Mac hardware) rather than trying to make the square peg of Docker-OSX fit the round hole of macOS-specific CI/CD.
|
||||
|
||||
You absolutely can install runners on the macOS VM itself (which does not get around the legal considerations mentioned above), but [Docker-OSX may not be the best approach](#why-docker).
|
||||
|
||||
### ...run on Linux but with Wayland?
|
||||
|
||||
Yes, but your Wayland server must support X11 connections (or you can [use VNC instead](README.md#building-a-headless-container-that-allows-insecure-vnc-on-localhost-for-local-use-only)).
|
||||
|
||||
### ...run on Windows?
|
||||
|
||||
Yes, as long as you have a new enough version of Windows 11 and have WSL2 set up. See [this section of the README](README.md#id-like-to-run-docker-osx-on-windows) for details. No, it will not work under Windows 10. Not even if you have WSL2 set up.
|
||||
|
||||
### ...run on macOS?
|
||||
|
||||
If you have a Mac with Apple Silicon you are better served by [UTM](https://apps.apple.com/us/app/utm-virtual-machines/id1538878817?mt=12).
|
||||
|
||||
If you have an Intel Mac you can install and run docker (either [Docker Desktop](https://www.docker.com/products/docker-desktop/) or [colima](https://github.com/abiosoft/colima)). In either case, docker will be running under a Linux VM, which complicates things. You are likely to encounter one or more of the [common errors](#common-errors) below. Consider using qemu directly with HVF acceleration (e.g. with [libvirt](https://libvirt.org/macos.html)) instead.
|
||||
|
||||
### ...run on cloud services?
|
||||
|
||||
Cloud providers typically run their various services within virtual machines running on top of their actual hardware. These VMs typically are not set up to provide nested virtualization, which means KVM is unavailable so Docker-OSX will not work. This is _especially and specifically_ the case on CI/CD runners such as GitHub Actions, Azure DevOps Pipelines, CircleCI, GitLab CI/CD, etc. (however, see [running CI/CD](#run-cicd-processes-with-it)). Some cloud providers offer services that do allow virtualization, such as [Amazon's EC2 Bare Metal Instances](https://aws.amazon.com/about-aws/whats-new/2018/05/announcing-general-availability-of-amazon-ec2-bare-metal-instances/), but often at a significant premium.
|
||||
|
||||
In short, probably not.
|
||||
|
||||
## Common Errors
|
||||
|
||||
### Docker Errors
|
||||
|
||||
If you get an error like `docker: command not found` then you don't have docker installed and none of this works. Try [Docker Desktop](https://www.docker.com/products/docker-desktop/) on Windows or your distribution's normal package manager on Linux.
|
||||
|
||||
If you get an error like `docker: Got permission denied while trying to connect to the Docker daemon` or `docker: unknown server OS: .` the mostly likely explanation is that your user isn't in the `docker` Unix group. You'll need to add yourself to the `docker` group, log out, and log back in.
|
||||
|
||||
If you get an error like `Cannot connect to the Docker daemon at unix://var/run/docker.sock. Is the docker daemon running?` then `dockerd` isn't running. On most Linux distributions you should be able to start it with `sudo systemctl enable docker --now`.
|
||||
|
||||
### GTK Initialization Failed
|
||||
|
||||
This is an X11 error and means that the arguments to qemu are telling it to connect to an X11 display that it either can't connect to at all or doesn't have permission to connect to. In the latter case, this can usually be fixed by running `xhost +` on the host running the X11 server.
|
||||
|
||||
In many cases, however, it is preferable to tell qemu to listen for a VNC connection instead of trying to connect to X11; see [this section of the README](README.md#building-a-headless-container-that-allows-insecure-vnc-on-localhost-for-local-use-only) for instructions.
|
||||
|
||||
### KVM Error
|
||||
|
||||
If you get an error like `error gathering device information while adding custom device "/dev/kvm": no such file or directory` that means KVM is not available/working on the Linux kernel on which you are running docker. This could be because you are attempting to run somewhere that doesn't support nested virtualization (see [above](#can-i-run-this-on)), or because your BIOS does not have virtualization extensions turned on, or because your CPU is too old to support virtualization extensions, or your Linux kernel does not have KVM support loaded/enabled. Fixing KVM issues is well beyond the scope of this document, but you can [start here](https://www.linux-kvm.org/page/FAQ).
|
||||
|
||||
### ALSA Error
|
||||
|
||||
You might get an error like this:
|
||||
```
|
||||
(qemu) ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
|
||||
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
|
||||
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
|
||||
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
|
||||
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
|
||||
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
|
||||
ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory
|
||||
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM default
|
||||
alsa: Could not initialize DAC
|
||||
alsa: Failed to open `default':
|
||||
alsa: Reason: No such file or directory
|
||||
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
|
||||
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
|
||||
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
|
||||
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
|
||||
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
|
||||
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
|
||||
ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory
|
||||
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM default
|
||||
alsa: Could not initialize DAC
|
||||
alsa: Failed to open `default':
|
||||
alsa: Reason: No such file or directory
|
||||
audio: Failed to create voice `dac'
|
||||
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
|
||||
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
|
||||
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
|
||||
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
|
||||
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
|
||||
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
|
||||
ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory
|
||||
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM default
|
||||
alsa: Could not initialize ADC
|
||||
alsa: Failed to open `default':
|
||||
alsa: Reason: No such file or directory
|
||||
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
|
||||
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
|
||||
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
|
||||
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
|
||||
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
|
||||
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
|
||||
ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory
|
||||
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM default
|
||||
alsa: Could not initialize ADC
|
||||
alsa: Failed to open `default':
|
||||
alsa: Reason: No such file or directory
|
||||
audio: Failed to create voice `adc'
|
||||
```
|
||||
|
||||
Docker-OSX defaults to telling qemu to use ALSA for audio output. Your host system may be using PulseAudio instead (see [PulseAudio](README.md#pulseaudio)), but you may not need audio output at all. You can pass `-e AUDIO_DRIVER="id=none,driver=none"` to disable audio output.
|
||||
|
||||
### No Disk to Install On
|
||||
|
||||
If you have launched the installer but don't see a disk to install macOS on, it probably means you skipped the step where you run Disk Utility to format the virtual disk. See the [README](README.md#additional-boot-instructions-for-when-you-are-creating-your-container).
|
||||
|
||||
### Slow Installation
|
||||
|
||||
This is not unique to virtual hardware. The macOS installation process gives apparently random and dependably incorrect time estimates, and can often appear to have completely frozen. Just be patient. It could take hours, maybe even more than a day.
|
||||
|
||||
### Installer After Completing Install
|
||||
|
||||
If you wind up in the installer again after you've installed macOS it means you booted from the installer disk instead of the disk you installed macOS on. Reboot and make sure you choose the correct disk to boot.
|
||||
|
||||
## Next Steps
|
||||
|
||||
Congratulations, you got a macOS VM up and running! Now what?
|
||||
|
||||
### 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.
|
||||
|
||||
### Extract the Virtual Disk
|
||||
|
||||
With the container stopped, `sudo find /var/lib/docker -size +10G -name mac_hdd_ng.img` to find the disk image then copy it where you want it.
|
||||
|
||||
### Disk Space
|
||||
|
||||
Is your host machine's disk, specifically `/var` (because of `/var/lib/docker`), getting full? [Fix it](README.md#increase-disk-space-by-moving-varlibdocker-to-external-drive-block-storage-nfs-or-any-other-location-conceivable).
|
||||
|
||||
### Increase RAM or CPUs/cores
|
||||
|
||||
The `RAM`, `SMP`, and `CORES` options are all docker environment variables, which means it uses whatever you provide any time you start a container.
|
||||
|
191
README.md
191
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,68 @@ 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 .
|
||||
```
|
||||
|
||||
#### Run Catalina Pre-Installed [](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
|
||||
|
||||
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' \
|
||||
-e SHORTNAME=ventura \
|
||||
sickcodes/docker-osx:latest
|
||||
|
||||
# docker build -t docker-osx .
|
||||
```
|
||||
|
||||
### Sonoma (14) [](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=sonoma \
|
||||
sickcodes/docker-osx:latest
|
||||
|
||||
# docker build -t docker-osx .
|
||||
```
|
||||
|
||||
### 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.
|
||||
@ -111,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
|
||||
|
||||
@ -125,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
|
||||
|
||||
@ -139,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 .
|
||||
```
|
||||
|
||||
|
||||
@ -164,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)
|
||||
|
||||
@ -178,26 +241,41 @@ 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:
|
||||
|
||||
```bash
|
||||
wget https://images2.sick.codes/mac_hdd_ng_auto.img
|
||||
# Catalina
|
||||
# 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 \
|
||||
--device /dev/kvm \
|
||||
-p 50922:10022 \
|
||||
-v "${PWD}/mac_hdd_ng_auto.img:/image" \
|
||||
-v "${PWD}/mac_hdd_ng_auto_monterey.img:/image" \
|
||||
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
||||
-e "DISPLAY=${DISPLAY:-:0.0}" \
|
||||
-e "USERNAME=user" \
|
||||
-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
|
||||
# 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)
|
||||
|
||||
If you have a laptop see the next usbfluxd section.
|
||||
|
||||
If you have a desktop PC, you can use [@Silfalion](https://github.com/Silfalion)'s instructions : [https://github.com/Silfalion/Iphone_docker_osx_passthrough](https://github.com/Silfalion/Iphone_docker_osx_passthrough)
|
||||
If you have a desktop PC, you can use [@Silfalion](https://github.com/Silfalion)'s instructions: [https://github.com/Silfalion/Iphone_docker_osx_passthrough](https://github.com/Silfalion/Iphone_docker_osx_passthrough)
|
||||
|
||||
# (USBFLUXD) iPhone USB -> Network style passthrough OSX-KVM Docker-OSX
|
||||
|
||||
@ -342,18 +420,22 @@ Pick one of these while **building**, irrelevant when using docker pull:
|
||||
--build-arg SHORTNAME=catalina
|
||||
--build-arg SHORTNAME=big-sur
|
||||
--build-arg SHORTNAME=monterey
|
||||
--build-arg SHORTNAME=ventura
|
||||
--build-arg SHORTNAME=sonoma
|
||||
```
|
||||
|
||||
|
||||
## Technical details
|
||||
|
||||
There currently multiple images, each with different use cases (explained [below](#container-images)):
|
||||
There are currently multiple images, each with different use cases (explained [below](#container-images)):
|
||||
|
||||
- High Sierra
|
||||
- Mojave
|
||||
- Catalina
|
||||
- Big Sur
|
||||
- Monterey
|
||||
- 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)
|
||||
@ -378,6 +460,14 @@ Monterey make your own image:
|
||||
|
||||
[](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||
|
||||
Ventura make your own image:
|
||||
|
||||
[](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||
|
||||
Sonoma make your own image:
|
||||
|
||||
[](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||
|
||||
Pre-made **Catalina** system by [Sick.Codes](https://sick.codes): username: `user`, password: `alpine`
|
||||
|
||||
[](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||
@ -458,7 +548,7 @@ In case you're interested, contact [@sickcodes on Twitter](https://twitter.com/s
|
||||
|
||||
## License/Contributing
|
||||
|
||||
Docker-OSX is licensed under the [GPL v3+](LICENSE). Contributions are welcomed and immensely appreciated. You are in-fact permitted to use Docker-OSX as a tool to create proprietary software.
|
||||
Docker-OSX is licensed under the [GPL v3+](LICENSE). Contributions are welcomed and immensely appreciated. You are in fact permitted to use Docker-OSX as a tool to create proprietary software.
|
||||
|
||||
### Other cool Docker/QEMU based projects
|
||||
- [Run Android in a Docker Container with Dock Droid](https://github.com/sickcodes/dock-droid)
|
||||
@ -478,7 +568,7 @@ Product names, logos, brands and other trademarks referred to within this projec
|
||||
|
||||
### Already set up or just looking to make a container quickly? Check out our [quick start](#quick-start-docker-osx) or see a bunch more use cases under our [container creation examples](#container-creation-examples) section.
|
||||
|
||||
There are several different Docker-OSX images available which are suitable for different purposes.
|
||||
There are several different Docker-OSX images available that are suitable for different purposes.
|
||||
|
||||
- `sickcodes/docker-osx:latest` - [I just want to try it out.](#quick-start-docker-osx)
|
||||
- `sickcodes/docker-osx:latest` - [I want to use Docker-OSX to develop/secure apps in Xcode (sign into Xcode, Transporter)](#quick-start-your-own-image-naked-container-image)
|
||||
@ -490,6 +580,8 @@ 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: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:ventura` - [I want to run Ventura.](#quick-start-docker-osx)
|
||||
- `sickcodes/docker-osx:sonoma` - [I want to run Sonoma.](#quick-start-docker-osx)
|
||||
|
||||
- `sickcodes/docker-osx:high-sierra` - I want to run High Sierra.
|
||||
- `sickcodes/docker-osx:mojave` - I want to run Mojave.
|
||||
@ -538,7 +630,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).
|
||||
|
||||
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.
|
||||
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.
|
||||
The result should be like this:
|
||||
```
|
||||
[wsl2]
|
||||
@ -552,6 +644,8 @@ INFO: /dev/kvm exists
|
||||
KVM acceleration can be used
|
||||
```
|
||||
|
||||
Use the command `sudo apt -y install bridge-utils cpu-checker libvirt-clients libvirt-daemon qemu qemu-kvm` to install it if it isn't.
|
||||
|
||||
Now download and install [Docker for Windows](https://docs.docker.com/desktop/windows/install/) if it is not already installed.
|
||||
|
||||
After installation, go into Settings and check these 2 boxes:
|
||||
@ -569,13 +663,21 @@ 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.
|
||||
|
||||
```bash
|
||||
```
|
||||
-e "DISPLAY=${DISPLAY:-:0.0}" \
|
||||
-v /mnt/wslg/.X11-unix:/tmp/.X11-unix \
|
||||
```
|
||||
Or try:
|
||||
|
||||
```
|
||||
-e "DISPLAY=${DISPLAY:-:0}" \
|
||||
-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)
|
||||
- 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 experience 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/)
|
||||
|
||||
## Additional boot instructions for when you are [creating your container](#container-creation-examples)
|
||||
|
||||
@ -634,15 +736,17 @@ Or
|
||||
|
||||
#### Use more CPU Cores/SMP
|
||||
|
||||
This will use all available cores; adjust accordingly to the day of the week:
|
||||
Examples:
|
||||
|
||||
```
|
||||
-e CPU_STRING=$(nproc) \
|
||||
```
|
||||
`-e EXTRA='-smp 6,sockets=3,cores=2'`
|
||||
|
||||
This will use `-smp $(nproc)`
|
||||
`-e EXTRA='-smp 8,sockets=4,cores=2'`
|
||||
|
||||
### Confirm your user is part of the the Docker group, KVM group, libvirt group
|
||||
`-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 Docker group, KVM group, libvirt group
|
||||
|
||||
#### Add yourself to the Docker group
|
||||
|
||||
@ -994,7 +1098,7 @@ IP_ADDRESS=172.17.0.1
|
||||
|
||||
### Fedora: enable internet connectivity with a bridged network
|
||||
|
||||
Fedora's default firewall settings may prevent Docker's network interface from reaching the internet. In order to reoslve this, you will need to whitelist the interface in your firewall:
|
||||
Fedora's default firewall settings may prevent Docker's network interface from reaching the internet. In order to resolve this, you will need to whitelist the interface in your firewall:
|
||||
|
||||
```bash
|
||||
# Set the docker0 bridge to the trusted zone
|
||||
@ -1356,7 +1460,7 @@ docker run -it \
|
||||
sickcodes/docker-osx:latest
|
||||
```
|
||||
|
||||
Here's a few other resolutions! If you resolution is invalid, it will default to 800x600.
|
||||
Here's a few other resolutions! If your resolution is invalid, it will default to 800x600.
|
||||
|
||||
```
|
||||
-e WIDTH=800 \
|
||||
@ -1534,7 +1638,7 @@ Important Note: this will cause the host system to lose access to the USB device
|
||||
|
||||
This is my favourite container. You can supply an existing disk image as a Docker command line argument.
|
||||
|
||||
- Pull images out using `sudo find /var/lib/docker -size +10G | grep mac_hdd_ng.img`
|
||||
- Pull images out using `sudo find /var/lib/docker -name mac_hdd_ng.img -size +10G`
|
||||
|
||||
- Supply your own local image with the command argument `-v "${PWD}/mac_hdd_ng.img:/image"` and use `sickcodes/docker-osx:naked` when instructing Docker to create your container.
|
||||
|
||||
@ -1645,7 +1749,7 @@ docker run -it \
|
||||
sickcodes/docker-osx:naked
|
||||
```
|
||||
|
||||
### Building a headless container which allows insecure VNC on localhost (!for local use only!)
|
||||
### Building a headless container that allows insecure VNC on localhost (!for local use only!)
|
||||
|
||||
**Must change -it to -i to be able to interact with the QEMU console**
|
||||
|
||||
@ -1690,7 +1794,7 @@ You also need the container IP: `docker inspect <containerid> | jq -r '.[0].Netw
|
||||
|
||||
Or `ip n` will usually show the container IP first.
|
||||
|
||||
Now VNC connect using the Docker container IP, for example `172.17.0.2:5999`
|
||||
Now VNC connects using the Docker container IP, for example `172.17.0.2:5999`
|
||||
|
||||
Remote VNC over SSH: `ssh -N root@1.1.1.1 -L 5999:172.17.0.2:5999`, where `1.1.1.1` is your remote server IP and `172.17.0.2` is your LAN container IP.
|
||||
|
||||
@ -1742,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.
|
||||
```
|
||||
|
||||
@ -1850,4 +1954,3 @@ 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.
|
||||
|
||||
See also: [here](https://github.com/sickcodes/Docker-OSX/issues/174).
|
||||
|
||||
|
Submodule osx-serial-generator updated: a9e2b126db...908b3d687a
@ -16,6 +16,8 @@
|
||||
# scrot -o catalina_master.png
|
||||
# scrot -o big-sur_master.png
|
||||
# scrot -o monterey_master.png
|
||||
# scrot -o ventura_master.png
|
||||
# scrot --overwrite --display :99 --file ~/${TEST}.png
|
||||
# pull off remote server to the tests folder
|
||||
# REMOTE_SERVER=
|
||||
# scp root@"${REMOTE_SERVER}":~/*_master.png .
|
||||
@ -28,6 +30,8 @@ TESTS=(
|
||||
catalina
|
||||
big-sur
|
||||
monterey
|
||||
ventura
|
||||
sonoma
|
||||
)
|
||||
|
||||
# test each docker image to see if they boot to their unique respective installation screens.
|
||||
|
BIN
tests/sonoma_master.png
Normal file
BIN
tests/sonoma_master.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 132 KiB |
@ -119,6 +119,12 @@ MIRROR_COUNTRY="${MIRROR_COUNTRY:=US}"
|
||||
NO_CACHE="${NO_CACHE:=--no-cache}"
|
||||
|
||||
|
||||
TEST_BUILDS=(
|
||||
'docker-osx:naked'
|
||||
'docker-osx:naked-auto'
|
||||
'docker-osx:auto'
|
||||
)
|
||||
|
||||
TEST_BUILDS=(
|
||||
'docker-osx:naked'
|
||||
'docker-osx:naked-auto'
|
||||
@ -131,13 +137,30 @@ VERSION_BUILDS=(
|
||||
'catalina'
|
||||
'big-sur'
|
||||
'monterey'
|
||||
'ventura'
|
||||
'sonoma'
|
||||
)
|
||||
|
||||
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 () {
|
||||
apt remove docker docker-engine docker.io containerd runc -y \
|
||||
; apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common -y \
|
||||
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
|
||||
&& apt-key fingerprint 0EBFCD88 \
|
||||
&& > /etc/apt/sources.list.d/docker.list \
|
||||
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \
|
||||
&& apt update -y \
|
||||
&& apt install docker-ce docker-ce-cli containerd.io -y \
|
||||
@ -270,6 +293,7 @@ EOF
|
||||
systemctl enable --now docker
|
||||
}
|
||||
|
||||
warning
|
||||
tee -a ~/.bashrc <<EOF
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
export TZ=UTC
|
||||
@ -285,13 +309,15 @@ yes | apt install -y --no-install-recommends tzdata -y
|
||||
install_scrotcat
|
||||
yes | install_vnc
|
||||
export_display_99
|
||||
apt install xvfb -y
|
||||
start_xvfb
|
||||
# start_vnc
|
||||
enable_kvm
|
||||
reset_docker_hard
|
||||
echo killall Xvfb
|
||||
# echo killall Xvfb
|
||||
clone_repo "${BRANCH}" "${REPO}"
|
||||
cd ./Docker-OSX
|
||||
git pull
|
||||
|
||||
for SHORTNAME in "${VERSION_BUILDS[@]}"; do
|
||||
docker-osx:version "${SHORTNAME}"
|
||||
@ -312,6 +338,10 @@ if [[ "${DOCKER_USERNAME}" ]] && [[ "${DOCKER_PASSWORD}" ]]; then
|
||||
docker push "sickcodes/docker-osx:${SHORTNAME}"
|
||||
done \
|
||||
&& touch PUSHED
|
||||
docker push sickcodes/docker-osx:naked
|
||||
docker push sickcodes/docker-osx:auto
|
||||
docker push sickcodes/docker-osx:naked-auto
|
||||
|
||||
fi
|
||||
|
||||
# connect remotely to your server to use VNC
|
||||
|
BIN
tests/ventura_master.png
Normal file
BIN
tests/ventura_master.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 194 KiB |
@ -93,10 +93,13 @@ 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' \
|
||||
&& cat /etc/pacman.d/mirrorlist ; 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
|
||||
|
||||
USER arch
|
||||
|
||||
RUN sudo pacman -Syyuu --noconfirm \
|
||||
&& sudo pacman -S tigervnc xterm xorg-xhost xdotool ufw --noconfirm \
|
||||
RUN yes | sudo pacman -Syyuu --noconfirm \
|
||||
&& yes | sudo pacman -S tigervnc xterm xorg-xhost xdotool ufw --noconfirm \
|
||||
&& mkdir -p ${HOME}/.vnc \
|
||||
&& touch ~/.vnc/config \
|
||||
&& tee -a ~/.vnc/config <<< 'geometry=1920x1080' \
|
||||
@ -122,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
|
||||
|
@ -57,12 +57,6 @@ 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' \
|
||||
&& 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.
|
||||
ARG SCROT
|
||||
|
||||
@ -83,12 +77,6 @@ RUN pacman -Syu xorg-server-xvfb wget xterm xorg-xhost xorg-xrandr sshpass --noc
|
||||
; fi \
|
||||
; 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
|
||||
|
||||
WORKDIR /home/arch/OSX-KVM
|
||||
@ -192,21 +180,14 @@ CMD sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/
|
||||
|
||||
WORKDIR /home/arch/OSX-KVM
|
||||
|
||||
RUN sudo pacman -Syyuu --noconfirm \
|
||||
&& sudo pacman -S tigervnc xterm xorg-xhost xdotool ufw --noconfirm \
|
||||
RUN yes | sudo pacman -Syyuu --noconfirm \
|
||||
&& yes | sudo pacman -S tigervnc xterm xorg-xhost xdotool ufw --noconfirm \
|
||||
&& mkdir -p ${HOME}/.vnc \
|
||||
&& touch ~/.vnc/config \
|
||||
&& tee -a ~/.vnc/config <<< 'geometry=1920x1080' \
|
||||
&& tee -a ~/.vnc/config <<< 'localhost' \
|
||||
&& 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' \
|
||||
'sudo rm -f /tmp/.X99-lock' \
|
||||
'export DISPLAY=:99' \
|
||||
@ -222,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