Skip to content

Commit

Permalink
Add support for macOS Catalina
Browse files Browse the repository at this point in the history
  • Loading branch information
kholia committed Jun 9, 2019
1 parent 9cb92a0 commit fb9d909
Show file tree
Hide file tree
Showing 9 changed files with 83 additions and 62 deletions.
2 changes: 2 additions & 0 deletions CREDITS.md
Expand Up @@ -53,3 +53,5 @@
* Pellegrino Prevete (tallero) - Better documentation

* Niklas Korz (niklaskorz) - Stop using brctl

* Mike Bybee (stereoplegic) - Higher resolution documentation
Binary file modified Mojave/CloverNG.qcow2
Binary file not shown.
2 changes: 1 addition & 1 deletion Mojave/create_iso_mojave.sh
Expand Up @@ -28,7 +28,7 @@ else
fi

# Borrrowed from multiple internet sources
hdiutil create -o "$iso_path.cdr" -size 6g -layout SPUD -fs HFS+J
hdiutil create -o "$iso_path.cdr" -size 7g -layout SPUD -fs HFS+J
hdiutil attach "$iso_path.cdr.dmg" -noverify -mountpoint /Volumes/install_build
sudo "$in_path/Contents/Resources/createinstallmedia" --volume /Volumes/install_build --nointeraction
hdiutil detach "/Volumes/Install macOS Mojave"
Expand Down
18 changes: 17 additions & 1 deletion README.md
Expand Up @@ -73,6 +73,20 @@ Phenom II X3 720 does not. Ryzen processors work just fine.
You can choose your desired macOS version here. After executing this step,
you should have the `BaseSystem.dmg` file in the current folder.

Sample run:

```
$ ./fetch-macOS.py
# ProductID Version Build Post Date Title
1 041-47723 10.14.4 18E2034 2019-03-25 macOS Mojave
2 091-95155 10.13.6 17G66 2019-01-08 macOS High Sierra
3 041-64745 10.14.5 18F203 2019-05-22 macOS Mojave
4 041-59913 10.14.5 18F132 2019-05-13 macOS Mojave
5 041-71284 10.15 19A471t 2019-06-03 macOS 10.15 Beta
Choose a product to download (1-5): 5
```

Attention: Modern NVIDIA GPUs are supported on HighSierra but not on Mojave
(yet).

Expand Down Expand Up @@ -123,6 +137,7 @@ Phenom II X3 720 does not. Ryzen processors work just fine.
If you are new to installing macOS, see the [older README](README-OLD.md) for
help.

For macOS Catalina, use `boot-macOS-Catalina.sh` script.

- GUI method (alternate - functional but needs further debugging work).

Expand Down Expand Up @@ -182,7 +197,8 @@ Phenom II X3 720 does not. Ryzen processors work just fine.

* To passthrough GPUs and other devices, see [these notes](UEFI/README.md).

* Need a different resolution? Check various notes included in this repository.
* Need a different resolution? Check out the [notes](notes.md) included in this
repository.


### Is This Legal?
Expand Down
36 changes: 36 additions & 0 deletions boot-macOS-Catalina.sh
@@ -0,0 +1,36 @@
#!/bin/bash

# qemu-img create -f qcow2 mac_hdd_ng.img 128G
#
# echo 1 > /sys/module/kvm/parameters/ignore_msrs (this is required)

############################################################################
# NOTE: Tweak the "MY_OPTIONS" line in case you are having booting problems!
############################################################################

# This works for High Sierra as well as Mojave. Tested with macOS 10.13.6 and macOS 10.14.4.

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

# OVMF=./firmware
OVMF="./"

qemu-system-x86_64 -enable-kvm -m 3072 -cpu Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,$MY_OPTIONS\
-machine q35 \
-smp 4,cores=2 \
-usb -device usb-kbd -device usb-mouse \
-device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" \
-drive if=pflash,format=raw,readonly,file=$OVMF/OVMF_CODE.fd \
-drive if=pflash,format=raw,file=$OVMF/OVMF_VARS-1024x768.fd \
-smbios type=2 \
-device ich9-intel-hda -device hda-duplex \
-device ich9-ahci,id=sata \
-drive id=Clover,if=none,snapshot=on,format=qcow2,file=./'Mojave/CloverNG.qcow2' \
-device ide-hd,bus=sata.2,drive=Clover \
-device ide-hd,bus=sata.3,drive=InstallMedia \
-drive id=InstallMedia,if=none,file=BaseSystem.img,format=raw \
-drive id=MacHDD,if=none,file=./mac_hdd_ng.img,format=qcow2 \
-device ide-hd,bus=sata.4,drive=MacHDD \
-netdev tap,id=net0,ifname=tap0,script=no,downscript=no -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:c9:18:27 \
-monitor stdio \
-vga vmware
3 changes: 2 additions & 1 deletion boot-macOS-NG.sh
Expand Up @@ -32,4 +32,5 @@ qemu-system-x86_64 -enable-kvm -m 3072 -cpu Penryn,kvm=on,vendor=GenuineIntel,+i
-drive id=MacHDD,if=none,file=./mac_hdd_ng.img,format=qcow2 \
-device ide-hd,bus=sata.4,drive=MacHDD \
-netdev tap,id=net0,ifname=tap0,script=no,downscript=no -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:c9:18:27 \
-monitor stdio
-monitor stdio \
-vga vmware
15 changes: 8 additions & 7 deletions fetch-macOS.py
Expand Up @@ -45,13 +45,13 @@
else:
import urllib.parse as urlstuff

