16 Commits

Author SHA1 Message Date
7f31e91099 Merge pull request #840 from Dakai/master
Some checks failed
Push Docker Image to Docker Hub / Push Docker Image to Docker Hub (push) Has been cancelled
Update README.md
2025-06-06 10:08:10 +00:00
0b3e586b26 Merge pull request #880 from akshaynexus/master
Add Apple ID/iCloud troubleshooting for macOS Container
2025-06-06 10:07:12 +00:00
fa7baa5fc8 fix: use curl instead of wget 2025-05-01 20:59:41 +07:00
74d8498ea6 fix: remove unecessary change added 2025-05-01 06:01:42 +07:00
b282993a4a Add detailed guide for fixing Apple ID login issues in macOS VMs, including kernel patching methods and a new utility script for applying patches. 2025-05-01 06:00:47 +07:00
69f6e7d0cf Update README.md to add troubleshooting steps for Apple ID/iMessage/iCloud login issues in macOS VM. 2025-04-30 04:02:02 +07:00
e962dce97f Merge pull request #875 from sickcodes/sequoia
Some checks failed
Push Docker Image to Docker Hub / Push Docker Image to Docker Hub (push) Has been cancelled
Add Sequoia to README.md
2025-03-30 11:05:11 +00:00
2d4cc60572 Add Sequoia to README.md 2025-03-30 10:52:17 +00:00
3259824617 Update README.md
minor typo fix to the sshfs mount command
2024-11-22 16:59:50 +08:00
730d6f294a rename build id's in action
Some checks failed
Push Docker Image to Docker Hub / Push Docker Image to Docker Hub (push) Has been cancelled
2024-11-18 15:00:53 +00:00
93c2119ebc Label images correctly in yaml 2024-11-18 14:59:41 +00:00
fb8aa4b248 Push latest
Some checks are pending
Push Docker Image to Docker Hub / Push Docker Image to Docker Hub (push) Waiting to run
2024-11-18 13:24:20 +00:00
b5a70782cc Push latest 2024-11-18 07:19:56 +00:00
61b21421f6 main to master, -ng typo 2024-11-18 07:07:00 +00:00
342c09eb2a Add docker-build.yml 2024-11-18 07:05:24 +00:00
2dc1d615b1 Merge pull request #826 from sickcodes/runtime-download
DMCA compliance, installer download at runtime
2024-10-14 09:51:21 +00:00
5 changed files with 355 additions and 13 deletions

52
.github/workflows/docker-build.yml vendored Normal file
View File

@ -0,0 +1,52 @@
name: Push Docker Image to Docker Hub
on:
push:
branches:
- master
jobs:
push_to_docker_hub:
name: Push Docker Image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Checkout code
id: checkout_code
uses: actions/checkout@v3
- name: Login to Docker Hub
id: login_docker_hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USER_NAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Echo Docker Hub Username
run: echo ${{ secrets.DOCKER_HUB_USER_NAME }}
- name: Echo GitHub SHA
run: echo $GITHUB_SHA
- name: Build Docker image
id: build_image
run: |
docker build "$GITHUB_WORKSPACE" -t sickcodes/docker-osx:master --label dockerfile-path="Dockerfile"
- name: Label Master Docker Image as Latest
id: label_image
run: |
docker tag sickcodes/docker-osx:master sickcodes/docker-osx:latest
- name: Push Docker image master
id: push_master
run: docker push sickcodes/docker-osx:master
- name: Push Docker image latest
id: push_latest
run: docker push sickcodes/docker-osx:latest
- name: Logout from Docker Hub
run: docker logout
- name: End
run: echo "Docker image pushed to Docker Hub successfully"

View File

@ -356,8 +356,8 @@ VOLUME ["/tmp/.X11-unix"]
# DMCA compliant download process
# If BaseSystem.img does not exist, download ${SHORTNAME}
# shortname default is catalina, which means :latest is catalina
ENV SHORTNAME=sonoma
# shortname default is below
ENV SHORTNAME=sequoia
ENV BASESYSTEM_IMAGE=BaseSystem.img

179
FAQ.md
View File

