sakoula / XiaoMi-Air-6200U

Hackintosh Xiaomi Mi Air 13.3 Skylake-U 2016 for macOS Catalina & Mojave & High Sierra
67 stars 17 forks source link

Hackintosh Xiaomi Mi Air 13.3 Skylake-U 2016 for macOS Big Sur & Catalina

Hackintosh your XiaoMi Air 13.3 Skylake-U 2016. This is intented to create a fully functional hackintosh for the Xiaomi Mi Notebook Air 13.3'' i5-6200U (Skylake-U 2016).

Important Notes

up up up

Please note that this guide will be not possible without all the excellent resources:

What's working

up up up

What's not working

up up up

If you face another problem please open a issue.

Hardware Specifications

up up up


Table of Contents

up up up

Installation Guide

up up up

These are the steps in order to install or upgrade your Mi. There is a very detailed document on the steps followed and the customizations which can be found in DETAILS.md.

There is a another document on how I setup my environment including all the tools and utilities I have used ENVIRONMENT.air.md.

Start by downloading the latest version the customization files from the releases page. It includes:

The guide is being written based on the excellent Dortania guides

Installation SSD

up up up

I installed a Samsung 850 Evo Series, 500GB M.2 SSD (MZ-N5E500BW) specifically for macOS on the second M.2 port. Use F12 to boot from a specific device.

Preparing USB Flash Drive

up up up

Get a at least 16GB USB Flash Drive and follow Creating the USB > Making the installer. Follow just the Making the installer Guide.

Or could follow this guide,if you need Big Sur,you can direct download.

If you need just a USB stick with OpenCore installation for booting an existing MacOS installation just format the USB stick as following:

Disk Utility > Select USB Device > Erase:

Customize USB Flash Drive

up up up

In this step you will add all the required opencore files to the USB flash drive.

Download the latest release from github and unzip the archive. You will find an AIR_EFI directory. Mount the USB Flash Drive's EFI partition on /Volumes/EFI. You can do this with many utilities (e.g. MountEFI or mount_efi.sh).

Move the AIR_EFI to /Volumes/EFI and rename it to EFI. It will look like /Volumes/EFI/EFI

Generate a valid SMBIOS

up up up

Use corpnewt/GenSMBIOS to generate a valid MacBookPro13,1 SMBIOS and populate the following /Volumes/EFI/OC/config.plist with a text editor or corpnewt/ProperTree:

<key>PlatformInfo</key>
<dict>
    ...
    <key>MLB</key>
    <string>XXXXXXXXXXXXXXXXX</string>
    ...
    <key>SystemSerialNumber</key>
    <string>XXXXXXXXXXXX</string>
    ...
    <key>SystemUUID</key>
    <string>XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX</string>
    ...
</dict>

a valid SMBIOS is really important for Apple Services, iMessage & FaceTime. Check also the guide An iDiot's Guide To iMessage

Disable Secure Boot

up up up

Hold F2 to get into the BIOS. In order to disable the secure boot you need to set a supervisor BIOS password. Use root as a password. Without exiting disable the secure boot. Then change the supervisor password and do not enter a new one. This will disable it. Exit BIOS saving the options.

You do not have to change anything else from the defaults

Unlock CFG Lock

up up up

CFG Lock removal is required.

This procedure is verified for BIOS A06. It has not been tested in any other BIOS. Proceed at your own risk.

Follow Fixing CFG Lock. The right offset is 0x84A. The steps are:

If your BIOS version is A05, you can upgrade to A06 and direct use above value(0x84A).

  1. boot from the USB drive

  2. On the opencore menu hit Space. You will see a number of options

  3. select Modified GRUB Shell. On the prompt you will type:

setup_var 0x84A

Only if you do not get any type of error type the following to unlock CFG:

setup_var 0x84A 0x00
  1. reboot and boot from the USB drive again. On the OpenCore menu hit Space. Then Select VerifyMSRE2.efi. This will verify whether CFG is unlocked.

Note: If you change any settings on the BIOS or flash a new BIOS you should always redo this procedure again.

Install macOS

up up up

During the first time you boot you must clear the NVRAM of the system (Clover and other Bootloader leave traces)

To boot from the USB Flash Drive you can just hit F9 and you will get the UEFI boot loader. Once you get to Clover hit space and select CleanNvram.efi. After it completes power off the computer wait for ten seconds and power on again.

Boot again and Install macOS

Post Install

up up up

At this point OpenCore boot loader is installed only in the USB driver. You are required to install it on your bootable disk. Follow Moving OpenCore from USB to macOS Drive

