Skip to content

Commit

Permalink
Batch Update 2 - November 2020
Browse files Browse the repository at this point in the history
- Big Sur Stuff

- Add makefile to build Big Sur recovery/full installer (nick)

- Typo fixes (Gelma)

- Simplify Big-Sur installation notes (ivy-rew)

- Simplify Big-Sur installation notes (Broly1)

- Simplify Big-Sur installation notes (mikkeyboi)

- Xcode + OSX-KVM tutorial (ADawesomeguy)

- Remove broken links (CyberShadow)

- Expand "Docker on macOS " notes (mikehardy)
  • Loading branch information
kholia committed Dec 1, 2020
1 parent 5a0544e commit 23a6a90
Show file tree
Hide file tree
Showing 12 changed files with 714 additions and 215 deletions.
91 changes: 0 additions & 91 deletions Big-Sur.md

This file was deleted.

14 changes: 13 additions & 1 deletion CREDITS.md
Expand Up @@ -90,6 +90,18 @@

- Sangwhan "fish" Moon - Big Sur doc enhancements

- ADawesomeguy - Big Sur doc enhancements
- ADawesomeguy - Big Sur doc enhancements, Xcode + OSX-KVM tutorial

- shmsh9 - Python 3.9.x support

- Gelma (Andrea Gelmini) - Typo fixes

- ivy-rew (Reguel) - Greatly improved Big-Sur notes

- Broly1 - Greatly improved Big-Sur notes

- mikkeyboi (Michael Leung) - Greatly improved Big-Sur notes

- CyberShadow (Vladimir Panteleev) - Documentation fixes

- mikehardy (Mike Hardy) - Docker on macOS notes, CPU support notes
4 changes: 1 addition & 3 deletions Makefile
@@ -1,4 +1,2 @@
clean:
rm -rf *.dist 2>/dev/null
rm -rf *.sucatalog 2>/dev/null
rm -rf *.smd 2>/dev/null
rm -rf content || true
2 changes: 1 addition & 1 deletion OpenCore-Catalina/README.md
@@ -1,6 +1,6 @@
### Notes

Catalina installs the same way as [Mojave](../Mojave/README.md).
Catalina installs the same way as Mojave.

Tested with macOS Catalina 10.15.7 with OpenCore-0.6.4-DEBUG.zip snapshot
(2020-11-03).
Expand Down
43 changes: 20 additions & 23 deletions README.md
Expand Up @@ -9,8 +9,6 @@ instructions are included!).
:green_heart: Looking for **commercial** support with this stuff? I am [available
over email](mailto:dhiru.kholia@gmail.com?subject=[GitHub]%20OSX-KVM%20Commercial%20Support%20Request&body=Hi%20-%20We%20are%20interested%20in%20purchasing%20commercial%20support%20options%20for%20your%20project.) for a chat for **commercial support options only**.

Looking for `Big Sur` support? See these [notes](Big-Sur.md).