"""
# https://github.com/foxlet/macOS-Simple-KVM/blob/master/tools/FetchMacOS/fetch-macos.py (unused)
catalogs = {"CustomerSeed":"https://swscan.apple.com/content/catalogs/others/index-10.14customerseed-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog",
"DeveloperSeed":"https://swscan.apple.com/content/catalogs/others/index-10.14seed-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog",
"PublicSeed":"https://swscan.apple.com/content/catalogs/others/index-10.14beta-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog",
"PublicRelease":"https://swscan.apple.com/content/catalogs/others/index-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog"}
"""
catalogs = {
"CustomerSeed":"https://swscan.apple.com/content/catalogs/others/index-10.15customerseed-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog",
"DeveloperSeed":"https://swscan.apple.com/content/catalogs/others/index-10.15seed-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog",
"PublicSeed":"https://swscan.apple.com/content/catalogs/others/index-10.15beta-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog",
"PublicRelease":"https://swscan.apple.com/content/catalogs/others/index-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog"
}

DEFAULT_SUCATALOGS = {
'17': 'https://swscan.apple.com/content/catalogs/others/'
Expand All @@ -60,13 +60,14 @@
'18': 'https://swscan.apple.com/content/catalogs/others/'
'index-10.14-10.13-10.12-10.11-10.10-10.9'
'-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog',
'something': 'https://swscan.apple.com/content/catalogs/others/index-10.15seed-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog'
}

def get_default_catalog():
'''Returns the default softwareupdate catalog for the current OS'''
# darwin_major = os.uname()[2].split('.')[0]
# return DEFAULT_SUCATALOGS.get(darwin_major)
return DEFAULT_SUCATALOGS.get('18')
return DEFAULT_SUCATALOGS.get('something')


class ReplicationError(Exception):
Expand Down
4 changes: 2 additions & 2 deletions macOS-libvirt-NG.xml
Expand Up @@ -130,8 +130,8 @@
<mac address='52:54:00:8e:e2:66'/>
<source bridge='virbr0'/>
<target dev='tap0'/>
<model type='e1000-82545em'/>
<address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x0'/>
<model type='vmxnet3'/>
<address type='pci' domain='0x0000' bus='0x0' slot='0x02' function='0x0'/>
</interface>
<input type='keyboard' bus='usb'>
<address type='usb' bus='0' port='2'/>
Expand Down
65 changes: 15 additions & 50 deletions notes.md
Expand Up @@ -106,66 +106,31 @@ recommended instead.
cp usr/standalone/i386/boot enoch_rev2848_boot
```

### Higher Resolution
### Higher Resolution (UEFI + Clover)

If you want a larger VNC screen add the following to the bootloader config in /Extra/org.chameleon.Boot.plist:
Follow the steps below to get a higher resolution:

```
<key>Graphics Mode</key>
<string>1440x900x32</string>
```

Make sure to pick a resolution that is supported by the SeaBIOS used by QEMU.
The full list can be found in the source for SeaBIOS located
[here](http://git.qemu-project.org/?p=seabios.git;a=blob_plain;f=vgasrc/bochsvga.c;hb=HEAD).

For example, setting the resolution to 2560x1440x32 will not work. OS X will
boot with the next lowest supported resolution which is 1920x1200x32. Instead,
use 2560x1600x32 and it will work.
1. Set the desired Clover screen resolution in the relevant
`config.plist.stripped.qemu` file and regenerate the corresponding
`Clover*.qcow2` file (process documented in `Mojave/README.md`).

### Higher Resolution (UEFI)

If you want larger VNC/SPICE screen edit the Clover bootloader config in
`/EFI/CLOVER/config.plist`. In the XML root `<dict>` section there is a
`<key>GUI</key>` with values in a `<dict>` section. Set your resolution
in the following key-value block; create it if it does not exist:

```
<key>ScreenResolution</key>
<string>1360x768</string>
```
2. Ensure that the OVMF resolution is set equal to resolution set in your
Clover.qcow2 file (default is 1024x768). This can be done via the OVMF menu,
which you can reach with a press of the ESC button during the OVMF boot logo
(before Clover boot screen appears). In the OVMF menu settings, set Device
Manager -> OVMF Platform Configuration -> Change Preferred Resolution for Next
Boot to the desired value (default is 1024x768). Commit changes and exit the
OVMF menu.

A simple way to configure this setting, even when you use a separated disk for
Clover is by using the Clover Configurator tool, allowing to mount the disk
image and setting this resolution from a simple interface.

The resolution set there must be supported by the resolution list in UEFI
configuration. EDK II OVMF UEFI resolution must be updated to match the
resolution set in Clover configuration. Check the [README.md for High
Sierra](HighSierra/README.md) for detailed instructions.

EDK II supports more resolutions than SeaBIOS, however QEMU is currently
limited to widths and heights that are multiple of 8. This means resolutions
like 1366x768 won't be displayed properly because dividing 1366/8 does not
return an integer value. For this particular case, select the nearer 1360x768
resolution instead. VNC implementation may require a multiple of 16, so beware
of setting 1080 vertical resolution or use SPICE instead.
3. Relaunch the boot script.

### Accelerated Graphics

Install VMsvga2 from [this location](https://sourceforge.net/projects/vmsvga2/). No support
is provided for this unmaintained project!

* Add `-vga vmware` to QEMU parameters in boot-macOS.sh.

* For Chameleon (unused nowadays), add the following to `/Extra/org.chameleon.Boot.plist` file.

```
<key>Kernel Flags</key>
<string>vmw_options_fb=0x06</string>
```

Thanks to Zhang Tong and Kfir Ozer for finding this.
* Add `-vga vmware` to QEMU parameters in the booot script (e.g.
boot-macOS.sh), if required.

* For Clover bootloader, add `wmv_option_fb=0x06` to the `<string>` tag of the
`Arguments` key of the `config.plist` you use when generating the
Expand Down

0 comments on commit fb9d909

Please sign in to comment.