Enable TRIM for SSDs

up up up

Since OpenCore does not reccomends to patch for TRIM using the bootloader you need to enable TRIM for all SSDs manually. Open terminal and use command: sudo trimforce enable. Reboot and check that TRIM is enabled on the Apple > About this Mac > System Report.

Clover to OpenCore Migration

up up up

This section is for those who run Clover and want to migrate to OpenCore. You need to:

  1. make sure you have a backup USB flash drive with clover in order to boot your system. Check README.clover.md. If something goes wrong you may end up with an unbootable system! You have been warned!

  2. Create a USB flash drive without the macos installer. check Preparing USB Flash Drive and Customize USB Flash Drive.

  3. Remove Clover. Check Converting from Clover to OpenCore. TLDR you need to Cleaning the Clover Junk in macOS and Removing kexts from macOS(S/L/E and L/E)

  4. Most likely you will hit the stuck on OCB: LoadImage failed - Security Violation. Follow the link and fix it now. Do not disable SecureBootModel. Follow the terminal instructions

  5. Boot from the USB and Clear the NVRAM. Check Install macOS section.

  6. Boot from the USB flash drive. Make sure you have a working system

  7. Move OpenCore from USB to macOS Driver. Check Post Install

Sleep

up up up

make sure that you type the following on the terminal based on (Fixing Sleep)

check your current state:

$ sudo pmset -g

and type

sudo pmset autopoweroff 0
sudo pmset powernap 0
sudo pmset standby 0
sudo pmset proximitywake 0
sudo pmset lidwake 0

Upgrade Guide

up up up

Upgrade from Catalina 10.15.3 to Catalina 10.15.7

up up up

Upgrade from within macOS. No special action is needed

Upgrade to Big Sur 11.0.1

up up up

Use the latest release from here boot in Catalina and upgrade.

Postinstallation Steps

up up up

Enable HiDPI resolutions

up up up

I am using the computer using the 1600x900 resolution that fits my eyes best.

You can enable HiDPI resolutions using the amazing script one-key-hidpi. However since native max resolution of the LCD is 1920x1080 it does not make any sense. HiDPI will look huge on screen and the 1920x1080 HiDPI will not seem any different and will make the computer slower. 1920x1080 HiDPI will create a 3840x2160 virtual screen that will map it to a 1920x1080 display, so it does not help much.

If you still want to use HiDPI get the avibrazil/RDM tool if you cannot see all the available resolutions.

Install ALCPlugFix :icecream:

up up up

Wi-Fi

up up up

The card in the laptop is Intel® Dual Band Wireless-AC 8260

Support to the Wifi card has been condifured using itlwm and not AirportItlwm (does not support hidden networks).

You will need to install OpenIntelWireless/HeliPort as well.

You can also use USB dongles but this is not reccomended anymore. TP-LINK TL-WN725N v3 and Archer T3U has been used succesfully in the past. Drivers for those can be downloaded from TP-LINK site or chris1111/Wireless-USB-Adapter.

In the case you migrate from a USB dongle with NullEthernet to native wifi support you need to force macOS to rewnumerate the interfaces. Check Fixing En0.

In short you need to open terminal write the following and then reboot:

sudo rm /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist
sudo rm /Library/Preferences/SystemConfiguration/preferences.plist

Headphone Port

up up up

The is a problem with the headphone port and does not always work. You need to install hackintosh-stuff/ComboJack and follow the instructions on github.

Changelog

up up up

You can view Changelog for detailed information.

Benchmarking

up up up

Benchmarking Windows 10

Benchmarking macOS 10.14.2 (Clover)

Benchmarking macOS 10.15.3 (JahStories CPUFriendProvider) (Clover)

Benchmarking macOS 10.15.3 (corpnewt/CPUFriendFriend LFM=08/EPP=80) (Clover)

Benchmarking macOS 10.15.7 (corpnewt/CPUFriendFriend LFM=08/EPP=80/PerfBias=05) (OpenCore)

FAQ

up up up

Disabling SIP

up up up

Disabling SIP

OCB: LoadImage failed - Security Violation

up up up

Users may find upgrading OpenCore on an already installed system can result in early boot failures due to Security > SecureBootModel > Default OCB: LoadImage failed - Security Violation

MacOS installer thinks I am russian

up up up

macOS installer in Russian

OpenCore Sanity Checker

up up up

make sure to check your config.plist against OpenCore Sanity Checker

Make Changes on the root filesystem

up up up

