53 Commits

Author SHA1 Message Date
37aad0460d Add sonoma to README with special flags 2024-04-08 13:12:35 +00:00
54c96557c0 Add tests/sonoma_master.png 2024-04-08 10:37:47 +00:00
e17ee6c90a Update submodule 2024-04-01 07:55:14 +00:00
a208578bf0 Merge @kholia/OSX-KVM Set XHCI controller to qemu-xhci for USB keyboard/ mouse on macOS 14.4 #238 2024-03-27 13:07:30 +00:00
d09fa38b47 Update submodule 2023-11-16 18:05:26 +00:00
b09155a612 Add another version specific field 2023-11-16 15:32:50 +00:00
669bea269d Add sonoma to README and build script. Plist changes shall be made via 422bb3b713 and then update submodule sickcodes/osx-serial-generator 2023-11-16 14:28:51 +00:00
846cf8fdaf Merge pull request #661 from lucasrueda/master
Tiny change on Readme: Recommend to Find by name instead of using grep on results
2023-06-13 11:04:26 +00:00
bc0be6b6c7 Find by name instead of using grep on results 2023-05-22 17:04:39 -03:00
bb1e992916 Merge pull request #616 from raeldev/add-kvm-install-to-readme
Add kvm and dependencies install to readme
2023-01-23 18:11:32 +00:00
51f1c1ce14 Merge pull request #613 from Ygnys/fix-typos
fixing typos in Readme
2023-01-23 18:09:40 +00:00
ac3fe529a8 fix wrong parameter 2023-01-21 02:06:20 +00:00
0daf0ff5d4 add kvm and dependencies install to readme 2023-01-21 01:54:20 +00:00
8f555f085d fixing typos in Readme
Found a few minor typos in Readme
2023-01-16 08:59:16 -10:00
924fa68088 Update submodule 2022-11-19 10:37:21 +00:00
237a286e44 Add ventura test, add other images to automated push 2022-11-19 10:19:05 +00:00
de142e8e49 Remove libguestfs patch from auto 2022-11-19 04:02:57 +00:00
fc8f78ff0f Fix Dockerfile.auto inline with others 2022-11-19 04:02:17 +00:00
6dc83cebc2 Remove libguestfs old fixes from auto and naked 2022-11-19 04:00:20 +00:00
9b10a306db Add Xvfb to tests for screenshotting test auto 2022-11-19 03:59:33 +00:00
fbe5dba618 Fix busted docker.list 2022-11-19 03:53:32 +00:00
2265bb5a3f Signature errors 2022-11-18 15:58:05 +00:00
86452e6da3 Clean Dockerfile 2022-11-18 04:35:02 +00:00
e612ca3229 Warning still exit 1's 2022-11-16 14:46:51 +00:00
dab7fc884c Add Worldwide mirrors 2022-11-16 14:44:37 +00:00
c0ea46aab5 archlinux image keyring issue 2022-11-16 14:41:37 +00:00
bb75dc4669 git pull when doubling builds on one server 2022-11-16 14:26:58 +00:00
9aac2dbe7f Fix keyring pacman-key --populate archlinux 2022-11-16 14:25:24 +00:00
cedfbf521c Update submodules 2022-11-16 14:00:58 +00:00
671c46046a Merge pull request #566 from sickcodes/ventura
Add latest OS, Ventura
2022-11-16 13:05:35 +00:00
e5ca81ee6e Add mkdir -p, add ventura elsewhere 2022-11-15 19:17:58 +00:00
ed5e50da7c Add ventura to Docker-OSX README 2022-11-14 19:03:18 +00:00
306961a107 Add ventura to Docker-OSX 2022-11-14 19:00:37 +00:00
917e091798 Merge pull request #545 from Sondro/master
README: 'mac_hdd_ng_auto_monterey' to 'mac_hdd_ng_auto_monterey.img'
2022-11-14 17:16:30 +00:00
1e00c9cfd7 Fix keyserver issues, cherry pick aaronjamt/patch-1 2022-11-10 00:11:18 +00:00
f794cac0e2 Merge pull request #532 from arifulislamat/patch-1 2022-11-09 16:03:43 -08:00
e0d753030b Merge pull request #551 from aaronjamt/patch-1 2022-11-09 16:02:46 -08:00
586e093ba6 Fix qemu build 2022-11-09 22:45:19 +00:00
160489b0e3 Add ventura 2022-11-09 22:39:21 +00:00
a43fc57188 Fix issue with invalid GPG keys in VNC version
Without this, `pacman` gives the following errors when trying to update packages as part of the installation:
* The first error is `error: pambase: key "991F6E3F0765CF6295888586139B09DA5BF0D338" is unknown`
* This is followed by a bunch of errors similar to (but with different filenames): `:: File /var/cache/pacman/pkg/pambase-20221020-1-any.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)). Do you want to delete it? [Y/n]`
* These are followed by `error: libvpx: key "95220BE99CE6FF778AE0DC670F65C7D881506130" is unknown`
* Finally, it ends with `error: failed to commit transaction (invalid or corrupted package)` and `Errors occurred, no packages were upgraded.` before exiting with code `1`.
This `RUN` command will update the `archlinux-keyring` package to get the latest keys, then remove and regenerate all gnupg keys inside the container. This allows `pacman` to accept the GPG keys and resolves the above error.
2022-10-21 22:23:45 -07:00
ab54b75ab8 README: 'mac_hdd_ng_auto_monterey' to 'mac_hdd_ng_auto_monterey.img' 2022-10-02 20:22:13 -07:00
49b86bec9a Merge pull request #538 from TartanLeGrand/master
sshpass install and label
2022-09-12 13:52:26 +00:00
40a7e0d200 fix: sshpass install and label 2022-09-01 08:38:59 +02:00
e6763761c0 Typing mistake correction
it's should be "experience" not "experiencem"
2022-08-20 22:30:44 +06:00
1fa728b08d Fixes #510 missing keyservers 2022-07-04 12:53:22 +00:00
d7f0c289fc Fixes #485 2022-05-14 16:14:58 +00:00
1103007c8d Merge pull request #495 from jonathanweinberg/patch-1
Additional information about .wslconfig
2022-05-14 16:08:11 +00:00
41b07267b2 Share files, shared folder, mount folder
# 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
```
2022-05-14 16:07:27 +00:00
fa0e336c7d Additional information about .wslconfig
From official MS documentation around `.wslconfig`. Link also has some interesting reading about the `8 second rule` regarding changes not really being made to configs until about 8 seconds after *all* the instance of a distro are shut down. Might be good for some troubleshooting issues with wsl configs not "sticking".
2022-05-09 17:46:21 -04:00
55293cbb6c Fixes #495 2022-04-21 11:10:03 +00:00
f9bfddbb5b Recognize. Add new legends to credits.
[@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
2022-04-17 04:34:14 +00:00
4501c6a854 Fix #440
> According to [this](https://github.com/foxlet/macOS-Simple-KVM/issues/319#issuecomment-1003775896), macOS only supports power-of-two cores. But you can increase the number of sockets to get the virtual cores you need.
> 
> If you need 6 cores, go with:
> 
> ```
> -e EXTRA='-smp 6,sockets=3,cores=2'
> ```
2022-04-14 22:49:35 +00:00
524749cbb8 Merge pull request #472 from sickcodes/naked-vnc-legacy-patch
Fixes #470  TEMP-FIX is breaking Dockerfile.nakedvnc build #470
2022-04-07 20:53:57 +00:00
14 changed files with 231 additions and 170 deletions

View File

@ -120,4 +120,12 @@ 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
@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

View File

@ -24,6 +24,7 @@
# #
# docker build -t docker-osx . # 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 --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: # 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 # change disk size here or add during build, e.g. --build-arg VERSION=10.14.5 --build-arg SIZE=50G
ARG SIZE=200G ARG SIZE=200G
ARG PARALLEL_DOWNLOADS=30
# 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
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 RANKMIRRORS
ARG MIRROR_COUNTRY=US ARG MIRROR_COUNTRY=US
ARG MIRROR_COUNT=10 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 \ RUN if [[ "${RANKMIRRORS}" ]]; then \
{ pacman -Sy wget --noconfirm || pacman -Syu wget --noconfirm ; } \ { 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" \ ; wget -O- "https://www.archlinux.org/mirrorlist/?country=${MIRROR_COUNTRY:-US}&protocol=https&use_mirror_status=on" \
| sed -e 's/^#Server/Server/' -e '/^#/d' \ | sed -e 's/^#Server/Server/' -e '/^#/d' \
| head -n "$((${MIRROR_COUNT:-10}+1))" \ | head -n "$((${MIRROR_COUNT:-10}+1))" \
| bash ./rankmirrors --verbose --max-time 5 - > /etc/pacman.d/mirrorlist \ | 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 \ && cat /etc/pacman.d/mirrorlist \
; fi ; 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 # 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; }
@ -90,11 +105,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 /home/arch \ && mkdir -p /home/arch \
&& chown arch:arch /home/arch && chown arch:arch /home/arch
# allow ssh to container # allow ssh to container
RUN mkdir -m 700 /root/.ssh RUN mkdir -p -m 700 /root/.ssh
WORKDIR /root/.ssh WORKDIR /root/.ssh
RUN touch authorized_keys \ RUN touch authorized_keys \
@ -113,8 +128,7 @@ RUN tee -a sshd_config <<< 'AllowTcpForwarding yes' \
USER arch USER arch
# download 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
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/OSX-KVM
# enable ssh # enable ssh
@ -140,31 +154,40 @@ 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 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 && yes | sudo pacman -Scc
WORKDIR /home/arch/OSX-KVM WORKDIR /home/arch/OSX-KVM
# RUN wget https://raw.githubusercontent.com/kholia/OSX-KVM/master/fetch-macOS-v2.py # shortname default is catalina, which means :latest is catalina
ARG SHORTNAME=catalina ARG SHORTNAME=catalina
RUN make \ 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}" \
&& sudo tee -a /etc/pacman.conf <<< 'RemoteFileSigLevel = Optional' \
&& sudo sed -i -e 's/^\#RemoteFileSigLevel/RemoteFileSigLevel/g' /etc/pacman.conf
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
# reminder this is what makes :naked image larger than expected
RUN if [[ "${LINUX}" == true ]]; then \ 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 ; fi
# optional --build-arg to change branches for testing # optional --build-arg to change branches for testing
ARG BRANCH=master ARG BRANCH=master
ARG REPO='https://github.com/sickcodes/Docker-OSX.git' ARG REPO='https://github.com/sickcodes/Docker-OSX.git'
# 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 git clone --recurse-submodules --depth 1 --branch "${BRANCH}" "${REPO}"
RUN touch Launch.sh \ RUN touch Launch.sh \
&& chmod +x ./Launch.sh \ && chmod +x ./Launch.sh \
@ -179,7 +202,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 <<< '-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 <<< '-machine q35,${KVM-"accel=kvm:tcg"} \' \
&& 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 <<< '-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 <<< '-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/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/OSX-KVM/OVMF_VARS-1024x768.fd \' \
@ -213,32 +237,6 @@ 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
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-*
####
# 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

View File

@ -42,7 +42,7 @@
FROM sickcodes/docker-osx:latest FROM sickcodes/docker-osx:latest
MAINTAINER 'https://twitter.com/sickcodes' <https://sick.codes> LABEL maintainer='https://twitter.com/sickcodes <https://sick.codes>'
USER root USER root
@ -53,25 +53,41 @@ ARG SCROT
# 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
RUN perl -i -p -e s/^\#Color/Color$'\n'ParallelDownloads\ =\ 30/g /etc/pacman.conf
ARG RANKMIRRORS ARG RANKMIRRORS
ARG MIRROR_COUNTRY=US ARG MIRROR_COUNTRY=US
ARG MIRROR_COUNT=10 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 \ RUN if [[ "${RANKMIRRORS}" ]]; then \
{ pacman -Sy wget --noconfirm || pacman -Syu wget --noconfirm ; } \ { 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" \ ; wget -O- "https://www.archlinux.org/mirrorlist/?country=${MIRROR_COUNTRY:-US}&protocol=https&use_mirror_status=on" \
| sed -e 's/^#Server/Server/' -e '/^#/d' \ | sed -e 's/^#Server/Server/' -e '/^#/d' \
| head -n "$((${MIRROR_COUNT:-10}+1))" \ | head -n "$((${MIRROR_COUNT:-10}+1))" \
| bash ./rankmirrors --verbose --max-time 5 - > /etc/pacman.d/mirrorlist \ | 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 \ && 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,38 +104,13 @@ RUN pacman -Syu xorg-server-xvfb wget xterm xorg-xhost xorg-xrandr sshpass --noc
; 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
#### 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 WORKDIR /home/arch/OSX-KVM
RUN mkdir -p ~/.ssh \ RUN mkdir -p ~/.ssh \

View File

@ -21,7 +21,7 @@
FROM sickcodes/docker-osx FROM sickcodes/docker-osx
MAINTAINER 'https://twitter.com/sickcodes' <https://sick.codes> LABEL maintainer='https://twitter.com/sickcodes <https://sick.codes>'
SHELL ["/bin/bash", "-c"] SHELL ["/bin/bash", "-c"]

View File

@ -32,7 +32,7 @@
FROM sickcodes/docker-osx:latest FROM sickcodes/docker-osx:latest
MAINTAINER 'https://twitter.com/sickcodes' <https://sick.codes> LABEL maintainer='https://twitter.com/sickcodes <https://sick.codes>'
USER root 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 # 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
RUN perl -i -p -e s/^\#Color/Color$'\n'ParallelDownloads\ =\ 30/g /etc/pacman.conf
ARG RANKMIRRORS ARG RANKMIRRORS
ARG MIRROR_COUNTRY=US ARG MIRROR_COUNTRY=US
ARG MIRROR_COUNT=10 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" \ ; wget -O- "https://www.archlinux.org/mirrorlist/?country=${MIRROR_COUNTRY:-US}&protocol=https&use_mirror_status=on" \
| sed -e 's/^#Server/Server/' -e '/^#/d' \ | sed -e 's/^#Server/Server/' -e '/^#/d' \
| head -n "$((${MIRROR_COUNT:-10}+1))" \ | head -n "$((${MIRROR_COUNT:-10}+1))" \
| bash ./rankmirrors --verbose --max-time 5 - > /etc/pacman.d/mirrorlist \ | 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 \ && cat /etc/pacman.d/mirrorlist \
; fi ; 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. # For taking screenshots of the Xfvb screen, useful during development.
ARG SCROT ARG SCROT
@ -81,28 +97,6 @@ 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
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 WORKDIR /home/arch/OSX-KVM
RUN mkdir -p ~/.ssh \ RUN mkdir -p ~/.ssh \

View File

@ -18,7 +18,7 @@
FROM sickcodes/docker-osx:latest FROM sickcodes/docker-osx:latest
MAINTAINER 'https://twitter.com/sickcodes' <https://sick.codes> LABEL maintainer='https://twitter.com/sickcodes <https://sick.codes>'
USER root USER root
@ -31,28 +31,41 @@ ARG SCROT
# 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
RUN perl -i -p -e s/^\#Color/Color$'\n'ParallelDownloads\ =\ 30/g /etc/pacman.conf
ARG RANKMIRRORS ARG RANKMIRRORS
ARG MIRROR_COUNTRY=US ARG MIRROR_COUNTRY=US
ARG MIRROR_COUNT=10 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 \ RUN if [[ "${RANKMIRRORS}" ]]; then \
{ pacman -Sy wget --noconfirm || pacman -Syu wget --noconfirm ; } \ { 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" \ ; wget -O- "https://www.archlinux.org/mirrorlist/?country=${MIRROR_COUNTRY:-US}&protocol=https&use_mirror_status=on" \
| sed -e 's/^#Server/Server/' -e '/^#/d' \ | sed -e 's/^#Server/Server/' -e '/^#/d' \
| head -n "$((${MIRROR_COUNT:-10}+1))" \ | head -n "$((${MIRROR_COUNT:-10}+1))" \
| bash ./rankmirrors --verbose --max-time 5 - > /etc/pacman.d/mirrorlist \ | 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 \ && cat /etc/pacman.d/mirrorlist \
; fi \ ; fi
; yes | pacman -Scc
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. # 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 sshpass --noconfirm \ RUN pacman -Syu xorg-server-xvfb wget xterm xorg-xhost xorg-xrandr --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,37 +82,13 @@ RUN pacman -Syu xorg-server-xvfb wget xterm xorg-xhost xorg-xrandr sshpass --noc
; 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
#### 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 WORKDIR /home/arch/OSX-KVM
RUN mkdir -p ~/.ssh \ RUN mkdir -p ~/.ssh \

105
README.md
View File

@ -95,6 +95,40 @@ docker run -it \
# 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 .
```
### Sonoma [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/sonoma?label=sickcodes%2Fdocker-osx%3Asonoma](https://img.shields.io/docker/image-size/sickcodes/docker-osx/sonoma?label=sickcodes%2Fdocker-osx%3Asonoma)](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-sonoma-custom.plist' \
sickcodes/docker-osx:sonoma
# docker build -t docker-osx --build-arg SHORTNAME=sonoma .
```
#### 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
@ -178,12 +212,15 @@ 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
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 \ docker run -it \
--device /dev/kvm \ --device /dev/kvm \
-p 50922:10022 \ -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 \ -v /tmp/.X11-unix:/tmp/.X11-unix \
-e "DISPLAY=${DISPLAY:-:0.0}" \ -e "DISPLAY=${DISPLAY:-:0.0}" \
-e "USERNAME=user" \ -e "USERNAME=user" \
@ -193,11 +230,22 @@ 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.
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 # (USBFLUXD) iPhone USB -> Network style passthrough OSX-KVM Docker-OSX
@ -342,18 +390,22 @@ 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
--build-arg SHORTNAME=sonoma
``` ```
## Technical details ## 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 - High Sierra
- Mojave - Mojave
- Catalina - Catalina
- Big Sur - Big Sur
- Monterey - Monterey
- Ventura
- Sonoma
- 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)
@ -378,6 +430,14 @@ Monterey make your own image:
[![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) [![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)
Ventura make your own image:
[![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)
Sonoma make your own image:
[![https://img.shields.io/docker/image-size/sickcodes/docker-osx/sonoma?label=sickcodes%2Fdocker-osx%3Asonoma](https://img.shields.io/docker/image-size/sickcodes/docker-osx/sonoma?label=sickcodes%2Fdocker-osx%3Asonoma)](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` Pre-made **Catalina** system by [Sick.Codes](https://sick.codes): username: `user`, password: `alpine`
[![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) [![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)
@ -458,7 +518,7 @@ In case you're interested, contact [@sickcodes on Twitter](https://twitter.com/s
## License/Contributing ## 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 ### Other cool Docker/QEMU based projects
- [Run Android in a Docker Container with Dock Droid](https://github.com/sickcodes/dock-droid) - [Run Android in a Docker Container with Dock Droid](https://github.com/sickcodes/dock-droid)
@ -478,7 +538,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. ### 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 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) - `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 +550,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: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:sonoma` - [I want to run Sonoma.](#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.
@ -538,7 +600,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). 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: The result should be like this:
``` ```
[wsl2] [wsl2]
@ -552,6 +614,8 @@ INFO: /dev/kvm exists
KVM acceleration can be used 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. 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: After installation, go into Settings and check these 2 boxes:
@ -583,7 +647,7 @@ Or try:
For Ubuntu 20.x on Windows, see [https://github.com/sickcodes/Docker-OSX/discussions/458](https://github.com/sickcodes/Docker-OSX/discussions/458) 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 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) ## Additional boot instructions for when you are [creating your container](#container-creation-examples)
@ -642,15 +706,17 @@ Or
#### Use more CPU Cores/SMP #### Use more CPU Cores/SMP
This will use all available cores; adjust accordingly to the day of the week: Examples:
``` `-e EXTRA='-smp 6,sockets=3,cores=2'`
-e CPU_STRING=$(nproc) \
```
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 #### Add yourself to the Docker group
@ -1002,7 +1068,7 @@ IP_ADDRESS=172.17.0.1
### Fedora: enable internet connectivity with a bridged network ### 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 ```bash
# Set the docker0 bridge to the trusted zone # Set the docker0 bridge to the trusted zone
@ -1364,7 +1430,7 @@ docker run -it \
sickcodes/docker-osx:latest 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 \ -e WIDTH=800 \
@ -1542,7 +1608,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. 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. - 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.
@ -1653,7 +1719,7 @@ docker run -it \
sickcodes/docker-osx:naked 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** **Must change -it to -i to be able to interact with the QEMU console**
@ -1698,7 +1764,7 @@ You also need the container IP: `docker inspect <containerid> | jq -r '.[0].Netw
Or `ip n` will usually show the container IP first. 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. 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.
@ -1858,4 +1924,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. `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,6 +16,8 @@
# 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
# scrot --overwrite --display :99 --file ~/${TEST}.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 .
@ -28,6 +30,8 @@ TESTS=(
catalina catalina
big-sur big-sur
monterey monterey
ventura
sonoma
) )
# 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.

BIN
tests/sonoma_master.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 KiB

View File

@ -137,6 +137,8 @@ VERSION_BUILDS=(
'catalina' 'catalina'
'big-sur' 'big-sur'
'monterey' 'monterey'
'ventura'
'sonoma'
) )
warning () { warning () {
@ -158,6 +160,7 @@ install_docker () {
; 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 \
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \ && curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
&& apt-key fingerprint 0EBFCD88 \ && 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" \ && add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \
&& apt update -y \ && apt update -y \
&& apt install docker-ce docker-ce-cli containerd.io -y \ && apt install docker-ce docker-ce-cli containerd.io -y \
@ -306,13 +309,15 @@ yes | apt install -y --no-install-recommends tzdata -y
install_scrotcat install_scrotcat
yes | install_vnc yes | install_vnc
export_display_99 export_display_99
apt install xvfb -y
start_xvfb start_xvfb
# start_vnc # start_vnc
enable_kvm enable_kvm
reset_docker_hard reset_docker_hard
echo killall Xvfb # echo killall Xvfb
clone_repo "${BRANCH}" "${REPO}" clone_repo "${BRANCH}" "${REPO}"
cd ./Docker-OSX cd ./Docker-OSX
git pull
for SHORTNAME in "${VERSION_BUILDS[@]}"; do for SHORTNAME in "${VERSION_BUILDS[@]}"; do
docker-osx:version "${SHORTNAME}" docker-osx:version "${SHORTNAME}"
@ -333,6 +338,10 @@ if [[ "${DOCKER_USERNAME}" ]] && [[ "${DOCKER_PASSWORD}" ]]; then
docker push "sickcodes/docker-osx:${SHORTNAME}" docker push "sickcodes/docker-osx:${SHORTNAME}"
done \ done \
&& touch PUSHED && touch PUSHED
docker push sickcodes/docker-osx:naked
docker push sickcodes/docker-osx:auto
docker push sickcodes/docker-osx:naked-auto
fi fi
# connect remotely to your server to use VNC # connect remotely to your server to use VNC

BIN
tests/ventura_master.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 KiB

View File

@ -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' \ && 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
# 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 USER arch
RUN sudo pacman -Syyuu --noconfirm \ RUN yes | sudo pacman -Syyuu --noconfirm \
&& sudo pacman -S tigervnc xterm xorg-xhost xdotool ufw --noconfirm \ && yes | 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

@ -180,8 +180,8 @@ CMD sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/
WORKDIR /home/arch/OSX-KVM WORKDIR /home/arch/OSX-KVM
RUN sudo pacman -Syyuu --noconfirm \ RUN yes | sudo pacman -Syyuu --noconfirm \
&& sudo pacman -S tigervnc xterm xorg-xhost xdotool ufw --noconfirm \ && yes | 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' \