bacongravy/macinbox

Support - macOS 10.15 Catalina installer

egandro opened this issue · 26 comments

I will do a go/nogo installation with this

Iso won't boot in Vmware...

milch commented

I tried the installation with the following options, using the latest VMware 11:

sudo macinbox --short catalina-test --full User --password 123456 --installer /Applications/Install\ macOS\ 10.15\ Beta.app --use-qemu

Got this log output:

• Checking macOS versions...
  + Warning: host OS version (10.14.5) and installer OS version (10.15) do not match
• Creating image from installer...
  + Creating and attaching wrapper disk image...
  + Creating and attaching a new blank disk image...
  + Installing macOS...
    - installer: 100% done

• Cleaning up...
Traceback (most recent call last):
        11: from ~/.rbenv/versions/2.6.3/bin/macinbox:23:in `<main>'
        10: from ~/.rbenv/versions/2.6.3/bin/macinbox:23:in `load'
         9: from ~/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/macinbox-3.3.0/exe/macinbox:5:in `<top (required)>'
         8: from ~/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/macinbox-3.3.0/lib/macinbox/cli.rb:19:in `run!'
         7: from ~/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/macinbox-3.3.0/lib/macinbox/cli.rb:122:in `start'
         6: from ~/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/macinbox-3.3.0/lib/macinbox/cli.rb:122:in `chdir'
         5: from ~/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/macinbox-3.3.0/lib/macinbox/cli.rb:128:in `block in start'
         4: from ~/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/macinbox-3.3.0/lib/macinbox/logger.rb:17:in `info'
         3: from ~/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/macinbox-3.3.0/lib/macinbox/cli.rb:129:in `block (2 levels) in start'
         2: from ~/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/macinbox-3.3.0/lib/macinbox/actions/create_image_from_installer.rb:49:in `run'
         1: from ~/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/macinbox-3.3.0/lib/macinbox/actions/create_image_from_installer.rb:112:in `create_rc_vagrant'
~/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/macinbox-3.3.0/lib/macinbox/actions/create_image_from_installer.rb:112:in `write': No such file or directory @ rb_sysopen - /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/create_image_from_installer.ZAEvtMe6/scratch_mountpoint/private/etc/rc.installer_cleanup (Errno::ENOENT)

I tried just the ISO not via macinbox.

At this point the VM didn't start, yet - just the Installer was called to write the content to a disk.

So could be the same issue. So VMWare needs to solve this :)

Thanks, @egandro, for looking into this and sharing your findings. I haven't had a chance to dig into Catalina support. I did find this thread which has some workarounds for getting Catalina to work in Fusion:

https://communities.vmware.com/thread/611961

The error that macinbox reported:

