“Permission denied” when running macOS installer from command line

command lineexternal-diskhigh sierrainstallpermission

I'm trying to install High Sierra to an external drive, from a system which is running Mojave. I can't run the GUI installer (it warns me about trying to install an older version of the OS), so I'm trying to use the command line instead.

My system has SIP disabled and I've connected an empty, Mac OS (Extended, Journaled) formatted SSD via USB and named "macOS". I run the following:

sudo /Applications/Install\ macOS\ High\ Sierra.app/Contents/Resources/startosinstall --converttoapfs NO --agreetolicense --volume /Volumes/macOS

This gives the following output:

By using the agreetolicense option, you are agreeing that you have run this tool with the license only option and have read and agreed to the terms.
If you do not agree, press CTRL-C and cancel this process immediately.
Preparing to run macOS Installer...
Permission denied

Any ideas why permission is denied even though I'm using sudo and have SIP disabled?

Best Answer

What worked for me is:

sudo /Applications/Install\ macOS\ High\ Sierra.app/Contents/Resources/startosinstall --volume /Volumes/macOS --converttoapfs NO

As it will then show you the license to review.