Running MacOS on VMware Fusion
1. Get MacOS Installer
References:
- https://dortania.github.io/OpenCore-Install-Guide/installer-guide/mac-install-pkg.html
- https://osxdaily.com/2020/07/20/how-convert-macos-installer-iso/
i. Download the desired version
There are links to download from the App Store at https://support.apple.com/en-us/HT211683. For example, I want to download Catalina.
If it mentions that the version is not suitable to be installed, it doesn’t really matter. The important thing is /Applications contains a file called Install macOS Catalina.app (or other version).
Alternatively, an installer can be downloaded with Munki’s InstallMacOS utility (but I didn’t try this)
mkdir -p ~/macOS-installer && cd ~/macOS-installer && curl https://raw.githubusercontent.com/munki/macadmin-scripts/main/installinstallmacos.py > installinstallmacos.py && sudo python installinstallmacos.py
ii. Set up the installer
Using either method in the previous step, there should be a Install macOS <version>.app file.
With Catalina as an example, run the following commands.
- Create a DMG disk image
hdiutil create -o /tmp/Catalina -size 8500m -volname Catalina -layout SPUD -fs HFS+J
- Mount the disk image
hdiutil attach /tmp/Catalina.dmg -noverify -mountpoint /Volumes/Catalina
- Use
createinstallmedia
utility to create the installer on the mounted volumesudo /Applications/Install\ macOS\ Catalina.app/Contents/Resources/createinstallmedia --volume /Volumes/Catalina --nointeraction
- Once
createinstallemdia
has finished, unmount the volumehdiutil detach /Volumes/Install\ macOS\ Catalina
- Convert the DMG disk image to CDR
hdiutil convert /tmp/Catalina.dmg -format UDTO -o ~/Desktop/Catalina.cdr
- Rename ISO to CDR
mv ~/Desktop/Catalina.cdr ~/Desktop/Catalina.iso
Done!
2. Install macOS in VMware Fusion
- Create new VM
- Install from disc or image
- Select .iso file created earlier
- Follow installation steps
- Wait 20 mins maybe
Simples.
3. Disable System Integrity Protection (SIP)
References:
- https://www.virtual-odyssey.com/2017/10/23/disable-sip-within-osx-virtual-machine/#:~:text=At%20the%20terminal%20screen%20type,that%20SIP%20is%20indeed%20disabled.
It is best to disable SIP when doing security research. Otherwise, there are some security settings that will make life inconvenient.
To disable SIP, the installer ISO will be used again. (By default, it is still mounted onto the CD/DVD drive, so nothing needs to be done.)
- Find the Settings button of VMware Fusion
- Choose
Startup Disk
- Choose
CD/DVD
and clickRestart
The VM will now restart and boot into the ISO used earlier.
- At the top bar,
Utility
->Terminal
- Enter
csrutil disable
in the terminal
Now, it is time to restart back to the system. Similar to earlier,
- Find the Settings button of VMware Fusion
- Choose
Startup Disk
- Choose
Hard Disk (SATA)
and clickRestart
In the VM, open a terminal and enter csrutil status
to see that SIP has been disabled.