Previous month:
April 2020
Next month:
July 2020

Setting user home directory in macOS via command line

My old Hackintosh was messed up: it mounted the separate drive holding the Home directories in "/Volumes/Homes 1" rather than "/Volumes/Homes". That meant I could not login normally.

But, I was still able to login via ssh. Since macOS is a Unix-ish system, it just drops you in the root directory. From there, do the following:

    sudo dscl . -change /Users/username NFSHomeDirectory old-path new-path

Replace username, old-path, and new-path with appropriate values.

Credit to this answer at Stack Overflow. Like any *nix, there is a man page.


Migrating from Aperture to Lightroom Classic drops non-destructive adjustments layer

Well, this sucks: according to Apple, migrating Aperture RAW files to Lightroom Classic does NOT migrate the non-destructive adjustment layer. Which means my 650 GB or so of photos are the unedited versions. 

The old Hackintosh is dead. So, I can’t go in and re-export edited JPGs. But even if I could, I wouldn’t do that: who’s got the time?


New Hackintosh using OpenCore

Ddd126a3b2f1424995a2019c1c75b8f6

 

I now have a new Hackintosh. My old Hackintosh was completed at the end of 2012. And for the last year or so, it has been running really slow. I also managed to kill the GPU slot a few years ago, due to my usual impatience. So, it had been running with the on-board Intel GPU. However, I was still able to play League of Legends on its lowest quality graphics mode, all credit to Riot Games.

This build was rather frustrating: I decided to use OpenCore, as it seemed (last fall) to be the future of Hackintosh. I had all parts in hand last November. I worked on the build a bit at a time over the last few months, but kept running into issues. E.g. fixing the "slide" value for KASLR, random crashes, black screens, etc.

In any case, all the bits and pieces sat around for a few months. I finally installed Windows on its own HDD, and had been running it for a few weeks. Finally decided to take a look at OpenCore, again. I ended up using OpenCore 0.5.9. The documentation had also been tidied up a bit, and it seemed a little easier to follow this time around.

It took me only a couple of days to get everything up and running, stably and consistently.

Here is the parts list:

Additionally, I re-purposed an old 2.5" 500 GB HDD that I had lying around from an old used Mac Mini that I destroyed. (Did I mention that I tend to destroy hardware due to impatience?)

Before I go into some detail about the process, here is a short rundown on what works and what doesn't:

  • Messages works
  • FaceTime may work -- I don't have a webcam, so I can't confirm
  • iTunes works
  • AppleTV does not work due to DRM issues (HDCP, I think?)
  • Netflix on Safari does not work, again due to DRM
  • Netflix on Google Chrome works, but at 720p, I think (it does not look like 1080p)
  • YouTube 4K works
  • Audio (analog) input and output jacks on rear and front panels work; the rear panel jacks appear as "built-in"
  • On-board Bluetooth works
  • On-board WiFi does not work
  • Blu-ray reading/playing does not work. Have not tried burning. UPDATE July 2020: need to consult the motherboard documentation. Installing M.2 storage may disable one or more of the SATA ports due to sharing of data lanes in the chipset. Now, reading/playing/ripping CDs works fine, playing DVDs works fine, ripping DVDs with Handbrake works fine (install libdvdcss using Fink), reading Blu-Ray works but can’t play them (of course), MakeMKV recognizes the Blu-Ray but hit a “fatal error” when trying to rip.
  • Steam games pretty much do not DO work (updated Jul 20, 2020 - not sure what has changed, but Steam games seem to work, now)
  • League of Legends works (Teamfight Tactics is what I'm playing most, nowadays)

Here is what I did. There is a lot of detail follow in the official guides, so I will just present an outline, and the key hardware-specific things I had to do.

I also found the diagrams in this forum post useful, even though it uses TonyMacx86, since they use the same motherboard.

  1. Create USB flash drive installer.
    1. You will need a 16 GB USB flash drive.
    2. This can be done on macOS (including a Hackintosh), Windows, or Linux. Here is another guide for doing this on Windows.
  2. BIOS settings. There are a variety of settings to make: first, "Load Optimized Defaults" as a starting point.
    1. Use UEFI boot mode
    2. Disable the following:
      1. Fast Boot
      2. VT-d. N.B. can be enabled if you set DisableIoMapper to True.
      3. CSM
      4. Thunderbolt
      5. Intel SGX
      6. Intel Platform Trust
      7. CFG Lock (MSR 0xE2 write protection). This may not exist in your BIOS.
      8. All RGB lighting
    3. Enable the following:
      1. VT-x
      2. Hyper-Threading (technically irrelevant, since the i7-9700 does not do hyperthreading)
      3. Execute Disable Bit
      4. Above 4G decoding
      5. EHCI/XHCI Hand-off
    4. Set OS type to: Windows
  3. OpenCore setup on the USB flash drive.
    1. This is probably the most tedious part: setting up OpenCore in the EFI folder, and creating a config.plist file.
    2. However, if you use the ProperTree OpenCore config.plist editor, quite a bit of the work is automated.
    3. NB some of the text instructions in the OpenCore guide do not match up with the pictures which illustrate the instructions. If there was a conflict, I took the text to be authoritative, and ignored the pictures.
  4. Once OpenCore config.plist is done, save a copy of that config.plist (I add a date-time stamp to the backup copy). Then, reboot from the USB flash drive, and run the macOS Installer.
    1. For the initial install, I installed on the NVMe boot drive. I selected APFS format.
  5. Post-install, set up the new Hackintosh boot drive with its own EFI partition so that the installer USB flash drive is no longer needed. 
    1. Optionally, set up a GUI for the boot device selector
    2. Fix the audio interface: find the appropriate PCI ID for the device. The motherboard includes a Realtek® ALC1220-VB codec. I used layout 1.
  6. Once it was installed, I ran Disk Utility to format the data HDD for use as my home folder.
    1. I suggest formatting HDD as HDFS+. My experience with APFS on a HDD in my old Hackintosh is that APFS on HDD is pretty slow, particularly when backups run and a snapshot is created.
    2. Then, follow these instructions to set a new location for the home folder.
    3. Reboot, and make sure the new home folder works.
    4. Apply any OS updates.
  7. I have a Time Machine backup HDD in a USB enclosure. I hooked up the backup HDD to the new Hackintosh, and used Migration Assistant to move OS and applications. Since my home folder on the old Hackintosh and the new Hackintosh are not on the same device as the boot drive, Migration Assistant was not able to transfer the data.
    1. I tried mounting the old HDD containing the home directory using USB on the new Hackintosh, but was unable to see any of the data at all. I didn't spend too much time to figure out why: after about 30 minutes trying a couple of obvious tricks, I bailed.
    2. The old Hackintosh was started up with the home folder HDD attached. I used rsync to transfer the data. NB you will likely need a newer version of rsync than what comes with macOS Catalina. This is because I ran into errors using the default rsync: it had trouble with some extended file attributes. Compilation was straightforward; standard GNU style: ./configure ; make ; make install

Late addition based on post-install experience: Do not bother with USB mapping unless you find one or more USB ports that you need are not working. Things just seem to work.

And that was pretty much it.

Screen_Shot_2020-06-14_at_6_31_43_PM

Screen_Shot_2020-06-20_at_2_00_45_PM