@ -160,6 +160,185 @@ If you wind up in the installer again after you've installed macOS it means you
Congratulations, you got a macOS VM up and running! Now what?
# Fixing Apple ID Login Issues in macOS Virtual Machines
## Problem Overview
When running macOS in a virtual machine, you may encounter problems logging into Apple services including:
- Apple ID
- iMessage
- iCloud
- App Store
This happens because Apple's services can detect that macOS is running in a virtual environment and block access. The solution is to apply a kernel patch that hides the VM presence from Apple's detection mechanism.
NOTE as per forum post: Unfortunately, this would very possibly break qemu-guest-agent, which is necessary for the host getting VM status or taking hot snapshot while the VM is running. This is because qemu-guest-agent also checks the hv_vmm_present flag, but only works if it is true (=1).
Use at your own risk. Hope it would help.
## Solution: Kernel Patching
This guide provides three methods to apply the necessary kernel patch. All methods implement the same fix originally described in [this forum post](https://forum.proxmox.com/threads/anyone-can-make-bluetooth-work-on-sonoma.153301/#post-697832).
### Prerequisites
Before proceeding with any method:
- Make sure you can access your EFI partition
- Locate your OpenCore `config.plist` file (typically in the `EFI/OC` folder)
- Back up your current `config.plist` before making changes
## Method 1: Using the Utility Script (Simplest Approach)
This is the fastest and easiest way to apply the patch.
1. Mount your EFI partition using Clover Configurator or another EFI mounting tool
2. Download the patch script:
```bash
curl -o apply_appleid_kernelpatch.py https://raw.githubusercontent.com/sickcodes/Docker-OSX/scripts/apply_appleid_kernelpatch.py
```
3. Run the script with your `config.plist` file path:
```bash
python3 apply_appleid_kernelpatch.py /path/to/config.plist
```
**Pro Tip**: You can drag and drop the `config.plist` file into your terminal after typing `python3 apply_appleid_kernelpatch.py` for an easy path insertion.
**Note**: If you encounter a "permission denied" error, run the command with `sudo`:
```bash
sudo python3 apply_appleid_kernelpatch.py /path/to/config.plist
```
## Method 2: Using OCAT (OpenCore Auxiliary Tools) GUI
If you prefer a graphical approach:
1. Open OCAT and load your `config.plist`
2. Navigate to the **Kernel** section
3. Go to the **Patch** subsection
4. Add two new patch entries with the following details:
### Patch 1
| Setting | Value |
|---------|-------|
| **Identifier** | `kernel` |
| **Base** | *(leave empty)* |
| **Count** | `1` |
| **Find (Hex)** | `68696265726E61746568696472656164790068696265726E617465636F756E7400` |
| **Limit** | `0` |
| **Mask** | *(leave empty)* |
| **Replace (Hex)** | `68696265726E61746568696472656164790068765F766D6D5F70726573656E7400` |
| **Skip** | `0` |
| **Arch** | `x86_64` |
| **MinKernel** | `20.4.0` |
| **MaxKernel** | *(leave empty)* |
| **Enabled** | `True` |
| **Comment** | `Sonoma VM BT Enabler - PART 1 of 2 - Patch kern.hv_vmm_present=0` |
### Patch 2
| Setting | Value |
|---------|-------|
| **Identifier** | `kernel` |
| **Base** | *(leave empty)* |
| **Count** | `1` |
| **Find (Hex)** | `626F6F742073657373696F6E20555549440068765F766D6D5F70726573656E7400` |
| **Limit** | `0` |
| **Mask** | *(leave empty)* |
| **Replace (Hex)** | `626F6F742073657373696F6E20555549440068696265726E617465636F756E7400` |
| **Skip** | `0` |
| **Arch** | `x86_64` |
| **MinKernel** | `22.0.0` |
| **MaxKernel** | *(leave empty)* |
| **Enabled** | `True` |
| **Comment** | `Sonoma VM BT Enabler - PART 2 of 2 - Patch kern.hv_vmm_present=0` |
5. Save the configuration
6. Reboot your VM
## Method 3: Direct `config.plist` Editing
For users who prefer to manually edit the configuration file:
1. Mount your EFI partition
2. Locate and open your `config.plist` file in a text editor
3. Find the `<key>Kernel</key>` → `<dict>` → `<key>Patch</key>` → `<array>` section
4. Add these two `<dict>` entries within the `<array>`:
```xml
<dict>
<key>Arch</key>
<string>x86_64</string>
<key>Base</key>
<string></string>
<key>Comment</key>
<string>Sonoma VM BT Enabler - PART 1 of 2 - Patch kern.hv_vmm_present=0</string>
<key>Count</key>
<integer>1</integer>
<key>Enabled</key>
<true/>
<key>Find</key>
<data>aGliZXJuYXRlaGlkcmVhZHkAaGliZXJuYXRlY291bnQA</data>
<key>Identifier</key>
<string>kernel</string>
<key>Limit</key>
<integer>0</integer>
<key>Mask</key>
<data></data>
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string>20.4.0</string>
<key>Replace</key>
<data>aGliZXJuYXRlaGlkcmVhZHkAaHZfdm1tX3ByZXNlbnQA</data>
<key>ReplaceMask</key>
<data></data>
<key>Skip</key>
<integer>0</integer>
</dict>
<dict>
<key>Arch</key>
<string>x86_64</string>
<key>Base</key>
<string></string>
<key>Comment</key>
<string>Sonoma VM BT Enabler - PART 2 of 2 - Patch kern.hv_vmm_present=0</string>
<key>Count</key>
<integer>1</integer>
<key>Enabled</key>
<true/>
<key>Find</key>
<data>Ym9vdCBzZXNzaW9uIFVVSUQAaHZfdm1tX3ByZXNlbnQA</data>
<key>Identifier</key>
<string>kernel</string>
<key>Limit</key>
<integer>0</integer>
<key>Mask</key>
<data></data>
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string>22.0.0</string>
<key>Replace</key>
<data>Ym9vdCBzZXNzaW9uIFVVSUQAaGliZXJuYXRlY291bnQA</data>
<key>ReplaceMask</key>
<data></data>
<key>Skip</key>
<integer>0</integer>
</dict>
```
5. Save the file
6. Reboot your VM
## Important Notes
- The `MinKernel` values (`20.4.0` and `22.0.0`) may need adjustment depending on your specific macOS version (Monterey, Ventura, Sonoma, etc.)
- If you encounter issues, consult the [OpenCore documentation](https://dortania.github.io/docs/) for appropriate values for your setup
- Always back up your configuration before making changes
- After applying the patch and rebooting, try signing into Apple services again
## What This Patch Does
This patch tricks macOS into believing it's running on physical hardware by redirecting the `hv_vmm_present` kernel variable, which normally indicates VM presence. After applying the patch, Apple services should function normally within your virtual environment.
### Slow UI
The macOS UI expects and relies on GPU acceleration, and there is (currently) no way to provide GPU acceleration in the virtual hardware. See [osx-optimizer](https://github.com/sickcodes/osx-optimizer) for macOS configuration to speed things up.

View File

@ -69,7 +69,7 @@ docker run -it \
# docker build -t docker-osx .
```
### Big Sur (11) [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/big-sur?label=sickcodes%2Fdocker-osx%3Abig-sur](https://img.shields.io/docker/image-size/sickcodes/docker-osx/big-sur?label=sickcodes%2Fdocker-osx%3Abig-sur)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
### Big Sur (11) [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/latest?label=sickcodes%2Fdocker-osx%3Alatest](https://img.shields.io/docker/image-size/sickcodes/docker-osx/latest?label=sickcodes%2Fdocker-osx%3Alatest)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
```bash
docker run -it \
@ -83,7 +83,7 @@ docker run -it \
# docker build -t docker-osx .
```
### Monterey (12) [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/monterey?label=sickcodes%2Fdocker-osx%3Amonterey](https://img.shields.io/docker/image-size/sickcodes/docker-osx/monterey?label=sickcodes%2Fdocker-osx%3Amonterey)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
### Monterey (12) [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/latest?label=sickcodes%2Fdocker-osx%3Alatest](https://img.shields.io/docker/image-size/sickcodes/docker-osx/latest?label=sickcodes%2Fdocker-osx%3Alatest)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
```bash
@ -100,7 +100,7 @@ docker run -it \
# docker build -t docker-osx .
```
### Ventura (13) [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/ventura?label=sickcodes%2Fdocker-osx%3Aventura](https://img.shields.io/docker/image-size/sickcodes/docker-osx/ventura?label=sickcodes%2Fdocker-osx%3Aventura)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
### Ventura (13) [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/latest?label=sickcodes%2Fdocker-osx%3Alatest](https://img.shields.io/docker/image-size/sickcodes/docker-osx/latest?label=sickcodes%2Fdocker-osx%3Alatest)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
```bash
@ -117,7 +117,7 @@ docker run -it \
# docker build -t docker-osx .
```
### Sonoma (14) [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/sonoma?label=sickcodes%2Fdocker-osx%3Asonoma](https://img.shields.io/docker/image-size/sickcodes/docker-osx/sonoma?label=sickcodes%2Fdocker-osx%3Asonoma)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
### Sonoma (14) [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/latest?label=sickcodes%2Fdocker-osx%3Alatest](https://img.shields.io/docker/image-size/sickcodes/docker-osx/latest?label=sickcodes%2Fdocker-osx%3Alatest)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
```bash
@ -136,7 +136,26 @@ docker run -it \
# docker build -t docker-osx .
```
#### Run Catalina Pre-Installed [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/auto?label=sickcodes%2Fdocker-osx%3Aauto](https://img.shields.io/docker/image-size/sickcodes/docker-osx/auto?label=sickcodes%2Fdocker-osx%3Aauto)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
### Sequoia (15) [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/latest?label=sickcodes%2Fdocker-osx%3Alatest](https://img.shields.io/docker/image-size/sickcodes/docker-osx/latest?label=sickcodes%2Fdocker-osx%3Alatest)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
```bash
docker run -it \
--device /dev/kvm \
-p 50922:10022 \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-e "DISPLAY=${DISPLAY:-:0.0}" \
-e GENERATE_UNIQUE=true \
-e CPU='Haswell-noTSX' \
-e CPUID_FLAGS='kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on' \
-e MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom-sonoma.plist' \
-e SHORTNAME=sequoia \
sickcodes/docker-osx:latest
# docker build -t docker-osx .
```
<!-- #### Run Catalina Pre-Installed [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/auto?label=sickcodes%2Fdocker-osx%3Aauto](https://img.shields.io/docker/image-size/sickcodes/docker-osx/auto?label=sickcodes%2Fdocker-osx%3Aauto)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
```bash
# 40GB disk space required: 20GB original image 20GB your container.
@ -153,11 +172,11 @@ docker run -it \
# username is user
# password is alpine
```
``` -->
### Older Systems
### High Sierra [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/high-sierra?label=sickcodes%2Fdocker-osx%3Ahigh-sierra](https://img.shields.io/docker/image-size/sickcodes/docker-osx/high-sierra?label=sickcodes%2Fdocker-osx%3Ahigh-sierra)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
### High Sierra [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/latest?label=sickcodes%2Fdocker-osx%3Alatest](https://img.shields.io/docker/image-size/sickcodes/docker-osx/latest?label=sickcodes%2Fdocker-osx%3Alatest)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
```bash
@ -172,7 +191,7 @@ docker run -it \
# docker build -t docker-osx .
```
### Mojave [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/mojave?label=sickcodes%2Fdocker-osx%3Amojave](https://img.shields.io/docker/image-size/sickcodes/docker-osx/mojave?label=sickcodes%2Fdocker-osx%3Amojave)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
### Mojave [![https://img.shields.io/docker/image-size/sickcodes/docker-osx/latest?label=sickcodes%2Fdocker-osx%3Alatest](https://img.shields.io/docker/image-size/sickcodes/docker-osx/latest?label=sickcodes%2Fdocker-osx%3Alatest)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
```bash
@ -212,7 +231,7 @@ docker run -it \
```
#### Use your own image and manually and automatically log into a shell
<!-- #### Use your own image and manually and automatically log into a shell
[![https://img.shields.io/docker/image-size/sickcodes/docker-osx/naked-auto?label=sickcodes%2Fdocker-osx%3Anaked-auto](https://img.shields.io/docker/image-size/sickcodes/docker-osx/naked-auto?label=sickcodes%2Fdocker-osx%3Anaked-auto)](https://hub.docker.com/r/sickcodes/docker-osx/tags?page=1&ordering=last_updated)
@ -239,14 +258,14 @@ docker run -it \
-e MASTER_PLIST_URL=https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/custom/config-nopicker-custom.plist \
-e SHORTNAME=monterey \
sickcodes/docker-osx:naked-auto
```
``` -->
# Share directories, sharing files, shared folder, mount folder
The easiest and most secure way is `sshfs`
```bash
# on Linux/Windows
mkdir ~/mnt/osx
sshfs user@localhost:/ -p 50922 ~/mnt/osx
sshfs user@localhost: -p 50922 ~/mnt/osx
# wait a few seconds, and ~/mnt/osx will have full rootfs mounted over ssh, and in userspace
# automated: sshpass -p <password> sshfs user@localhost:/ -p 50922 ~/mnt/osx
```

View File

@ -0,0 +1,92 @@
#!/usr/bin/env python3
import plistlib
import base64
import os
import sys
def add_kernel_patches(config_path):
# Make a backup of the original file
backup_path = config_path + '.backup'
os.system(f'cp "{config_path}" "{backup_path}"')
print(f"Backup created at {backup_path}")
# Read the plist file
with open(config_path, 'rb') as f:
config = plistlib.load(f)
# Prepare the patch entries
patch1 = {
'Arch': 'x86_64',
'Base': '',
'Comment': 'Sonoma VM BT Enabler - PART 1 of 2 - Patch kern.hv_vmm_present=0',
'Count': 1,
'Enabled': True,
'Find': base64.b64decode('aGliZXJuYXRlaGlkcmVhZHkAaGliZXJuYXRlY291bnQA'),
'Identifier': 'kernel',
'Limit': 0,
'Mask': b'',
'MaxKernel': '',
'MinKernel': '20.4.0',
'Replace': base64.b64decode('aGliZXJuYXRlaGlkcmVhZHkAaHZfdm1tX3ByZXNlbnQA'),
'ReplaceMask': b'',
'Skip': 0,
}
patch2 = {
'Arch': 'x86_64',
'Base': '',
'Comment': 'Sonoma VM BT Enabler - PART 2 of 2 - Patch kern.hv_vmm_present=0',
'Count': 1,
'Enabled': True,
'Find': base64.b64decode('Ym9vdCBzZXNzaW9uIFVVSUQAaHZfdm1tX3ByZXNlbnQA'),
'Identifier': 'kernel',
'Limit': 0,
'Mask': b'',
'MaxKernel': '',
'MinKernel': '22.0.0',
'Replace': base64.b64decode('Ym9vdCBzZXNzaW9uIFVVSUQAaGliZXJuYXRlY291bnQA'),
'ReplaceMask': b'',
'Skip': 0,
}
# Add patches to the kernel patch section
if 'Kernel' in config and 'Patch' in config['Kernel']:
# Check if patches already exist
patch_exists = False
for patch in config['Kernel']['Patch']:
if isinstance(patch, dict) and 'Comment' in patch:
if 'Sonoma VM BT Enabler' in patch['Comment']:
patch_exists = True
print(f"Patch already exists: {patch['Comment']}")
if not patch_exists:
config['Kernel']['Patch'].append(patch1)
config['Kernel']['Patch'].append(patch2)
print("Added both Sonoma VM BT Enabler patches to config.plist")
else:
print("Error: Could not find Kernel -> Patch section in config.plist")
return False
# Write the updated plist file
with open(config_path, 'wb') as f:
plistlib.dump(config, f)
print(f"Successfully updated {config_path}")
return True
if __name__ == "__main__":
if len(sys.argv) != 2:
print("Usage: python apply_appleid_kernelpatch.py /path/to/config.plist")
sys.exit(1)
config_path = sys.argv[1]
if not os.path.exists(config_path):
print(f"Error: File {config_path} does not exist")
sys.exit(1)
success = add_kernel_patches(config_path)
if success:
print("Patches applied successfully. Please reboot to apply changes.")
else:
print("Failed to apply patches.")