Compare commits
126 Commits
osx-serial
...
rollback-n
Author | SHA1 | Date | |
---|---|---|---|
e718aec193 | |||
0202359871 | |||
a04466a704 | |||
21b17535b5 | |||
e79ce8a273 | |||
d028bd341b | |||
c6c6c69851 | |||
be0c44928f | |||
8ae71a36d1 | |||
030258ef67 | |||
7300479b9a | |||
2d79f06079 | |||
c9b33ddb62 | |||
4805b9169b | |||
e55e55229d | |||
bc79a1fffb | |||
8dc03683e1 | |||
55b4820e07 | |||
d2e2604cfc | |||
abce04d6fe | |||
3f7256e145 | |||
5fdf587a29 | |||
8689e0e12c | |||
9ca9372da1 | |||
b820ec4ef2 | |||
8112e97bbf | |||
cc4303b5f3 | |||
71e4fa60cd | |||
6729dd7877 | |||
7da38e0d83 | |||
7f7a24f1d3 | |||
c913b66853 | |||
629563eb52 | |||
31247a5f63 | |||
d36ac07b34 | |||
c65f80ab16 | |||
e6fcfd86db | |||
0a0ae76333 | |||
dca8b28f9f | |||
50c87a4bac | |||
1d8682403f | |||
d40be09953 | |||
9639fa2289 | |||
24033387a3 | |||
7dfd04eafd | |||
5806f862d3 | |||
5a159c19e9 | |||
1d6168dfed | |||
50c5dce110 | |||
ff250fa0ca | |||
302885dc08 | |||
fcfba30086 | |||
df10b3c651 | |||
e265065e31 | |||
beef908d4c | |||
12b8ce7a2b | |||
9c8d70c9da | |||
363bac93a9 | |||
f6344e6beb | |||
022b7b5864 | |||
bed57dc73e | |||
423d6697c3 | |||
15fa5d3ef7 | |||
b97d6134f0 | |||
c2fca85acf | |||
48db29e013 | |||
1f9807929e | |||
911dad8b58 | |||
0865bb21c1 | |||
31c95fd640 | |||
a9479fb875 | |||
aabf8d949a | |||
e7070fd1cd | |||
5ca6529ae2 | |||
61012cf0c8 | |||
cdf9dae7f2 | |||
d12612bb35 | |||
b96bac8cd2 | |||
ae32ff2cb4 | |||
9a8239f8ec | |||
5e294d35c1 | |||
458c4781cd | |||
ca92e33b20 | |||
d910db6958 | |||
87efcbb6f6 | |||
d2dadeea4d | |||
127fca4718 | |||
f4fd2d53fd | |||
ddc92a2675 | |||
010dc94818 | |||
48bc561aa9 | |||
866a429848 | |||
7014f82a30 | |||
2374861720 | |||
e11f62a9ef | |||
0d70bed2ed | |||
0fb7c28608 | |||
62baabc31e | |||
54774ab91e | |||
4e41e2bc08 | |||
64ed979a65 | |||
a4c83df192 | |||
84e1682700 | |||
879b964621 | |||
f5a92a394e | |||
53c9b91612 | |||
c31e2618c6 | |||
ee65907abe | |||
77307c7b24 | |||
e5f4d6cc12 | |||
9ccb93101d | |||
5dc2f4fd04 | |||
e102d8c3c7 | |||
c5a2a5539d | |||
869b5fafd6 | |||
309ff1cd51 | |||
17631b47ef | |||
15cb15e153 | |||
1d3a12a9c6 | |||
5542eafad7 | |||
19439bf2bd | |||
aac1017c40 | |||
d77b5cfcf2 | |||
6e134e763d | |||
0925c6e1b2 | |||
bbb38349b1 |
@ -1,5 +1,14 @@
|
|||||||
|Version|Date|Notes|
|
|Version|Date|Notes|
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
|
| |2021-09-09|Add Monterey|
|
||||||
|
| |2021-08-27|Add iPhone passthrough OTA!|
|
||||||
|
|6.0|2021-08-25|Added naked-auto. Keep kernel at 5.13, even tho it's just for supermin.|
|
||||||
|
|5.0|2021-07-25|Retire glibc patch. Retire file command patch. Add bootmenu=on.|
|
||||||
|
| |2021-07-08|Add CPUID_FLAGS to edit the CPUID flags on the fly.|
|
||||||
|
|4.4|2021-05-06|Prepare nakedvnc for hub.docker.com. Add `ENV BOOT_ARGS=` to supply additon boot arguments, for example, `vmx,rdtscp`. Add `ENV CPU=Penryn` to allow changes to the CPU emulation, for example, `Skylake-Client`, or see [more examples here](https://manpages.ubuntu.com/manpages/disco/man7/qemu-cpu-models.7.html).|
|
||||||
|
| |2021-05-04|Disable arbitrary chown warning|
|
||||||
|
| |2021-04-27|Fixed missing sudo|
|
||||||
|
| |2021-04-18|Add LIBGUESTFS debug & trace commands, exit on fail when creating bootdisks. Silence touch errors.|
|
||||||
|4.3|2021-03-24|Enable interactive QEMU again. Remove envsubst since we are already using bash... Add set -x flag|
|
|4.3|2021-03-24|Enable interactive QEMU again. Remove envsubst since we are already using bash... Add set -x flag|
|
||||||
|4.2|2021-03-24|Add all ENV variables to each dockerfile for readability. Add RAM allocation buffer and cache drop bug fix. Add kvm and libvirt groups. Add `IMAGE_FORMAT=qcow2` to allow `IMAGE_FORMAT=raw` too.|
|
|4.2|2021-03-24|Add all ENV variables to each dockerfile for readability. Add RAM allocation buffer and cache drop bug fix. Add kvm and libvirt groups. Add `IMAGE_FORMAT=qcow2` to allow `IMAGE_FORMAT=raw` too.|
|
||||||
| |2021-03-19|Use RAM=3 as the default RAM allocation. Add instructions to clear buff/cache.|
|
| |2021-03-19|Use RAM=3 as the default RAM allocation. Add instructions to clear buff/cache.|
|
||||||
|
54
CREDITS.md
@ -1,12 +1,18 @@
|
|||||||
# Credits
|
# Credits
|
||||||
|
|
||||||
|
The most important part of the project. You.
|
||||||
|
|
||||||
## Upstream Acknowledgements:
|
## Upstream Acknowledgements:
|
||||||
|
|
||||||
This project uses OSX-KVM from https://github.com/kholia/OSX-KVM/ and fully appreciates the work done by [@Kholia](https://github.com/Kholia) and all the contributors who are listed: [https://github.com/kholia/OSX-KVM/blob/master/CREDITS.md](https://github.com/kholia/OSX-KVM/blob/master/CREDITS.md)
|
This project uses OSX-KVM from https://github.com/kholia/OSX-KVM and fully appreciates the work done by [@Kholia](https://github.com/Kholia) and all the contributors who are listed: [https://github.com/kholia/OSX-KVM/blob/master/CREDITS.md](https://github.com/kholia/OSX-KVM/blob/master/CREDITS.md)
|
||||||
|
|
||||||
|
This project also uses KVM-OpenCore from https://github.com/Leoyzen/KVM-Opencore and fully appreciates the work done by [@Leoyzen](https://github.com/Leoyzen).
|
||||||
|
|
||||||
|
We use a special fork by [Nicholas Sherlock](https://www.nicksherlock.com/) of KVM-Opencore https://github.com/thenickdude/KVM-Opencore and thank Nick for his awesome upstream work!
|
||||||
|
|
||||||
This project now uses the fantastic OpenCore bootloader from the community OpenCore project: https://github.com/acidanthera/OpenCorePkg. You can join their [Subreddit here](https://www.reddit.com/r/hackintosh/)!
|
This project now uses the fantastic OpenCore bootloader from the community OpenCore project: https://github.com/acidanthera/OpenCorePkg. You can join their [Subreddit here](https://www.reddit.com/r/hackintosh/)!
|
||||||
|
|
||||||
## These credits refer to the contributors to this repository:
|
## These credits refer to the legendary contributors to this repository:
|
||||||
|
|
||||||
[@GreeFine](https://github.com/GreeFine) - Readme Typo #9
|
[@GreeFine](https://github.com/GreeFine) - Readme Typo #9
|
||||||
|
|
||||||
@ -18,7 +24,7 @@ This project now uses the fantastic OpenCore bootloader from the community OpenC
|
|||||||
|
|
||||||
[@qcasey](https://github.com/qcasey) - Removed unnecessary yay in Remove yay dependancy #40
|
[@qcasey](https://github.com/qcasey) - Removed unnecessary yay in Remove yay dependancy #40
|
||||||
|
|
||||||
[@tlierdotfr](https://github.com/tlierdotfr) - Reduce number of layers in Dockerfile
|
[@tlierdotfr](https://github.com/tlierdotfr) - Reduce number of layers in Dockerfile
|
||||||
|
|
||||||
[@Julioevm](https://github.com/Julioevm) - Update docker-compose.yml #57
|
[@Julioevm](https://github.com/Julioevm) - Update docker-compose.yml #57
|
||||||
|
|
||||||
@ -42,7 +48,7 @@ This project now uses the fantastic OpenCore bootloader from the community OpenC
|
|||||||
|
|
||||||
[@PeterDaveHello](https://github.com/PeterDaveHello) - Reduce image size by setting git clone depth #110
|
[@PeterDaveHello](https://github.com/PeterDaveHello) - Reduce image size by setting git clone depth #110
|
||||||
|
|
||||||
[@PeterDaveHello](https://github.com/PeterDaveHello) - Reduce Dockerfile instructions and Docker image layers #112
|
[@PeterDaveHello](https://github.com/PeterDaveHello) - Reduce Dockerfile instructions and Docker image layers #112
|
||||||
|
|
||||||
[@weskerfoot](https://github.com/weskerfoot) Docs updates: usb passthrough, headless mode, disk space reduction guide #113
|
[@weskerfoot](https://github.com/weskerfoot) Docs updates: usb passthrough, headless mode, disk space reduction guide #113
|
||||||
|
|
||||||
@ -64,8 +70,46 @@ This project now uses the fantastic OpenCore bootloader from the community OpenC
|
|||||||
|
|
||||||
[@TheHackerCoding](https://github.com/TheHackerCoding) - Typo in README.md #194
|
[@TheHackerCoding](https://github.com/TheHackerCoding) - Typo in README.md #194
|
||||||
|
|
||||||
[@panos](https://github.com/panos) - Improved README #212
|
[@panos](https://github.com/panos) - Improved README #212
|
||||||
|
|
||||||
[@ggjulio](https://github.com/ggjulio) - Restarting an "auto" container #216
|
[@ggjulio](https://github.com/ggjulio) - Restarting an "auto" container #216
|
||||||
|
|
||||||
|
[@panos](https://github.com/panos) - Improved README #212
|
||||||
|
|
||||||
[@panos](https://github.com/panos) - Made further improvements to the README #219
|
[@panos](https://github.com/panos) - Made further improvements to the README #219
|
||||||
|
|
||||||
|
[@kaoudis](https://github.com/kaoudis) README / troubleshooting docs improvements #235
|
||||||
|
|
||||||
|
[@a10kiloham](https://github.com/a10kiloham) - Dockerfile for :naked image with VNC support #245
|
||||||
|
|
||||||
|
[@a10kiloham](https://github.com/a10kiloham) - Adding Bluebubbles as an example use case #250
|
||||||
|
|
||||||
|
[@aronzvi](https://github.com/aronzvi) - Fixed Failed to boot OSX with GENERATE_UNIQUE #244
|
||||||
|
|
||||||
|
[@tinjaw](https://github.com/tinjaw) - Fixed Type #258
|
||||||
|
|
||||||
|
[@m-zheng](https://github.com/m-zheng) - Update README.md #260
|
||||||
|
|
||||||
|
[@johnjhacking](https://github.com/johnjhacking) - Change call function to Popen #288
|
||||||
|
|
||||||
|
[@allansrc](https://github.com/allansrc) - Update Doc detail for run on WLS #318
|
||||||
|
|
||||||
|
[@mcandre](https://github.com/mcandre) - fix typo #334
|
||||||
|
|
||||||
|
[@cybik](https://github.com/cybik) Spice fix #337
|
||||||
|
|
||||||
|
[@Silfalion](https://github.com/Silfalion) - [https://github.com/Silfalion/Iphone_docker_osx_passthrough](https://github.com/Silfalion/Iphone_docker_osx_passthrough)
|
||||||
|
|
||||||
|
[@chirag350](https://github.com/chirag350) use LABEL instead of MAINTAINER since MAINTAINER is deprecated #352
|
||||||
|
|
||||||
|
[@Buthrakaur](https://github.com/Buthrakaur) readme - improve instructions for running on windows #361
|
||||||
|
|
||||||
|
[@TheHackerCoding](https://github.com/TheHackerCoding) Typo in README #367
|
||||||
|
|
||||||
|
[@cameronsteele](https://github.com/cameronsteele) fix Big Sur build example #378
|
||||||
|
|
||||||
|
[@eggplants](https://github.com/eggplants) Fix command to launch sickcodes/docker-osx:auto #366
|
||||||
|
|
||||||
|
[@martinmullins](https://github.com/martinmullins) Notes for mounting an NFS folder from a linux host #392
|
||||||
|
|
||||||
|
[@kimjammer](https://github.com/kimjammer) Readme - Added instructions for using WSLg's built in X11 server #395
|
||||||
|
189
Dockerfile
@ -7,7 +7,7 @@
|
|||||||
#
|
#
|
||||||
# Title: Docker-OSX (Mac on Docker)
|
# Title: Docker-OSX (Mac on Docker)
|
||||||
# Author: Sick.Codes https://twitter.com/sickcodes
|
# Author: Sick.Codes https://twitter.com/sickcodes
|
||||||
# Version: 4.3
|
# Version: 6.0
|
||||||
# License: GPLv3+
|
# License: GPLv3+
|
||||||
# Repository: https://github.com/sickcodes/Docker-OSX
|
# Repository: https://github.com/sickcodes/Docker-OSX
|
||||||
# Website: https://sick.codes
|
# Website: https://sick.codes
|
||||||
@ -52,27 +52,21 @@
|
|||||||
# # you will also need to pass the device to the container
|
# # you will also need to pass the device to the container
|
||||||
|
|
||||||
FROM archlinux:base-devel
|
FROM archlinux:base-devel
|
||||||
|
LABEL maintainer='https://twitter.com/sickcodes <https://sick.codes>'
|
||||||
MAINTAINER 'https://twitter.com/sickcodes' <https://sick.codes>
|
|
||||||
|
|
||||||
SHELL ["/bin/bash", "-c"]
|
SHELL ["/bin/bash", "-c"]
|
||||||
|
|
||||||
# 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 VERSION=10.15.6
|
|
||||||
|
|
||||||
# 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
|
||||||
|
|
||||||
# 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
|
|
||||||
|
|
||||||
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/master/rankmirrors" \
|
||||||
@ -99,12 +93,6 @@ RUN pacman -Syu git zip vim nano alsa-utils openssh --noconfirm \
|
|||||||
&& mkdir /home/arch \
|
&& mkdir /home/arch \
|
||||||
&& chown arch:arch /home/arch
|
&& chown arch:arch /home/arch
|
||||||
|
|
||||||
# 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
|
|
||||||
|
|
||||||
# allow ssh to container
|
# allow ssh to container
|
||||||
RUN mkdir -m 700 /root/.ssh
|
RUN mkdir -m 700 /root/.ssh
|
||||||
|
|
||||||
@ -126,6 +114,7 @@ RUN tee -a sshd_config <<< 'AllowTcpForwarding yes' \
|
|||||||
USER arch
|
USER arch
|
||||||
|
|
||||||
# download OSX-KVM
|
# download OSX-KVM
|
||||||
|
# RUN git clone --recurse-submodules --depth 1 https://github.com/kholia/OSX-KVM.git /home/arch/OSX-KVM
|
||||||
RUN git clone --recurse-submodules --depth 1 https://github.com/kholia/OSX-KVM.git /home/arch/OSX-KVM
|
RUN git clone --recurse-submodules --depth 1 https://github.com/kholia/OSX-KVM.git /home/arch/OSX-KVM
|
||||||
|
|
||||||
# enable ssh
|
# enable ssh
|
||||||
@ -151,58 +140,30 @@ 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 qemu libvirt dnsmasq virt-manager bridge-utils openresolv jack ebtables edk2-ovmf netctl libvirt-dbus wget --overwrite --noconfirm \
|
RUN yes | sudo pacman -Syu bc qemu libvirt dnsmasq virt-manager bridge-utils openresolv jack ebtables edk2-ovmf netctl libvirt-dbus wget --overwrite --noconfirm \
|
||||||
&& yes | sudo pacman -Scc
|
&& yes | sudo 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
|
|
||||||
|
|
||||||
# RUN sudo systemctl enable libvirtd.service
|
|
||||||
# RUN sudo systemctl enable virtlogd.service
|
|
||||||
|
|
||||||
WORKDIR /home/arch/OSX-KVM
|
WORKDIR /home/arch/OSX-KVM
|
||||||
|
|
||||||
RUN wget https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/fetch-macOS.py
|
# RUN wget https://raw.githubusercontent.com/kholia/OSX-KVM/master/fetch-macOS-v2.py
|
||||||
|
|
||||||
RUN [[ "${VERSION%%.*}" -lt 11 ]] && { python fetch-macOS.py --version "${VERSION}" \
|
ARG SHORTNAME=catalina
|
||||||
&& qemu-img convert BaseSystem.dmg -O qcow2 -p -c BaseSystem.img \
|
|
||||||
&& qemu-img create -f qcow2 mac_hdd_ng.img "${SIZE}" \
|
|
||||||
&& rm -f BaseSystem.dmg \
|
|
||||||
; } || true
|
|
||||||
|
|
||||||
# VERSION=11.2.1
|
RUN make \
|
||||||
# this downloads LATEST ONLY
|
&& qemu-img convert BaseSystem.dmg -O qcow2 -p -c BaseSystem.img \
|
||||||
ARG FETCH_MAC_OS_RAW=https://raw.githubusercontent.com/acidanthera/OpenCorePkg/master/Utilities/macrecovery/macrecovery.py
|
&& rm ./BaseSystem.dmg
|
||||||
# submit a PR to here to get the version option https://github.com/acidanthera/OpenCorePkg/blob/master/Utilities/macrecovery/macrecovery.py
|
|
||||||
|
|
||||||
RUN [[ "${VERSION%%.*}" -ge 11 ]] && { wget "${FETCH_MAC_OS_RAW}" \
|
|
||||||
&& python macrecovery.py download \
|
|
||||||
&& qemu-img convert BaseSystem.dmg -O qcow2 -p -c BaseSystem.img \
|
|
||||||
&& qemu-img create -f qcow2 mac_hdd_ng.img "${SIZE}" \
|
|
||||||
&& rm -f BaseSystem.dmg \
|
|
||||||
; } || true
|
|
||||||
|
|
||||||
# > Launch.sh
|
|
||||||
# > Docker-OSX.xml
|
|
||||||
|
|
||||||
WORKDIR /home/arch/OSX-KVM
|
|
||||||
|
|
||||||
ARG LINUX=true
|
ARG LINUX=true
|
||||||
|
|
||||||
# required to use libguestfs inside a docker container, to create bootdisks for docker-osx on-the-fly
|
# required to use libguestfs inside a docker container, to create bootdisks for docker-osx on-the-fly
|
||||||
RUN if [[ "${LINUX}" == true ]]; then \
|
RUN if [[ "${LINUX}" == true ]]; then \
|
||||||
sudo pacman -Syu linux libguestfs --noconfirm \
|
sudo pacman -Syu linux libguestfs --noconfirm \
|
||||||
&& 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." \
|
|
||||||
; 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}" "${REPO}"
|
RUN git clone --recurse-submodules --depth 1 --branch "${BRANCH}" "${REPO}"
|
||||||
|
|
||||||
RUN touch Launch.sh \
|
RUN touch Launch.sh \
|
||||||
@ -214,50 +175,141 @@ RUN touch Launch.sh \
|
|||||||
&& tee -a Launch.sh <<< '[[ "${RAM}" = max ]] && export RAM="$(("$(head -n1 /proc/meminfo | tr -dc "[:digit:]") / 1000000"))"' \
|
&& 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 <<< '[[ "${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 <<< '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 <<< 'exec qemu-system-x86_64 -m ${RAM:-4}000 \' \
|
||||||
&& tee -a Launch.sh <<< '-cpu Penryn,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+pcid,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check \' \
|
&& 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 <<< '-usb -device usb-kbd -device usb-tablet \' \
|
||||||
&& tee -a Launch.sh <<< '-device isa-applesmc,osk=ourhardworkbythesewordsguardedpleasedontsteal\(c\)AppleComputerInc \' \
|
&& tee -a Launch.sh <<< '-device isa-applesmc,osk=ourhardworkbythesewordsguardedpleasedontsteal\(c\)AppleComputerInc \' \
|
||||||
&& tee -a Launch.sh <<< '-drive if=pflash,format=raw,readonly,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 \' \
|
||||||
&& tee -a Launch.sh <<< '-smbios type=2 \' \
|
&& tee -a Launch.sh <<< '-smbios type=2 \' \
|
||||||
&& tee -a Launch.sh <<< '-audiodev ${AUDIO_DRIVER:-alsa},id=hda -device ich9-intel-hda -device hda-duplex,audiodev=hda \' \
|
&& tee -a Launch.sh <<< '-audiodev ${AUDIO_DRIVER:-alsa},id=hda -device ich9-intel-hda -device hda-duplex,audiodev=hda \' \
|
||||||
&& tee -a Launch.sh <<< '-device ich9-ahci,id=sata \' \
|
&& tee -a Launch.sh <<< '-device ich9-ahci,id=sata \' \
|
||||||
&& tee -a Launch.sh <<< '-drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file=${BOOTDISK:-/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2} \' \
|
&& tee -a Launch.sh <<< '-drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file=${BOOTDISK:-/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2} \' \
|
||||||
&& tee -a Launch.sh <<< '-device ide-hd,bus=sata.2,drive=OpenCoreBoot \' \
|
&& tee -a Launch.sh <<< '-device ide-hd,bus=sata.2,drive=OpenCoreBoot \' \
|
||||||
&& tee -a Launch.sh <<< '-device ide-hd,bus=sata.3,drive=InstallMedia \' \
|
&& tee -a Launch.sh <<< '-device ide-hd,bus=sata.3,drive=InstallMedia \' \
|
||||||
&& tee -a Launch.sh <<< '-drive id=InstallMedia,if=none,file=/home/arch/OSX-KVM/BaseSystem.img,format=qcow2 \' \
|
&& tee -a Launch.sh <<< '-drive id=InstallMedia,if=none,file=/home/arch/OSX-KVM/BaseSystem.img,format=${BASESYSTEM_FORMAT:-qcow2} \' \
|
||||||
&& tee -a Launch.sh <<< '-drive id=MacHDD,if=none,file=${IMAGE_PATH:-/home/arch/OSX-KVM/mac_hdd_ng.img},format=${IMAGE_FORMAT:-qcow2} \' \
|
&& tee -a Launch.sh <<< '-drive id=MacHDD,if=none,file=${IMAGE_PATH:-/home/arch/OSX-KVM/mac_hdd_ng.img},format=${IMAGE_FORMAT:-qcow2} \' \
|
||||||
&& tee -a Launch.sh <<< '-device ide-hd,bus=sata.4,drive=MacHDD \' \
|
&& tee -a Launch.sh <<< '-device ide-hd,bus=sata.4,drive=MacHDD \' \
|
||||||
&& tee -a Launch.sh <<< '-netdev user,id=net0,hostfwd=tcp::${INTERNAL_SSH_PORT:-10022}-:22,hostfwd=tcp::${SCREEN_SHARE_PORT:-5900}-:5900,${ADDITIONAL_PORTS} \' \
|
&& tee -a Launch.sh <<< '-netdev user,id=net0,hostfwd=tcp::${INTERNAL_SSH_PORT:-10022}-:22,hostfwd=tcp::${SCREEN_SHARE_PORT:-5900}-:5900,${ADDITIONAL_PORTS} \' \
|
||||||
&& tee -a Launch.sh <<< '-device ${NETWORKING:-vmxnet3},netdev=net0,id=net0,mac=${MAC_ADDRESS:-52:54:00:09:49:17} \' \
|
&& tee -a Launch.sh <<< '-device ${NETWORKING:-vmxnet3},netdev=net0,id=net0,mac=${MAC_ADDRESS:-52:54:00:09:49:17} \' \
|
||||||
&& tee -a Launch.sh <<< '-monitor stdio \' \
|
&& tee -a Launch.sh <<< '-monitor stdio \' \
|
||||||
|
&& tee -a Launch.sh <<< '-boot menu=on \' \
|
||||||
&& tee -a Launch.sh <<< '-vga vmware \' \
|
&& tee -a Launch.sh <<< '-vga vmware \' \
|
||||||
&& tee -a Launch.sh <<< '${EXTRA:-}'
|
&& tee -a Launch.sh <<< '${EXTRA:-}'
|
||||||
|
|
||||||
# docker exec containerid mv ./Launch-nopicker.sh ./Launch.sh
|
# docker exec containerid mv ./Launch-nopicker.sh ./Launch.sh
|
||||||
# This is now a legacy command.
|
# This is now a legacy command.
|
||||||
# You can use -e BOOTDISK=/bootdisk with -v ./bootdisk.img:/bootdisk
|
# You can use -e BOOTDISK=/bootdisk with -v ./bootdisk.img:/bootdisk
|
||||||
|
|
||||||
|
### LEGACY CODE
|
||||||
RUN grep -v InstallMedia ./Launch.sh > ./Launch-nopicker.sh \
|
RUN grep -v InstallMedia ./Launch.sh > ./Launch-nopicker.sh \
|
||||||
&& chmod +x ./Launch-nopicker.sh \
|
&& chmod +x ./Launch-nopicker.sh \
|
||||||
&& sed -i -e s/OpenCore\.qcow2/OpenCore\-nopicker\.qcow2/ ./Launch-nopicker.sh
|
&& sed -i -e s/OpenCore\.qcow2/OpenCore\-nopicker\.qcow2/ ./Launch-nopicker.sh
|
||||||
|
###
|
||||||
|
|
||||||
USER arch
|
USER arch
|
||||||
|
|
||||||
ENV USER arch
|
ENV USER arch
|
||||||
|
|
||||||
#### SPECIAL RUNTIME ARGUMENTS BELOW
|
#### 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
|
||||||
|
# Overwritten by using GENERATE_UNIQUE=true
|
||||||
|
# Upstream removed nopicker, so we are adding it back in, at build time
|
||||||
|
# Once again, this is just for the Docker build so there is a default nopicker image there
|
||||||
|
|
||||||
|
# libguestfs verbose
|
||||||
|
ENV LIBGUESTFS_DEBUG=1
|
||||||
|
ENV LIBGUESTFS_TRACE=1
|
||||||
|
|
||||||
|
ARG STOCK_DEVICE_MODEL=iMacPro1,1
|
||||||
|
ARG STOCK_SERIAL=C02TM2ZBHX87
|
||||||
|
ARG STOCK_BOARD_SERIAL=C02717306J9JG361M
|
||||||
|
ARG STOCK_UUID=007076A6-F2A2-4461-BBE5-BAD019F8025A
|
||||||
|
ARG STOCK_MAC_ADDRESS=00:0A:27:00:00:00
|
||||||
|
ARG STOCK_WIDTH=1920
|
||||||
|
ARG STOCK_HEIGHT=1080
|
||||||
|
ARG STOCK_MASTER_PLIST_URL=https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom.plist
|
||||||
|
ARG STOCK_MASTER_PLIST_URL_NOPICKER=https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-nopicker-custom.plist
|
||||||
|
ARG STOCK_BOOTDISK=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2
|
||||||
|
ARG STOCK_BOOTDISK_NOPICKER=/home/arch/OSX-KVM/OpenCore/OpenCore-nopicker.qcow2
|
||||||
|
|
||||||
|
RUN ./Docker-OSX/osx-serial-generator/generate-specific-bootdisk.sh \
|
||||||
|
--master-plist-url="${STOCK_MASTER_PLIST_URL}" \
|
||||||
|
--model "${STOCK_DEVICE_MODEL}" \
|
||||||
|
--serial "${STOCK_SERIAL}" \
|
||||||
|
--board-serial "${STOCK_BOARD_SERIAL}" \
|
||||||
|
--uuid "${STOCK_UUID}" \
|
||||||
|
--mac-address "${STOCK_MAC_ADDRESS}" \
|
||||||
|
--width "${STOCK_WIDTH}" \
|
||||||
|
--height "${STOCK_HEIGHT}" \
|
||||||
|
--output-bootdisk "${STOCK_BOOTDISK}" || exit 1 \
|
||||||
|
; rm -rf /var/tmp/.guestfs-*
|
||||||
|
|
||||||
|
RUN ./Docker-OSX/osx-serial-generator/generate-specific-bootdisk.sh \
|
||||||
|
--master-plist-url="${STOCK_MASTER_PLIST_URL_NOPICKER}" \
|
||||||
|
--model "${STOCK_DEVICE_MODEL}" \
|
||||||
|
--serial "${STOCK_SERIAL}" \
|
||||||
|
--board-serial "${STOCK_BOARD_SERIAL}" \
|
||||||
|
--uuid "${STOCK_UUID}" \
|
||||||
|
--mac-address "${STOCK_MAC_ADDRESS}" \
|
||||||
|
--width "${STOCK_WIDTH}" \
|
||||||
|
--height "${STOCK_HEIGHT}" \
|
||||||
|
--output-bootdisk "${STOCK_BOOTDISK_NOPICKER}" || exit 1 \
|
||||||
|
; rm -rf /var/tmp/.guestfs-*
|
||||||
|
|
||||||
|
### symlink the old directory as upstream has renamed a directory. Symlinking purely for backwards compatability!
|
||||||
|
RUN ln -s /home/arch/OSX-KVM/OpenCore /home/arch/OSX-KVM/OpenCore-Catalina || true
|
||||||
|
####
|
||||||
|
|
||||||
|
#### SPECIAL RUNTIME ARGUMENTS BELOW
|
||||||
# env -e ADDITIONAL_PORTS with a comma
|
# env -e ADDITIONAL_PORTS with a comma
|
||||||
# for example, -e ADDITIONAL_PORTS=hostfwd=tcp::23-:23,
|
# for example, -e ADDITIONAL_PORTS=hostfwd=tcp::23-:23,
|
||||||
ENV ADDITIONAL_PORTS=
|
ENV ADDITIONAL_PORTS=
|
||||||
|
|
||||||
|
# since the Makefile uses raw, and raw uses the full disk amount
|
||||||
|
# we want to use a compressed qcow2
|
||||||
|
# ENV BASESYSTEM_FORMAT=raw
|
||||||
|
ENV BASESYSTEM_FORMAT=qcow2
|
||||||
|
|
||||||
|
# add additional QEMU boot arguments
|
||||||
|
ENV BOOT_ARGS=
|
||||||
|
|
||||||
ENV BOOTDISK=
|
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
|
ENV DISPLAY=:0.0
|
||||||
|
|
||||||
|
# Deprecated
|
||||||
ENV ENV=/env
|
ENV ENV=/env
|
||||||
|
|
||||||
# Boolean for generating a bootdisk with new random serials.
|
# Boolean for generating a bootdisk with new random serials.
|
||||||
@ -271,7 +323,7 @@ ENV IMAGE_FORMAT=qcow2
|
|||||||
|
|
||||||
ENV KVM='accel=kvm:tcg'
|
ENV KVM='accel=kvm:tcg'
|
||||||
|
|
||||||
ENV MASTER_PLIST_URL="https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-nopicker-custom.plist"
|
ENV MASTER_PLIST_URL="https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom.plist"
|
||||||
|
|
||||||
# ENV NETWORKING=e1000-82545em
|
# ENV NETWORKING=e1000-82545em
|
||||||
ENV NETWORKING=vmxnet3
|
ENV NETWORKING=vmxnet3
|
||||||
@ -280,7 +332,7 @@ ENV NETWORKING=vmxnet3
|
|||||||
ENV NOPICKER=false
|
ENV NOPICKER=false
|
||||||
|
|
||||||
# dynamic RAM options for runtime
|
# dynamic RAM options for runtime
|
||||||
ENV RAM=3
|
ENV RAM=4
|
||||||
# ENV RAM=max
|
# ENV RAM=max
|
||||||
# ENV RAM=half
|
# ENV RAM=half
|
||||||
|
|
||||||
@ -289,7 +341,6 @@ ENV RAM=3
|
|||||||
ENV WIDTH=1920
|
ENV WIDTH=1920
|
||||||
ENV HEIGHT=1080
|
ENV HEIGHT=1080
|
||||||
|
|
||||||
|
|
||||||
VOLUME ["/tmp/.X11-unix"]
|
VOLUME ["/tmp/.X11-unix"]
|
||||||
|
|
||||||
# check if /image is a disk image or a directory. This allows you to optionally use -v disk.img:/image
|
# check if /image is a disk image or a directory. This allows you to optionally use -v disk.img:/image
|
||||||
@ -308,16 +359,16 @@ VOLUME ["/tmp/.X11-unix"]
|
|||||||
# /bootdisk is a useful persistent place to store the 15Mb serial number bootdisk.
|
# /bootdisk is a useful persistent place to store the 15Mb serial number bootdisk.
|
||||||
|
|
||||||
# if you don't set any of the above:
|
# if you don't set any of the above:
|
||||||
# the default serial numbers are already contained in ./OpenCore-Catalina/OpenCore.qcow2
|
# the default serial numbers are already contained in ./OpenCore/OpenCore.qcow2
|
||||||
# And the default serial numbers
|
# And the default serial numbers
|
||||||
|
|
||||||
CMD sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" || true \
|
CMD sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/null || true \
|
||||||
; sudo chown -R $(id -u):$(id -g) /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" || true \
|
; sudo chown -R $(id -u):$(id -g) /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/null || true \
|
||||||
; [[ "${NOPICKER}" == true ]] && { \
|
; [[ "${NOPICKER}" == true ]] && { \
|
||||||
sed -i '/^.*InstallMedia.*/d' Launch.sh \
|
sed -i '/^.*InstallMedia.*/d' Launch.sh \
|
||||||
&& export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore-nopicker.qcow2}" \
|
&& export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore-nopicker.qcow2}" \
|
||||||
; } \
|
; } \
|
||||||
|| export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \
|
|| export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
|
||||||
; [[ "${GENERATE_UNIQUE}" == true ]] && { \
|
; [[ "${GENERATE_UNIQUE}" == true ]] && { \
|
||||||
./Docker-OSX/osx-serial-generator/generate-unique-machine-values.sh \
|
./Docker-OSX/osx-serial-generator/generate-unique-machine-values.sh \
|
||||||
--master-plist-url="${MASTER_PLIST_URL}" \
|
--master-plist-url="${MASTER_PLIST_URL}" \
|
||||||
@ -326,9 +377,9 @@ CMD sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" || true
|
|||||||
--bootdisks \
|
--bootdisks \
|
||||||
--width "${WIDTH:-1920}" \
|
--width "${WIDTH:-1920}" \
|
||||||
--height "${HEIGHT:-1080}" \
|
--height "${HEIGHT:-1080}" \
|
||||||
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \
|
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
|
||||||
--output-env "${ENV:=/env}" \
|
--output-env "${ENV:=/env}" \
|
||||||
; } \
|
|| exit 1 ; } \
|
||||||
; [[ "${GENERATE_SPECIFIC}" == true ]] && { \
|
; [[ "${GENERATE_SPECIFIC}" == true ]] && { \
|
||||||
source "${ENV:=/env}" 2>/dev/null \
|
source "${ENV:=/env}" 2>/dev/null \
|
||||||
; ./Docker-OSX/osx-serial-generator/generate-specific-bootdisk.sh \
|
; ./Docker-OSX/osx-serial-generator/generate-specific-bootdisk.sh \
|
||||||
@ -340,8 +391,8 @@ CMD sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" || true
|
|||||||
--mac-address "${MAC_ADDRESS}" \
|
--mac-address "${MAC_ADDRESS}" \
|
||||||
--width "${WIDTH:-1920}" \
|
--width "${WIDTH:-1920}" \
|
||||||
--height "${HEIGHT:-1080}" \
|
--height "${HEIGHT:-1080}" \
|
||||||
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \
|
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
|
||||||
; } \
|
|| exit 1 ; } \
|
||||||
; ./enable-ssh.sh && /bin/bash -c ./Launch.sh
|
; ./enable-ssh.sh && /bin/bash -c ./Launch.sh
|
||||||
|
|
||||||
# virt-manager mode: eta son
|
# virt-manager mode: eta son
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#
|
#
|
||||||
# Title: Docker-OSX (Mac on Docker)
|
# Title: Docker-OSX (Mac on Docker)
|
||||||
# Author: Sick.Codes https://twitter.com/sickcodes
|
# Author: Sick.Codes https://twitter.com/sickcodes
|
||||||
# Version: 4.3
|
# Version: 6.0
|
||||||
# License: GPLv3+
|
# License: GPLv3+
|
||||||
# Repository: https://github.com/sickcodes/Docker-OSX
|
# Repository: https://github.com/sickcodes/Docker-OSX
|
||||||
# Website: https://sick.codes
|
# Website: https://sick.codes
|
||||||
@ -56,6 +56,7 @@ ARG SCROT
|
|||||||
ARG RANKMIRRORS
|
ARG RANKMIRRORS
|
||||||
ARG MIRROR_COUNTRY=US
|
ARG MIRROR_COUNTRY=US
|
||||||
ARG MIRROR_COUNT=10
|
ARG MIRROR_COUNT=10
|
||||||
|
|
||||||
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/master/rankmirrors" \
|
||||||
@ -70,12 +71,6 @@ RUN if [[ "${RANKMIRRORS}" ]]; then \
|
|||||||
; fi \
|
; fi \
|
||||||
; yes | pacman -Scc
|
; yes | pacman -Scc
|
||||||
|
|
||||||
# TEMP-FIX for pacman issue
|
|
||||||
RUN patched_glibc=glibc-linux4-2.33-4-x86_64.pkg.tar.zst \
|
|
||||||
&& curl -LO "https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/${patched_glibc}" \
|
|
||||||
&& bsdtar -C / -xvf "${patched_glibc}" || echo "Everything is fine."
|
|
||||||
# TEMP-FIX for pacman issue
|
|
||||||
|
|
||||||
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 sshpass --noconfirm \
|
||||||
&& if [[ "${SCROT}" ]]; then \
|
&& if [[ "${SCROT}" ]]; then \
|
||||||
pacman -Syu scrot base-devel --noconfirm \
|
pacman -Syu scrot base-devel --noconfirm \
|
||||||
@ -93,14 +88,38 @@ RUN pacman -Syu xorg-server-xvfb wget xterm xorg-xhost xorg-xrandr sshpass --noc
|
|||||||
; fi \
|
; fi \
|
||||||
; yes | pacman -Scc
|
; yes | pacman -Scc
|
||||||
|
|
||||||
# TEMP-FIX for pacman issue
|
|
||||||
RUN patched_glibc=glibc-linux4-2.33-4-x86_64.pkg.tar.zst \
|
|
||||||
&& curl -LO "https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/${patched_glibc}" \
|
|
||||||
&& bsdtar -C / -xvf "${patched_glibc}" || echo "Everything is fine."
|
|
||||||
# TEMP-FIX for pacman issue
|
|
||||||
|
|
||||||
USER arch
|
USER arch
|
||||||
|
|
||||||
|
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 \
|
||||||
@ -130,12 +149,26 @@ RUN if [[ "${COMPLETE}" ]]; then \
|
|||||||
&& wget ${WGET_OPTIONS} -O /home/arch/OSX-KVM/mac_hdd_ng.img "${IMAGE_URL}" \
|
&& wget ${WGET_OPTIONS} -O /home/arch/OSX-KVM/mac_hdd_ng.img "${IMAGE_URL}" \
|
||||||
; fi
|
; fi
|
||||||
|
|
||||||
|
|
||||||
|
####
|
||||||
|
|
||||||
|
# symlink the old directory, for redundancy
|
||||||
|
RUN ln -s /home/arch/OSX-KVM/OpenCore /home/arch/OSX-KVM/OpenCore-Catalina || true
|
||||||
|
|
||||||
|
####
|
||||||
|
|
||||||
#### SPECIAL RUNTIME ARGUMENTS BELOW
|
#### SPECIAL RUNTIME ARGUMENTS BELOW
|
||||||
|
|
||||||
ENV ADDITIONAL_PORTS=
|
ENV ADDITIONAL_PORTS=
|
||||||
|
|
||||||
|
# add additional QEMU boot arguments
|
||||||
|
ENV BOOT_ARGS=
|
||||||
|
|
||||||
ENV BOOTDISK=
|
ENV BOOTDISK=
|
||||||
|
|
||||||
|
# edit the CPU that is beign emulated
|
||||||
|
ENV CPU=Penryn
|
||||||
|
|
||||||
ENV DISPLAY=:99
|
ENV DISPLAY=:99
|
||||||
|
|
||||||
ENV HEADLESS=false
|
ENV HEADLESS=false
|
||||||
@ -160,6 +193,10 @@ ENV NETWORKING=vmxnet3
|
|||||||
|
|
||||||
ENV NOPICKER=true
|
ENV NOPICKER=true
|
||||||
|
|
||||||
|
# set the username and password for automatically logging in
|
||||||
|
ENV USERNAME=user
|
||||||
|
ENV PASSWORD=alpine
|
||||||
|
|
||||||
# dynamic RAM options for runtime
|
# dynamic RAM options for runtime
|
||||||
ENV RAM=3
|
ENV RAM=3
|
||||||
# ENV RAM=max
|
# ENV RAM=max
|
||||||
@ -170,6 +207,10 @@ ENV RAM=3
|
|||||||
ENV WIDTH=1920
|
ENV WIDTH=1920
|
||||||
ENV HEIGHT=1080
|
ENV HEIGHT=1080
|
||||||
|
|
||||||
|
# libguestfs verbose
|
||||||
|
ENV LIBGUESTFS_DEBUG=1
|
||||||
|
ENV LIBGUESTFS_TRACE=1
|
||||||
|
|
||||||
ENV TERMS_OF_USE=i_agree
|
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"
|
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"
|
||||||
@ -177,13 +218,13 @@ ENV BOILERPLATE="By using this Dockerfile, you hereby agree that you are a secur
|
|||||||
CMD echo "${BOILERPLATE}" \
|
CMD echo "${BOILERPLATE}" \
|
||||||
; [[ "${TERMS_OF_USE}" = i_agree ]] || exit 1 \
|
; [[ "${TERMS_OF_USE}" = i_agree ]] || exit 1 \
|
||||||
; echo "Disk is being copied between layers... Please wait a minute..." \
|
; echo "Disk is being copied between layers... Please wait a minute..." \
|
||||||
; sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" || true \
|
; 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}" || true \
|
; sudo chown -R $(id -u):$(id -g) /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" 2>/dev/null || true \
|
||||||
; [[ "${NOPICKER}" == true ]] && { \
|
; [[ "${NOPICKER}" == true ]] && { \
|
||||||
sed -i '/^.*InstallMedia.*/d' Launch.sh \
|
sed -i '/^.*InstallMedia.*/d' Launch.sh \
|
||||||
&& export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore-nopicker.qcow2}" \
|
&& export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore-nopicker.qcow2}" \
|
||||||
; } \
|
; } \
|
||||||
|| export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \
|
|| export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
|
||||||
; [[ "${GENERATE_UNIQUE}" == true ]] && { \
|
; [[ "${GENERATE_UNIQUE}" == true ]] && { \
|
||||||
./Docker-OSX/osx-serial-generator/generate-unique-machine-values.sh \
|
./Docker-OSX/osx-serial-generator/generate-unique-machine-values.sh \
|
||||||
--master-plist-url="${MASTER_PLIST_URL}" \
|
--master-plist-url="${MASTER_PLIST_URL}" \
|
||||||
@ -192,9 +233,9 @@ CMD echo "${BOILERPLATE}" \
|
|||||||
--bootdisks \
|
--bootdisks \
|
||||||
--width "${WIDTH:-1920}" \
|
--width "${WIDTH:-1920}" \
|
||||||
--height "${HEIGHT:-1080}" \
|
--height "${HEIGHT:-1080}" \
|
||||||
--output-bootdisk "${BOOTDISK:-/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \
|
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
|
||||||
--output-env "${ENV:=/env}" \
|
--output-env "${ENV:=/env}" \
|
||||||
; } \
|
|| exit 1 ; } \
|
||||||
; [[ "${GENERATE_SPECIFIC}" == true ]] && { \
|
; [[ "${GENERATE_SPECIFIC}" == true ]] && { \
|
||||||
source "${ENV:=/env}" 2>/dev/null \
|
source "${ENV:=/env}" 2>/dev/null \
|
||||||
; ./Docker-OSX/osx-serial-generator/generate-specific-bootdisk.sh \
|
; ./Docker-OSX/osx-serial-generator/generate-specific-bootdisk.sh \
|
||||||
@ -206,8 +247,8 @@ CMD echo "${BOILERPLATE}" \
|
|||||||
--mac-address "${MAC_ADDRESS}" \
|
--mac-address "${MAC_ADDRESS}" \
|
||||||
--width "${WIDTH:-1920}" \
|
--width "${WIDTH:-1920}" \
|
||||||
--height "${HEIGHT:-1080}" \
|
--height "${HEIGHT:-1080}" \
|
||||||
--output-bootdisk "${BOOTDISK:-/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \
|
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
|
||||||
; } \
|
|| exit 1 ; } \
|
||||||
; { [[ "${DISPLAY}" = ':99' ]] || [[ "${HEADLESS}" == true ]] ; } && { \
|
; { [[ "${DISPLAY}" = ':99' ]] || [[ "${HEADLESS}" == true ]] ; } && { \
|
||||||
nohup Xvfb :99 -screen 0 1920x1080x16 \
|
nohup Xvfb :99 -screen 0 1920x1080x16 \
|
||||||
& until [[ "$(xrandr --query 2>/dev/null)" ]]; do sleep 1 ; done \
|
& until [[ "$(xrandr --query 2>/dev/null)" ]]; do sleep 1 ; done \
|
||||||
@ -221,13 +262,13 @@ CMD echo "${BOILERPLATE}" \
|
|||||||
; } \
|
; } \
|
||||||
; /bin/bash -c ./Launch.sh \
|
; /bin/bash -c ./Launch.sh \
|
||||||
& echo "Booting Docker-OSX in the background. Please wait..." \
|
& echo "Booting Docker-OSX in the background. Please wait..." \
|
||||||
; until [[ "$(sshpass -palpine ssh-copy-id -f -i ~/.ssh/id_docker_osx.pub -p 10022 user@127.0.0.1)" ]]; do \
|
; until [[ "$(sshpass -p${PASSWORD:=alpine} ssh-copy-id -f -i ~/.ssh/id_docker_osx.pub -p 10022 ${USERNAME:=user}@127.0.0.1)" ]]; do \
|
||||||
echo "Disk is being copied between layers. Repeating until able to copy SSH key into OSX..." \
|
echo "Disk is being copied between layers. Repeating until able to copy SSH key into OSX..." \
|
||||||
; sleep 1 \
|
; sleep 1 \
|
||||||
; done \
|
; done \
|
||||||
; grep id_docker_osx ~/.ssh/config || { \
|
; grep id_docker_osx ~/.ssh/config || { \
|
||||||
tee -a ~/.ssh/config <<< 'Host 127.0.0.1' \
|
tee -a ~/.ssh/config <<< 'Host 127.0.0.1' \
|
||||||
; tee -a ~/.ssh/config <<< ' User user' \
|
; tee -a ~/.ssh/config <<< " User ${USERNAME:=user}" \
|
||||||
; tee -a ~/.ssh/config <<< ' Port 10022' \
|
; tee -a ~/.ssh/config <<< ' Port 10022' \
|
||||||
; tee -a ~/.ssh/config <<< ' IdentityFile ~/.ssh/id_docker_osx' \
|
; tee -a ~/.ssh/config <<< ' IdentityFile ~/.ssh/id_docker_osx' \
|
||||||
; tee -a ~/.ssh/config <<< ' StrictHostKeyChecking no' \
|
; tee -a ~/.ssh/config <<< ' StrictHostKeyChecking no' \
|
||||||
@ -236,7 +277,7 @@ CMD echo "${BOILERPLATE}" \
|
|||||||
&& echo 'Default username: user' \
|
&& echo 'Default username: user' \
|
||||||
&& echo 'Default password: alpine' \
|
&& echo 'Default password: alpine' \
|
||||||
&& echo 'Change it immediately using the command: passwd' \
|
&& echo 'Change it immediately using the command: passwd' \
|
||||||
&& ssh -i ~/.ssh/id_docker_osx user@127.0.0.1 -p 10022 "${OSX_COMMANDS}"
|
&& ssh -i ~/.ssh/id_docker_osx ${USERNAME:=user}@127.0.0.1 -p 10022 "${OSX_COMMANDS}"
|
||||||
|
|
||||||
# username: user
|
# username: user
|
||||||
# password: alpine
|
# password: alpine
|
||||||
|
255
Dockerfile.monterey
Normal file
@ -0,0 +1,255 @@
|
|||||||
|
#!/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
|
@ -7,7 +7,7 @@
|
|||||||
#
|
#
|
||||||
# Title: Docker-OSX (Mac on Docker)
|
# Title: Docker-OSX (Mac on Docker)
|
||||||
# Author: Sick.Codes https://twitter.com/sickcodes
|
# Author: Sick.Codes https://twitter.com/sickcodes
|
||||||
# Version: 4.3
|
# Version: 6.0
|
||||||
# License: GPLv3+
|
# License: GPLv3+
|
||||||
# Repository: https://github.com/sickcodes/Docker-OSX
|
# Repository: https://github.com/sickcodes/Docker-OSX
|
||||||
# Website: https://sick.codes
|
# Website: https://sick.codes
|
||||||
@ -46,21 +46,16 @@ 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 ; } \
|
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/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://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 = http://mirror.rackspace.com/archlinux/$repo/os/$arch' \
|
||||||
&& tee -a /etc/pacman.d/mirrorlist <<< 'Server = https://mirror.rackspace.com/archlinux/$repo/os/$arch' \
|
&& tee -a /etc/pacman.d/mirrorlist <<< 'Server = https://mirror.rackspace.com/archlinux/$repo/os/$arch' \
|
||||||
&& cat /etc/pacman.d/mirrorlist ; fi
|
&& cat /etc/pacman.d/mirrorlist \
|
||||||
|
; fi
|
||||||
# TEMP-FIX for pacman issue
|
|
||||||
RUN patched_glibc=glibc-linux4-2.33-4-x86_64.pkg.tar.zst \
|
|
||||||
&& curl -LO "https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/${patched_glibc}" \
|
|
||||||
&& bsdtar -C / -xvf "${patched_glibc}" || echo "Everything is fine."
|
|
||||||
# TEMP-FIX for pacman issue
|
|
||||||
|
|
||||||
# For taking screenshots of the Xfvb screen, useful during development.
|
# For taking screenshots of the Xfvb screen, useful during development.
|
||||||
ARG SCROT
|
ARG SCROT
|
||||||
@ -82,14 +77,32 @@ RUN pacman -Syu xorg-server-xvfb wget xterm xorg-xhost xorg-xrandr sshpass --noc
|
|||||||
; fi \
|
; fi \
|
||||||
; yes | pacman -Scc
|
; yes | pacman -Scc
|
||||||
|
|
||||||
# TEMP-FIX for pacman issue
|
|
||||||
RUN patched_glibc=glibc-linux4-2.33-4-x86_64.pkg.tar.zst \
|
|
||||||
&& curl -LO "https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/${patched_glibc}" \
|
|
||||||
&& bsdtar -C / -xvf "${patched_glibc}" || echo "Everything is fine."
|
|
||||||
# TEMP-FIX for pacman issue
|
|
||||||
|
|
||||||
USER arch
|
USER arch
|
||||||
|
|
||||||
|
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 \
|
||||||
@ -102,12 +115,25 @@ RUN mkdir -p ~/.ssh \
|
|||||||
&& tee -a ~/.ssh/config <<< ' StrictHostKeyChecking no' \
|
&& tee -a ~/.ssh/config <<< ' StrictHostKeyChecking no' \
|
||||||
&& tee -a ~/.ssh/config <<< ' UserKnownHostsFile=/dev/null'
|
&& tee -a ~/.ssh/config <<< ' UserKnownHostsFile=/dev/null'
|
||||||
|
|
||||||
|
####
|
||||||
|
|
||||||
|
# symlink the old directory, for redundancy
|
||||||
|
RUN ln -s /home/arch/OSX-KVM/OpenCore /home/arch/OSX-KVM/OpenCore-Catalina || true
|
||||||
|
|
||||||
|
####
|
||||||
|
|
||||||
#### SPECIAL RUNTIME ARGUMENTS BELOW
|
#### SPECIAL RUNTIME ARGUMENTS BELOW
|
||||||
|
|
||||||
ENV ADDITIONAL_PORTS=
|
ENV ADDITIONAL_PORTS=
|
||||||
|
|
||||||
|
# add additional QEMU boot arguments
|
||||||
|
ENV BOOT_ARGS=
|
||||||
|
|
||||||
ENV BOOTDISK=
|
ENV BOOTDISK=
|
||||||
|
|
||||||
|
# edit the CPU that is beign emulated
|
||||||
|
ENV CPU=Penryn
|
||||||
|
|
||||||
ENV DISPLAY=:99
|
ENV DISPLAY=:99
|
||||||
|
|
||||||
ENV HEADLESS=false
|
ENV HEADLESS=false
|
||||||
@ -142,17 +168,21 @@ ENV RAM=3
|
|||||||
ENV WIDTH=1920
|
ENV WIDTH=1920
|
||||||
ENV HEIGHT=1080
|
ENV HEIGHT=1080
|
||||||
|
|
||||||
CMD sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" || true \
|
# libguestfs verbose
|
||||||
; sudo chown -R $(id -u):$(id -g) /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" || true \
|
ENV LIBGUESTFS_DEBUG=1
|
||||||
|
ENV LIBGUESTFS_TRACE=1
|
||||||
|
|
||||||
|
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 \
|
||||||
; { [[ "${DISPLAY}" = ':99' ]] || [[ "${HEADLESS}" == true ]] ; } && { \
|
; { [[ "${DISPLAY}" = ':99' ]] || [[ "${HEADLESS}" == true ]] ; } && { \
|
||||||
nohup Xvfb :99 -screen 0 1920x1080x16 \
|
nohup Xvfb :99 -screen 0 1920x1080x16 \
|
||||||
& until [[ "$(xrandr --query 2>/dev/null)" ]]; do sleep 1 ; done \
|
& until [[ "$(xrandr --query 2>/dev/null)" ]]; do sleep 1 ; done \
|
||||||
; } \
|
; } \
|
||||||
; [[ "${NOPICKER}" == true ]] && { \
|
; [[ "${NOPICKER}" == true ]] && { \
|
||||||
sed -i '/^.*InstallMedia.*/d' Launch.sh \
|
sed -i '/^.*InstallMedia.*/d' Launch.sh \
|
||||||
&& export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore-nopicker.qcow2}" \
|
&& export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore-nopicker.qcow2}" \
|
||||||
; } \
|
; } \
|
||||||
|| export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \
|
|| export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
|
||||||
; [[ "${GENERATE_UNIQUE}" == true ]] && { \
|
; [[ "${GENERATE_UNIQUE}" == true ]] && { \
|
||||||
./Docker-OSX/osx-serial-generator/generate-unique-machine-values.sh \
|
./Docker-OSX/osx-serial-generator/generate-unique-machine-values.sh \
|
||||||
--master-plist-url="${MASTER_PLIST_URL}" \
|
--master-plist-url="${MASTER_PLIST_URL}" \
|
||||||
@ -161,9 +191,9 @@ CMD sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" || true
|
|||||||
--bootdisks \
|
--bootdisks \
|
||||||
--width "${WIDTH:-1920}" \
|
--width "${WIDTH:-1920}" \
|
||||||
--height "${HEIGHT:-1080}" \
|
--height "${HEIGHT:-1080}" \
|
||||||
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \
|
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
|
||||||
--output-env "${ENV:=/env}" \
|
--output-env "${ENV:=/env}" \
|
||||||
; } \
|
|| exit 1 ; } \
|
||||||
; [[ "${GENERATE_SPECIFIC}" == true ]] && { \
|
; [[ "${GENERATE_SPECIFIC}" == true ]] && { \
|
||||||
source "${ENV:=/env}" 2>/dev/null \
|
source "${ENV:=/env}" 2>/dev/null \
|
||||||
; ./Docker-OSX/osx-serial-generator/generate-specific-bootdisk.sh \
|
; ./Docker-OSX/osx-serial-generator/generate-specific-bootdisk.sh \
|
||||||
@ -175,6 +205,6 @@ CMD sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" || true
|
|||||||
--mac-address "${MAC_ADDRESS}" \
|
--mac-address "${MAC_ADDRESS}" \
|
||||||
--width "${WIDTH:-1920}" \
|
--width "${WIDTH:-1920}" \
|
||||||
--height "${HEIGHT:-1080}" \
|
--height "${HEIGHT:-1080}" \
|
||||||
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \
|
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2}" \
|
||||||
; } \
|
|| exit 1 ; } \
|
||||||
; ./enable-ssh.sh && /bin/bash -c ./Launch.sh
|
; ./enable-ssh.sh && /bin/bash -c ./Launch.sh
|
||||||
|
256
Dockerfile.naked-auto
Normal file
@ -0,0 +1,256 @@
|
|||||||
|
#!/usr/bin/docker
|
||||||
|
# ____ __ ____ ______ __
|
||||||
|
# / __ \____ _____/ /_____ _____/ __ \/ ___/ |/ /
|
||||||
|
# / / / / __ \/ ___/ //_/ _ \/ ___/ / / /\__ \| /
|
||||||
|
# / /_/ / /_/ / /__/ ,< / __/ / / /_/ /___/ / |
|
||||||
|
# /_____/\____/\___/_/|_|\___/_/ \____//____/_/|_| :NAKED-AUTO
|
||||||
|
#
|
||||||
|
# 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
|
||||||
|
#
|
||||||
|
# This Dockerfile needs you to supply a pre-installed installation of Docker-OSX!
|
||||||
|
#
|
||||||
|
# Visit https://github.com/sickcodes/Docker-OSX for info
|
||||||
|
|
||||||
|
FROM sickcodes/docker-osx:latest
|
||||||
|
|
||||||
|
MAINTAINER 'https://twitter.com/sickcodes' <https://sick.codes>
|
||||||
|
|
||||||
|
USER root
|
||||||
|
|
||||||
|
WORKDIR /root
|
||||||
|
|
||||||
|
RUN rm -f /home/arch/OSX-KVM/mac_hdd_ng.img
|
||||||
|
|
||||||
|
# For taking screenshots of the Xfvb screen, useful during development.
|
||||||
|
ARG SCROT
|
||||||
|
|
||||||
|
# OPTIONAL: Arch Linux server mirrors for super fast builds
|
||||||
|
# set RANKMIRRORS to any value other that nothing, e.g. -e RANKMIRRORS=true
|
||||||
|
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" \
|
||||||
|
; 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
|
||||||
|
|
||||||
|
# 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 \
|
||||||
|
&& if [[ "${SCROT}" ]]; then \
|
||||||
|
pacman -Syu scrot base-devel --noconfirm \
|
||||||
|
&& git clone --recurse-submodules --depth 1 https://github.com/stolk/imcat.git \
|
||||||
|
&& cd imcat \
|
||||||
|
&& make \
|
||||||
|
&& sudo cp imcat /usr/bin/imcat \
|
||||||
|
&& touch /usr/bin/scrotcat \
|
||||||
|
&& tee -a /usr/bin/scrotcat <<< '/usr/bin/imcat <(scrot -o /dev/stdout)' \
|
||||||
|
&& chmod +x /usr/bin/scrotcat \
|
||||||
|
; else \
|
||||||
|
touch /usr/bin/scrotcat \
|
||||||
|
&& echo echo >> /usr/bin/scrotcat \
|
||||||
|
&& chmod +x /usr/bin/scrotcat \
|
||||||
|
; fi \
|
||||||
|
; 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 \
|
||||||
|
&& touch ~/.ssh/authorized_keys \
|
||||||
|
&& touch ~/.ssh/config \
|
||||||
|
&& chmod 700 ~/.ssh \
|
||||||
|
&& chmod 600 ~/.ssh/config \
|
||||||
|
&& chmod 600 ~/.ssh/authorized_keys \
|
||||||
|
&& tee -a ~/.ssh/config <<< 'Host *' \
|
||||||
|
&& tee -a ~/.ssh/config <<< ' StrictHostKeyChecking no' \
|
||||||
|
&& tee -a ~/.ssh/config <<< ' UserKnownHostsFile=/dev/null'
|
||||||
|
|
||||||
|
ARG COMPLETE=
|
||||||
|
|
||||||
|
# use the COMPLETE arg, for a complete image, ready to boot.
|
||||||
|
# otherwise use your own image: -v "$PWD/disk.img":/image
|
||||||
|
ARG WGET_OPTIONS=
|
||||||
|
# ARG WGET_OPTIONS='--no-verbose'
|
||||||
|
|
||||||
|
# Feel free to take a copy of this image and then host it internally
|
||||||
|
ARG IMAGE_URL=
|
||||||
|
# ARG IMAGE_URL='https://images.sick.codes/mac_hdd_ng_auto_big_sur.img'
|
||||||
|
|
||||||
|
RUN if [[ "${COMPLETE}" ]]; then \
|
||||||
|
echo "Downloading your image... This step might take a while... Press Ctrl+C if you want to abort." \
|
||||||
|
; rm -f /home/arch/OSX-KVM/mac_hdd_ng.img \
|
||||||
|
&& wget ${WGET_OPTIONS} -O /home/arch/OSX-KVM/mac_hdd_ng.img "${IMAGE_URL}" \
|
||||||
|
; fi
|
||||||
|
|
||||||
|
####
|
||||||
|
|
||||||
|
# symlink the old directory, for redundancy
|
||||||
|
RUN ln -s /home/arch/OSX-KVM/OpenCore /home/arch/OSX-KVM/OpenCore-Catalina || true
|
||||||
|
|
||||||
|
####
|
||||||
|
|
||||||
|
#### SPECIAL RUNTIME ARGUMENTS BELOW
|
||||||
|
|
||||||
|
ENV ADDITIONAL_PORTS=
|
||||||
|
|
||||||
|
# add additional QEMU boot arguments
|
||||||
|
ENV BOOT_ARGS=
|
||||||
|
|
||||||
|
ENV BOOTDISK=
|
||||||
|
|
||||||
|
# edit the CPU that is beign emulated
|
||||||
|
ENV CPU=Penryn
|
||||||
|
|
||||||
|
ENV DISPLAY=:99
|
||||||
|
|
||||||
|
ENV HEADLESS=false
|
||||||
|
|
||||||
|
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=/image
|
||||||
|
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
|
||||||
|
|
||||||
|
ENV NOPICKER=true
|
||||||
|
|
||||||
|
# set the username and password for automatically logging in
|
||||||
|
ENV USERNAME=user
|
||||||
|
ENV PASSWORD=alpine
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
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}" \
|
||||||
|
; [[ "${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 \
|
||||||
|
; 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 ; } \
|
||||||
|
; { [[ "${DISPLAY}" = ':99' ]] || [[ "${HEADLESS}" == true ]] ; } && { \
|
||||||
|
nohup Xvfb :99 -screen 0 1920x1080x16 \
|
||||||
|
& until [[ "$(xrandr --query 2>/dev/null)" ]]; do sleep 1 ; done \
|
||||||
|
; } \
|
||||||
|
; stat "${IMAGE_PATH}" \
|
||||||
|
; echo "Large image is being copied between layers, please wait a minute..." \
|
||||||
|
; ./enable-ssh.sh \
|
||||||
|
; [[ -e ~/.ssh/id_docker_osx ]] || { \
|
||||||
|
/usr/bin/ssh-keygen -t rsa -f ~/.ssh/id_docker_osx -q -N "" \
|
||||||
|
&& chmod 600 ~/.ssh/id_docker_osx \
|
||||||
|
; } \
|
||||||
|
; /bin/bash -c ./Launch.sh \
|
||||||
|
& echo "Booting Docker-OSX in the background. Please wait..." \
|
||||||
|
; until [[ "$(sshpass -p${PASSWORD:=alpine} ssh-copy-id -f -i ~/.ssh/id_docker_osx.pub -p 10022 ${USERNAME:=user}@127.0.0.1)" ]]; do \
|
||||||
|
echo "Disk is being copied between layers. Repeating until able to copy SSH key into OSX..." \
|
||||||
|
; sleep 1 \
|
||||||
|
; done \
|
||||||
|
; grep id_docker_osx ~/.ssh/config || { \
|
||||||
|
tee -a ~/.ssh/config <<< 'Host 127.0.0.1' \
|
||||||
|
; tee -a ~/.ssh/config <<< " User ${USERNAME:=user}" \
|
||||||
|
; tee -a ~/.ssh/config <<< ' Port 10022' \
|
||||||
|
; tee -a ~/.ssh/config <<< ' IdentityFile ~/.ssh/id_docker_osx' \
|
||||||
|
; tee -a ~/.ssh/config <<< ' StrictHostKeyChecking no' \
|
||||||
|
; tee -a ~/.ssh/config <<< ' UserKnownHostsFile=/dev/null' \
|
||||||
|
; } \
|
||||||
|
&& ssh -i ~/.ssh/id_docker_osx ${USERNAME:=user}@127.0.0.1 -p 10022 "${OSX_COMMANDS}"
|
754
README.md
@ -2,7 +2,26 @@
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
Run Mac OS X in Docker with near-native performance! X11 Forwarding! iMessage security research!
|
Run Mac OS X in Docker with near-native performance! X11 Forwarding! iMessage security research! iPhone USB working! macOS in a Docker container!
|
||||||
|
|
||||||
|
Conduct Security Research on macOS using both Linux & Windows!
|
||||||
|
|
||||||
|
# Docker-OSX now has a Discord server & Telegram!
|
||||||
|
|
||||||
|
The Discord is active on #docker-osx and anyone is welcome to come and ask questions, ideas, etc.
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<a href="https://hub.docker.com/r/sickcodes/docker-osx"><img src="https://dockeri.co/image/sickcodes/docker-osx"/></a><a href="https://discord.gg/sickchat"><a href="https://discord.gg/sickchat" target="_blank"><img src="https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/discord-logo.svg"></a></a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
### Click to join the Discord server [https://discord.gg/sickchat](https://discord.gg/sickchat)
|
||||||
|
|
||||||
|
### Click to join the Telegram server [https://t.me/sickcodeschat](https://t.me/sickcodeschat)
|
||||||
|
|
||||||
|
Or reach out via Linkedin if it's private: [https://www.linkedin.com/in/sickcodes](https://www.linkedin.com/in/sickcodes)
|
||||||
|
|
||||||
|
Or via [https://sick.codes/contact/](https://sick.codes/contact/)
|
||||||
|
|
||||||
## Author
|
## Author
|
||||||
|
|
||||||
@ -12,16 +31,29 @@ Additional credits can be found here: https://github.com/sickcodes/Docker-OSX/bl
|
|||||||
|
|
||||||
Additionally, comprehensive list of all contributors can be found here: https://github.com/sickcodes/Docker-OSX/graphs/contributors
|
Additionally, comprehensive list of all contributors can be found here: https://github.com/sickcodes/Docker-OSX/graphs/contributors
|
||||||
|
|
||||||
Special thanks to [@kholia](https://twitter.com/kholia) for maintaining the upstream project, which Docker-OSX is built on top of: [OSX-KVM](https://github.com/kholia/OSX-KVM).
|
Big thanks to [@kholia](https://twitter.com/kholia) for maintaining the upstream project, which Docker-OSX is built on top of: [OSX-KVM](https://github.com/kholia/OSX-KVM).
|
||||||
|
|
||||||
Big thanks to the OpenCore team over at: https://github.com/acidanthera/OpenCorePkg. Their well-maintained bootloader provides much of the great functionality that Docker-OSX users enjoy :)
|
Also special thanks to [@thenickdude](https://github.com/thenickdude) who maintains the valuable fork [KVM-OpenCore](https://github.com/thenickdude/KVM-Opencore), which was started by [@Leoyzen](https://github.com/Leoyzen/)!
|
||||||
|
|
||||||
|
Extra special thanks to the OpenCore team over at: https://github.com/acidanthera/OpenCorePkg. Their well-maintained bootloader provides much of the great functionality that Docker-OSX users enjoy :)
|
||||||
|
|
||||||
If you like this project, consider contributing here or upstream!
|
If you like this project, consider contributing here or upstream!
|
||||||
|
|
||||||
## Quick Start Docker-OSX
|
## Quick Start Docker-OSX
|
||||||
|
|
||||||
|
Video setup tutorial is also available here: https://www.youtube.com/watch?v=wLezYl77Ll8
|
||||||
|
|
||||||
|
**Windows users:** [click here to see the notes below](#id-like-to-run-docker-osx-on-windows)!
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<a href="https://www.youtube.com/watch?v=wLezYl77Ll8" target="_blank"><img src="https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/Youtube-Screenshot-Docker-OSX-Setup.png"></a>
|
||||||
|
</p>
|
||||||
|
|
||||||
First time here? try [initial setup](#initial-setup), otherwise try the instructions below to use either Catalina or Big Sur.
|
First time here? try [initial setup](#initial-setup), otherwise try the instructions below to use either Catalina or Big Sur.
|
||||||
|
|
||||||
|
## Any questions, ideas, or just want to hang out?
|
||||||
|
# [https://discord.gg/sickchat](https://discord.gg/sickchat)
|
||||||
|
|
||||||
### Catalina [](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
### Catalina [](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@ -31,6 +63,8 @@ docker run -it \
|
|||||||
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
||||||
-e "DISPLAY=${DISPLAY:-:0.0}" \
|
-e "DISPLAY=${DISPLAY:-:0.0}" \
|
||||||
sickcodes/docker-osx:latest
|
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 [](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||||
|
|
||||||
@ -41,29 +75,285 @@ docker run -it \
|
|||||||
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
||||||
-e "DISPLAY=${DISPLAY:-:0.0}" \
|
-e "DISPLAY=${DISPLAY:-:0.0}" \
|
||||||
sickcodes/docker-osx:big-sur
|
sickcodes/docker-osx:big-sur
|
||||||
|
|
||||||
|
# docker build -t docker-osx --build-arg SHORTNAME=big-sur .
|
||||||
```
|
```
|
||||||
|
|
||||||
## Technical details
|
### Monterey [](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||||
|
|
||||||
There currently four images, each with different use cases (explained [below](#container-images)):
|
```bash
|
||||||
|
|
||||||
[](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
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:monterey
|
||||||
|
|
||||||
|
# docker build -t docker-osx --build-arg SHORTNAME=monterey .
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 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.
|
||||||
|
docker pull sickcodes/docker-osx:auto
|
||||||
|
|
||||||
|
# boot directly into a real OS X shell with a visual display [NOT HEADLESS]
|
||||||
|
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 \
|
||||||
|
sickcodes/docker-osx:auto
|
||||||
|
|
||||||
|
# username is user
|
||||||
|
# passsword is alpine
|
||||||
|
```
|
||||||
|
|
||||||
|
### Older Systems
|
||||||
|
|
||||||
|
### High Sierra [](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}" \
|
||||||
|
sickcodes/docker-osx:high-sierra
|
||||||
|
|
||||||
|
# docker build -t docker-osx --build-arg SHORTNAME=high-sierra .
|
||||||
|
```
|
||||||
|
|
||||||
|
### Mojave [](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}" \
|
||||||
|
sickcodes/docker-osx:mojave
|
||||||
|
|
||||||
|
# docker build -t docker-osx --build-arg SHORTNAME=mojave .
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#### Download the image manually and use it in Docker
|
||||||
|
|
||||||
[](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
[](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||||
|
|
||||||
|
|
||||||
|
This is a particularly good way for downloading the container, in case Docker's CDN (or your connection) happens to be slow.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
wget https://images2.sick.codes/mac_hdd_ng_auto.img
|
||||||
|
|
||||||
|
docker run -it \
|
||||||
|
--device /dev/kvm \
|
||||||
|
-p 50922:10022 \
|
||||||
|
-v "${PWD}/mac_hdd_ng_auto.img:/image" \
|
||||||
|
-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/Docker-OSX/master/custom/config-nopicker-custom.plist \
|
||||||
|
sickcodes/docker-osx:naked
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
#### 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)
|
||||||
|
|
||||||
|
|
||||||
|
Enable SSH in network sharing inside the guest first. Change `-e "USERNAME=user"` and `-e "PASSWORD=password"` to your credentials. The container will add itself to `~/.ssh/authorized_keys`
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
docker run -it \
|
||||||
|
--device /dev/kvm \
|
||||||
|
-p 50922:10022 \
|
||||||
|
-v "${PWD}/mac_hdd_ng_auto.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 \
|
||||||
|
sickcodes/docker-osx:naked-auto
|
||||||
|
```
|
||||||
|
|
||||||
|
# (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)
|
||||||
|
|
||||||
|
# (USBFLUXD) iPhone USB -> Network style passthrough OSX-KVM Docker-OSX
|
||||||
|
|
||||||
|
This method WORKS on laptop, PC, anything!
|
||||||
|
|
||||||
|
Thank you [@nikias](https://github.com/nikias) for [usbfluxd](https://github.com/corellium/usbfluxd) via [https://github.com/corellium](https://github.com/corellium)!
|
||||||
|
|
||||||
|
**This is done inside Linux.**
|
||||||
|
|
||||||
|
Open 3 terminals on Linux
|
||||||
|
|
||||||
|
Connecting your device over USB on Linux allows you to expose `usbmuxd` on port `5000` using [https://github.com/corellium/usbfluxd](https://github.com/corellium/usbfluxd) to another system on the same network.
|
||||||
|
|
||||||
|
Ensure `usbmuxd`, `socat` and `usbfluxd` are installed.
|
||||||
|
|
||||||
|
`sudo pacman -S libusbmuxd usbmuxd avahi socat`
|
||||||
|
|
||||||
|
Available on the AUR: [https://aur.archlinux.org/packages/usbfluxd/](https://aur.archlinux.org/packages/usbfluxd/)
|
||||||
|
|
||||||
|
`yay usbfluxd`
|
||||||
|
|
||||||
|
Plug in your iPhone or iPad.
|
||||||
|
|
||||||
|
Terminal 1
|
||||||
|
```bash
|
||||||
|
sudo systemctl start usbmuxd
|
||||||
|
sudo avahi-daemon
|
||||||
|
```
|
||||||
|
|
||||||
|
Terminal 2:
|
||||||
|
```bash
|
||||||
|
# on host
|
||||||
|
sudo systemctl restart usbmuxd
|
||||||
|
sudo socat tcp-listen:5000,fork unix-connect:/var/run/usbmuxd
|
||||||
|
```
|
||||||
|
|
||||||
|
Terminal 3:
|
||||||
|
```bash
|
||||||
|
sudo usbfluxd -f -n
|
||||||
|
```
|
||||||
|
|
||||||
|
### Connect to a host running usbfluxd
|
||||||
|
|
||||||
|
**This is done inside macOS.**
|
||||||
|
|
||||||
|
Install homebrew.
|
||||||
|
|
||||||
|
`172.17.0.1` is usually the Docker bridge IP, which is your PC, but you can use any IP from `ip addr`...
|
||||||
|
|
||||||
|
macOS Terminal:
|
||||||
|
```zsh
|
||||||
|
# on the guest
|
||||||
|
brew install make automake autoconf libtool pkg-config gcc libimobiledevice usbmuxd
|
||||||
|
|
||||||
|
git clone https://github.com/corellium/usbfluxd.git
|
||||||
|
cd usbfluxd
|
||||||
|
|
||||||
|
./autogen.sh
|
||||||
|
make
|
||||||
|
sudo make install
|
||||||
|
```
|
||||||
|
|
||||||
|
Accept the USB over TCP connection, and appear as local:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# on the guest
|
||||||
|
sudo launchctl start usbmuxd
|
||||||
|
export PATH=/usr/local/sbin:${PATH}
|
||||||
|
sudo usbfluxd -f -r 172.17.0.1:5000
|
||||||
|
```
|
||||||
|
|
||||||
|
Close apps such as Xcode and reopen them and your device should appear!
|
||||||
|
|
||||||
|
*If you need to start again on Linux, wipe the current usbfluxd, usbmuxd, and socat:*
|
||||||
|
```bash
|
||||||
|
sudo killall usbfluxd
|
||||||
|
sudo systemctl restart usbmuxd
|
||||||
|
sudo killall socat
|
||||||
|
```
|
||||||
|
|
||||||
|
## Make container FASTER using [https://github.com/sickcodes/osx-optimizer](https://github.com/sickcodes/osx-optimizer)
|
||||||
|
|
||||||
|
SEE commands in [https://github.com/sickcodes/osx-optimizer](https://github.com/sickcodes/osx-optimizer)!
|
||||||
|
|
||||||
|
- Skip the GUI login screen (at your own risk!)
|
||||||
|
- Disable spotlight indexing on macOS to heavily speed up Virtual Instances.
|
||||||
|
- Disable heavy login screen wallpaper
|
||||||
|
- Disable updates (at your own risk!)
|
||||||
|
|
||||||
|
## Important notices:
|
||||||
|
|
||||||
|
**2021-11-14** - Added High Sierra, Mojave
|
||||||
|
|
||||||
|
Pick one of these while **building**, irrelevant when using docker pull:
|
||||||
|
```
|
||||||
|
--build-arg SHORTNAME=high-sierra
|
||||||
|
--build-arg SHORTNAME=mojave
|
||||||
|
--build-arg SHORTNAME=catalina
|
||||||
|
--build-arg SHORTNAME=big-sur
|
||||||
|
--build-arg SHORTNAME=monterey
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Technical details
|
||||||
|
|
||||||
|
There currently multiple images, each with different use cases (explained [below](#container-images)):
|
||||||
|
|
||||||
|
- High Sierra
|
||||||
|
- Mojave
|
||||||
|
- Catalina
|
||||||
|
- Big Sur
|
||||||
|
- Monterey
|
||||||
|
- Auto (pre-made Catalina)
|
||||||
|
- Naked (use your own .img)
|
||||||
|
- Naked-Auto (user your own .img and SSH in)
|
||||||
|
|
||||||
|
High Sierra:
|
||||||
|
|
||||||
|
[](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)
|
||||||
|
|
||||||
|
Catalina:
|
||||||
|
|
||||||
|
[](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||||
|
|
||||||
|
Big-Sur:
|
||||||
|
|
||||||
[](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
[](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||||
|
|
||||||
|
Monterey 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)
|
[](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||||
|
|
||||||
This special set of images was developed by [Sick.Codes](https://sick.codes).
|
Naked: Bring-your-own-image setup (use any of the above first):
|
||||||
|
|
||||||
The images (excluding `:naked`) launch a container with an existing installation with a couple of premade configurations:
|
[](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||||
- username: `user`, password: `alpine`
|
|
||||||
|
Naked Auto: same as above but with `-e USERNAME` & `-e PASSWORD` and `-e OSX_COMMANDS="put your commands here"`
|
||||||
|
|
||||||
|
[](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||||
|
|
||||||
|
## Capabilities
|
||||||
|
- use iPhone OSX KVM on Linux using [usbfluxd](https://github.com/corellium/usbfluxd)!
|
||||||
|
- macOS Monterey VM on Linux!
|
||||||
|
- Folder sharing-
|
||||||
|
- USB passthrough (hotplug too)
|
||||||
- SSH enabled (`localhost:50922`)
|
- SSH enabled (`localhost:50922`)
|
||||||
- VNC enabled (`localhost:8888`) if using ./vnc version
|
- VNC enabled (`localhost:8888`) if using ./vnc version
|
||||||
- VNC enabled (`localhost:8888`) if using ./vnc version
|
- iMessage security research via [serial number generator!](https://github.com/sickcodes/osx-serial-generator)
|
||||||
- auto-updates disabled
|
|
||||||
- [serial number generator!](https://github.com/sickcodes/osx-serial-generator)
|
|
||||||
- X11 forwarding is enabled
|
- X11 forwarding is enabled
|
||||||
- runs on top of QEMU + KVM
|
- runs on top of QEMU + KVM
|
||||||
- supports Big Sur, custom images, Xvfb headless mode
|
- supports Big Sur, custom images, Xvfb headless mode
|
||||||
@ -71,9 +361,9 @@ The images (excluding `:naked`) launch a container with an existing installation
|
|||||||
|
|
||||||
### Requirements
|
### Requirements
|
||||||
|
|
||||||
- 20GB disk space for bare minimum installation
|
- 20GB+++ disk space for bare minimum installation (50GB if using Xcode)
|
||||||
- virtualization should be enabled in your BIOS settings
|
- virtualization should be enabled in your BIOS settings
|
||||||
- a kvm-capable host
|
- a x86_64 kvm-capable host
|
||||||
- at least 50 GBs for `:auto` (half for the base image, half for your runtime image
|
- at least 50 GBs for `:auto` (half for the base image, half for your runtime image
|
||||||
|
|
||||||
### TODO
|
### TODO
|
||||||
@ -127,8 +417,10 @@ In case you're interested, contact [@sickcodes on Twitter](https://twitter.com/s
|
|||||||
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 iOS in a Docker container with Docker-eyeOS](https://github.com/sickcodes/Docker-eyeOS) - [https://github.com/sickcodes/Docker-eyeOS](https://github.com/sickcodes/Docker-eyeOS)
|
- [Run Android fully native on the host!](https://github.com/sickcodes/droid-native)
|
||||||
|
- [Run iOS 12 in a Docker container with Docker-eyeOS](https://github.com/sickcodes/Docker-eyeOS) - [https://github.com/sickcodes/Docker-eyeOS](https://github.com/sickcodes/Docker-eyeOS)
|
||||||
|
- [Run iMessage relayer in Docker with Bluebubbles.app](https://bluebubbles.app/) - [Getting started wiki](https://github.com/BlueBubblesApp/BlueBubbles-Server/wiki/Running-via-Docker)
|
||||||
|
|
||||||
## Disclaimer
|
## Disclaimer
|
||||||
|
|
||||||
@ -148,11 +440,15 @@ There are several different Docker-OSX images available which are suitable for d
|
|||||||
- `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)
|
||||||
- `sickcodes/docker-osx:naked` - [I want to use Docker-OSX for CI/CD-related purposes (sign into Xcode, Transporter)](#building-a-headless-container-from-a-custom-image)
|
- `sickcodes/docker-osx:naked` - [I want to use Docker-OSX for CI/CD-related purposes (sign into Xcode, Transporter)](#building-a-headless-container-from-a-custom-image)
|
||||||
|
|
||||||
Create your personal image using `:latest`. Then, extract the image. Afterwards, you will be able to duplicate that image and import it to the `:naked` container, in order to revert the container to a previous state repeatedly.
|
Create your personal image using `:latest` or `big-sur`. Then, pull the image out the image. Afterwards, you will be able to duplicate that image and import it to the `:naked` container, in order to revert the container to a previous state repeatedly.
|
||||||
|
|
||||||
- `sickcodes/docker-osx:auto` - [I'm only interested in using the command line (useful for compiling software or using Homebrew headlessly).](#prebuilt-image-with-arbitrary-command-line-arguments)
|
- `sickcodes/docker-osx:auto` - [I'm only interested in using the command line (useful for compiling software or using Homebrew headlessly).](#prebuilt-image-with-arbitrary-command-line-arguments)
|
||||||
- `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:high-sierra` - I want to run High Sierra.
|
||||||
|
- `sickcodes/docker-osx:mojave` - I want to run Mojave.
|
||||||
|
|
||||||
## Initial setup
|
## Initial setup
|
||||||
Before you do anything else, you will need to turn on hardware virtualization in your BIOS. Precisely how will depend on your particular machine (and BIOS), but it should be straightforward.
|
Before you do anything else, you will need to turn on hardware virtualization in your BIOS. Precisely how will depend on your particular machine (and BIOS), but it should be straightforward.
|
||||||
@ -164,7 +460,7 @@ Then, you'll need QEMU and some other dependencies on your host:
|
|||||||
sudo pacman -S qemu libvirt dnsmasq virt-manager bridge-utils flex bison iptables-nft edk2-ovmf
|
sudo pacman -S qemu libvirt dnsmasq virt-manager bridge-utils flex bison iptables-nft edk2-ovmf
|
||||||
|
|
||||||
# UBUNTU DEBIAN
|
# UBUNTU DEBIAN
|
||||||
sudo apt install qemu qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils virt-manager
|
sudo apt install qemu qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils virt-manager libguestfs-tools
|
||||||
|
|
||||||
# CENTOS RHEL FEDORA
|
# CENTOS RHEL FEDORA
|
||||||
sudo yum install libvirt qemu-kvm
|
sudo yum install libvirt qemu-kvm
|
||||||
@ -181,9 +477,33 @@ echo 1 | sudo tee /sys/module/kvm/parameters/ignore_msrs
|
|||||||
sudo modprobe kvm
|
sudo modprobe kvm
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### I'd like to run Docker-OSX on Windows
|
||||||
|
|
||||||
|
Running Docker-OSX on Windows is now possible using WSL2 (Windows + Ubuntu Subsystem!).
|
||||||
|
|
||||||
|
Ensure KVM is enabled (Windows 11 is required) and `x11-apps` is installed.
|
||||||
|
|
||||||
|
First, setup [Docker for Windows following the official Docker guide](https://docs.docker.com/desktop/windows/wsl/#download).
|
||||||
|
|
||||||
|
You need the official Docker Desktop exe: [https://desktop.docker.com/win/main/amd64/Docker%20Desktop%20Installer.exe](https://desktop.docker.com/win/main/amd64/Docker%20Desktop%20Installer.exe).
|
||||||
|
|
||||||
|
#### Using WSLg (WSL GUI which includes Wayland or X applications to run)
|
||||||
|
|
||||||
|
[https://github.com/microsoft/wslg](https://github.com/microsoft/wslg)
|
||||||
|
|
||||||
|
To use WSLg's built in X11 server, change these two lines to point Docker-OSX to it.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
-e "DISPLAY=${DISPLAY:-:0}" \
|
||||||
|
-v /mnt/wslg/.X11-unix:/tmp/.X11-unix \
|
||||||
|
```
|
||||||
|
|
||||||
|
See more in-depth discussion about Docker-OSX on Windows [here](https://github.com/sickcodes/Docker-OSX/issues/17) and [here](https://github.com/sickcodes/Docker-OSX/issues/60).
|
||||||
|
|
||||||
|
|
||||||
## 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)
|
||||||
|
|
||||||
- Boot the macOS Base System
|
- Boot the macOS Base System (Press Enter)
|
||||||
|
|
||||||
- Click `Disk Utility`
|
- Click `Disk Utility`
|
||||||
|
|
||||||
@ -194,6 +514,8 @@ sudo modprobe kvm
|
|||||||
|
|
||||||
- Click `Reinstall macOS`
|
- Click `Reinstall macOS`
|
||||||
|
|
||||||
|
- The system may require multiple reboots during installation
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
### Routine checks
|
### Routine checks
|
||||||
@ -208,7 +530,45 @@ More specific/advanced troubleshooting questions and answers may be found in [Mo
|
|||||||
|
|
||||||
See [initial setup](#initial-setup).
|
See [initial setup](#initial-setup).
|
||||||
|
|
||||||
#### Confirm your user is part of the the Docker group, KVM group, libvirt group
|
|
||||||
|
|
||||||
|
#### Docker Unknown Server OS error
|
||||||
|
|
||||||
|
```console
|
||||||
|
docker: unknown server OS: .
|
||||||
|
See 'docker run --help'.
|
||||||
|
```
|
||||||
|
|
||||||
|
This means your docker daemon is not running.
|
||||||
|
|
||||||
|
`pgrep dockerd` should return nothing
|
||||||
|
|
||||||
|
Therefore, you have a few choices.
|
||||||
|
|
||||||
|
`sudo dockerd` for foreground Docker usage. I use this.
|
||||||
|
|
||||||
|
Or
|
||||||
|
|
||||||
|
`sudo systemctl --start dockerd` to start dockerd this now.
|
||||||
|
|
||||||
|
Or
|
||||||
|
|
||||||
|
`sudo systemctl --enable --now dockerd` for start dockerd on every reboot, and now.
|
||||||
|
|
||||||
|
|
||||||
|
#### Use more CPU Cores/SMP
|
||||||
|
|
||||||
|
This will use all available cores; adjust accordingly to the day of the week:
|
||||||
|
|
||||||
|
```
|
||||||
|
-e CPU_STRING=$(nproc) \
|
||||||
|
```
|
||||||
|
|
||||||
|
This will use `-smp $(nproc)`
|
||||||
|
|
||||||
|
### Confirm your user is part of the the Docker group, KVM group, libvirt group
|
||||||
|
|
||||||
|
#### Add yourself to the Docker group
|
||||||
|
|
||||||
If you use `sudo dockerd` or dockerd is controlled by systemd/systemctl, then you must be in the Docker group.
|
If you use `sudo dockerd` or dockerd is controlled by systemd/systemctl, then you must be in the Docker group.
|
||||||
If you are not in the Docker group:
|
If you are not in the Docker group:
|
||||||
@ -228,17 +588,17 @@ See also: [initial setup](#initial-setup).
|
|||||||
#### Is the docker daemon enabled?
|
#### Is the docker daemon enabled?
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
# run ad hoc
|
||||||
|
sudo dockerd
|
||||||
|
|
||||||
|
# or daemonize it
|
||||||
|
sudo nohup dockerd &
|
||||||
|
|
||||||
# enable it in systemd (it will persist across reboots this way)
|
# enable it in systemd (it will persist across reboots this way)
|
||||||
sudo systemctl enable --now docker
|
sudo systemctl enable --now docker
|
||||||
|
|
||||||
# or just start it as your user with systemd instead of enabling it
|
# or just start it as your user with systemd instead of enabling it
|
||||||
systemctl start docker
|
systemctl start docker
|
||||||
|
|
||||||
# or run ad hoc
|
|
||||||
sudo dockerd
|
|
||||||
|
|
||||||
# or daemonize it
|
|
||||||
sudo nohup dockerd &
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## More Questions and Answers
|
## More Questions and Answers
|
||||||
@ -247,51 +607,6 @@ Big thank you to our contributors who have worked out almost every conceivable i
|
|||||||
|
|
||||||
[https://github.com/sickcodes/Docker-OSX/blob/master/CREDITS.md](https://github.com/sickcodes/Docker-OSX/blob/master/CREDITS.md)
|
[https://github.com/sickcodes/Docker-OSX/blob/master/CREDITS.md](https://github.com/sickcodes/Docker-OSX/blob/master/CREDITS.md)
|
||||||
|
|
||||||
### The big-sur image starts slowly after installation. Is this expected?
|
|
||||||
|
|
||||||
Automatic updates are still on in the container's settings. You may wish to turn them off. [We have future plans for development around this.](https://github.com/sickcodes/Docker-OSX/issues/227)
|
|
||||||
|
|
||||||
### What is `${DISPLAY:-:0.0}`?
|
|
||||||
|
|
||||||
`$DISPLAY` is the shell variable that refers to your X11 display server.
|
|
||||||
|
|
||||||
`${DISPLAY}` is the same, but allows you to join variables like this:
|
|
||||||
|
|
||||||
- e.g. `${DISPLAY}_${DISPLAY}` would print `:0.0_:0.0`
|
|
||||||
- e.g. `$DISPLAY_$DISPLAY` would print `:0.0`
|
|
||||||
|
|
||||||
...because `$DISPLAY_` is not `$DISPLAY`
|
|
||||||
|
|
||||||
`${variable:-fallback}` allows you to set a "fallback" variable to be substituted if `$variable` is not set.
|
|
||||||
|
|
||||||
You can also use `${variable:=fallback}` to set that variable (in your current terminal).
|
|
||||||
|
|
||||||
In Docker-OSX, we assume, `:0.0` is your default `$DISPLAY` variable.
|
|
||||||
|
|
||||||
You can see what yours is
|
|
||||||
|
|
||||||
```bash
|
|
||||||
echo $DISPLAY
|
|
||||||
```
|
|
||||||
|
|
||||||
That way, `${DISPLAY:-:0.0}` will use whatever variable your X11 server has set for you, else `:0.0`
|
|
||||||
|
|
||||||
### What is `-v /tmp/.X11-unix:/tmp/.X11-unix`?
|
|
||||||
|
|
||||||
`-v` is a Docker command-line option that lets you pass a volume to the container.
|
|
||||||
|
|
||||||
The directory that we are letting the Docker container use is a X server display socket.
|
|
||||||
|
|
||||||
`/tmp/.X11-unix`
|
|
||||||
|
|
||||||
If we let the Docker container use the same display socket as our own environment, then any applications you run inside the Docker container will show up on your screen too! [https://www.x.org/archive/X11R6.8.0/doc/RELNOTES5.html](https://www.x.org/archive/X11R6.8.0/doc/RELNOTES5.html)
|
|
||||||
|
|
||||||
### ALSA errors on startup or container creation
|
|
||||||
|
|
||||||
You may when initialising or booting into a container see errors from the `(qemu)` console of the following form:
|
|
||||||
`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).
|
|
||||||
|
|
||||||
### Start the same container later (persistent disk)
|
### Start the same container later (persistent disk)
|
||||||
|
|
||||||
@ -333,7 +648,7 @@ docker ps -a
|
|||||||
docker start -ai -i <Replace this with your ID>
|
docker start -ai -i <Replace this with your ID>
|
||||||
```
|
```
|
||||||
|
|
||||||
### LibGTK errors
|
### LibGTK errors "connection refused"
|
||||||
|
|
||||||
You may see one or more libgtk-related errors if you do not have everything set up for hardware virtualisation yet. If you have not yet done so, check out the [initial setup](#initial-setup) section and the [routine checks](#routine-checks) section as you may have missed a setup step or may not have all the needed Docker dependencies ready to go.
|
You may see one or more libgtk-related errors if you do not have everything set up for hardware virtualisation yet. If you have not yet done so, check out the [initial setup](#initial-setup) section and the [routine checks](#routine-checks) section as you may have missed a setup step or may not have all the needed Docker dependencies ready to go.
|
||||||
|
|
||||||
@ -489,6 +804,107 @@ nano /etc/sysctl.conf || vi /etc/sysctl.conf || vim /etc/sysctl.conf
|
|||||||
# now reboot
|
# now reboot
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Share folder with Docker-OSX QEMU macOS
|
||||||
|
|
||||||
|
Sharing a folder with guest is quite simple.
|
||||||
|
|
||||||
|
Your folder, will go to /mnt/hostshare inside the Arch container which is then passed over QEMU.
|
||||||
|
|
||||||
|
Then mount using `sudo -S mount_9p hostshare` from inside the mac.
|
||||||
|
|
||||||
|
For example,
|
||||||
|
|
||||||
|
```bash
|
||||||
|
FOLDER=~/somefolder
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
-v "${FOLDER}:/mnt/hostshare" \
|
||||||
|
-e EXTRA="-virtfs local,path=/mnt/hostshare,mount_tag=hostshare,security_model=passthrough,id=hostshare" \
|
||||||
|
```
|
||||||
|
|
||||||
|
Full example:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# stat mac_hdd_ng.img
|
||||||
|
SHARE=~/somefolder
|
||||||
|
|
||||||
|
docker run -it \
|
||||||
|
--device /dev/kvm \
|
||||||
|
-p 50922:10022 \
|
||||||
|
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
||||||
|
-e "DISPLAY=${DISPLAY:-:0.0}" \
|
||||||
|
-v "${PWD}/mac_hdd_ng.img:/home/arch/OSX-KVM/mac_hdd_ng.img" \
|
||||||
|
-v "${SHARE}:/mnt/hostshare" \
|
||||||
|
-e EXTRA="-virtfs local,path=/mnt/hostshare,mount_tag=hostshare,security_model=passthrough,id=hostshare" \
|
||||||
|
sickcodes/docker-osx:latest
|
||||||
|
|
||||||
|
# !!! Open Terminal inside macOS and run the following command to mount the virtual file system
|
||||||
|
# sudo -S mount_9p hostshare
|
||||||
|
|
||||||
|
```
|
||||||
|
### Share Linux NFS Drive into macOS
|
||||||
|
|
||||||
|
To share a folder using NFS, setup a folder for on the host machine, for example, `/srv/nfs/share` and then append to `/etc/exports`:
|
||||||
|
```bash
|
||||||
|
/srv/nfs/share 127.0.0.1/0(insecure,rw,all_squash,anonuid=1000,anongid=985,no_subtree_check)
|
||||||
|
```
|
||||||
|
|
||||||
|
You may need to reload exports now, which will begin sharing that directory.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# reload shared folders
|
||||||
|
sudo exportfs -arv
|
||||||
|
```
|
||||||
|
|
||||||
|
[Source & Explanation](https://serverfault.com/questions/716350/mount-nfs-volume-on-ubuntu-linux-server-from-macos-client)
|
||||||
|
|
||||||
|
Give permissions on the shared folder for the `anonuid` and `anongid`, where `anonuid` and `anongid` matches that of your linux user; `id -u`
|
||||||
|
|
||||||
|
`id -u ; id -g` will print `userid:groupid`
|
||||||
|
```
|
||||||
|
chown 1000:985 /srv/nfs/share
|
||||||
|
chmod u+rwx /srv/nfs/share
|
||||||
|
```
|
||||||
|
|
||||||
|
Start the Docker-OSX container with the additional flag `--network host`
|
||||||
|
|
||||||
|
Create and mount the nfs folder from the mac terminal:
|
||||||
|
```
|
||||||
|
mkdir -p ~/mnt
|
||||||
|
sudo mount -t nfs 10.0.2.2:/srv/nfs/share ~/mnt
|
||||||
|
```
|
||||||
|
|
||||||
|
### Share USB Drive into macOS over QEMU
|
||||||
|
|
||||||
|
## Mount USB Drive (Hotplug/Hot Plug USB)
|
||||||
|
|
||||||
|
Start your container.
|
||||||
|
|
||||||
|
Pick a port, for example, `7700`.
|
||||||
|
|
||||||
|
`lsusb` to get `vid:pid`
|
||||||
|
|
||||||
|
On Linux:
|
||||||
|
`sudo usbredirserver -p 7700 1e3d:2096`
|
||||||
|
|
||||||
|
Now, in the Docker window hit Enter to see the `(qemu)` console.
|
||||||
|
|
||||||
|
You can add/remove the disk using commands like this, even once the machine is started:
|
||||||
|
|
||||||
|
`chardev-add socket,id=usbredirchardev1,port=7700,host=172.17.0.1`
|
||||||
|
|
||||||
|
`device_add usb-redir,chardev=usbredirchardev1,id=usbredirdev1,debug=4`
|
||||||
|
|
||||||
|
## Mount USB Drive inside macOS at boot Docker OSX
|
||||||
|
|
||||||
|
```bash
|
||||||
|
PORT=7700
|
||||||
|
IP_ADDRESS=172.17.0.1
|
||||||
|
|
||||||
|
-e EXTRA="-chardev socket,id=usbredirchardev1,port=${PORT},host=${IP_ADDRESS} -device usb-redir,chardev=usbredirchardev1,id=usbredirdev1,debug=4" \`
|
||||||
|
```
|
||||||
|
|
||||||
### 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 reoslve this, you will need to whitelist the interface in your firewall:
|
||||||
@ -576,7 +992,7 @@ docker build -t docker-osx:latest \
|
|||||||
--build-arg RANKMIRRORS=true \
|
--build-arg RANKMIRRORS=true \
|
||||||
--build-arg MIRROR_COUNTRY=US \
|
--build-arg MIRROR_COUNTRY=US \
|
||||||
--build-arg MIRROR_COUNT=10 \
|
--build-arg MIRROR_COUNT=10 \
|
||||||
--build-arg VERSION=10.15.6 \
|
--build-arg SHORTNAME=catalina \
|
||||||
--build-arg SIZE=200G .
|
--build-arg SIZE=200G .
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -614,7 +1030,10 @@ At any time, verify your serial number before logging into iCloud, etc.
|
|||||||
# this is a quick way to check your serial number via cli inside OSX
|
# this is a quick way to check your serial number via cli inside OSX
|
||||||
ioreg -l | grep IOPlatformSerialNumber
|
ioreg -l | grep IOPlatformSerialNumber
|
||||||
|
|
||||||
# or from the host
|
# test some commands
|
||||||
|
sshpass -p 'alpine' ssh user@localhost -p 50922 'ping google.com'
|
||||||
|
|
||||||
|
# check your serial number
|
||||||
sshpass -p 'alpine' ssh user@localhost -p 50922 'ioreg -l | grep IOPlatformSerialNumber'
|
sshpass -p 'alpine' ssh user@localhost -p 50922 'ioreg -l | grep IOPlatformSerialNumber'
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -678,8 +1097,9 @@ docker run --rm -it \
|
|||||||
-e NOPICKER=true \
|
-e NOPICKER=true \
|
||||||
-e GENERATE_UNIQUE=true \
|
-e GENERATE_UNIQUE=true \
|
||||||
-e DEVICE_MODEL="iMacPro1,1" \
|
-e DEVICE_MODEL="iMacPro1,1" \
|
||||||
-e OSX_COMMANDS='ioreg -l | grep IOPlatformSerialNumber' \
|
|
||||||
sickcodes/docker-osx:auto
|
sickcodes/docker-osx:auto
|
||||||
|
|
||||||
|
# -e OSX_COMMANDS='ioreg -l | grep IOPlatformSerialNumber' \
|
||||||
```
|
```
|
||||||
|
|
||||||
#### This example generates a specific set of serial numbers at runtime
|
#### This example generates a specific set of serial numbers at runtime
|
||||||
@ -784,13 +1204,6 @@ Or tell the container to use specific ones using `-e GENERATE_SPECIFIC=true`
|
|||||||
-e MAC_ADDRESS="A8:5C:2C:9A:46:2F" \
|
-e MAC_ADDRESS="A8:5C:2C:9A:46:2F" \
|
||||||
```
|
```
|
||||||
|
|
||||||
### I'd like to run Docker-OSX with WSL2 (Windows, Ubuntu)
|
|
||||||
|
|
||||||
Ensure KVM is enabled and `x11-apps` is installed.
|
|
||||||
|
|
||||||
See more in-depth discussion [here](https://github.com/sickcodes/Docker-OSX/issues/17) and [here](https://github.com/sickcodes/Docker-OSX/issues/60).
|
|
||||||
|
|
||||||
|
|
||||||
### Changing display resolution
|
### Changing display resolution
|
||||||
|
|
||||||
The display resolution is controlled by this line:
|
The display resolution is controlled by this line:
|
||||||
@ -883,6 +1296,23 @@ Here's a few other resolutions! If you resolution is invalid, it will default to
|
|||||||
-e HEIGHT=1600 \
|
-e HEIGHT=1600 \
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### This example shows how to change resolution after the container is created.
|
||||||
|
|
||||||
|
First step is to stop the docker daemon
|
||||||
|
```
|
||||||
|
sudo systemctl stop docker
|
||||||
|
```
|
||||||
|
The second step is to change container config in
|
||||||
|
```
|
||||||
|
/var/lib/docker/containers/[container-id]/config.v2.json
|
||||||
|
```
|
||||||
|
(Suppose your original WIDTH is 1024 and HEIGHT is 768, you can search 1024 and replace it with the new value. Same for 768.)
|
||||||
|
|
||||||
|
The last step is to restart the docker daemon
|
||||||
|
```
|
||||||
|
sudo systemctl restart docker
|
||||||
|
```
|
||||||
|
|
||||||
### Mounting physical disks in Mac OSX
|
### Mounting physical disks in Mac OSX
|
||||||
|
|
||||||
Pass the disk into the container as a volume and then pass the disk again into QEMU command line extras with.
|
Pass the disk into the container as a volume and then pass the disk again into QEMU command line extras with.
|
||||||
@ -917,6 +1347,45 @@ docker run -it \
|
|||||||
|
|
||||||
See also: [here](https://github.com/sickcodes/Docker-OSX/issues/222).
|
See also: [here](https://github.com/sickcodes/Docker-OSX/issues/222).
|
||||||
|
|
||||||
|
|
||||||
|
#### Extracting the APFS disk on Linux
|
||||||
|
|
||||||
|
In Docker-OSX, we are using `qcow2` images.
|
||||||
|
|
||||||
|
This means the image grows as you use it, but the guest OS thinks you have 200GB available.
|
||||||
|
|
||||||
|
|
||||||
|
**READ ONLY**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# mount the qemu image like a real disk
|
||||||
|
sudo modprobe nbd max_part=8
|
||||||
|
sudo qemu-nbd --connect=/dev/nbd0 ./image.img
|
||||||
|
sudo fdisk /dev/nbd0 -l
|
||||||
|
|
||||||
|
mkdir -p ./mnt
|
||||||
|
sudo mount /dev/nbd0p1 ./mnt
|
||||||
|
|
||||||
|
# inspect partitions (2 partitions)
|
||||||
|
sudo fdisk /dev/nbd0 -l
|
||||||
|
|
||||||
|
# mount using apfs-linux-rw OR apfs-fuse
|
||||||
|
mkdir -p ./part
|
||||||
|
|
||||||
|
sudo mount /dev/nbd0p2 ./part
|
||||||
|
sudo apfs-fuse -o allow_other /dev/nbd0p2 ./part
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
When you are finishing looking at your disk, you can unmount the partition, the disk, and remove the loopback device:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo umount ./part
|
||||||
|
sudo umount ./mnt
|
||||||
|
sudo qemu-nbd --disconnect /dev/nbd0
|
||||||
|
sudo rmmod nbd
|
||||||
|
```
|
||||||
|
|
||||||
### USB Passthrough
|
### USB Passthrough
|
||||||
|
|
||||||
Firstly, QEMU must be started as root.
|
Firstly, QEMU must be started as root.
|
||||||
@ -1020,29 +1489,12 @@ The Quick Start command should work out of the box, provided that you keep the f
|
|||||||
-e "DISPLAY=${DISPLAY:-:0.0}" \
|
-e "DISPLAY=${DISPLAY:-:0.0}" \
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Download the image manually and use it in Docker
|
|
||||||
|
|
||||||
[](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
|
||||||
|
|
||||||
|
|
||||||
This is a particularly good way for downloading the container, in case Docker's CDN (or your connection) happens to be slow.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
wget https://images2.sick.codes/mac_hdd_ng_auto.img
|
|
||||||
|
|
||||||
docker run -it \
|
|
||||||
--device /dev/kvm \
|
|
||||||
-p 50922:10022 \
|
|
||||||
-v "${PWD}/mac_hdd_ng_auto.img:/image" \
|
|
||||||
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
|
||||||
-e "DISPLAY=${DISPLAY:-:0.0}" \
|
|
||||||
sickcodes/docker-osx:naked
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Prebuilt image with arbitrary command line arguments
|
#### Prebuilt image with arbitrary command line arguments
|
||||||
|
|
||||||
[](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
[](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
||||||
|
|
||||||
|
`-e OSX_COMMANDS` lets you run any commands inside the container
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker pull sickcodes/docker-osx:auto
|
docker pull sickcodes/docker-osx:auto
|
||||||
|
|
||||||
@ -1052,12 +1504,32 @@ docker run -it \
|
|||||||
-p 50922:10022 \
|
-p 50922:10022 \
|
||||||
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
||||||
-e "DISPLAY=${DISPLAY:-:0.0}" \
|
-e "DISPLAY=${DISPLAY:-:0.0}" \
|
||||||
-e "OSX_COMMANDS=/bin/bash -c \"pwd && uname -a\"" \
|
-e "OSX_COMMANDS=/bin/bash -c \"put your commands here\"" \
|
||||||
sickcodes/docker-osx:auto
|
sickcodes/docker-osx:auto
|
||||||
|
|
||||||
# Boots in a minute or two!
|
# Boots in a minute or two!
|
||||||
```
|
```
|
||||||
|
|
||||||
|
OR if you have an image already and just want to log in and execute arbitrary commands:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker pull sickcodes/docker-osx:naked-auto
|
||||||
|
|
||||||
|
# boot to OS X shell + display + specify commands to run inside OS X!
|
||||||
|
docker run -it \
|
||||||
|
--device /dev/kvm \
|
||||||
|
-p 50922:10022 \
|
||||||
|
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
||||||
|
-e "DISPLAY=${DISPLAY:-:0.0}" \
|
||||||
|
-e USERNAME=yourusername \
|
||||||
|
-e PASSWORD=yourpassword \
|
||||||
|
-e "OSX_COMMANDS=/bin/bash -c \"put your commands here\"" \
|
||||||
|
sickcodes/docker-osx:naked-auto
|
||||||
|
|
||||||
|
# Boots in a minute or two!
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
### Further examples
|
### Further examples
|
||||||
|
|
||||||
There's a myriad of other potential use cases that can work perfectly with Docker-OSX, some of which you'll see below!
|
There's a myriad of other potential use cases that can work perfectly with Docker-OSX, some of which you'll see below!
|
||||||
@ -1101,11 +1573,12 @@ docker run -i \
|
|||||||
-p 5999:5999 \
|
-p 5999:5999 \
|
||||||
-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 EXTRA="-display none -vnc 0.0.0.0:99,password" \
|
-e EXTRA="-display none -vnc 0.0.0.0:99,password=on" \
|
||||||
sickcodes/docker-osx:big-sur
|
sickcodes/docker-osx:big-sur
|
||||||
|
|
||||||
# type `change vnc password` into the docker terminal and set a password
|
# type `change vnc password myvncusername` into the docker terminal and set a password
|
||||||
# connect to localhost:5999 using VNC
|
# connect to localhost:5999 using VNC
|
||||||
|
# qemu 6 seems to require a username for vnc now
|
||||||
```
|
```
|
||||||
|
|
||||||
**NOT TLS/HTTPS Encrypted at all!**
|
**NOT TLS/HTTPS Encrypted at all!**
|
||||||
@ -1118,11 +1591,13 @@ Or `ssh -N root@1.1.1.1 -L 5999:127.0.0.1:5999`, where `1.1.1.1` is your remote
|
|||||||
|
|
||||||
Add the following line:
|
Add the following line:
|
||||||
|
|
||||||
`-e EXTRA="-display none -vnc 0.0.0.0:99,password"`
|
`-e EXTRA="-display none -vnc 0.0.0.0:99,password=on"`
|
||||||
|
|
||||||
In the Docker terminal, press `enter` until you see `(qemu)`.
|
In the Docker terminal, press `enter` until you see `(qemu)`.
|
||||||
|
|
||||||
Type `change vnc password`
|
Type `change vnc password someusername`
|
||||||
|
|
||||||
|
Enter a password for your new vnc username^.
|
||||||
|
|
||||||
You also need the container IP: `docker inspect <containerid> | jq -r '.[0].NetworkSettings.IPAddress'`
|
You also need the container IP: `docker inspect <containerid> | jq -r '.[0].NetworkSettings.IPAddress'`
|
||||||
|
|
||||||
@ -1143,6 +1618,7 @@ Note: `-disable-ticketing` will allow unauthenticated access to the VM. See the
|
|||||||
```bash
|
```bash
|
||||||
docker run \
|
docker run \
|
||||||
--device /dev/kvm \
|
--device /dev/kvm \
|
||||||
|
-p 3001:3001 \
|
||||||
-p 50922:10022 \
|
-p 50922:10022 \
|
||||||
-e "DISPLAY=${DISPLAY:-:0.0}" \
|
-e "DISPLAY=${DISPLAY:-:0.0}" \
|
||||||
-e EXTRA="-monitor telnet::45454,server,nowait -nographic -serial null -spice disable-ticketing,port=3001" \
|
-e EXTRA="-monitor telnet::45454,server,nowait -nographic -serial null -spice disable-ticketing,port=3001" \
|
||||||
@ -1169,23 +1645,6 @@ docker run \
|
|||||||
newImageName
|
newImageName
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Run Catalina Pre-Installed [](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
|
|
||||||
|
|
||||||
```bash
|
|
||||||
docker pull sickcodes/docker-osx:auto
|
|
||||||
|
|
||||||
# boot directly into a real OS X shell with a visual display [NOT HEADLESS]
|
|
||||||
docker run -it \
|
|
||||||
--device /dev/kvm \
|
|
||||||
-p 50922:10022 \
|
|
||||||
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
|
||||||
-e "DISPLAY=${DISPLAY:-:0.0}" \
|
|
||||||
sickcodes/docker-osx:auto
|
|
||||||
|
|
||||||
# username is user
|
|
||||||
# passsword is alpine
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker pull sickcodes/docker-osx:auto
|
docker pull sickcodes/docker-osx:auto
|
||||||
|
|
||||||
@ -1256,3 +1715,52 @@ chmod +x ./Launch-nopicker.sh
|
|||||||
sed -i -e s/OpenCore\.qcow2/OpenCore\-nopicker\.qcow2/ ./Launch-nopicker.sh
|
sed -i -e s/OpenCore\.qcow2/OpenCore\-nopicker\.qcow2/ ./Launch-nopicker.sh
|
||||||
"
|
"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### The big-sur image starts slowly after installation. Is this expected?
|
||||||
|
|
||||||
|
Automatic updates are still on in the container's settings. You may wish to turn them off. [We have future plans for development around this.](https://github.com/sickcodes/Docker-OSX/issues/227)
|
||||||
|
|
||||||
|
### What is `${DISPLAY:-:0.0}`?
|
||||||
|
|
||||||
|
`$DISPLAY` is the shell variable that refers to your X11 display server.
|
||||||
|
|
||||||
|
`${DISPLAY}` is the same, but allows you to join variables like this:
|
||||||
|
|
||||||
|
- e.g. `${DISPLAY}_${DISPLAY}` would print `:0.0_:0.0`
|
||||||
|
- e.g. `$DISPLAY_$DISPLAY` would print `:0.0`
|
||||||
|
|
||||||
|
...because `$DISPLAY_` is not `$DISPLAY`
|
||||||
|
|
||||||
|
`${variable:-fallback}` allows you to set a "fallback" variable to be substituted if `$variable` is not set.
|
||||||
|
|
||||||
|
You can also use `${variable:=fallback}` to set that variable (in your current terminal).
|
||||||
|
|
||||||
|
In Docker-OSX, we assume, `:0.0` is your default `$DISPLAY` variable.
|
||||||
|
|
||||||
|
You can see what yours is
|
||||||
|
|
||||||
|
```bash
|
||||||
|
echo $DISPLAY
|
||||||
|
```
|
||||||
|
|
||||||
|
That way, `${DISPLAY:-:0.0}` will use whatever variable your X11 server has set for you, else `:0.0`
|
||||||
|
|
||||||
|
### What is `-v /tmp/.X11-unix:/tmp/.X11-unix`?
|
||||||
|
|
||||||
|
`-v` is a Docker command-line option that lets you pass a volume to the container.
|
||||||
|
|
||||||
|
The directory that we are letting the Docker container use is a X server display socket.
|
||||||
|
|
||||||
|
`/tmp/.X11-unix`
|
||||||
|
|
||||||
|
If we let the Docker container use the same display socket as our own environment, then any applications you run inside the Docker container will show up on your screen too! [https://www.x.org/archive/X11R6.8.0/doc/RELNOTES5.html](https://www.x.org/archive/X11R6.8.0/doc/RELNOTES5.html)
|
||||||
|
|
||||||
|
### ALSA errors on startup or container creation
|
||||||
|
|
||||||
|
You may when initialising or booting into a container see errors from the `(qemu)` console of the following form:
|
||||||
|
`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).
|
||||||
|
|
||||||
|
BIN
Youtube-Screenshot-Docker-OSX-Setup.png
Normal file
After Width: | Height: | Size: 104 KiB |
@ -30,10 +30,11 @@ Optional options:
|
|||||||
--master-plist <filename> Same as above.
|
--master-plist <filename> Same as above.
|
||||||
--output-bootdisk <filename> Optionally change the bootdisk filename
|
--output-bootdisk <filename> Optionally change the bootdisk filename
|
||||||
--output-plist <filename> Optionally change the output plist filename
|
--output-plist <filename> Optionally change the output plist filename
|
||||||
|
--thinkpad Sets ForceOcWriteFlash to true
|
||||||
--help, -h, help Display this help and exit
|
--help, -h, help Display this help and exit
|
||||||
|
|
||||||
Placeholders: {{DEVICE_MODEL}}, {{SERIAL}}, {{BOARD_SERIAL}}, {{UUID}},
|
Placeholders: {{DEVICE_MODEL}}, {{SERIAL}}, {{BOARD_SERIAL}}, {{UUID}},
|
||||||
{{ROM}}, {{WIDTH}}, {{HEIGHT}}
|
{{ROM}}, {{WIDTH}}, {{HEIGHT}}, {{THINKPAD}}
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
./generate-specific-bootdisk.sh \\
|
./generate-specific-bootdisk.sh \\
|
||||||
@ -183,6 +184,12 @@ while (( "$#" )); do
|
|||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
||||||
|
--thinkpad )
|
||||||
|
export THINKPAD=true
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
echo "Invalid option ${1}. Running with default values..."
|
echo "Invalid option ${1}. Running with default values..."
|
||||||
shift
|
shift
|
||||||
@ -193,12 +200,12 @@ done
|
|||||||
|
|
||||||
download_qcow_efi_folder () {
|
download_qcow_efi_folder () {
|
||||||
|
|
||||||
export EFI_FOLDER=./OpenCore-Catalina/EFI
|
export EFI_FOLDER=./OpenCore/EFI
|
||||||
export RESOURCES_FOLDER=./resources/OcBinaryData/Resources
|
export RESOURCES_FOLDER=./resources/OcBinaryData/Resources
|
||||||
|
|
||||||
# check if we are inside OSX-KVM already
|
# check if we are inside OSX-KVM already
|
||||||
# if not, download OSX-KVM locally
|
# if not, download OSX-KVM locally
|
||||||
[ -d ./OpenCore-Catalina/EFI/ ] || {
|
[ -d ./OpenCore/EFI/ ] || {
|
||||||
[ -d ./OSX-KVM/ ] || git clone --recurse-submodules --depth 1 https://github.com/kholia/OSX-KVM.git
|
[ -d ./OSX-KVM/ ] || git clone --recurse-submodules --depth 1 https://github.com/kholia/OSX-KVM.git
|
||||||
export EFI_FOLDER="./OSX-KVM/${EFI_FOLDER}"
|
export EFI_FOLDER="./OSX-KVM/${EFI_FOLDER}"
|
||||||
}
|
}
|
||||||
@ -233,6 +240,13 @@ generate_bootdisk () {
|
|||||||
wget -O "${MASTER_PLIST:=./config-nopicker-custom.plist}" "${MASTER_PLIST_URL}"
|
wget -O "${MASTER_PLIST:=./config-nopicker-custom.plist}" "${MASTER_PLIST_URL}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "${THINKPAD}" == true ]]; then
|
||||||
|
echo "Thinkpads: setting ForceOcWriteFlash to true"
|
||||||
|
export THINKPAD=true
|
||||||
|
else
|
||||||
|
export THINKPAD=false
|
||||||
|
fi
|
||||||
|
|
||||||
[ -e ./opencore-image-ng.sh ] \
|
[ -e ./opencore-image-ng.sh ] \
|
||||||
|| { wget "${OPENCORE_IMAGE_MAKER_URL}" \
|
|| { wget "${OPENCORE_IMAGE_MAKER_URL}" \
|
||||||
&& chmod +x opencore-image-ng.sh ; }
|
&& chmod +x opencore-image-ng.sh ; }
|
||||||
@ -252,6 +266,7 @@ generate_bootdisk () {
|
|||||||
-e s/\{\{ROM\}\}/"${ROM}"/g \
|
-e s/\{\{ROM\}\}/"${ROM}"/g \
|
||||||
-e s/\{\{WIDTH\}\}/"${WIDTH:-1920}"/g \
|
-e s/\{\{WIDTH\}\}/"${WIDTH:-1920}"/g \
|
||||||
-e s/\{\{HEIGHT\}\}/"${HEIGHT:-1080}"/g \
|
-e s/\{\{HEIGHT\}\}/"${HEIGHT:-1080}"/g \
|
||||||
|
-e s/\{\{THINKPAD\}\}/"${THINKPAD:-false}"/g \
|
||||||
"${MASTER_PLIST}" > ./tmp.config.plist || exit 1
|
"${MASTER_PLIST}" > ./tmp.config.plist || exit 1
|
||||||
else
|
else
|
||||||
cat <<EOF && exit 1
|
cat <<EOF && exit 1
|
||||||
|
@ -30,6 +30,7 @@ General options:
|
|||||||
--create-envs, --envs Create all corresponding sourcable envs
|
--create-envs, --envs Create all corresponding sourcable envs
|
||||||
--create-plists, --plists Create all corresponding config.plists
|
--create-plists, --plists Create all corresponding config.plists
|
||||||
--create-bootdisks, --bootdisks Create all corresponding bootdisks [SLOW]
|
--create-bootdisks, --bootdisks Create all corresponding bootdisks [SLOW]
|
||||||
|
--thinkpad Toggles ForceOcWriteFlash to true
|
||||||
--help, -h, help Display this help and exit
|
--help, -h, help Display this help and exit
|
||||||
|
|
||||||
Additional options only if you are creating ONE serial set:
|
Additional options only if you are creating ONE serial set:
|
||||||
@ -38,7 +39,7 @@ Additional options only if you are creating ONE serial set:
|
|||||||
|
|
||||||
Custom plist placeholders:
|
Custom plist placeholders:
|
||||||
{{DEVICE_MODEL}}, {{SERIAL}}, {{BOARD_SERIAL}},
|
{{DEVICE_MODEL}}, {{SERIAL}}, {{BOARD_SERIAL}},
|
||||||
{{UUID}}, {{ROM}}, {{WIDTH}}, {{HEIGHT}}
|
{{UUID}}, {{ROM}}, {{WIDTH}}, {{HEIGHT}}, {{THINKPAD}}
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
./generate-unique-machine-values.sh --count 1 --plists --bootdisks --envs
|
./generate-unique-machine-values.sh --count 1 --plists --bootdisks --envs
|
||||||
@ -202,9 +203,14 @@ while (( "$#" )); do
|
|||||||
export CREATE_ENVS=1
|
export CREATE_ENVS=1
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
--thinkpad )
|
||||||
|
export THINKPAD=true
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
echo "Invalid option. Running with default values..."
|
echo "Invalid option ${1}. Running with default values..."
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@ -226,12 +232,12 @@ download_vendor_mac_addresses () {
|
|||||||
|
|
||||||
download_qcow_efi_folder () {
|
download_qcow_efi_folder () {
|
||||||
|
|
||||||
export EFI_FOLDER=./OpenCore-Catalina/EFI
|
export EFI_FOLDER=./OpenCore/EFI
|
||||||
export RESOURCES_FOLDER=./resources/OcBinaryData/Resources
|
export RESOURCES_FOLDER=./resources/OcBinaryData/Resources
|
||||||
|
|
||||||
# check if we are inside OSX-KVM already
|
# check if we are inside OSX-KVM already
|
||||||
# if not, download OSX-KVM locally
|
# if not, download OSX-KVM locally
|
||||||
[ -d ./OpenCore-Catalina/EFI/ ] || {
|
[ -d ./OpenCore/EFI/ ] || {
|
||||||
[ -d ./OSX-KVM/ ] || git clone --recurse-submodules --depth 1 https://github.com/kholia/OSX-KVM.git
|
[ -d ./OSX-KVM/ ] || git clone --recurse-submodules --depth 1 https://github.com/kholia/OSX-KVM.git
|
||||||
export EFI_FOLDER="./OSX-KVM/${EFI_FOLDER}"
|
export EFI_FOLDER="./OSX-KVM/${EFI_FOLDER}"
|
||||||
}
|
}
|
||||||
@ -313,6 +319,7 @@ export UUID="${UUID}"
|
|||||||
export MAC_ADDRESS="${MAC_ADDRESS}"
|
export MAC_ADDRESS="${MAC_ADDRESS}"
|
||||||
export WIDTH="${WIDTH}"
|
export WIDTH="${WIDTH}"
|
||||||
export HEIGHT="${HEIGHT}"
|
export HEIGHT="${HEIGHT}"
|
||||||
|
export THINKPAD="${THINKPAD}"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
fi
|
fi
|
||||||
@ -333,10 +340,17 @@ EOF
|
|||||||
wget -O "${MASTER_PLIST:=./config-nopicker-custom.plist}" "${MASTER_PLIST_URL}"
|
wget -O "${MASTER_PLIST:=./config-nopicker-custom.plist}" "${MASTER_PLIST_URL}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "${THINKPAD}" == true ]]; then
|
||||||
|
echo "Thinkpads: setting ForceOcWriteFlash to true"
|
||||||
|
export THINKPAD=true
|
||||||
|
else
|
||||||
|
export THINKPAD=false
|
||||||
|
fi
|
||||||
|
|
||||||
mkdir -p "${OUTPUT_DIRECTORY}/plists"
|
mkdir -p "${OUTPUT_DIRECTORY}/plists"
|
||||||
source "${OUTPUT_ENV_FILE}"
|
source "${OUTPUT_ENV_FILE}"
|
||||||
ROM_VALUE="${MAC_ADDRESS//\:/}"
|
ROM="${MAC_ADDRESS//\:/}"
|
||||||
ROM_VALUE="${ROM_VALUE,,}"
|
ROM="${ROM,,}"
|
||||||
sed -e s/\{\{DEVICE_MODEL\}\}/"${DEVICE_MODEL}"/g \
|
sed -e s/\{\{DEVICE_MODEL\}\}/"${DEVICE_MODEL}"/g \
|
||||||
-e s/\{\{SERIAL\}\}/"${SERIAL}"/g \
|
-e s/\{\{SERIAL\}\}/"${SERIAL}"/g \
|
||||||
-e s/\{\{BOARD_SERIAL\}\}/"${BOARD_SERIAL}"/g \
|
-e s/\{\{BOARD_SERIAL\}\}/"${BOARD_SERIAL}"/g \
|
||||||
@ -344,6 +358,7 @@ EOF
|
|||||||
-e s/\{\{ROM\}\}/"${ROM}"/g \
|
-e s/\{\{ROM\}\}/"${ROM}"/g \
|
||||||
-e s/\{\{WIDTH\}\}/"${WIDTH}"/g \
|
-e s/\{\{WIDTH\}\}/"${WIDTH}"/g \
|
||||||
-e s/\{\{HEIGHT\}\}/"${HEIGHT}"/g \
|
-e s/\{\{HEIGHT\}\}/"${HEIGHT}"/g \
|
||||||
|
-e s/\{\{THINKPAD\}\}/"${THINKPAD}"/g \
|
||||||
"${MASTER_PLIST}" > "${OUTPUT_DIRECTORY}/plists/${SERIAL}.config.plist" || exit 1
|
"${MASTER_PLIST}" > "${OUTPUT_DIRECTORY}/plists/${SERIAL}.config.plist" || exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -133,26 +133,26 @@ fish part-add /dev/sda p 302048 -2048
|
|||||||
fish part-set-gpt-type /dev/sda 1 C12A7328-F81F-11D2-BA4B-00A0C93EC93B
|
fish part-set-gpt-type /dev/sda 1 C12A7328-F81F-11D2-BA4B-00A0C93EC93B
|
||||||
fish part-set-bootable /dev/sda 1 true
|
fish part-set-bootable /dev/sda 1 true
|
||||||
fish mkfs vfat /dev/sda1 label:EFI
|
fish mkfs vfat /dev/sda1 label:EFI
|
||||||
fish mkfs vfat /dev/sda2 label:OpenCoreBoo
|
fish mkfs vfat /dev/sda2 label:OpenCore
|
||||||
fish mount /dev/sda2 /
|
fish mount /dev/sda2 /
|
||||||
fish mkdir /ESP
|
fish mkdir /ESP
|
||||||
fish mount /dev/sda1 /ESP
|
fish mount /dev/sda1 /ESP
|
||||||
|
|
||||||
msg "copy files to disk image"
|
msg "copy files to disk image"
|
||||||
cp -v "$cfg" $WORK/config.plist
|
cp -v "$cfg" $WORK/config.plist
|
||||||
fish mkdir /ESP/EFI
|
fish mkdir /ESP/EFI
|
||||||
fish mkdir /ESP/EFI/OC
|
fish mkdir /ESP/EFI/OC
|
||||||
fish mkdir /ESP/EFI/OC/Kexts
|
fish mkdir /ESP/EFI/OC/Kexts
|
||||||
fish mkdir /ESP/EFI/OC/ACPI
|
fish mkdir /ESP/EFI/OC/ACPI
|
||||||
fish mkdir /ESP/EFI/OC/Resources
|
fish mkdir /ESP/EFI/OC/Resources
|
||||||
fish mkdir /ESP/EFI/OC/Tools
|
fish mkdir /ESP/EFI/OC/Tools
|
||||||
fish copy-in $WORK/EFI/BOOT /ESP/EFI
|
fish copy-in $WORK/EFI/BOOT /ESP/EFI
|
||||||
fish copy-in $WORK/EFI/OC/OpenCore.efi /ESP/EFI/OC
|
fish copy-in $WORK/EFI/OC/OpenCore.efi /ESP/EFI/OC
|
||||||
fish copy-in $WORK/EFI/OC/Drivers /ESP/EFI/OC/
|
fish copy-in $WORK/EFI/OC/Drivers /ESP/EFI/OC/
|
||||||
fish copy-in $WORK/EFI/OC/Kexts /ESP/EFI/OC/
|
fish copy-in $WORK/EFI/OC/Kexts /ESP/EFI/OC/
|
||||||
fish copy-in $WORK/EFI/OC/ACPI /ESP/EFI/OC/
|
fish copy-in $WORK/EFI/OC/ACPI /ESP/EFI/OC/
|
||||||
fish copy-in $WORK/EFI/OC/Resources /ESP/EFI/OC/
|
fish copy-in $BASE/resources/OcBinaryData/Resources /ESP/EFI/OC/
|
||||||
fish copy-in $WORK/EFI/OC/Tools /ESP/EFI/OC/
|
fish copy-in $WORK/EFI/OC/Tools /ESP/EFI/OC/
|
||||||
|
|
||||||
# Note
|
# Note
|
||||||
fish copy-in startup.nsh /
|
fish copy-in startup.nsh /
|
||||||
|
14
discord-logo.svg
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<!-- animated SVG is from https://github.com/NNTin/discord-logo -->
|
||||||
|
<svg width="90" height="90" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" class="discord-logo-container" viewBox="0 0 48 48">
|
||||||
|
<defs>
|
||||||
|
<g>
|
||||||
|
<path id="discord-logo" d="m40,12c0,0 -4.585,-3.588 -10,-4l-0.488,0.976c4.896,1.198 7.142,2.915 9.488,5.024c-4.045,-2.065 -8.039,-4 -15,-4s-10.955,1.935 -15,4c2.346,-2.109 5.018,-4.015 9.488,-5.024l-0.488,-0.976c-5.681,0.537 -10,4 -10,4s-5.121,7.425 -6,22c5.162,5.953 13,6 13,6l1.639,-2.185c-2.782,-0.967 -5.924,-2.694 -8.639,-5.815c3.238,2.45 8.125,5 16,5s12.762,-2.55 16,-5c-2.715,3.121 -5.857,4.848 -8.639,5.815l1.639,2.185c0,0 7.838,-0.047 13,-6c-0.879,-14.575 -6,-22 -6,-22zm-22.5,18c-1.933,0 -3.5,-1.791 -3.5,-4c0,-2.209 1.567,-4 3.5,-4s3.5,1.791 3.5,4c0,2.209 -1.567,4 -3.5,4zm13,0c-1.933,0 -3.5,-1.791 -3.5,-4c0,-2.209 1.567,-4 3.5,-4s3.5,1.791 3.5,4c0,2.209 -1.567,4 -3.5,4z" />
|
||||||
|
</g>
|
||||||
|
</defs>
|
||||||
|
<g class="discord-logo">
|
||||||
|
<use class="discord-original" href="#discord-logo">
|
||||||
|
</use>
|
||||||
|
<animateTransform attributeName="transform" type="rotate" values="0 24 24;-18 24 24;16.8 24 24;-11.4 24 24;8.7 24 24;-7.5 24 24;6 24 24;-4.8 24 24;3.79 24 24;-3.12 24 24;2.52 24 24;-2.01 24 24;1.56 24 24;-1.2 24 24;0.96 24 24;-0.75 24 24;0.6 24 24;-0.48 24 24;0.384 24 24;0 24 24;0 24 24;0 24 24;0 24 24;0 24 24;0 24 24" begin="0s" dur="2s" fill="freeze" repeatCount="indefinite" />
|
||||||
|
</g>
|
||||||
|
<animate fill="freeze" dur="0000ms" begin="0s" values="#17f018;#000000;#17f018;#000000;#17f018;#000000;#17f018;#000000;#17f018" calMode="linear" attributeName="fill" repeatCount="indefinite" />
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.6 KiB |
@ -87,8 +87,8 @@ class ReplicationError(Exception):
|
|||||||
|
|
||||||
|
|
||||||
def cmd_exists(cmd):
|
def cmd_exists(cmd):
|
||||||
return subprocess.call("type " + cmd, shell=True,
|
return subprocess.Popen("type " + cmd, shell=True,
|
||||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE) == 0
|
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
|
|
||||||
|
|
||||||
def replicate_url(full_url,
|
def replicate_url(full_url,
|
||||||
|
BIN
tests/big-sur_master.png
Normal file
After Width: | Height: | Size: 196 KiB |
67
tests/boot-images.sh
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Author: Sick.Codes https://twitter.com/sickcodes
|
||||||
|
# Contact: https://github.com/sickcodes, https://sick.codes
|
||||||
|
# Copyright: sickcodes (C) 2021
|
||||||
|
# License: GPLv3+
|
||||||
|
# Title: Docker-OSX (Mac on Docker)
|
||||||
|
# Repository: https://github.com/sickcodes/Docker-OSX
|
||||||
|
# Website: https://sick.codes
|
||||||
|
#
|
||||||
|
# Status: Used internally to run each image and take screenshots until they match the pngs in this folder.
|
||||||
|
#
|
||||||
|
|
||||||
|
# note to self: # to get master images, boot each image, then screen shot using DISPLAY=:99 in the test.sh script
|
||||||
|
# scrot -o high-sierra_master.png
|
||||||
|
# scrot -o mojave_master.png
|
||||||
|
# scrot -o catalina_master.png
|
||||||
|
# scrot -o big-sur_master.png
|
||||||
|
# scrot -o monterey_master.png
|
||||||
|
# pull off remote server to the tests folder
|
||||||
|
# REMOTE_SERVER=
|
||||||
|
# scp root@"${REMOTE_SERVER}":~/*_master.png .
|
||||||
|
|
||||||
|
export DISPLAY=:99
|
||||||
|
|
||||||
|
TESTS=(
|
||||||
|
high-sierra
|
||||||
|
mojave
|
||||||
|
catalina
|
||||||
|
big-sur
|
||||||
|
monterey
|
||||||
|
)
|
||||||
|
|
||||||
|
# test each docker image to see if they boot to their unique respective installation screens.
|
||||||
|
|
||||||
|
for TEST in "${TESTS[@]}"; do
|
||||||
|
# run the image detached
|
||||||
|
docker run --rm -d \
|
||||||
|
--device /dev/kvm \
|
||||||
|
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
||||||
|
-e "DISPLAY=:99" \
|
||||||
|
"sickcodes/docker-osx:${TEST}"
|
||||||
|
|
||||||
|
# imcat the expected test screenshot to ./"${TEST}_master.txt"
|
||||||
|
imcat ~/Docker-OSX/tests/${TEST}_master.png > ./"${TEST}_master.txt"
|
||||||
|
|
||||||
|
# run until the screen matches the expected screen
|
||||||
|
while :; do
|
||||||
|
sleep 5
|
||||||
|
# screenshot the Xvfb
|
||||||
|
scrotcat > ./"${TEST}.txt"
|
||||||
|
# diff the low res txt files created from imcat
|
||||||
|
diff "./${TEST}.txt" ./"${TEST}_master.txt" && break
|
||||||
|
scrotcat
|
||||||
|
done
|
||||||
|
|
||||||
|
# kill any containers
|
||||||
|
docker kill "$(docker ps --format "{{.ID}}")"
|
||||||
|
|
||||||
|
# ensure all containers are dead
|
||||||
|
until [[ "$(docker ps | wc -l)" = 1 ]]; do
|
||||||
|
sleep 1
|
||||||
|
docker ps | xargs docker kill
|
||||||
|
done
|
||||||
|
|
||||||
|
done
|
||||||
|
|
||||||
|
exit 0
|
BIN
tests/catalina_master.png
Normal file
After Width: | Height: | Size: 316 KiB |
BIN
tests/high-sierra_master.png
Normal file
After Width: | Height: | Size: 328 KiB |
BIN
tests/mojave_master.png
Normal file
After Width: | Height: | Size: 316 KiB |
BIN
tests/monterey_master.png
Normal file
After Width: | Height: | Size: 194 KiB |
136
tests/test.sh
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/docker
|
#!/usr/bin/bash
|
||||||
# ____ __ ____ ______ __
|
# ____ __ ____ ______ __
|
||||||
# / __ \____ _____/ /_____ _____/ __ \/ ___/ |/ /
|
# / __ \____ _____/ /_____ _____/ __ \/ ___/ |/ /
|
||||||
# / / / / __ \/ ___/ //_/ _ \/ ___/ / / /\__ \| /
|
# / / / / __ \/ ___/ //_/ _ \/ ___/ / / /\__ \| /
|
||||||
@ -12,7 +12,7 @@
|
|||||||
# Repository: https://github.com/sickcodes/Docker-OSX
|
# Repository: https://github.com/sickcodes/Docker-OSX
|
||||||
# Website: https://sick.codes
|
# Website: https://sick.codes
|
||||||
#
|
#
|
||||||
# Status: Work in progress.
|
# Status: Used internally to auto build, run and test images on DO.
|
||||||
#
|
#
|
||||||
|
|
||||||
help_text="Usage: ./test.sh --branch <string> --repo <string>
|
help_text="Usage: ./test.sh --branch <string> --repo <string>
|
||||||
@ -120,11 +120,17 @@ NO_CACHE="${NO_CACHE:=--no-cache}"
|
|||||||
|
|
||||||
|
|
||||||
TEST_BUILDS=(
|
TEST_BUILDS=(
|
||||||
'docker-osx:latest'
|
'docker-osx:naked'
|
||||||
'docker-osx:naked'
|
'docker-osx:naked-auto'
|
||||||
'docker-osx:big-sur'
|
'docker-osx:auto'
|
||||||
'docker-osx:auto'
|
)
|
||||||
#'docker-osx:auto-big-sur'
|
|
||||||
|
VERSION_BUILDS=(
|
||||||
|
'high-sierra'
|
||||||
|
'mojave'
|
||||||
|
'catalina'
|
||||||
|
'big-sur'
|
||||||
|
'monterey'
|
||||||
)
|
)
|
||||||
|
|
||||||
install_docker () {
|
install_docker () {
|
||||||
@ -172,7 +178,7 @@ install_scrotcat () {
|
|||||||
make -C ./imcat
|
make -C ./imcat
|
||||||
sudo cp ./imcat/imcat /usr/bin/imcat
|
sudo cp ./imcat/imcat /usr/bin/imcat
|
||||||
touch /usr/bin/scrotcat
|
touch /usr/bin/scrotcat
|
||||||
tee -a /usr/bin/scrotcat <<< '/usr/bin/imcat <(scrot -o /dev/stdout)'
|
tee /usr/bin/scrotcat <<< '/usr/bin/imcat <(scrot -o /dev/stdout)'
|
||||||
chmod +x /usr/bin/scrotcat
|
chmod +x /usr/bin/scrotcat
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -194,25 +200,13 @@ enable_kvm () {
|
|||||||
echo 1 | tee /sys/module/kvm/parameters/ignore_msrs
|
echo 1 | tee /sys/module/kvm/parameters/ignore_msrs
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
clone_repo () {
|
clone_repo () {
|
||||||
git clone --branch="${1}" "${2}" Docker-OSX
|
git clone --branch="${1}" "${2}" Docker-OSX
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
docker-osx:latest () {
|
|
||||||
docker build ${NO_CACHE} \
|
|
||||||
--build-arg BRANCH="${BRANCH}" \
|
|
||||||
--build-arg RANKMIRRORS=true \
|
|
||||||
--build-arg MIRROR_COUNTRY="${MIRROR_COUNTRY}" \
|
|
||||||
-f ./Dockerfile \
|
|
||||||
-t docker-osx:latest .
|
|
||||||
docker tag docker-osx:latest sickcodes/docker-osx:latest
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
docker-osx:naked () {
|
docker-osx:naked () {
|
||||||
docker build ${NO_CACHE} \
|
docker build ${NO_CACHE} \
|
||||||
|
--squash \
|
||||||
--build-arg RANKMIRRORS=true \
|
--build-arg RANKMIRRORS=true \
|
||||||
--build-arg MIRROR_COUNTRY="${MIRROR_COUNTRY}" \
|
--build-arg MIRROR_COUNTRY="${MIRROR_COUNTRY}" \
|
||||||
-f ./Dockerfile.naked \
|
-f ./Dockerfile.naked \
|
||||||
@ -220,15 +214,14 @@ docker-osx:naked () {
|
|||||||
docker tag docker-osx:naked sickcodes/docker-osx:naked
|
docker tag docker-osx:naked sickcodes/docker-osx:naked
|
||||||
}
|
}
|
||||||
|
|
||||||
|
docker-osx:naked-auto () {
|
||||||
docker-osx:big-sur () {
|
|
||||||
docker build ${NO_CACHE} \
|
docker build ${NO_CACHE} \
|
||||||
--build-arg VERSION=11 \
|
--squash \
|
||||||
--build-arg RANKMIRRORS=true \
|
--build-arg RANKMIRRORS=true \
|
||||||
--build-arg MIRROR_COUNTRY="${MIRROR_COUNTRY}" \
|
--build-arg MIRROR_COUNTRY="${MIRROR_COUNTRY}" \
|
||||||
-f ./Dockerfile \
|
-f ./Dockerfile.naked-auto \
|
||||||
-t docker-osx:big-sur .
|
-t docker-osx:naked-auto .
|
||||||
docker tag docker-osx:big-sur sickcodes/docker-osx:big-sur
|
docker tag docker-osx:naked-auto sickcodes/docker-osx:naked-auto
|
||||||
}
|
}
|
||||||
|
|
||||||
docker-osx:auto () {
|
docker-osx:auto () {
|
||||||
@ -240,17 +233,35 @@ docker-osx:auto () {
|
|||||||
docker tag docker-osx:auto sickcodes/docker-osx:auto
|
docker tag docker-osx:auto sickcodes/docker-osx:auto
|
||||||
}
|
}
|
||||||
|
|
||||||
docker-osx:auto-big-sur () {
|
# docker-osx:auto-big-sur () {
|
||||||
|
# docker build ${NO_CACHE} \
|
||||||
|
# --build-arg RANKMIRRORS=true \
|
||||||
|
# --build-arg MIRROR_COUNTRY="${MIRROR_COUNTRY}" \
|
||||||
|
# --build-arg IMAGE_URL='https://images.sick.codes/mac_hdd_ng_auto_big_sur.img' \
|
||||||
|
# -f ./Dockerfile.auto \
|
||||||
|
# -t docker-osx:auto-big-sur .
|
||||||
|
# docker tag docker-osx:auto-big-sur sickcodes/docker-osx:auto-big-sur
|
||||||
|
# }
|
||||||
|
|
||||||
|
docker-osx:version () {
|
||||||
|
SHORTNAME="${1}"
|
||||||
docker build ${NO_CACHE} \
|
docker build ${NO_CACHE} \
|
||||||
|
--build-arg BRANCH="${BRANCH}" \
|
||||||
--build-arg RANKMIRRORS=true \
|
--build-arg RANKMIRRORS=true \
|
||||||
|
--build-arg SHORTNAME="${SHORTNAME}" \
|
||||||
--build-arg MIRROR_COUNTRY="${MIRROR_COUNTRY}" \
|
--build-arg MIRROR_COUNTRY="${MIRROR_COUNTRY}" \
|
||||||
--build-arg IMAGE_URL='https://images.sick.codes/mac_hdd_ng_auto_big_sur.img' \
|
-f ./Dockerfile \
|
||||||
-f ./Dockerfile.auto \
|
-t "docker-osx:${SHORTNAME}" .
|
||||||
-t docker-osx:auto-big-sur .
|
docker tag "docker-osx:${SHORTNAME}" "sickcodes/docker-osx:${SHORTNAME}"
|
||||||
docker tag docker-osx:auto-big-sur sickcodes/docker-osx:auto-big-sur
|
|
||||||
}
|
}
|
||||||
|
|
||||||
reset_docker_hard () {
|
reset_docker_hard () {
|
||||||
|
|
||||||
|
tee /etc/docker/daemon.json <<'EOF'
|
||||||
|
{
|
||||||
|
"experimental": true
|
||||||
|
}
|
||||||
|
EOF
|
||||||
systemctl disable --now docker
|
systemctl disable --now docker
|
||||||
systemctl disable --now docker.socket
|
systemctl disable --now docker.socket
|
||||||
systemctl stop docker
|
systemctl stop docker
|
||||||
@ -259,40 +270,47 @@ reset_docker_hard () {
|
|||||||
systemctl enable --now docker
|
systemctl enable --now docker
|
||||||
}
|
}
|
||||||
|
|
||||||
tee -a ~/.bashrc <<EOF ; true &&
|
tee -a ~/.bashrc <<EOF
|
||||||
export DEBIAN_FRONTEND=noninteractive
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
export TZ=UTC
|
export TZ=UTC
|
||||||
EOF
|
EOF
|
||||||
export DEBIAN_FRONTEND=noninteractive \
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
; export TZ=UTC \
|
export TZ=UTC
|
||||||
; ln -snf "/usr/share/zoneinfo/${TZ}" /etc/localtime \
|
ln -snf "/usr/share/zoneinfo/${TZ}" /etc/localtime
|
||||||
; tee -a /etc/timezone <<< "${TZ}" \
|
tee -a /etc/timezone <<< "${TZ}"
|
||||||
; apt update -y \
|
apt update -y
|
||||||
; apt-get install keyboard-configuration -y \
|
apt-get install keyboard-configuration -y
|
||||||
; docker -v | grep '\ 20\.\|\ 19\.' || install_docker \
|
docker -v | grep '\ 20\.\|\ 19\.' || install_docker
|
||||||
; yes | apt install -y --no-install-recommends tzdata -y \
|
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
|
||||||
; echo start_xvfb \
|
start_xvfb
|
||||||
; start_vnc \
|
# start_vnc
|
||||||
; enable_kvm \
|
enable_kvm
|
||||||
; echo reset_docker_hard \
|
reset_docker_hard
|
||||||
; echo killall Xvfb \
|
echo killall Xvfb
|
||||||
; clone_repo "${BRANCH}" "${REPO}" \
|
clone_repo "${BRANCH}" "${REPO}"
|
||||||
; cd Docker-OSX \
|
cd ./Docker-OSX
|
||||||
; for TEST_BUILD in "${TEST_BUILDS[@]}"; do
|
|
||||||
|
for SHORTNAME in "${VERSION_BUILDS[@]}"; do
|
||||||
|
docker-osx:version "${SHORTNAME}"
|
||||||
|
done
|
||||||
|
|
||||||
|
docker tag docker-osx:catalina sickcodes/docker-osx:latest
|
||||||
|
|
||||||
|
for TEST_BUILD in "${TEST_BUILDS[@]}"; do
|
||||||
"${TEST_BUILD}"
|
"${TEST_BUILD}"
|
||||||
done \
|
done
|
||||||
&& touch COMPLETED
|
|
||||||
|
# boot each image and test
|
||||||
|
bash ./tests/boot-images.sh || exit 1
|
||||||
|
|
||||||
if [[ "${DOCKER_USERNAME}" ]] && [[ "${DOCKER_PASSWORD}" ]]; then
|
if [[ "${DOCKER_USERNAME}" ]] && [[ "${DOCKER_PASSWORD}" ]]; then
|
||||||
docker login --username "${DOCKER_USERNAME}" --password "${DOCKER_PASSWORD}" \
|
docker login --username "${DOCKER_USERNAME}" --password "${DOCKER_PASSWORD}" \
|
||||||
&& docker push sickcodes/docker-osx:latest \
|
&& for SHORTNAME in "${VERSION_BUILDS[@]}"; do
|
||||||
&& docker push sickcodes/docker-osx:big-sur \
|
docker push "sickcodes/docker-osx:${SHORTNAME}"
|
||||||
&& docker push sickcodes/docker-osx:naked \
|
done \
|
||||||
&& docker push sickcodes/docker-osx:auto \
|
|
||||||
&& docker push sickcodes/docker-osx:auto-big-sur \
|
|
||||||
&& touch PUSHED
|
&& touch PUSHED
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
225
vnc-version/Dockerfile.nakedvnc
Normal file
@ -0,0 +1,225 @@
|
|||||||
|
#!/usr/bin/docker
|
||||||
|
# ____ __ ____ ______ __
|
||||||
|
# / __ \____ _____/ /_____ _____/ __ \/ ___/ |/ /
|
||||||
|
# / / / / __ \/ ___/ //_/ _ \/ ___/ / / /\__ \| /
|
||||||
|
# / /_/ / /_/ / /__/ ,< / __/ / / /_/ /___/ / |
|
||||||
|
# /_____/\____/\___/_/|_|\___/_/ \____//____/_/|_| :NAKEDVNC
|
||||||
|
#
|
||||||
|
# Title: Docker-OSX (Mac on Docker)
|
||||||
|
# Author: Sick.Codes https://twitter.com/sickcodes
|
||||||
|
# Version: 4.4
|
||||||
|
# License: GPLv3+
|
||||||
|
# Repository: https://github.com/sickcodes/Docker-OSX
|
||||||
|
# Website: https://sick.codes
|
||||||
|
#
|
||||||
|
# This image won't run unless you supply a disk image using:
|
||||||
|
# -v ${PWD}/mac_hdd_ng.img:/image
|
||||||
|
#
|
||||||
|
# Take screenshots in the Arch container and display in terminal: scrotcat
|
||||||
|
#
|
||||||
|
# Build:
|
||||||
|
#
|
||||||
|
# docker build -t docker-osx:nakedvnc -f Dockerfile.nakedvnc .
|
||||||
|
#
|
||||||
|
# Run headless:
|
||||||
|
#
|
||||||
|
# docker run -it --device /dev/kvm -p 50922:10022 -v ${PWD}/mac_hdd_ng.img:/image docker-osx:nakedvnc
|
||||||
|
#
|
||||||
|
# Run with display:
|
||||||
|
#
|
||||||
|
# docker run -it --device /dev/kvm -p 50922:10022 -v ${PWD}/mac_hdd_ng.img:/image -e "DISPLAY=${DISPLAY:-:0.0}" -v /tmp/.X11-unix:/tmp/.X11-unix docker-osx:nakedvnc
|
||||||
|
#
|
||||||
|
|
||||||
|
FROM sickcodes/docker-osx:latest
|
||||||
|
|
||||||
|
MAINTAINER 'https://twitter.com/sickcodes' <https://sick.codes>
|
||||||
|
|
||||||
|
USER root
|
||||||
|
|
||||||
|
WORKDIR /root
|
||||||
|
|
||||||
|
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
|
||||||
|
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" \
|
||||||
|
; 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
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
RUN pacman -Syu xorg-server-xvfb wget xterm xorg-xhost xorg-xrandr sshpass --noconfirm \
|
||||||
|
&& if [[ "${SCROT}" ]]; then \
|
||||||
|
pacman -Syu scrot base-devel --noconfirm \
|
||||||
|
&& git clone --recurse-submodules --depth 1 https://github.com/stolk/imcat.git \
|
||||||
|
&& cd imcat \
|
||||||
|
&& make \
|
||||||
|
&& sudo cp imcat /usr/bin/imcat \
|
||||||
|
&& touch /usr/bin/scrotcat \
|
||||||
|
&& tee -a /usr/bin/scrotcat <<< '/usr/bin/imcat <(scrot -o /dev/stdout)' \
|
||||||
|
&& chmod +x /usr/bin/scrotcat \
|
||||||
|
; else \
|
||||||
|
touch /usr/bin/scrotcat \
|
||||||
|
&& echo echo >> /usr/bin/scrotcat \
|
||||||
|
&& chmod +x /usr/bin/scrotcat \
|
||||||
|
; 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
|
||||||
|
|
||||||
|
RUN mkdir -p ~/.ssh \
|
||||||
|
&& touch ~/.ssh/authorized_keys \
|
||||||
|
&& touch ~/.ssh/config \
|
||||||
|
&& chmod 700 ~/.ssh \
|
||||||
|
&& chmod 600 ~/.ssh/config \
|
||||||
|
&& chmod 600 ~/.ssh/authorized_keys \
|
||||||
|
&& tee -a ~/.ssh/config <<< 'Host *' \
|
||||||
|
&& tee -a ~/.ssh/config <<< ' StrictHostKeyChecking no' \
|
||||||
|
&& tee -a ~/.ssh/config <<< ' UserKnownHostsFile=/dev/null'
|
||||||
|
|
||||||
|
#### SPECIAL RUNTIME ARGUMENTS BELOW
|
||||||
|
|
||||||
|
ENV ADDITIONAL_PORTS=
|
||||||
|
|
||||||
|
# add additional QEMU boot arguments
|
||||||
|
ENV BOOT_ARGS=
|
||||||
|
|
||||||
|
ENV BOOTDISK=
|
||||||
|
|
||||||
|
# edit the CPU that is beign emulated
|
||||||
|
ENV CPU=Penryn
|
||||||
|
|
||||||
|
ENV DISPLAY=:99
|
||||||
|
|
||||||
|
ENV HEADLESS=false
|
||||||
|
|
||||||
|
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=/image
|
||||||
|
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
|
||||||
|
|
||||||
|
ENV NOPICKER=true
|
||||||
|
|
||||||
|
# dynamic RAM options for runtime
|
||||||
|
ENV RAM=8
|
||||||
|
# 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
|
||||||
|
|
||||||
|
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 \
|
||||||
|
; { [[ "${DISPLAY}" = ':99' ]] || [[ "${HEADLESS}" == true ]] ; } && { \
|
||||||
|
nohup Xvfb :99 -screen 0 1920x1080x16 \
|
||||||
|
& until [[ "$(xrandr --query 2>/dev/null)" ]]; do sleep 1 ; done \
|
||||||
|
; } \
|
||||||
|
; [[ "${NOPICKER}" == true ]] && { \
|
||||||
|
sed -i '/^.*InstallMedia.*/d' Launch.sh \
|
||||||
|
&& export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore-nopicker.qcow2}" \
|
||||||
|
; } \
|
||||||
|
|| export BOOTDISK="${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/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-Catalina/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-Catalina/OpenCore.qcow2}" \
|
||||||
|
|| exit 1 ; } \
|
||||||
|
# ; ./enable-ssh.sh && /bin/bash -c ./Launch.sh
|
||||||
|
|
||||||
|
WORKDIR /home/arch/OSX-KVM
|
||||||
|
|
||||||
|
RUN sudo pacman -Syyuu --noconfirm \
|
||||||
|
&& 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' \
|
||||||
|
'/usr/bin/Xvnc -geometry 1920x1080 -rfbauth "${HOME}/.vnc/passwd" :99 &' > vnc.sh
|
||||||
|
|
||||||
|
RUN cat vnc.sh Launch.sh > Launch_custom.sh
|
||||||
|
|
||||||
|
RUN chmod +x Launch_custom.sh
|
||||||
|
|
||||||
|
RUN tee vncpasswd_file <<< "${VNC_PASSWORD:="$(tr -dc '[:graph:]' </dev/urandom | head -c8)"}"
|
||||||
|
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
|
||||||
|
|