create_image_from_installer.rb:112:in `write': No such file or directory @ rb_sysopen - /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/create_image_from_installer.ZAEvtMe6/scratch_mountpoint/private/etc/rc.installer_cleanup (Errno::ENOENT)

...is probably because Catalina changes how the root filesystem works, and it is no longer okay to create files in /private/etc. I'm hopeful that once I learn more about how Catalina works that I'll be able to identify a workaround.

I have reproduced this issue. The following directories do not exist on the volume created by the Catalina installer:

/private/etc
/private/etc/sudoers.d
/Library/Preferences

The script fails when it tries to write files to these locations.

There appears to be "templates" for a lot of the files around this path, inside the image:
/System/Library/Templates/Data

Someone managed to get this working with VMWare:

macOS 10.15 Catalina Installer (Beta 1 19A471t)

I hacked on macinbox to add a /System/Library/Templates/Data prefix to all the relevant paths and was able to create a box, but when I boot the box with VMware it gets about 80% through the startup progress bar and then the VM spontaneously powers off. I tried booting verbosely but didn't see any relevant messages before the VM stopped.

We have to figure out how to create / patch a specific nvram file :( This issue can be solved with a -v boot arg parameter.

I think we can borrow some things from here! https://github.com/AlexanderWillner/runMacOSinVirtualBox

@adamwolf Contributions are welcome! However, I'm not sure what we can borrow from that project that I haven't already. The difficultly here isn't in getting macOS to boot in a VM, but in getting that VM automatically configured to be a valid vagrant box.

The macinbox tool is somewhat unique in that it attempts to perform the installation of the OS on the host, rather than inside of a VM. In order to configure the installed OS to be usable by vagrant the tool needs to lay down some files in locations projected by SIP, which is very hard to do once the installed OS is running. You'll note that runMacOSinVirtualBox doesn't automate the installation of the OS or the creation of user accounts at all. You have to manually click through the installer after the VM boots for the first time!

Someone tried a new beta?

I got Beta7 booting with this "trick":

https://communities.vmware.com/thread/611961

But the installed OS still does not boot :(

Officially announced: https://blogs.vmware.com/teamfusion/2019/08/vmworld-2019-fusion-and-workstation-announcements.html

Fusion 11.5 comes with macOS 10.15 Catalina

I guess we have to wait for a few weeks...

Thanks, @egandro ! I haven't had a chance to try the new Fusion yet, or the latest Catalina, but I will soon.

I did see that AutoDMG needed to make a change for Catalina: MagerValp/AutoDMG@c55bbcf

...which looks like it addresses: MagerValp/AutoDMG#234

I did some more testing with the latest Catalina and Fusion using a Mojave host. I can install and run Catalina in Fusion if I create the VM using Fusion from the Catalina installer app. However, if I create a box with a hacked (that is, with paths prefixed with /System/Library/Templates/Data) version of macinbox it powers off part way through booting in Fusion. According to the logs it seems that the Data volume isn't getting mounted. I'm starting to wonder if the Mojave installer actually knows how to install Catalina properly. The next thing to try is to use the hacked macinbox from a Catalina host and see if the created box behaves differently.

I tested with Catalina 19A582a as both the host and installer version, and macinbox mostly works as-is. The box is created and boots fine, but the VMware guest kernel extensions don't get loaded properly.

I was able to boot Catalina with Parallels and VirtualBox, too, using an unmodified macinbox to create the boxes from a Catalina host.

I then recreated a VMWare box and it started hanging at the end of the boot process. My suspicion is that the broken VMWare tools kernel extensions were somehow blocking the boot process. (I don't know why sometimes they are reported as broken after booting, whereas other times they apparently just cause a hang.) I was able to work around the issue by re-creating the Catalina VMWare box again, this time without the tools installed or the KextPolicy file updated.

I am also observing that the HiDPI setting is not preserved when vagrant brings up the VMWare box. When you try to bring up a VMWare box and then inspect the virtual machine with VMWare Fusion the HiDPI setting is not enabled. The setting appears properly in the original VMX file in the box, but the cloned VMX file has the setting lowercased, and it is not respected. If you power off the VM and change the setting with VMWare Fusion it updates the VMX and puts the capitalization of the setting correctly again. If you power the VM back on with VMWare Fusion the setting is preserved. However, if you run vagrant up again, then the setting gets lowercased again, and the VM boots without HiDPI support.

Works: gui.fitGuestUsingNativeDisplayResolution = "TRUE"
Does not work: gui.fitguestusingnativedisplayresolution = "TRUE"

This appears to be long-standing vagrant behavior so I think this may be a regression introduced by VMWare Fusion 11.5.

Confirmed, the HiDPI issue does not occur with 11.1.0. I have filed #44 to track the issue.

Here's my current thinking for how to resolve this issue:

  • Prevent pre-Catalina hosts from attempting to create a Catalina-or-later box
  • Don't install the VMWare tools into Catalina-or-later guests
  • Set the virtualHW and guestOS values in the VMX based on the installer OS version

It also turns out the Catalina hosts cannot create Mojave (or earlier) boxes, so we'll need to prevent that, too.

I've begun to address this on a catalina branch. I'm targeting this for the v4.0.0 milestone.

I have addressed this with 019c999.

v4.0.0 has been released. Closing.