Working with `Proxmox` and macOS? See [Nick's blog for sure](https://www.nicksherlock.com/).

Yes, we support offline macOS installations now 🎉
Expand All @@ -21,19 +19,14 @@ Yes, we support offline macOS installations now 🎉
This project can always use your help, time and attention. I am looking for
help (pull-requests!) with the following work items:

* Create *full* installation (ISO) image without requiring an existing macOS
physical/virtual installation.

* Documentation around running macOS on popular cloud providers (Hetzner, GCP,
AWS). See the `Is This Legal?` section and associated references.

* Test `accel=hvf` flag on QEMU + macOS Mojave on MacBook Pro.
* Test QEMU's `accel=hvf` flag on macOS on MacBook Pro.

* Document (share) how you use this project to build + test open-source
projects / get your stuff done.

* Document how to use this project for iOS development.

* Document how to use this project for XNU kernel debugging and development.

* Document the process to create and reuse VM snapshots. Instantaneous macOS
Expand All @@ -59,7 +52,7 @@ help (pull-requests!) with the following work items:

* QEMU >= 4.2.0

* A CPU with Intel VT-x / AMD SVM support is required
* A CPU with Intel VT-x / AMD SVM support is required (`egrep '(vmx|svm)' /proc/cpuinfo`)

* A CPU with SSE4.1 support is required for >= macOS Sierra

Expand All @@ -74,19 +67,20 @@ Phenom II X3 720 does not. Ryzen processors work just fine.
* KVM may need the following tweak on the host machine to work.

```
$ echo 1 | sudo tee /sys/module/kvm/parameters/ignore_msrs
echo 1 | sudo tee /sys/module/kvm/parameters/ignore_msrs
```

To make this change permanent, you may use the following command.

```
$ sudo cp kvm.conf /etc/modprobe.d/kvm.conf
sudo cp kvm.conf /etc/modprobe.d/kvm.conf # for intel boxes
```

* Install QEMU and other packages.

```
sudo apt-get install qemu uml-utilities virt-manager git wget libguestfs-tools -y
sudo apt-get install qemu uml-utilities virt-manager git \
wget libguestfs-tools p7zip-full -y
```

This step may need to be adapted for your Linux distribution.
Expand All @@ -108,6 +102,8 @@ Phenom II X3 720 does not. Ryzen processors work just fine.
./fetch-macOS.py
```

ATTENTION: Use `./fetch-macOS-v2.py` for downloading `macOS Big Sur`.

You can choose your desired macOS version here. After executing this step,
you should have the `BaseSystem.dmg` file in the current folder.

Expand All @@ -127,14 +123,18 @@ Phenom II X3 720 does not. Ryzen processors work just fine.
9 001-36735 10.15.6 2020-08-06 macOS Catalina
10 001-36801 10.15.6 2020-08-12 macOS Catalina
11 001-51042 10.15.7 2020-09-24 macOS Catalina
12 001-57224 10.15.7 2020-10-27 macOS Catalina
13 001-68446 10.15.7 2020-11-11 macOS Catalina
14 001-79699 11.0.1 2020-11-12 macOS Big Sur
Choose a product to download (1-11): 11
Choose a product to download (1-14): 13
```

Attention: Modern NVIDIA GPUs are supported on HighSierra but not on later
versions (yet).
Note: Modern NVIDIA GPUs are supported on HighSierra but not on later
versions.

Next, convert this file into a usable format.
* Convert the downloaded (or the extracted) `BaseSystem.dmg` file into the
`BaseSystem.img` file.

```
qemu-img convert BaseSystem.dmg -O raw BaseSystem.img
Expand All @@ -156,17 +156,14 @@ Phenom II X3 720 does not. Ryzen processors work just fine.
### Installation

- CLI method (primary). Just run the `OpenCore-Boot.sh` script to start the
installation proces.
installation process.

```
./OpenCore-Boot.sh
```

Note: This same script works for Big Sur, Catalina, Mojave, and High Sierra.

If you are new to installing macOS, see the [older README](README-OLD.md) for
help.

- You are all set! 🙌

- (OPTIONAL) Use this macOS VM disk with libvirt (virt-manager / virsh stuff).
Expand Down Expand Up @@ -205,8 +202,6 @@ look at our [notes](notes.md). We would like to resume our testing and
documentation work around this area. Please [reach out to us](mailto:dhiru.kholia@gmail.com?subject=[GitHub]%20OSX-KVM%20Funding%20Support)
if you are able to fund this area of work.

Specifically, we are looking for an AMD RX 560/570 GPU for testing purposes.

It is possible to have 'beyond-native-apple-hw' performance but it does require
work, patience, and a bit of luck (perhaps?).

Expand Down Expand Up @@ -243,6 +238,8 @@ work, patience, and a bit of luck (perhaps?).

The "secret" Apple OSK string is widely available on the Internet. It is also included in a public court document [available here](http://www.rcfp.org/sites/default/files/docs/20120105_202426_apple_sealing.pdf). I am not a lawyer but it seems that Apple's attempt(s) to get the OSK string treated as a trade secret did not work out. Due to these reasons, the OSK string is freely included in this repository.

Please review the ['Legality of Hackintoshing' documentation bits from Dortania's OpenCore Install Guide](https://dortania.github.io/OpenCore-Install-Guide/why-oc.html#legality-of-hackintoshing).

Gabriel Somlo also has [some thoughts](http://www.contrib.andrew.cmu.edu/~somlo/OSXKVM/) on the legal aspects involved in running macOS under QEMU/KVM.


Expand All @@ -263,4 +260,4 @@ software). Also, a long time back, I had to completely wipe my (then) brand new
`MacBook Pro (Retina, 15-inch, Late 2013)` and install Xubuntu on it - as the
`OS X` kernel kept crashing on it!

Backstory: I was a (poor) student in Canada once and Apple made [my work on cracking Apple Keychains](https://github.com/openwall/john/blob/bleeding-jumbo/src/keychain_fmt_plug.c) a lot harder than it needed to be.
Backstory: I was a (poor) student in Canada once and Apple made [my work on cracking Apple Keychains](https://github.com/openwall/john/blob/bleeding-jumbo/src/keychain_fmt_plug.c) a lot harder than it needed to be. This is how I got interested in Hackintosh systems.
71 changes: 71 additions & 0 deletions Xcode-Tutorial.md
@@ -0,0 +1,71 @@
### Developing on Virtualized macOS

1. Install Xcode from the Apple App Store or from the [Apple developer website](https://developers.apple.com).

2. Create an Xcode project as usual.

3. Connect the `Apple Device` (called `iPhone` from now on) to the macOS VM.
This can be done in two ways:

Method 1: Use USB passthrough technique to connect an entire USB controller
(to which `iPhone` is connected) to the macOS VM. This method is covered in
these [notes](notes.md#usb-passthrough-notes).

If USB passthrough is not an option, use `Method 2`.

Method 2. You can use the [USB Network Gate](https://www.eltima.com/products/usb-over-ethernet/)
software to pass USB devices to macOS VMs over the network (LAN / Wi-Fi).

![USB Network Gate - USB over Ethernet Sharing Software](https://www.eltima.com/imgnew/products/usb-over-ethernet/illustrationShare.png)

This software comes with a free trial and supports a wide variety of
operating systems. If your operating system is not supported directly, you can
deploy this software on a Raspberry Pi.

Once you have it installed on the host computer (the one with the USB device
that you will be sharing), you can install it on the macOS VM. Make sure to
allow the extension in `System Preferences > Security & Privacy` and reboot.

Once that is finished, you can open up `USB Network Gate` on the client
(macOS VM) and click `Add Server` and type in the IP address of the Raspberry Pi
or other device (to which the `iPhone` is connected). Finally, you have to
trust the computer on your `iPhone`, and it should be completely set up!

At this point, the `iPhone` should work as usual - showing up in
Finder, Xcode, etc.

4. At this point, the macOS VM has an Xcode project and has access to the
`iPhone`. Continue using Xcode as usual to build, deploy, and test the Xcode
project.


### Setup USB Network Gate on Raspberry Pi

These steps were tested on RPi 3B+ running `Raspberry Pi OS with desktop
(August 20th 2020)`.

```
sudo apt update
sudo apt upgrade -y
sudo reboot
sudo apt install raspberrypi-kernel-headers
wget https://cdn.electronic.us/products/usb-over-ethernet/linux/download/eveusb_armv7l.deb
sudo apt install ./eveusb_armv7l.deb
```

To get proper VNC resolution (for headless systems), insert the following lines
in `/boot/config.txt` on the RPi system.

```
dtparam=audio=on # note: existing line
hdmi_force_hotplug=1
hdmi_group=2
hdmi_mode=82
```

Enable VNC on the RPi system using the `sudo raspi-config nonint do_vnc 0`
command.
10 changes: 7 additions & 3 deletions boot-macOS-headless.sh
Expand Up @@ -30,7 +30,7 @@
# - Fix cpuid related warning on EPYC
# - Fix 'savevm' support

MY_OPTIONS="+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt"
MY_OPTIONS="+pcid,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check"

# This script works for Catalina as well as Mojave. Tested with macOS 10.14.6 and macOS 10.15.6.

Expand All @@ -42,9 +42,12 @@ CPU_THREADS="4"
REPO_PATH="."
OVMF_DIR="."

# for snapshots
export TMPDIR=$PWD

# shellcheck disable=SC2054
args=(
-enable-kvm -m "$ALLOCATED_RAM" -cpu Penryn,kvm=on,vendor=GenuineIntel,vmware-cpuid-freq=on,"$MY_OPTIONS"
-enable-kvm -m "$ALLOCATED_RAM" -cpu Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,"$MY_OPTIONS"
-machine q35
-usb -device usb-kbd -device usb-tablet
-smp "$CPU_THREADS",cores="$CPU_CORES",sockets="$CPU_SOCKETS"
Expand All @@ -58,7 +61,8 @@ args=(
-device ide-hd,bus=sata.2,drive=OpenCoreBoot
-device ide-hd,bus=sata.3,drive=InstallMedia
-drive id=InstallMedia,if=none,file="$REPO_PATH/BaseSystem.img",format=raw
-drive id=MacHDD,if=none,snapshot=on,file="$REPO_PATH/mac_hdd_ng.img",format=qcow2
# -drive id=MacHDD,if=none,snapshot=on,file="$REPO_PATH/mac_hdd_ng.img",format=qcow2
-drive id=MacHDD,if=none,snapshot=off,file="$REPO_PATH/mac_hdd_ng.img",format=qcow2
-device ide-hd,bus=sata.4,drive=MacHDD
-netdev user,id=net0 -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:c9:18:27
-monitor stdio
Expand Down

0 comments on commit 23a6a90

Please sign in to comment.