If you need a macOS USB installer, but you cannot boot into macOS, you can still create one on Windows or Linux using Docker-OSX
Create a macOS virtual machine on Linux:
https://github.com/sickcodes/Docker-OSX
docker run -it \
--device /dev/kvm \
-p 50922:10022 \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-e "DISPLAY=${DISPLAY:-:0.0}" \
-e GENERATE_UNIQUE=true \
-e MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom.plist' \
sickcodes/docker-osx:monterey
I would use Monterey because it can “do recovery” on Big Sur, Catalina, Mojave, etc.
This is because Monterey can perform recovery on APFS and HFS disks.
Once you’ve created a Monterey or later macOS virtual machine, you can hot plug a USB stick in:
https://github.com/sickcodes/Docker-OSX#mount-usb-drive-hotplughot-plug-usb
Pick a port, for example, port 7700
.
lsusb
to get vendor ID and product ID of the USB stick, for example:
Bus 003 Device 008: ID 0781:5590 SanDisk Corp. Ultra Dual
The above vendor ID is 0781
The above product ID is 5590
Now, expose your USB stick via network access using usbredir
so the macOS guest can reach the USB over-the-air:
sudo usbredirserver -p 7700 0781:5590
Now, in the Docker window hit Enter to see the (qemu) console.
Then hot plug the USB stick through to the macOS virtual machine:
chardev-add socket,id=usbredirchardev1,port=7700,host=172.17.0.1
device_add usb-redir,chardev=usbredirchardev1,id=usbredirdev1,debug=4
The USB will appear in the macOS virtual machine and then you can create a real USB installer.
You may need to change 172.17.0.1
to your host IP, e.g. 192.168.1.x
, which you can get using ip addr
on linux.
And, of course, the xxxx:yyyy
of your USB stick will be different, unless it’s the same USB as mine!
Once I start the OSX docker installer, how do I proceed to restoring the recovery disk on USB? Do I need to install the OSX within the docker first… or perhaps can I download the InstallAssistant.pkg and use it already within the OSX docker installer? Perhaps I can get some help before me ~dial-up finishes downloading all that 🙂
The title is misleading.
It mentions that this guide covers the way to create a bootable MacOS USB installer *without* MacOS. And yet, the bulk of the work is done *within* MacOS.
The fact that the used instance of MacOS runs within a virtual machine is irrelevant. Your guide still *requires* MacOS at some point to work.
Incorrect, you can plus a USB in https://github.com/sickcodes/Docker-OSX/commit/15fa5d3ef75b2df1881bf5b72f3fff6e25e6762b