Apple has introduce SSV (signed system volumes). SSV features a kernel mechanism that verifies the integrity of the system content at runtime, and rejects any data — code and non-code — that doesn’t have a valid cryptographic signature from Apple. In order to make root volume writable you need to disable, mount it, change it, create a new snapshot and boot from that snapshot. I am not responsible if you make your machine unbootable. This may break OS updates. Check how to do it @ macOS 11 Big Sur and Mount root as writable in Big Sur

Note: For some reason bless is not working with errors like:

sudo bless --folder /Users/xxx/mount/System/Library/CoreServices --bootefi --create-snapshot
Couldn't copy file "/Users/xxx/mount/System/Library/CoreServices/boot.efi.j137ap.im4m" - Error Domain=NSCocoaErrorDomain Code=513 "“boot.efi.j137ap.im4m” couldn’t be copied because you don’t have permission to access “CoreServices”." UserInfo={NSSourceFilePathErrorKey=/System/Volumes/Preboot/525BE91F-EBD8-3CBD-9774-952E4F6FC515/usr/standalone/i386/boot.efi.j137ap.im4m, NSUserStringVariant=(
    Copy
), NSDestinationFilePath=/Users/xxx/mount/System/Library/CoreServices/boot.efi.j137ap.im4m, NSFilePath=/System/Volumes/Preboot/525BE91F-EBD8-3CBD-9774-952E4F6FC515/usr/standalone/i386/boot.efi.j137ap.im4m, NSUnderlyingError=0x7f94b8d13c30 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}}

Instead of bless you can do the following:

Steps:

  1. Boot from recovery and disable SSV (this will be permanent)
csrutil authenticated-root disable
  1. Boot on macos and mount your root volume as writable. Find your root mount's device - run mount and chop off the last s, e.g. if your root is /dev/disk1s2s3, you'll mount /dev/disk1s2
$ mount
/dev/disk2s5s1 on / (apfs, sealed, local, read-only, journaled)
$ mkdir /Users/xxx/mount
sudo mount -o nobrowse -t apfs /dev/disk2s5 /Users/xxx/mount
  1. Make any modifications you want in /Users/xxx/mount

  2. Generate and tag new APFS System Snapshot as follows and make it bootable

# Create snapshot.
sudo /System/Library/Filesystems/apfs.fs/Contents/Resources/apfs_systemsnapshot -s "ChangedRoot" -v /Users/xxx/mount

# Tag snapshot for next boot.
sudo /System/Library/Filesystems/apfs.fs/Contents/Resources/apfs_systemsnapshot -r "ChangedRoot" -v /Users/xxx/mount
  1. reboot and you are done

  2. check the snapshots

$ diskutil apfs snapshots disk2s5s1
Snapshots for disk2s5s1 (3 found)
|
+-- AFD82B0C-23D3-481B-9401-0A17DC46C1EC
|   Name:        com.apple.os.update-779BDF1556C6F688504E24FB29C75AFFABFCB91E701806FFFF35235E19914F1E
|   XID:         489684
|   Purgeable:   No
|   NOTE:        This snapshot limits the minimum size of APFS Container disk2
|
+-- 4A6FACBE-2667-4127-8143-646C38E3C3B4
|   Name:        ChangedRoot
|   XID:         490985
|   Purgeable:   Yes
|
+-- 3DC0C93D-F858-4420-AC0B-49FDF23D5C3A
    Name:        NewRoot
    XID:         9223372036855268389
    Purgeable:   Yes
  1. you can always boot to another snapshot by doing
$ diskutil apfs snapshots disk2s5s1
$ mount
/dev/disk2s5s1 on / (apfs, sealed, local, read-only, journaled)
$ mkdir /Users/xxx/mount
$ sudo mount -o nobrowse -t apfs /dev/disk2s5 /Users/xxx/mount
$ sudo /System/Library/Filesystems/apfs.fs/Contents/Resources/apfs_systemsnapshot -r "com.apple.os.update-779BDF1556C6F688504E24FB29C75AFFABFCB91E701806FFFF35235E19914F1E" -v /Users/xxx/mount

reboot
  1. to delete a snapshot you need to boot into recovery
$ diskutil list
$ diskutil apfs snapshots disk2s5
$ diskutil apfs deleteSnapshot disk2s5 -name ChangedRoot

you cannot delete the bootable snapshot

  1. when upgrading it do idea whats will happen XXX

Making Symbolic Links on the root filesystem

up up up

Try Making Symbolic Links on the root filesystem

Changelog

up up up

You can view Changelog for detailed information.

Buy me a coffee or a beer

up up up

If you feel so you can buy me a coffee or a beer!

Credits

up up up