Compare commits

...

184 commits

Author SHA1 Message Date
Kroese
297714126c
build: Update QEMU base image to v7.29 (#377)
Some checks failed
Update / dockerHubDescription (push) Has been cancelled
2025-11-22 05:00:34 +01:00
renovate[bot]
056dfdd026
chore(deps): update actions/checkout action to v6 (#375) 2025-11-21 12:35:52 +01:00
Kroese
4cdd13585d
fix: Continue booting when Fiano fails (#376)
Add error handling for logo replacement in BIOS
2025-11-21 12:33:10 +01:00
Kroese
1b3f506bbe
fix: Update Workspaces configuration (#374) 2025-11-14 06:33:48 +01:00
Kroese
9288c856e4
build: Update QEMU base image to v7.28 (#372) 2025-11-12 07:07:54 +01:00
Kroese
67a172743c
build: Use Github token (#366) 2025-10-29 14:05:31 +01:00
Kroese
333948ef19
fix: Inherit owner from parent folder (#359) 2025-10-22 04:03:24 +02:00
Kroese
dd59b97af6
build: Add code quality checks (#363) 2025-10-22 01:02:41 +02:00
Kroese
5c26b95ee4
build: Update QEMU base image to v7.27 (#362) 2025-10-21 23:19:57 +02:00
Kroese
b3450d11eb
docs: Update docker run command (#361) 2025-10-21 23:15:38 +02:00
Kroese
61ff166d16
build: Add review workflow for shell formatting (#360) 2025-10-21 22:38:09 +02:00
Kroese
211601d12b
build: Update QEMU base image to v7.26 (#358) 2025-10-19 18:02:33 +02:00
Kroese
e032e349ee
feat: Improve Github Codespaces configuration (#357) 2025-10-19 12:48:57 +02:00
Kroese
2f0e962edd
feat: Improve Github Codespaces configuration (#356) 2025-10-19 10:40:37 +02:00
Kroese
05a699ba9a
feat: Improve Github Codespaces configuration (#355) 2025-10-19 01:11:57 +02:00
Kroese
72468237d3
fix: Remove version variable in Codespaces (#354) 2025-10-17 19:02:01 +02:00
Kroese
20068d21a3
fix: Remove hostRequirements in Codespaces (#353) 2025-10-17 18:57:16 +02:00
Kroese
6672deb920
fix: Use temporary file when extracting ROM (#352) 2025-10-17 17:18:21 +02:00
Kroese
fb7cd67691
feat: Improve Github Codespaces configuration (#351) 2025-10-17 13:35:52 +02:00
Kroese
c3d9de925c
build: Update QEMU base image version to v7.25 (#350) 2025-10-17 13:33:28 +02:00
Kroese
b1d47f113b
feat: Load memory module (#349) 2025-10-17 13:31:46 +02:00
Kroese
8def1efbc0
build: Validate JSON and YML files (#348) 2025-10-17 10:05:33 +02:00
Kroese
9a8afcf237
feat: Make macOS version selectable in Codespaces (#347) 2025-10-16 08:55:31 +02:00
Kroese
e461eba7b3
feat: Improve Github Codespaces configuration (#346) 2025-10-16 00:01:30 +02:00
Kroese
3935b89941
feat: Improve Github Codespaces configuration (#345) 2025-10-15 23:45:21 +02:00
Kroese
9c8458d30b
fix: Use Skylake CPU model for macOS 14+ on AMD (#341) 2025-10-15 21:33:53 +02:00
Kroese
61d30d1672
docs: Add warning about AMD processors (#343) 2025-10-15 21:31:32 +02:00
Kroese
0daaa39547
docs: Add info about Migration Assistant (#344) 2025-10-15 21:30:24 +02:00
Kroese
2d21f714c3
feat: Add custom .yml for Github Codespaces (#342) 2025-10-15 11:53:22 +02:00
Kroese
d3c2d44855
build: Update QEMU base image to v7.24 (#339) 2025-10-13 15:06:02 +02:00
Kroese
cfd279b7e1
build: Update QEMU base image version to v7.23 (#336) 2025-10-12 02:02:37 +02:00
Kroese
8423965cf8
build: Run check for all files (#335)
Removed specific paths from pull request trigger.
2025-10-12 00:21:57 +02:00
Kroese
4c529524ad
build: Update QEMU base image to v7.22 (#332) 2025-10-08 22:06:07 +02:00
Kroese
7f1202725c
build: Update QEMU base image to v7.21 (#330) 2025-10-07 01:17:59 +02:00
Kroese
6c6f929adf
fix: Correct Tahoe version number (#329) 2025-10-03 11:17:16 +02:00
Kroese
feac11ef9a
feat: Add startup hook (#328) 2025-10-03 11:15:21 +02:00
renovate[bot]
9d19aeeaf3
chore(deps): update qemux/qemu docker tag to v7.20 (#327)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-03 05:42:16 +02:00
renovate[bot]
edaa2d2bfc
chore(deps): update peter-evans/dockerhub-description action to v5 (#325)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-01 23:40:04 +02:00
Kroese
a92a2cb0a0
build: Update QEMU base image version to 7.19 (#324) 2025-10-01 13:16:31 +02:00
Kroese
944d58a982
docs: Readme (#323) 2025-09-30 18:01:16 +02:00
Kroese
eda63efc6e
docs: Add macOS Tahoe support (#322) 2025-09-30 17:26:11 +02:00
Kroese
45b966703e
feat: Set default to Sonoma (#321) 2025-09-30 11:33:07 +02:00
Kroese
1f31b50ff8
feat: Added custom BIOS logo (#319) 2025-09-30 01:16:08 +02:00
renovate[bot]
05dad712f3
chore(deps): update qemux/qemu docker tag to v7.18 (#318)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-09-30 00:47:56 +02:00
Kroese
4e804a1ef9
feat: Update warning messages (#314) 2025-09-24 16:42:50 +02:00
Kroese
5b25e4c64d
build: Update QEMU base image version to 7.17 (#315) 2025-09-24 16:41:59 +02:00
Kroese
f9ea2f2781
fix: Move KVM warning (#313) 2025-09-23 16:16:11 +02:00
Kroese
35c7419044
feat: Disable VMX cpu flag (#312) 2025-09-23 15:24:23 +02:00
Kroese
8e7572b1ff
feat: Add additional KVM check (#311) 2025-09-23 08:57:35 +02:00
Kroese
125f14164b
feat: Disable unsupported CPU flags in TCG mode (#310) 2025-09-23 08:44:48 +02:00
Kroese
1ed6749ccd
build: Update QEMU base image to v7.16 (#309) 2025-09-22 22:02:37 +02:00
renovate[bot]
fc99211115
chore(deps): update hadolint/hadolint-action action to v3.3.0 (#307)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-09-22 21:34:24 +02:00
Kroese
d4add50eb4
fix: Variable expansion in retry loop (#308) 2025-09-22 21:32:25 +02:00
Kroese
c787b8dd13
feat: Show delay progress (#306)
Added a delay function to handle retry messages for failed downloads.
2025-09-22 07:21:26 +02:00
Kroese
54e08a9425
revert: Simplify conditional checks (#305)
This reverts commit 733266fd6c.
2025-09-21 23:06:48 +02:00
Kroese
733266fd6c
fix: Simplify conditional checks (#304) 2025-09-21 15:04:44 +02:00
Kroese
08ac3ab823
build: Update QEMU base image to v7.15 (#303)
Updated QEMU base image version from 7.14 to 7.15.
2025-09-21 04:47:39 +02:00
Kroese
a737399811
fix: Simplify conditional checks (#302) 2025-09-20 23:48:56 +02:00
Kroese
109b84fd6f
feat: Resume failed download (#301) 2025-09-20 14:46:28 +02:00
renovate[bot]
fb044b9158
chore(deps): update qemux/qemu docker tag to v7.14 (#300)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-09-18 23:47:29 +02:00
Kroese
a82c3b58fd
feat: Cleanup old files before installation (#299) 2025-09-17 18:35:00 +02:00
renovate[bot]
0cd494674c
chore(deps): update qemux/qemu docker tag to v7.13 (#298)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-09-17 18:27:20 +02:00
Kroese
7d85112d12
feat: Restrict AMD CPU's to a single core (#297) 2025-09-15 22:09:51 +02:00
Kroese
f15a2d6ae5
feat: Create subfolder only after version is checked (#296) 2025-09-15 17:58:15 +02:00
Kroese
827f458cae
feat: Seperate subfolders for each version (#295)
Allows for easier version management as there is no need to clear the /storage folder anymore when switching between macOS releases.
2025-09-15 17:37:53 +02:00
Kroese
27a66f4748
feat: Remove leading and trailing spaces from VERSION (#294) 2025-09-15 14:18:24 +02:00
Kroese
9fb20e6ef5
build: Disable automatic builds (#293)
Removed push trigger and paths to ignore from build workflow.
2025-09-14 11:52:53 +02:00
renovate[bot]
e1977b9cdc
chore(deps): update hadolint/hadolint-action action to v3.2.0 (#288)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-09-06 20:18:38 +02:00
Kroese
db7d2d32a4
feat: Add syntax parser directive (#286) 2025-08-27 21:39:13 +02:00
dependabot[bot]
fa9319e74e
build(deps): bump alpine from 3.21 to 3.22 (#263)
Bumps alpine from 3.21 to 3.22.

---
updated-dependencies:
- dependency-name: alpine
  dependency-version: '3.22'
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-27 21:06:11 +02:00
dependabot[bot]
b6a318f6e9
build(deps): bump actions/checkout from 4 to 5 (#282)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-27 20:58:56 +02:00
renovate[bot]
d93c75b979
chore(deps): update qemux/qemu docker tag to v7.12 (#257) 2025-05-06 06:40:41 +02:00
Kroese
9115d132f6
docs: Add input types (#251) 2025-04-23 12:50:38 +02:00
Kroese
88c3f6219e
docs: Add quotes around $PWD (#247) 2025-04-16 12:13:46 +02:00
Kroese
e0a357091d
build: Update qemu-docker to v7.11 (#246) 2025-04-14 21:04:15 +02:00
Kroese
69b79d9ba9
build: Update qemu-docker to v7.10 (#245) 2025-04-08 07:58:04 +02:00
Kroese
132033171d
build: Update qemu-docker to v7.08 (#241) 2025-04-04 01:19:27 +02:00
Kroese
88a476ef4c
docs: Disk pass-through (#240) 2025-04-03 10:31:29 +02:00
Kroese
08255c5a45
build: Update OpenCore to 1.0.4 (#239) 2025-04-03 01:34:21 +02:00
Kroese
a410d8a123
build: Update qemu-docker to v7.07 (#236) 2025-03-28 20:34:27 +01:00
Kroese
6060d36387
docs: Github Codespaces (#234) 2025-03-27 01:47:11 +01:00
Kroese
0ffd7852fe
fix: Set BIOS variable (#233) 2025-03-27 00:18:30 +01:00
Kroese
431d9e544f
build: Update qemu-docker to v7.06 (#232) 2025-03-26 19:42:04 +01:00
Kroese
1bf46b7e0b
docs: Apple Account (#230) 2025-03-25 21:14:14 +01:00
Kroese
bbbc853178
docs: Github Codespaces (#229) 2025-03-25 14:44:55 +01:00
Kroese
453ec734ba
feat: Remove non-printable characters (#228) 2025-03-24 14:01:17 +01:00
renovate[bot]
cdf3e9df63
build: Update qemu-docker to v7.04 (#213) 2025-03-21 21:54:06 +01:00
Kroese
8e23be901f
docs: KVM information (#225) 2025-03-20 23:21:30 +01:00
Kroese
431b4b6ce9
docs: Compatibility chart (#224) 2025-03-20 23:07:18 +01:00
Kroese
a4735a328f
docs: Add Podman (#223) 2025-03-20 20:06:11 +01:00
Kroese
6d588e42e1
fix: Platform variable (#222) 2025-03-20 16:50:18 +01:00
Kroese
5698b772b3
build: Update qemu-docker to v7.03 (#220) 2025-03-20 10:07:33 +01:00
Kroese
874bfa197b
feat: Add devcontainer (#218) 2025-03-19 09:18:35 +01:00
Kroese
6d65c6cfbb
docs: Github Codespaces (#217) 2025-03-18 14:15:12 +01:00
Kroese
9e07cb5367
feat: Add devcontainer (#216) 2025-03-18 11:23:42 +01:00
Kroese
de76cca895
docs: Port number (#215) 2025-03-18 05:00:46 +01:00
Kroese
69fb95c90f
build: Update qemu-docker to v7.01 (#214) 2025-03-18 03:58:10 +01:00
Kroese
d07d09ea48
feat: Switch to port 80 (#212) 2025-03-17 16:44:07 +01:00
Kroese
422ded1364
feat: Improved download method (#211) 2025-03-16 13:59:01 +01:00
Kroese
3277ec9eea
docs: File sharing (#210) 2025-03-16 07:31:41 +01:00
Kroese
2f0ee294e0
docs: Readme (#209) 2025-03-16 07:04:15 +01:00
Kroese
ad46446f1b
feat: Verify clock source (#207) 2025-03-15 14:10:59 +01:00
renovate[bot]
e94516ebec
build: Update qemu-docker to v6.22 (#206)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-14 14:09:30 +01:00
renovate[bot]
876b858c69
build: Update qemu-docker to v6.21 (#205) 2025-03-12 21:56:19 +01:00
Kroese
35922a1714
docs: Use relative paths (#204) 2025-03-12 12:21:12 +01:00
Francois Liot
70f6feb864
docs: Kubernetes deployment (#202) 2025-03-07 00:41:03 +01:00
Kroese
5ccb6fde73
build: Update qemu-docker to v6.20 (#201) 2025-03-04 15:46:45 +01:00
Kroese
90e5afd771
build: Update qemu-docker to v6.19 (#200) 2025-03-03 12:28:21 +01:00
Kroese
0d270138f2
build: Update qemu-docker to v6.18 (#198) 2025-02-26 22:48:22 +01:00
Kroese
3768d0f3df
feat: Make app name configurable (#197)
Some checks failed
Build / Test (push) Has been cancelled
Build / Build (push) Has been cancelled
2025-02-25 15:13:03 +01:00
Kroese
8d10ce8f68
build: Update qemu-docker to v6.17 (#196)
Some checks are pending
Build / Test (push) Waiting to run
Build / Build (push) Blocked by required conditions
2025-02-25 06:02:18 +01:00
Kroese
250a09a2ac
build: Update qemu-docker to v6.16 (#194)
Some checks are pending
Build / Test (push) Waiting to run
Build / Build (push) Blocked by required conditions
2025-02-24 04:07:27 +01:00
Kroese
82865eb6d5
build: Update OpenCore to 1.0.3 (#190)
Some checks failed
Build / Test (push) Has been cancelled
Build / Build (push) Has been cancelled
2025-02-17 19:15:30 +01:00
Kroese
eb50bf405a
docs: Add restart policy (#189) 2025-02-17 09:26:28 +01:00
renovate[bot]
44be8f5869
chore(deps): update qemux/qemu-docker docker tag to v6.15 (#188)
Some checks failed
Build / Test (push) Has been cancelled
Build / Build (push) Has been cancelled
2025-02-15 11:05:54 +01:00
Kroese
028b71f593
docs: Add restart policy (#185)
Some checks failed
Update / dockerHubDescription (push) Has been cancelled
2025-02-10 00:27:27 +01:00
renovate[bot]
c2422ba1a4
chore(deps): update qemux/qemu-docker docker tag to v6.14 (#183)
Some checks failed
Build / Test (push) Has been cancelled
Build / Build (push) Has been cancelled
2025-02-06 02:08:14 +01:00
Kroese
72971f2df5
fix: Remove Sequoia patch (#182)
Some checks failed
Build / Test (push) Has been cancelled
Build / Build (push) Has been cancelled
2025-01-30 12:42:28 +01:00
Kroese
7aec69abd4
build: Update qemu-docker to v6.13 (#180)
Some checks failed
Build / Test (push) Has been cancelled
Build / Build (push) Has been cancelled
2025-01-15 23:29:19 +01:00
thinker007
b37ed52881
fix: Use kern.hv_vmm_present=0 for Sequoia (#160)
Some checks failed
Build / Test (push) Has been cancelled
Build / Build (push) Has been cancelled
2024-12-20 17:24:11 +01:00
Kroese
431e95d798
build: Update qemu-docker to v6.12 (#167) 2024-12-20 15:21:18 +01:00
renovate[bot]
17a2f29834
chore(deps): update alpine docker tag to v3.21 (#153)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-20 15:19:57 +01:00
Kroese
5cae89f75f
build: Update qemu-docker to v6.11 (#151)
Some checks failed
Build / Test (push) Has been cancelled
Build / Build (push) Has been cancelled
2024-12-03 11:56:17 +01:00
Kroese
22fedbfa72
docs: Add TUN device (#148)
Some checks failed
Update / dockerHubDescription (push) Has been cancelled
2024-12-01 18:06:30 +01:00
renovate[bot]
01e809c0aa
chore(deps): update qemux/qemu-docker docker tag to v6.10 (#141)
Some checks failed
Build / Test (push) Has been cancelled
Build / Build (push) Has been cancelled
2024-11-26 21:02:27 +01:00
renovate[bot]
e0c84427f8
chore(deps): update qemux/qemu-docker docker tag to v6.09 (#139)
Some checks failed
Build / Test (push) Has been cancelled
Build / Build (push) Has been cancelled
2024-11-24 23:41:06 +01:00
Kroese
6f833321b3
build: Pin Alpine version (#133)
Some checks failed
Build / Test (push) Has been cancelled
Build / Build (push) Has been cancelled
Update / dockerHubDescription (push) Has been cancelled
2024-11-16 14:32:19 +01:00
Kroese
c6ec08c0b5
feat: Generate unique machine serials (#132) 2024-11-16 14:27:09 +01:00
Kroese
ddff7a3f92
feat: Generate Apple MAC address (#125) 2024-11-14 02:29:50 +01:00
Kroese
fba0a66658
feat: Generate Apple MAC address (#124) 2024-11-14 02:27:42 +01:00
Kroese
f6831a5ba6
docs: Add Kubernetes URL (#119) 2024-11-13 03:36:56 +01:00
Kroese
7225019302
docs: Add compatibility chart (#118) 2024-11-13 03:26:54 +01:00
renovate[bot]
be5b26a754
chore(deps): update qemux/qemu-docker docker tag to v6.07 (#117)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-13 02:54:39 +01:00
Kroese
b993d8c0bd
docs: Readme (#116) 2024-11-13 00:33:42 +01:00
Kroese
cea3262937
docs: Acknowledgements (#114) 2024-11-12 10:31:55 +01:00
Kroese
b709ec3057
docs: KVM troubleshooting (#110) 2024-11-11 14:19:31 +01:00
Kroese
40fe37786b
docs: Use numeric version values (#109) 2024-11-10 00:22:01 +01:00
Kroese
ee97b791e0
docs: Use numeric version values (#102) 2024-10-21 12:00:55 +02:00
renovate[bot]
5ddafa7568
chore(deps): update qemux/qemu-docker docker tag to v6.06 (#101)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-21 12:00:37 +02:00
Markus Zimmermann
c2aa3c6f43
docs: Divide list of versions into the actual version and release name of MacOS (#100) 2024-10-18 12:27:30 +02:00
Kroese
c9c3d82a54
build: Remove index annotations (#97) 2024-10-15 00:36:25 +02:00
Kroese
48ae8e666b
build: Remove ARM64 platform (#96) 2024-10-14 18:58:00 +02:00
Kroese
b6be959712
feat: Detect nested virtualization (#94) 2024-10-12 20:05:41 +02:00
renovate[bot]
2fa64cf373
chore(deps): update qemux/qemu-docker docker tag to v6.05 (#92)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-08 19:36:29 +02:00
renovate[bot]
4528b3ecd6
chore(deps): update qemux/qemu-docker docker tag to v6.04 (#91)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-05 15:43:35 +02:00
Kroese
1cf4f3d154
fix: macOS Sequoia download (#90) 2024-10-04 18:02:06 +02:00
Kroese
0e69a19220
fix: Remove scsi parameter from virtio-blk-pci (#89) 2024-10-02 13:11:11 +02:00
renovate[bot]
471a809902
chore(deps): update qemux/qemu-docker docker tag to v6.03 (#87)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-02 00:39:27 +02:00
Kroese
c0865239d5
fix: Fix for Inappropriate ioctl for device (#86) 2024-10-01 10:18:12 +02:00
Kroese
bb640e7ecf
fix: Update board ID's (#80) 2024-09-29 21:13:27 +02:00
Kroese
60ddd4d611
feat: Update board ID's (#79) 2024-09-29 17:27:27 +02:00
Kroese
2ce297f9c5
feat: Add macOS 15 (Sequoia) (#78) 2024-09-29 16:51:27 +02:00
Kroese
55ecf49757
build: Update qemu-docker to v6.02 (#77) 2024-09-27 14:44:18 +02:00
Kroese
8c6314b5ab
build: Update qemu-docker to v6.01 (#73) 2024-09-14 23:18:21 +02:00
Kroese
cffe7321eb
build: Update qemu-docker to v6.00 (#71) 2024-09-05 18:56:11 +02:00
Kroese
0e999a5f5d
docs: Update package URL (#68) 2024-09-03 15:08:40 +02:00
Kroese
4d566a22aa
docs: Update package URL (#66) 2024-08-27 18:27:44 +02:00
Kroese
9b7bc11294
build: Update qemu-docker to v5.18 (#64) 2024-08-18 18:06:33 +02:00
Kroese
24377bb04a
build: Update qemu-docker to v5.17 (#63) 2024-08-18 02:47:12 +02:00
Kroese
d6a0a37026
docs: Fix badge (#60) 2024-08-13 21:16:13 +02:00
renovate[bot]
a65c619da8
chore(deps): update docker/build-push-action action to v6 (#52)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-19 10:59:22 +02:00
Kroese
00ecf9fff4
fix: Revert AMD core count restriction (#51) 2024-06-14 03:10:59 +02:00
renovate[bot]
3e5fe3430a
chore(deps): update qemux/qemu-docker docker tag to v5.16 (#50)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-14 03:07:04 +02:00
Kroese
7e761f8b17
docs: Removed Kubevirt dependancy (#49) 2024-06-13 19:33:39 +02:00
Kroese
9ebb1f4a38
docs: Add markdown alerts (#48) 2024-06-13 18:34:10 +02:00
Kroese
c4e3ccc43b
fix: Automaticly adjust CPU core count (#47) 2024-06-12 22:58:27 +02:00
renovate[bot]
c12f9c489b
chore(deps): update qemux/qemu-docker docker tag to v5.15 (#45)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-12 22:52:04 +02:00
Kroese
21d57d24c9
docs: Add GHCR badge (#44) 2024-06-11 23:37:04 +02:00
Kroese
ed8bc829da
docs: Readme (#42) 2024-06-11 21:49:13 +02:00
Kroese
f07c15ba82
docs: Add icons (#41) 2024-06-11 21:04:45 +02:00
Kroese
416abbc1f0
docs: Add icons (#40) 2024-06-11 21:01:40 +02:00
Kroese
e116eec294
docs: KVM information (#39) 2024-06-11 19:50:40 +02:00
Kroese
3b110b1ca1
fix: Set default version to Ventura (#38) 2024-06-11 02:58:10 +02:00
Kroese
e07aadf4e1
docs: Indentation (#37) 2024-06-11 02:44:54 +02:00
Kroese
45a3fdfcdc
build: Update qemu-docker to v5.13 (#36) 2024-06-11 01:54:44 +02:00
Kroese
5b021f883e
docs: KVM troubleshooting (#35) 2024-06-11 01:53:13 +02:00
seitenca
9bcc4bb095
feat: Make CPU model and flags configurable (#34) 2024-06-11 01:43:01 +02:00
renovate[bot]
0b23f617a9
chore(deps): update qemux/qemu-docker docker tag to v5.12 (#20)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-09 17:57:04 +02:00
Kroese
ba8dd2848b
feat: Update bootloader automaticly (#32) 2024-06-09 08:37:57 +02:00
Kroese
76e2781c46
docs: Legal information (#31) 2024-06-08 22:03:48 +02:00
Kroese
978f72009a
feat: Removed bootmenu (#30) 2024-06-08 20:43:29 +02:00
Kroese
41383565e7
fix: Specified version was ignored (#29) 2024-06-08 16:29:56 +02:00
Kroese
fc6e44a803
build: Use mtools instead of libguestfs to generate image (#28) 2024-06-08 13:48:51 +02:00
Kroese
07e0c5be59
feat: Store UEFI vars in /storage (#27) 2024-06-07 22:16:20 +02:00
24 changed files with 1007 additions and 284 deletions

View file

@ -0,0 +1,19 @@
{
"name": "macOS 15 (Sequoia)",
"service": "macos",
"containerEnv": {
"VERSION": "15"
},
"forwardPorts": [8006],
"portsAttributes": {
"8006": {
"label": "Web",
"onAutoForward": "notify"
}
},
"otherPortsAttributes": {
"onAutoForward": "ignore"
},
"dockerComposeFile": "../codespaces.yml",
"initializeCommand": "docker system prune --all --force"
}

View file

@ -0,0 +1,19 @@
{
"name": "macOS 13 (Ventura)",
"service": "macos",
"containerEnv": {
"VERSION": "13"
},
"forwardPorts": [8006],
"portsAttributes": {
"8006": {
"label": "Web",
"onAutoForward": "notify"
}
},
"otherPortsAttributes": {
"onAutoForward": "ignore"
},
"dockerComposeFile": "../codespaces.yml",
"initializeCommand": "docker system prune --all --force"
}

View file

@ -0,0 +1,19 @@
{
"name": "macOS 12 (Monterey)",
"service": "macos",
"containerEnv": {
"VERSION": "12"
},
"forwardPorts": [8006],
"portsAttributes": {
"8006": {
"label": "Web",
"onAutoForward": "notify"
}
},
"otherPortsAttributes": {
"onAutoForward": "ignore"
},
"dockerComposeFile": "../codespaces.yml",
"initializeCommand": "docker system prune --all --force"
}

View file

@ -0,0 +1,19 @@
{
"name": "macOS 11 (Big Sur)",
"service": "macos",
"containerEnv": {
"VERSION": "11"
},
"forwardPorts": [8006],
"portsAttributes": {
"8006": {
"label": "Web",
"onAutoForward": "notify"
}
},
"otherPortsAttributes": {
"onAutoForward": "ignore"
},
"dockerComposeFile": "../codespaces.yml",
"initializeCommand": "docker system prune --all --force"
}

View file

@ -0,0 +1,19 @@
{
"name": "macOS 10 (Catalina)",
"service": "macos",
"containerEnv": {
"VERSION": "10"
},
"forwardPorts": [8006],
"portsAttributes": {
"8006": {
"label": "Web",
"onAutoForward": "notify"
}
},
"otherPortsAttributes": {
"onAutoForward": "ignore"
},
"dockerComposeFile": "../codespaces.yml",
"initializeCommand": "docker system prune --all --force"
}

View file

@ -0,0 +1,21 @@
services:
macos:
container_name: macos
image: ghcr.io/dockur/macos
environment:
RAM_SIZE: "half"
DISK_SIZE: "max"
CPU_CORES: "max"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports:
- 8006:8006
- 5900:5900/tcp
- 5900:5900/udp
volumes:
- ./macos:/storage
restart: on-failure
stop_grace_period: 2m

View file

@ -0,0 +1,19 @@
{
"name": "macOS 14 (Sonoma)",
"service": "macos",
"containerEnv": {
"VERSION": "14"
},
"forwardPorts": [8006],
"portsAttributes": {
"8006": {
"label": "Web",
"onAutoForward": "notify"
}
},
"otherPortsAttributes": {
"onAutoForward": "ignore"
},
"dockerComposeFile": "codespaces.yml",
"initializeCommand": "docker system prune --all --force"
}

View file

@ -1,4 +1,5 @@
.dockerignore
.devcontainer
.git
.github
.gitignore

View file

@ -21,6 +21,7 @@ body:
attributes:
label: Docker compose
description: The compose file (or otherwise the `docker run` command used).
render: yaml
validations:
required: true
- type: textarea
@ -28,6 +29,7 @@ body:
attributes:
label: Docker log
description: The logfile of the container (as shown by `docker logs macos`).
render: shell
validations:
required: true
- type: textarea

View file

@ -23,6 +23,7 @@ body:
attributes:
label: Docker compose
description: The compose file (or otherwise the `docker run` command used).
render: yaml
validations:
required: true
- type: textarea
@ -30,6 +31,7 @@ body:
attributes:
label: Docker log
description: The logfile of the container (as shown by `docker logs macos`).
render: shell
validations:
required: true
- type: textarea

View file

@ -2,16 +2,6 @@ name: Build
on:
workflow_dispatch:
push:
branches:
- master
paths-ignore:
- '**/*.md'
- '**/*.yml'
- '.gitignore'
- '.dockerignore'
- '.github/**'
- '.github/workflows/**'
concurrency:
group: build
@ -32,7 +22,7 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0
-
@ -50,7 +40,7 @@ jobs:
labels: |
org.opencontainers.image.title=${{ vars.NAME }}
env:
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
@ -69,12 +59,12 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build Docker image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
push: true
provenance: false
platforms: linux/amd64,linux/arm64
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ steps.meta.outputs.annotations }}

View file

@ -7,14 +7,19 @@ jobs:
name: shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
env:
SHELLCHECK_OPTS: -x --source-path=src -e SC1091 -e SC2001 -e SC2002 -e SC2034 -e SC2064 -e SC2153 -e SC2317 -e SC2028
- name: Lint Dockerfile
uses: hadolint/hadolint-action@v3.1.0
uses: hadolint/hadolint-action@v3.3.0
with:
dockerfile: Dockerfile
ignore: DL3008,DL3020,DL3029,DL3059
ignore: DL3008,DL3018,DL3020,DL3029,DL3059
failure-threshold: warning
-
name: Validate JSON and YML files
uses: GrantBirki/json-yaml-validate@v4
with:
yaml_exclude_regex: ".*\\kubernetes\\.yml$"

View file

@ -12,13 +12,15 @@ jobs:
dockerHubDescription:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
-
name: Docker Hub Description
uses: peter-evans/dockerhub-description@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: ${{ secrets.DOCKERHUB_REPO }}
short-description: ${{ github.event.repository.description }}
readme-filepath: ./readme.md
-
name: Checkout repo
uses: actions/checkout@v6
-
name: Docker Hub Description
uses: peter-evans/dockerhub-description@v5
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: ${{ secrets.DOCKERHUB_REPO }}
short-description: ${{ github.event.repository.description }}
readme-filepath: ./readme.md

66
.github/workflows/review.yml vendored Normal file
View file

@ -0,0 +1,66 @@
on:
pull_request:
name: "Review"
permissions:
contents: read
pull-requests: write
checks: write
jobs:
review:
name: review
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v6
-
name: Spelling
uses: reviewdog/action-misspell@v1
with:
locale: "US"
level: warning
pattern: |
*.md
*.sh
reporter: github-pr-review
github_token: ${{ secrets.GITHUB_TOKEN }}
-
name: Hadolint
uses: reviewdog/action-hadolint@v1
with:
level: warning
reporter: github-pr-review
hadolint_ignore: DL3008 DL3018 DL3020 DL3029 DL3059
github_token: ${{ secrets.GITHUB_TOKEN }}
-
name: YamlLint
uses: reviewdog/action-yamllint@v1
with:
level: warning
reporter: github-pr-review
github_token: ${{ secrets.GITHUB_TOKEN }}
-
name: ActionLint
uses: reviewdog/action-actionlint@v1
with:
level: warning
reporter: github-pr-review
github_token: ${{ secrets.GITHUB_TOKEN }}
-
name: Shellformat
uses: reviewdog/action-shfmt@v1
with:
level: warning
shfmt_flags: "-i 2 -ci -bn"
github_token: ${{ secrets.GITHUB_TOKEN }}
-
name: Shellcheck
uses: reviewdog/action-shellcheck@v1
with:
level: warning
reporter: github-pr-review
shellcheck_flags: -x -e SC1091 -e SC2001 -e SC2002 -e SC2034 -e SC2064 -e SC2153 -e SC2317 -e SC2028
github_token: ${{ secrets.GITHUB_TOKEN }}

View file

@ -1,11 +1,6 @@
on:
workflow_dispatch:
pull_request:
paths:
- '**/*.sh'
- '.github/workflows/test.yml'
- '.github/workflows/check.yml'
- 'Dockerfile'
name: "Test"
permissions: {}

View file

@ -1,34 +1,24 @@
FROM --platform=linux/amd64 debian:trixie-slim AS builder
# syntax=docker/dockerfile:1
ARG VERSION_OPENCORE="v21"
ARG REPO_OPENCORE="https://github.com/thenickdude/KVM-Opencore"
FROM --platform=$BUILDPLATFORM alpine:3.22 AS builder
ARG DEBCONF_NOWARNINGS="yes"
ARG DEBIAN_FRONTEND="noninteractive"
ARG DEBCONF_NONINTERACTIVE_SEEN="true"
ARG VERSION_OPENCORE="1.0.4"
ARG REPO_OPENCORE="https://github.com/acidanthera/OpenCorePkg"
ADD $REPO_OPENCORE/releases/download/$VERSION_OPENCORE/OpenCore-$VERSION_OPENCORE-RELEASE.zip /tmp/opencore.zip
RUN set -eu && \
apt-get update && \
apt-get --no-install-recommends -y install \
guestfish \
linux-image-generic && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
COPY --chmod=755 ./src/build.sh /run
COPY --chmod=644 ./config.plist /run
ADD $REPO_OPENCORE/releases/download/$VERSION_OPENCORE/OpenCore-$VERSION_OPENCORE.iso.gz /tmp/opencore.iso.gz
RUN gzip -d /tmp/opencore.iso.gz
RUN run/build.sh /tmp/opencore.iso /run/config.plist
RUN apk --update --no-cache add unzip && \
unzip /tmp/opencore.zip -d /tmp/oc && \
cp /tmp/oc/Utilities/macserial/macserial.linux /macserial && \
rm -rf /tmp/* /var/tmp/* /var/cache/apk/*
FROM scratch AS runner
COPY --from=qemux/qemu-docker:5.11 / /
COPY --from=qemux/qemu:7.29 / /
ARG VERSION_ARG="0.0"
ARG VERSION_KVM_OPENCORE="v21"
ARG VERSION_OSX_KVM="326053dd61f49375d5dfb28ee715d38b04b5cd8e"
ARG REPO_OSX_KVM="https://raw.githubusercontent.com/kholia/OSX-KVM"
ARG REPO_KVM_OPENCORE="https://github.com/thenickdude/KVM-Opencore"
ARG DEBCONF_NOWARNINGS="yes"
ARG DEBIAN_FRONTEND="noninteractive"
@ -37,27 +27,29 @@ ARG DEBCONF_NONINTERACTIVE_SEEN="true"
RUN set -eu && \
apt-get update && \
apt-get --no-install-recommends -y install \
python3 && \
mtools && \
apt-get clean && \
echo "$VERSION_ARG" > /run/version && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
COPY --chmod=755 ./src /run/
COPY --from=builder /images /images
COPY --chmod=755 ./assets /assets/
COPY --chmod=755 --from=builder /macserial /usr/local/bin/
ADD --chmod=755 $REPO_OSX_KVM/$VERSION_OSX_KVM/fetch-macOS-v2.py /run/
ADD --chmod=755 \
ADD --chmod=644 \
$REPO_OSX_KVM/$VERSION_OSX_KVM/OVMF_CODE.fd \
$REPO_OSX_KVM/$VERSION_OSX_KVM/OVMF_VARS.fd \
$REPO_OSX_KVM/$VERSION_OSX_KVM/OVMF_VARS-1024x768.fd \
$REPO_OSX_KVM/$VERSION_OSX_KVM/OVMF_VARS-1920x1080.fd /usr/share/OVMF/
EXPOSE 8006 5900
VOLUME /storage
ADD $REPO_KVM_OPENCORE/releases/download/$VERSION_KVM_OPENCORE/OpenCore-$VERSION_KVM_OPENCORE.iso.gz /opencore.iso.gz
ENV RAM_SIZE "3G"
ENV CPU_CORES "2"
ENV DISK_SIZE "32G"
ENV VERSION "sonoma"
VOLUME /storage
EXPOSE 5900 8006
ENV VERSION="14"
ENV RAM_SIZE="4G"
ENV CPU_CORES="1"
ENV DISK_SIZE="64G"
ENTRYPOINT ["/usr/bin/tini", "-s", "/run/entry.sh"]

View file

@ -1015,7 +1015,7 @@
<key>HibernateSkipsPicker</key>
<false/>
<key>HideAuxiliary</key>
<true/>
<false/>
<key>InstanceIdentifier</key>
<string></string>
<key>LauncherOption</key>
@ -1033,11 +1033,11 @@
<key>PollAppleHotKeys</key>
<true/>
<key>ShowPicker</key>
<true/>
<false/>
<key>TakeoffDelay</key>
<integer>0</integer>
<key>Timeout</key>
<integer>15</integer>
<integer>0</integer>
</dict>
<key>Debug</key>
<dict>
@ -1063,7 +1063,7 @@
<key>Security</key>
<dict>
<key>AllowSetDefault</key>
<true/>
<false/>
<key>ApECID</key>
<integer>0</integer>
<key>AuthRestart</key>
@ -1083,7 +1083,7 @@
<key>PasswordSalt</key>
<data></data>
<key>ScanPolicy</key>
<integer>17761027</integer>
<integer>18809603</integer>
<key>SecureBootModel</key>
<string>Disabled</string>
<key>Vault</key>
@ -1189,7 +1189,7 @@
<key>SystemAudioVolume</key>
<data>Rg==</data>
<key>boot-args</key>
<string>-v keepsyms=1 amfi_get_out_of_my_way=1 tlbto_us=0 vti=9</string>
<string>keepsyms=1</string>
<key>csr-active-config</key>
<data>Jg8=</data>
<key>prev-lang:kbd</key>
@ -1260,11 +1260,13 @@
<key>AdviseFeatures</key>
<false/>
<key>MLB</key>
<string>C02119700QXJG36JC</string>
<string>C02717306J9JG361M</string>
<key>MaxBIOSVersion</key>
<false/>
<key>ProcessorType</key>
<integer>0</integer>
<key>ROM</key>
<string>0022412e3d4a</string>
<data>m7zhIYfl</data>
<key>SpoofVendor</key>
<true/>
<key>SystemMemoryStatus</key>
@ -1272,9 +1274,9 @@
<key>SystemProductName</key>
<string>iMacPro1,1</string>
<key>SystemSerialNumber</key>
<string>C02FPBZPHX87</string>
<string>C02TM2ZBHX87</string>
<key>SystemUUID</key>
<string>213FA768-A62C-4299-8598-47AA666E436F</string>
<string>007076A6-F2A2-4461-BBE5-BAD019F8025A</string>
</dict>
<key>UpdateDataHub</key>
<true/>
@ -1869,7 +1871,7 @@
<key>ReloadOptionRoms</key>
<false/>
<key>RequestBootVarRouting</key>
<true/>
<false/>
<key>ResizeGpuBars</key>
<integer>-1</integer>
<key>ResizeUsePciRbIo</key>

View file

@ -1,15 +1,19 @@
services:
osx:
macos:
image: dockurr/macos
container_name: macos
environment:
VERSION: "sonoma"
VERSION: "14"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports:
- 8006:8006
- 5900:5900/tcp
- 5900:5900/udp
volumes:
- ./macos:/storage
restart: always
stop_grace_period: 2m

View file

@ -1,73 +1,86 @@
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: macos-pvc
spec:
accessModes:
- ReadWriteOnce
- ReadWriteOnce
resources:
requests:
storage: 32Gi
storage: 64Gi
---
apiVersion: v1
kind: Pod
apiVersion: apps/v1
kind: Deployment
metadata:
name: macos
labels:
name: macos
spec:
terminationGracePeriodSeconds: 120 # the Kubernetes default is 30 seconds and it may be not enough
containers:
- name: macos
image: dockurr/macos
ports:
- containerPort: 8006
protocol: TCP
- containerPort: 5000
protocol: TCP
- containerPort: 5000
protocol: UDP
resources:
limits:
devices.kubevirt.io/kvm: 1
securityContext:
privileged: true
env:
- name: RAM_SIZE
value: 3G
- name: CPU_CORES
value: "2"
replicas: 1
selector:
matchLabels:
app: macos
template:
metadata:
labels:
app: macos
spec:
containers:
- name: macos
image: dockurr/macos
env:
- name: VERSION
value: "14"
- name: DISK_SIZE
value: "32G"
volumeMounts:
value: "64G"
ports:
- containerPort: 8006
name: http
protocol: TCP
- containerPort: 5900
name: vnc
protocol: TCP
securityContext:
capabilities:
add:
- NET_ADMIN
privileged: true
volumeMounts:
- mountPath: /storage
name: storage
volumes:
- name: storage
persistentVolumeClaim:
claimName: macos-pvc
- mountPath: /dev/kvm
name: dev-kvm
- mountPath: /dev/net/tun
name: dev-tun
terminationGracePeriodSeconds: 120
volumes:
- name: storage
persistentVolumeClaim:
claimName: macos-pvc
- hostPath:
path: /dev/kvm
name: dev-kvm
- hostPath:
path: /dev/net/tun
type: CharDevice
name: dev-tun
---
apiVersion: v1
kind: Service
metadata:
name: macos
spec:
type: NodePort
selector:
name: macos
internalTrafficPolicy: Cluster
ports:
- name: tcp-8006
protocol: TCP
- name: http
port: 8006
targetPort: 8006
nodePort: 48006
- name: tcp-5900
protocol: TCP
targetPort: 8006
- name: vnc
port: 5900
protocol: TCP
targetPort: 5900
nodePort: 43389
- name: udp-5900
protocol: UDP
port: 5900
targetPort: 5900
nodePort: 43388
selector:
app: macos
type: ClusterIP

234
readme.md
View file

@ -1,4 +1,4 @@
<h1 align="center">OSX<br />
<h1 align="center">macOS<br />
<div align="center">
<a href="https://github.com/dockur/macos/"><img src="https://github.com/dockur/macos/raw/master/.github/logo.png" title="Logo" style="max-width:100%;" width="128" /></a>
</div>
@ -7,21 +7,22 @@
[![Build]][build_url]
[![Version]][tag_url]
[![Size]][tag_url]
[![Package]][pkg_url]
[![Pulls]][hub_url]
</div></h1>
OSX (macOS) inside a Docker container.
MacOS inside a Docker container.
## Features
## Features
- KVM acceleration
- Image downloader
- Web-based viewer
- Automatic download
## Usage
## Usage 🐳
Via Docker Compose:
##### Via Docker Compose:
```yaml
services:
@ -29,99 +30,112 @@ services:
image: dockurr/macos
container_name: macos
environment:
VERSION: "sonoma"
VERSION: "14"
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports:
- 8006:8006
- 5900:5900/tcp
- 5900:5900/udp
volumes:
- ./macos:/storage
restart: always
stop_grace_period: 2m
```
Via Docker CLI:
##### Via Docker CLI:
```bash
docker run -it --rm -p 8006:8006 --device=/dev/kvm --cap-add NET_ADMIN --stop-timeout 120 dockurr/macos
docker run -it --rm --name macos -e "VERSION=14" -p 8006:8006 --device=/dev/kvm --device=/dev/net/tun --cap-add NET_ADMIN -v "${PWD:-.}/macos:/storage" --stop-timeout 120 docker.io/dockurr/macos
```
Via Kubernetes:
##### Via Kubernetes:
```shell
kubectl apply -f kubernetes.yml
kubectl apply -f https://raw.githubusercontent.com/dockur/macos/refs/heads/master/kubernetes.yml
```
## FAQ
##### Via Github Codespaces:
* ### How do I use it?
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/dockur/macos)
## FAQ 💬
### How do I use it?
Very simple! These are the steps:
- Start the container and connect to [port 8006](http://localhost:8006) using your web browser.
- Select `macOS Base System` by pressing the enter key to begin the installation.
- Start the container and connect to [port 8006](http://127.0.0.1:8006/) using your web browser.
- Choose `Disk Utility` and then select the largest `Apple Inc. VirtIO Block Media` disk.
- Click the `Erase` button to format the disk, and give it any recognizable name you like.
- Click the `Erase` button to format the disk to APFS, and give it any name you like.
- Close the current window and proceed the installation by clicking `Reinstall macOS`.
- When prompted where you want to install macOS, select the disk you just created previously.
- When prompted where you want to install it, select the disk you created previously.
- There will be several reboots, select `macOS Installer` each time until it shows your own disk.
- After all files are copied, select your region, language, and keyboard settings.
- After all files are copied, select your region, language, and account settings.
- When the `Migration Assistant` wants to transfer data, select `Not now` (bottom left).
- Once you see the desktop, your macOS installation is ready for use.
- On the `Apple ID` screen, select `Set Up Later` (bottom left) and then proceed using `Skip`.
- On the `Create a Computer Account` screen, fill in a username and password and `Continue`.
Enjoy your brand new machine, and don't forget to star this repo!
* ### How do I select the macOS version?
### How do I select the version of macOS?
By default, macOS Sonoma will be installed. But you can add the `VERSION` environment variable to your compose file, in order to specify an alternative macOS version to be downloaded:
By default, macOS 14 (Sonoma) will be installed, but you can add the `VERSION` environment variable in order to specify an alternative:
```yaml
environment:
VERSION: "sonoma"
VERSION: "15"
```
Select from the values below:
| **Value** | **Version** |
|----|-----|
| `sonoma` | macOS Sonoma |
| `ventura` | macOS Ventura |
| `monterey` | macOS Monterey |
| `big-sur` | macOS Big Sur |
| **Value** | **Version** | **Name** |
|-------------|----------------|------------------|
| `15` | macOS 15 | Sequoia |
| `14` | macOS 14 | Sonoma |
| `13` | macOS 13 | Ventura |
| `12` | macOS 12 | Monterey |
| `11` | macOS 11 | Big Sur |
* ### How do I change the storage location?
> [!NOTE]
> Support for macOS 15 (Sequoia) is still in its infancy, as it does not allow you to sign in to your Apple Account yet.
### How do I change the storage location?
To change the storage location, include the following bind mount in your compose file:
```yaml
volumes:
- /var/macos:/storage
- ./macos:/storage
```
Replace the example path `/var/macos` with the desired storage folder.
Replace the example path `./macos` with the desired storage folder or named volume.
* ### How do I change the size of the disk?
### How do I change the size of the disk?
To expand the default size of 32 GB, add the `DISK_SIZE` setting to your compose file and set it to your preferred capacity:
To expand the default size of 64 GB, add the `DISK_SIZE` setting to your compose file and set it to your preferred capacity:
```yaml
environment:
DISK_SIZE: "256G"
```
This can also be used to resize the existing disk to a larger capacity without any data loss.
> [!TIP]
> This can also be used to resize the existing disk to a larger capacity without any data loss.
* ### How do I change the amount of CPU or RAM?
### How do I change the amount of CPU or RAM?
By default, the container will be allowed to use a maximum of 2 CPU cores and 3 GB of RAM.
By default, macOS will be allowed to use a single CPU core and 4 GB of RAM.
If you want to adjust this, you can specify the desired amount using the following environment variables:
@ -131,39 +145,161 @@ kubectl apply -f kubernetes.yml
CPU_CORES: "4"
```
Please note that macOS requires the CPU core count to always be a power of 2.
> [!IMPORTANT]
> If your system has an AMD processor (instead of Intel), it is not advisable to enable multiple cores before the installation is completed and you have verified that everything runs stable for a while. Because in many cases it will introduce issues, which are difficult to pinpoint if you do not have experience with its behavior on a single core first.
* ### How do I verify if my system supports KVM?
### How do I assign an individual IP address to the container?
To verify if your system supports KVM, run the following commands:
By default, the container uses bridge networking, which shares the IP address with the host.
If you want to assign an individual IP address to the container, you can create a macvlan network as follows:
```bash
docker network create -d macvlan \
--subnet=192.168.0.0/24 \
--gateway=192.168.0.1 \
--ip-range=192.168.0.100/28 \
-o parent=eth0 vlan
```
Be sure to modify these values to match your local subnet.
Once you have created the network, change your compose file to look as follows:
```yaml
services:
macos:
container_name: macos
..<snip>..
networks:
vlan:
ipv4_address: 192.168.0.100
networks:
vlan:
external: true
```
An added benefit of this approach is that you won't have to perform any port mapping anymore, since all ports will be exposed by default.
> [!IMPORTANT]
> This IP address won't be accessible from the Docker host due to the design of macvlan, which doesn't permit communication between the two. If this is a concern, you need to create a [second macvlan](https://blog.oddbit.com/post/2018-03-12-using-docker-macvlan-networks/#host-access) as a workaround.
### How can macOS acquire an IP address from my router?
After configuring the container for [macvlan](#how-do-i-assign-an-individual-ip-address-to-the-container), it is possible for macOS to become part of your home network by requesting an IP from your router, just like your other devices.
To enable this mode, in which the container and macOS will have separate IP addresses, add the following lines to your compose file:
```yaml
environment:
DHCP: "Y"
devices:
- /dev/vhost-net
device_cgroup_rules:
- 'c *:* rwm'
```
### How do I pass-through a disk?
It is possible to pass-through disk devices or partitions directly by adding them to your compose file in this way:
```yaml
devices:
- /dev/sdb:/disk1
- /dev/sdc1:/disk2
```
Use `/disk1` if you want it to become your main drive, and use `/disk2` and higher to add them as secondary drives.
### How do I pass-through a USB device?
To pass-through a USB device, first lookup its vendor and product id via the `lsusb` command, then add them to your compose file like this:
```yaml
environment:
ARGUMENTS: "-device usb-host,vendorid=0x1234,productid=0x1234"
devices:
- /dev/bus/usb
```
### How do I share files with the host?
To share files with the host, add the following volume to your compose file:
```yaml
volumes:
- ./example:/shared
```
Then start macOS and execute the following command:
```shell
sudo -S mount_9p shared
```
In Finders menu bar, click on “Go Computer” to access this shared folder, it will show the contents of `./example`.
### How do I verify if my system supports KVM?
First check if your software is compatible using this chart:
| **Product** | **Linux** | **Win11** | **Win10** | **macOS** |
|---|---|---|---|---|
| Docker CLI | ✅ | ✅ | ❌ | ❌ |
| Docker Desktop | ❌ | ✅ | ❌ | ❌ |
| Podman CLI | ✅ | ✅ | ❌ | ❌ |
| Podman Desktop | ✅ | ✅ | ❌ | ❌ |
After that you can run the following commands in Linux to check your system:
```bash
sudo apt install cpu-checker
sudo kvm-ok
```
If you receive an error from `kvm-ok` indicating that KVM acceleration can't be used, check the virtualization settings in the BIOS.
If you receive an error from `kvm-ok` indicating that KVM cannot be used, please check whether:
* ### Is this project legal?
- the virtualization extensions (`Intel VT-x` or `AMD SVM`) are enabled in your BIOS.
Yes, this project contains only open-source code and does not distribute any copyrighted material. So under all applicable laws, this project will be considered legal.
- you enabled "nested virtualization" if you are running the container inside a virtual machine.
## Acknowledgements
- you are not using a cloud provider, as most of them do not allow nested virtualization for their VPS's.
Special thanks to [OSX-KVM](https://github.com/kholia/OSX-KVM), [KVM-Opencore](https://github.com/thenickdude/KVM-Opencore) and [seitenca](https://github.com/seitenca), this project would not exist without their invaluable work.
If you did not receive any error from `kvm-ok` but the container still complains about a missing KVM device, it could help to add `privileged: true` to your compose file (or `sudo` to your `docker` command) to rule out any permission issue.
## Stars
### How do I run Windows in a container?
You can use [dockur/windows](https://github.com/dockur/windows) for that. It shares many of the same features, and even has completely automatic installation.
### How do I run a Linux desktop in a container?
You can use [qemus/qemu](https://github.com/qemus/qemu) in that case.
### Is this project legal?
Yes, this project contains only open-source code and does not distribute any copyrighted material. Neither does it try to circumvent any copyright protection measures. So under all applicable laws, this project will be considered legal.
However, by installing Apple's macOS, you must accept their end-user license agreement, which does not permit installation on non-official hardware. So only run this container on hardware sold by Apple, as any other use will be a violation of their terms and conditions.
## Acknowledgements 🙏
Special thanks to [seitenca](https://github.com/seitenca), this project would not exist without her invaluable work.
## Stars 🌟
[![Stars](https://starchart.cc/dockur/macos.svg?variant=adaptive)](https://starchart.cc/dockur/macos)
## Disclaimer
## Disclaimer ⚖️
The product names, logos, brands, and other trademarks referred to within this project are the property of their respective trademark holders. This project is not affiliated, sponsored, or endorsed by Apple Inc.
*Only run this container on Apple hardware, any other use is not permitted by their EULA. The product names, logos, brands, and other trademarks referred to within this project are the property of their respective trademark holders. This project is not affiliated, sponsored, or endorsed by Apple Inc.*
[build_url]: https://github.com/dockur/macos/
[hub_url]: https://hub.docker.com/r/dockurr/macos/
[tag_url]: https://hub.docker.com/r/dockurr/macos/tags
[pkg_url]: https://github.com/dockur/macos/pkgs/container/macos
[Build]: https://github.com/dockur/macos/actions/workflows/build.yml/badge.svg
[Size]: https://img.shields.io/docker/image-size/dockurr/macos/latest?color=066da5&label=size
[Pulls]: https://img.shields.io/docker/pulls/dockurr/macos.svg?style=flat&label=pulls&logo=docker
[Version]: https://img.shields.io/docker/v/dockurr/macos/latest?arch=amd64&sort=semver&color=066da5
[Package]: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fipitio.github.io%2Fbackage%2Fdockur%2Fmacos%2Fmacos.json&query=%24.downloads&logo=github&style=flat&color=066da5&label=pulls

View file

@ -2,35 +2,32 @@
set -Eeuo pipefail
# Docker environment variables
: "${BOOT_MODE:="full"}" # Boot mode
: "${SECURE:="off"}" # Secure boot
: "${BOOT_MODE:="macos"}" # Boot mode
BOOT_DESC=""
BOOT_OPTS=""
BOOT_DRIVE_ID="OpenCoreBoot"
BOOT_DRIVE="/images/OpenCore.img"
SECURE="off"
OVMF="/usr/share/OVMF"
case "${BOOT_MODE,,}" in
full)
BOOT_DESC=" 1920x1080"
msg="Configuring boot..."
html "$msg"
[[ "$DEBUG" == [Yy1]* ]] && echo "$msg"
case "${HEIGHT,,}" in
"1080" )
DEST="$PROCESS"
ROM="OVMF_CODE.fd"
VARS="OVMF_VARS-1920x1080.fd"
;;
hd)
BOOT_DESC=" 1024x768"
"768" )
DEST="${PROCESS}_hd"
ROM="OVMF_CODE.fd"
VARS="OVMF_VARS-1024x768.fd"
;;
default)
BOOT_DESC=""
*)
ROM="OVMF_CODE.fd"
VARS="OVMF_VARS.fd"
;;
*)
error "Unknown BOOT_MODE, value \"${BOOT_MODE}\" is not recognized!"
exit 33
DEST="${PROCESS}_${HEIGHT}"
;;
esac
@ -44,20 +41,213 @@ osk=$(echo "bheuneqjbexolgurfrjbeqfthneqrqcyrnfrqbagfgrny(p)NccyrPbzchgreVap" |
BOOT_OPTS+=" -device isa-applesmc,osk=$osk"
# OVMF
BOOT_OPTS+=" -drive if=pflash,format=raw,readonly=on,file=$OVMF/$ROM"
BOOT_OPTS+=" -drive if=pflash,format=raw,file=$OVMF/$VARS"
DEST="$STORAGE/$DEST"
# OpenCoreBoot
DISK_OPTS+=" -device virtio-blk-pci,drive=${BOOT_DRIVE_ID},scsi=off,bus=pcie.0,addr=0x5,iothread=io2,bootindex=$BOOT_INDEX"
DISK_OPTS+=" -drive file=$BOOT_DRIVE,id=$BOOT_DRIVE_ID,format=raw,cache=$DISK_CACHE,aio=$DISK_IO,readonly=on,if=none"
if [ ! -s "$DEST.rom" ] || [ ! -f "$DEST.rom" ]; then
[ ! -s "$OVMF/$ROM" ] || [ ! -f "$OVMF/$ROM" ] && error "UEFI boot file ($OVMF/$ROM) not found!" && exit 44
if [[ "${LOGO:-}" == [Nn]* ]]; then
cp "$OVMF/$ROM" "$DEST.tmp"
else
if ! /run/utk.bin "$OVMF/$ROM" replace_ffs LogoDXE "/var/www/img/${PROCESS,,}.ffs" save "$DEST.tmp"; then
warn "failed to add custom logo to BIOS!"
cp "$OVMF/$ROM" "$DEST.tmp"
fi
fi
mv "$DEST.tmp" "$DEST.rom"
! setOwner "$DEST.rom" && error "Failed to set the owner for \"$DEST.rom\" !"
fi
if [ ! -s "$DEST.vars" ] || [ ! -f "$DEST.vars" ]; then
[ ! -s "$OVMF/$VARS" ] || [ ! -f "$OVMF/$VARS" ]&& error "UEFI vars file ($OVMF/$VARS) not found!" && exit 45
cp "$OVMF/$VARS" "$DEST.tmp"
mv "$DEST.tmp" "$DEST.vars"
! setOwner "$DEST.vars" && error "Failed to set the owner for \"$DEST.vars\" !"
fi
BOOT_OPTS+=" -drive if=pflash,format=raw,readonly=on,file=$DEST.rom"
BOOT_OPTS+=" -drive if=pflash,format=raw,file=$DEST.vars"
IMG="$STORAGE/boot.img"
if [ ! -f "$IMG" ]; then
FILE="OpenCore.img"
IMG="/tmp/$FILE"
rm -f "$IMG"
# OpenCoreBoot
ISO="/opencore.iso"
OUT="/tmp/extract"
rm -rf "$OUT"
mkdir -p "$OUT"
msg="Building boot image"
info "$msg..." && html "$msg..."
[ ! -f "$ISO" ] && gzip -dk "$ISO.gz"
if [ ! -f "$ISO" ] || [ ! -s "$ISO" ]; then
error "Could not find image file \"$ISO\"." && exit 10
fi
START=$(sfdisk -l "$ISO" | grep -i -m 1 "EFI System" | awk '{print $2}')
mcopy -bspmQ -i "$ISO@@${START}S" ::EFI "$OUT"
CFG="$OUT/EFI/OC/config.plist"
PLIST="/assets/config.plist"
[ -f "/config.plist" ] && PLIST="/config.plist"
cp "$PLIST" "$CFG"
ROM="${MAC//[^[:alnum:]]/}"
ROM="${ROM,,}"
BROM=$(echo "$ROM" | xxd -r -p | base64)
RESOLUTION="${WIDTH}x${HEIGHT}@32"
sed -r -i -e 's|<data>m7zhIYfl</data>|<data>'"${BROM}"'</data>|g' "$CFG"
sed -r -i -e 's|<string>iMacPro1,1</string>|<string>'"${MODEL}"'</string>|g' "$CFG"
sed -r -i -e 's|<string>C02TM2ZBHX87</string>|<string>'"${SN}"'</string>|g' "$CFG"
sed -r -i -e 's|<string>C02717306J9JG361M</string>|<string>'"${MLB}"'</string>|g' "$CFG"
sed -r -i -e 's|<string>1920x1080@32</string>|<string>'"${RESOLUTION}"'</string>|g' "$CFG"
sed -r -i -e 's|<string>007076A6-F2A2-4461-BBE5-BAD019F8025A</string>|<string>'"${UUID}"'</string>|g' "$CFG"
# Build image
MB=256
CLUSTER=4
START=2048
SECTOR=512
FIRST_LBA=34
SIZE=$(( MB*1024*1024 ))
OFFSET=$(( START*SECTOR ))
TOTAL=$(( SIZE-(FIRST_LBA*SECTOR) ))
LAST_LBA=$(( TOTAL/SECTOR ))
COUNT=$(( LAST_LBA-(START-1) ))
if ! truncate -s "$SIZE" "$IMG"; then
rm -f "$IMG"
error "Could not allocate space to create image $IMG ." && exit 11
fi
PART="/tmp/partition.fdisk"
{ echo "label: gpt"
echo "label-id: 1ACB1E00-3B8F-4B2A-86A4-D99ED21DCAEB"
echo "device: $FILE"
echo "unit: sectors"
echo "first-lba: $FIRST_LBA"
echo "last-lba: $LAST_LBA"
echo "sector-size: $SECTOR"
echo ""
echo "${FILE}1 : start=$START, size=$COUNT, type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B, uuid=05157F6E-0AE8-4D1A-BEA5-AC172453D02C, name=\"primary\""
} > "$PART"
sfdisk -q "$IMG" < "$PART"
echo "drive c: file=\"$IMG\" partition=0 offset=$OFFSET" > /etc/mtools.conf
mformat -F -M "$SECTOR" -c "$CLUSTER" -T "$COUNT" -v "EFI" "C:"
mcopy -bspmQ "$OUT/EFI" "C:"
rm -rf "$OUT"
info ""
info "Model: $MODEL"
info "Rom: $ROM"
info "Serial: $SN"
info "Board: $MLB"
info ""
fi
! setOwner "$IMG" && error "Failed to set the owner for \"$IMG\" !"
BOOT_DRIVE_ID="OpenCore"
DISK_OPTS+=" -device virtio-blk-pci,drive=${BOOT_DRIVE_ID},bus=pcie.0,addr=0x5,bootindex=$BOOT_INDEX"
DISK_OPTS+=" -drive file=$IMG,id=$BOOT_DRIVE_ID,format=raw,cache=unsafe,readonly=on,if=none"
CPU_VENDOR=$(lscpu | awk '/Vendor ID/{print $3}')
CPU_FLAGS="vendor=GenuineIntel,vmware-cpuid-freq=on,-pdpe1gb"
DEFAULT_FLAGS="vendor=GenuineIntel,vmx=off,vmware-cpuid-freq=on,-pdpe1gb"
if [[ "$CPU_VENDOR" == "AuthenticAMD" || "${KVM:-}" == [Nn]* ]]; then
if [ -z "${CPU_MODEL:-}" ]; then
case "${VERSION,,}" in
"ventura" | "13"* )
CPU_MODEL="Haswell-noTSX" ;;
"monterey" | "12"* )
CPU_MODEL="Haswell-noTSX" ;;
"bigsur" | "big-sur" | "11"* )
CPU_MODEL="Haswell-noTSX" ;;
"catalina" | "10"* )
CPU_MODEL="Haswell-noTSX" ;;
*)
CPU_MODEL="Skylake-Client-v4"
DEFAULT_FLAGS+=",-spec-ctrl"
;;
esac
fi
if [[ "${KVM:-}" == [Nn]* ]] || [[ "${ARCH,,}" != "amd64" ]] || [[ "$OSTYPE" =~ ^darwin ]]; then
DEFAULT_FLAGS+=",-pcid,-tsc-deadline,-invpcid,-xsavec,-xsaves,+ssse3,+sse4.2,+popcnt,+avx,+avx2,+aes,+fma,+bmi1,+bmi2,+smep,+xsave,+xsaveopt,+xgetbv1,+movbe,+rdrand,check"
else
DEFAULT_FLAGS+=",+pcid,+ssse3,+sse4.2,+popcnt,+avx,+avx2,+aes,+fma,+bmi1,+bmi2,+smep,+xsave,+xsavec,+xsaves,+xsaveopt,+xgetbv1,+movbe,+rdrand,check"
fi
if [[ "$CPU_VENDOR" != "GenuineIntel" ]]; then
CPU_MODEL="Haswell-noTSX"
fi
if [ -z "${CPU_FLAGS:-}" ]; then
CPU_FLAGS="$DEFAULT_FLAGS"
else
CPU_FLAGS="$DEFAULT_FLAGS,$CPU_FLAGS"
fi
SM_BIOS=""
CLOCKSOURCE="tsc"
[[ "${ARCH,,}" == "arm64" ]] && CLOCKSOURCE="arch_sys_counter"
CLOCK="/sys/devices/system/clocksource/clocksource0/current_clocksource"
if [ ! -f "$CLOCK" ]; then
warn "file \"$CLOCK\" cannot not found?"
else
result=$(<"$CLOCK")
result="${result//[![:print:]]/}"
case "${result,,}" in
"${CLOCKSOURCE,,}" )
if [[ "$CPU_VENDOR" == "GenuineIntel" && "$CPU_CORES" == "1" && "${KVM:-}" != [Nn]* ]]; then
CPU_CORES="2"
fi ;;
"kvm-clock" ) warn "Nested KVM virtualization detected, this might cause issues running macOS!" ;;
"hyperv_clocksource_tsc_page" ) info "Nested Hyper-V virtualization detected, this might cause issues running macOS!" ;;
"hpet" ) warn "unsupported clock source detected: '$result'. Please set host clock source to '$CLOCKSOURCE', otherwise it will cause issues running macOS!" ;;
*) warn "unexpected clock source detected: '$result'. Please set host clock source to '$CLOCKSOURCE', otherwise it will cause issues running macOS!" ;;
esac
fi
case "$CPU_CORES" in
"" | "0" | "3" ) CPU_CORES="2" ;;
"5" ) CPU_CORES="4" ;;
"9" ) CPU_CORES="8" ;;
esac
case "$CPU_CORES" in
"1" | "2" | "4" | "8" ) SMP="$CPU_CORES,sockets=1,dies=1,cores=$CPU_CORES,threads=1" ;;
"6" | "7" ) SMP="$CPU_CORES,sockets=3,dies=1,cores=2,threads=1" ;;
"10" | "11" ) SMP="$CPU_CORES,sockets=5,dies=1,cores=2,threads=1" ;;
"12" | "13" ) SMP="$CPU_CORES,sockets=3,dies=1,cores=4,threads=1" ;;
"14" | "15" ) SMP="$CPU_CORES,sockets=7,dies=1,cores=2,threads=1" ;;
"16" | "32" | "64" ) SMP="$CPU_CORES,sockets=1,dies=1,cores=$CPU_CORES,threads=1" ;;
*)
error "Invalid amount of CPU_CORES, value \"${CPU_CORES}\" is not a power of 2!" && exit 35
;;
esac
USB="nec-usb-xhci,id=xhci"
USB+=" -device usb-kbd,bus=xhci.0"
USB+=" -global nec-usb-xhci.msi=off"

View file

@ -1,48 +0,0 @@
#!/usr/bin/env bash
set -Eeuo pipefail
function msg() {
local txt="$1"
local bold="\x1b[1m"
local normal="\x1b[0m"
echo -e "${bold}### ${txt}${normal}"
}
function cleanup() {
if test "$GUESTFISH_PID" != ""; then
guestfish --remote -- exit >/dev/null 2>&1 || true
fi
}
function fish() {
echo "#" "$@"
guestfish --remote -- "$@" || exit 1
}
rm -rf /images
msg "Mounting template ISO..."
trap 'cleanup' EXIT
export LIBGUESTFS_BACKEND=direct
# shellcheck disable=SC2046
eval $(guestfish --listen)
if test "$GUESTFISH_PID" = ""; then
echo "ERROR: Starting Guestfish failed!"
exit 1
fi
fish add "$1"
fish run
fish mount /dev/sda1 /
fish ls /EFI
msg "Overriding config..."
fish copy-in "$2" /EFI/OC/
fish umount-all
mkdir -p /images
mv "$1" /images/OpenCore.img
msg "Finished succesfully!"

View file

@ -1,22 +1,27 @@
#!/usr/bin/env bash
set -Eeuo pipefail
: "${APP:="macOS"}"
: "${VGA:="vmware"}"
: "${DISK_TYPE:="blk"}"
APP="macOS"
SUPPORT="https://github.com/dockur/macos"
: "${PLATFORM:="x64"}"
: "${SUPPORT:="https://github.com/dockur/macos"}"
cd /run
. start.sh # Startup hook
. utils.sh # Load functions
. reset.sh # Initialize system
. server.sh # Start webserver
. install.sh # Get the OSX images
. disk.sh # Initialize disks
. display.sh # Initialize graphics
. network.sh # Initialize network
. boot.sh # Configure boot
. proc.sh # Initialize processor
. memory.sh # Check available memory
. config.sh # Configure arguments
. finish.sh # Finish initialization
trap - ERR

View file

@ -2,63 +2,294 @@
set -Eeuo pipefail
# Docker environment variables
: "${VERSION:="sonoma"}" # OSX Version
TMP="$STORAGE/tmp"
BASE_FILE="BaseSystem"
: "${SN:=""}" # Device serial
: "${MLB:=""}" # Board serial
: "${MAC:=""}" # MAC address
: "${UUID:=""}" # Unique ID
: "${VERSION:=""}" # OSX Version
: "${WIDTH:="1920"}" # Horizontal
: "${HEIGHT:="1080"}" # Vertical
: "${MODEL:="iMacPro1,1"}" # Device model
BASE_IMG_ID="InstallMedia"
BASE_IMG="$STORAGE/base.dmg"
BASE_TMP="$TMP/$BASE_FILE.dmg"
downloadImage() {
function getRandom() {
local length="${1}"
local result=""
local chars=("0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "A" "B" "C" "D" "E" "F")
rm -rf "$TMP"
mkdir -p "$TMP"
for ((i=0; i<length; i++)); do
result+="${chars[$((RANDOM % 16))]}"
done
local msg="Downloading macOS ($VERSION) image"
info "$msg..." && html "$msg..."
echo "$result"
return 0
}
/run/progress.sh "$BASE_TMP" "" "$msg ([P])..." &
delay() {
if ! /run/fetch-macOS-v2.py --action download -s "$VERSION" -n "$BASE_FILE" -o "$TMP"; then
error "Failed to fetch macOS ($VERSION)!"
fKill "progress.sh"
return 1
fi
local i
local delay="$1"
local msg="Retrying failed download in X seconds..."
fKill "progress.sh"
info "${msg/X/$delay}"
if [ ! -f "$BASE_TMP" ] || [ ! -s "$BASE_TMP" ]; then
error "Failed to find file $BASE_TMP !"
return 1
fi
echo "$VERSION" > "$STORAGE/$PROCESS.version"
mv "$BASE_TMP" "$BASE_IMG"
rm -rf "$TMP"
for i in $(seq "$delay" -1 1); do
html "${msg/X/$i}"
sleep 1
done
return 0
}
function download() {
local info=""
local dest="$1"
local board="$2"
local version="$3"
local type="latest"
local appleSession=""
local downloadLink=""
local downloadSession=""
local mlb="00000000000000000"
local rc total size progress
local msg="Downloading macOS ${version^}"
info "$msg recovery image..." && html "$msg..."
appleSession=$(curl --disable -v -H "Host: osrecovery.apple.com" \
-H "Connection: close" \
-A "InternetRecovery/1.0" https://osrecovery.apple.com/ 2>&1 | tr ';' '\n' | awk -F'session=|;' '{print $2}' | grep 1)
info=$(curl --disable -s -X POST -H "Host: osrecovery.apple.com" \
-H "Connection: close" \
-A "InternetRecovery/1.0" \
-b "session=\"${appleSession}\"" \
-H "Content-Type: text/plain" \
-d $'cid='"$(getRandom 16)"$'\nsn='"${mlb}"$'\nbid='"${board}"$'\nk='"$(getRandom 64)"$'\nfg='"$(getRandom 64)"$'\nos='"${type}" \
https://osrecovery.apple.com/InstallationPayload/RecoveryImage | tr ' ' '\n')
downloadLink=$(echo "$info" | grep 'oscdn' | grep 'dmg')
downloadSession=$(echo "$info" | grep 'expires' | grep 'dmg')
if [ -z "$downloadLink" ] || [ -z "$downloadSession" ]; then
local code="99"
msg="Failed to connect to the Apple servers, reason:"
curl --silent --max-time 10 --output /dev/null --fail -H "Host: osrecovery.apple.com" -H "Connection: close" -A "InternetRecovery/1.0" https://osrecovery.apple.com/ || {
code="$?"
}
case "${code,,}" in
"6" ) error "$msg could not resolve host!" ;;
"7" ) error "$msg no internet connection available!" ;;
"28" ) error "$msg connection timed out!" ;;
"99" )
[ -n "$info" ] && echo "$info" && echo
error "$msg unknown error" ;;
*) error "$msg $code" ;;
esac
return 1
fi
# Check if running with interactive TTY or redirected to docker log
if [ -t 1 ]; then
progress="--progress=bar:noscroll"
else
progress="--progress=dot:giga"
fi
rm -f "$dest"
/run/progress.sh "$dest" "0" "$msg ([P])..." &
{ wget "$downloadLink" -O "$dest" -q --header "Host: oscdn.apple.com" --header "Connection: close" --header "User-Agent: InternetRecovery/1.0" --header "Cookie: AssetToken=${downloadSession}" --timeout=30 --no-http-keep-alive --show-progress "$progress"; rc=$?; } || :
fKill "progress.sh"
if (( rc == 0 )) && [ -f "$dest" ]; then
total=$(stat -c%s "$dest")
size=$(formatBytes "$total")
if [ "$total" -lt 100000 ]; then
error "Invalid recovery image, file is only $size ?" && return 1
fi
html "Download finished successfully..."
return 0
fi
msg="Failed to download $downloadLink"
(( rc == 3 )) && error "$msg , cannot write file (disk full?)" && return 1
(( rc == 4 )) && error "$msg , network failure!" && return 1
(( rc == 8 )) && error "$msg , server issued an error response!" && return 1
error "$msg , reason: $rc"
return 1
}
install() {
local board
local version="$1"
local dest="$2"
case "${version,,}" in
"tahoe" | "26"* | "16"* )
board="Mac-CFF7D910A743CAAF" ;;
"sequoia" | "15"* )
board="Mac-937A206F2EE63C01" ;;
"sonoma" | "14"* )
board="Mac-827FAC58A8FDFA22" ;;
"ventura" | "13"* )
board="Mac-4B682C642B45593E" ;;
"monterey" | "12"* )
board="Mac-B809C3757DA9BB8D" ;;
"bigsur" | "big-sur" | "11"* )
board="Mac-2BD1B31983FE1663" ;;
"catalina" | "10"* )
board="Mac-00BE6ED71E35EB86" ;;
*)
error "Unknown VERSION specified, value \"${version}\" is not recognized!"
return 1 ;;
esac
rm -f "$dest"
if ! makeDir "$STORAGE"; then
error "Failed to create directory \"$STORAGE\" !" && return 1
fi
find "$STORAGE" -maxdepth 1 -type f \( -iname '*.rom' -or -iname '*.vars' \) -delete
find "$STORAGE" -maxdepth 1 -type f \( -iname 'data.*' -or -iname 'macos.*' \) -delete
if [ -f "/boot.dmg" ]; then
cp "/boot.dmg" "$dest"
return 0
fi
local file="$STORAGE/boot.dmg"
if ! download "$file" "$board" "$version"; then
delay 5
if ! download "$file" "$board" "$version"; then
rm -f "$file"
exit 60
fi
fi
mv -f "$file" "$dest"
return 0
}
generateID() {
local file="$STORAGE/$PROCESS.id"
[ -n "$UUID" ] && return 0
[ -s "$file" ] && UUID=$(<"$file")
UUID="${UUID//[![:print:]]/}"
[ -n "$UUID" ] && return 0
UUID=$(cat /proc/sys/kernel/random/uuid 2> /dev/null || uuidgen --random)
UUID="${UUID^^}"
UUID="${UUID//[![:print:]]/}"
echo "$UUID" > "$file"
! setOwner "$file" && error "Failed to set the owner for \"$file\" !"
return 0
}
generateAddress() {
local file="$STORAGE/$PROCESS.mac"
[ -n "$MAC" ] && return 0
[ -s "$file" ] && MAC=$(<"$file")
MAC="${MAC//[![:print:]]/}"
[ -n "$MAC" ] && return 0
# Generate Apple MAC address based on Docker container ID in hostname
MAC=$(echo "$HOST" | md5sum | sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\).*$/00:16:cb:\3:\4:\5/')
MAC="${MAC^^}"
echo "$MAC" > "$file"
! setOwner "$file" && error "Failed to set the owner for \"$file\" !"
return 0
}
generateSerial() {
local file="$STORAGE/$PROCESS.sn"
local file2="$STORAGE/$PROCESS.mlb"
[ -n "$SN" ] && [ -n "$MLB" ] && return 0
[ -s "$file" ] && SN=$(<"$file")
[ -s "$file2" ] && MLB=$(<"$file2")
SN="${SN//[![:print:]]/}"
MLB="${MLB//[![:print:]]/}"
[ -n "$SN" ] && [ -n "$MLB" ] && return 0
# Generate unique serial numbers for machine
SN=$(/usr/local/bin/macserial --num 1 --model "${MODEL}" 2>/dev/null)
SN="${SN##*$'\n'}"
[[ "$SN" != *" | "* ]] && error "$SN" && return 1
MLB=${SN#*|}
MLB="${MLB#"${MLB%%[![:space:]]*}"}"
SN="${SN%%|*}"
SN="${SN%"${SN##*[![:space:]]}"}"
echo "$SN" > "$file"
echo "$MLB" > "$file2"
! setOwner "$file" && error "Failed to set the owner for \"$file\" !"
! setOwner "$file2" && error "Failed to set the owner for \"$file2\" !"
return 0
}
if [[ "${VERSION}" == \"*\" || "${VERSION}" == \'*\' ]]; then
VERSION="${VERSION:1:-1}"
fi
VERSION=$(expr "$VERSION" : "^\ *\(.*[^ ]\)\ *$")
if [ -z "$VERSION" ]; then
VERSION="14"
warn "no value specified for the VERSION variable, defaulting to \"${VERSION}\"."
fi
if [ ! -f "$BASE_IMG" ] || [ ! -s "$BASE_IMG" ]; then
if ! downloadImage; then
rm -rf "$TMP"
exit 34
STORAGE="$STORAGE/${VERSION,,}"
BASE_IMG="$STORAGE/base.dmg"
if [ ! -f "$BASE_IMG" ] || [ ! -s "$BASE_IMG" ]; then
! install "$VERSION" "$BASE_IMG" && exit 34
! setOwner "$BASE_IMG" && error "Failed to set the owner for \"$BASE_IMG\" !"
fi
fi
STORED_VERSION=$(cat "$STORAGE/$PROCESS.version")
if [ "$VERSION" != "$STORED_VERSION" ]; then
info "Different version detected, switching base image from $STORED_VERSION to $VERSION"
if ! downloadImage; then
rm -rf "$TMP"
exit 34
fi
if ! generateID; then
error "Failed to generate UUID!" && exit 35
fi
DISK_OPTS="-device virtio-blk-pci,drive=${BASE_IMG_ID},scsi=off,bus=pcie.0,addr=0x6,iothread=io2"
if ! generateSerial; then
error "Failed to generate serial number!" && exit 36
fi
if ! generateAddress; then
error "Failed to generate MAC address!" && exit 37
fi
DISK_OPTS="-device virtio-blk-pci,drive=${BASE_IMG_ID},bus=pcie.0,addr=0x6"
DISK_OPTS+=" -drive file=$BASE_IMG,id=$BASE_IMG_ID,format=dmg,cache=unsafe,readonly=on,if=none"
return 0