Posted on 10-25-2021 07:50 PM
Hi all,
Referring to this macOS installer script.
macOSUpgrade/macOSUpgrade.sh at master · kc9wwh/macOSUpgrade · GitHub
This script works fine for Intel Macbook upgrading to macOS Monterey 12.0.1.
But it does not work with Apple Silicon Macbook 😞
When attempting, I get the following error:
Investigating further, I run the following in a M1 Mabook's terminal.
/Applications/Install\ macOS\ Monterey.app/Contents/Resources/startosinstall --agreetolicense --nointeraction --forcequitapps
Error: A method of password entry is required.
Usage: startosinstall
.....
The error suggests I need to supply admin username and password via
--user, an admin user to authorize installation.
--passprompt, collect a password for authorization with an interactive prompt.
--stdinpass, collect a password from stdin without interaction.
I want JAMF to execute this. I DO NOT want to need to supply admin account and password.
Anyone got any suggestions?
Solved! Go to Solution.
Posted on 11-04-2021 12:22 AM
Hi there,
I managed to get the upgrade to Monterey running on an M1 macbook via Self Service with the help of a script from https://github.com/therealmacjeezy/Scripts/tree/master/macOS%2010.14%20Update%20Script, it was originally created for upgrading to Mojave but I made some adaptations to get it running for Monterey.
You will need to create the installer package and have it within the self service policy, the install macOS Monterey.app has to be available for the script to work. Got it here: https://scriptingosx.com/2021/10/download-full-installer-update/
Most important - the logged in user has to have a secure token. This user does not necessarily have to be an admin.
this is the main key that triggers upgrade.
echo $fvPass | ./startosinstall --agreetolicense --forcequitapps --nointeraction --user $currUser --stdinpass
Posted on 11-09-2021 01:19 PM
Actually I wasn't patient enough. Works like a charm!
11-10-2021 10:41 AM - edited 06-29-2022 11:22 AM
Latest version working on both M1 and Intel macs
#!/bin/bash
# Pulls the current logged in user and their UID
currUser=$(ls -l /dev/console | awk '{print $3}')
currUserUID=$(id -u "$currUser")
fvPass=$(
# Prompts the user to input their FileVault password using Applescript. This password is used for a SecureToken into the startosinstall.
/bin/launchctl asuser "$currUserUID" sudo -iu "$currUser" /usr/bin/osascript <<APPLESCRIPT
set validatedPass to false
repeat while (validatedPass = false)
-- Prompt the user to enter their filevault password
display dialog "Enter your macOS password to start the macOS upgrade" with icon file "System:Library:CoreServices:CoreTypes.bundle:Contents:Resources:FileVaultIcon.icns" default answer "" buttons {"Continue"} default button "Continue" with text and hidden answer
set fvPass to (text returned of result)
display dialog "Re-enter your macOS password to verify it was entered correctly" buttons {"Continue"} with icon file "System:Library:CoreServices:CoreTypes.bundle:Contents:Resources:FileVaultIcon.icns" default answer "" default button "Continue" with text and hidden answer
if text returned of result is equal to fvPass then
set validatedPass to true
fvPass
else
display dialog "The passwords you have entered do not match. Please enter matching passwords." with title "FileVault Password Validation Failed" buttons {"Re-Enter Password"} default button "Re-Enter Password" with icon file "System:Library:CoreServices:CoreTypes.bundle:Contents:Resources:FileVaultIcon.icns"
end if
end repeat
AppleScript
)
##Heading to be used for jamfHelper
heading="Please wait as we prepare your computer for macOS Monterey..."
##Title to be used for jamfHelper
description="
This process will take approximately 20-30 minutes.
Once completed your computer will reboot and begin the upgrade which can take an additional 15-20 minutes."
##Icon to be used for jamfHelper
icon=/Applications/Install\ macOS\ Monterey.app/Contents/Resources/InstallAssistant.icns
##Launch jamfHelper
/Library/Application\ Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper -windowType fs -title "" -icon "$icon" -heading "$heading" -description "$description" &
jamfHelperPID=$!
##Start macOS Upgrade
echo $fvPass | /Applications/Install\ macOS\ Monterey.app/Contents/Resources/startosinstall --agreetolicense --forcequitapps --nointeraction --user $currUser --stdinpass --pidtosignal $jamfHelperPID >> /var/log/startosinstall.log 2>&1 &
exit 0
edited to include the fix from @benjmars
Posted on 08-05-2022 10:05 AM
My initial tests are failing on a M1 MBA running Big Sur with the full Monterey installer present. Get the helper screen for eternity. Never completes the process.
Posted on 08-09-2022 10:16 AM
This simply is not working with Big Sur M1's with FileVault enabled:
#!/bin/bash
# Pulls the current logged in user and their UID
currUser=$(ls -l /dev/console | awk '{print $3}')
currUserUID=$(id -u "$currUser")
fvPass=$(
# Prompts the user to input their FileVault password using Applescript. This password is used for a SecureToken into the startosinstall.
/bin/launchctl asuser "$currUserUID" sudo -iu "$currUser" /usr/bin/osascript <<APPLESCRIPT
set validatedPass to false
repeat while (validatedPass = false)
-- Prompt the user to enter their filevault password
display dialog "Enter your macOS password to start the macOS upgrade" with icon file "System:Library:CoreServices:CoreTypes.bundle:Contents:Resources:FileVaultIcon.icns" default answer "" buttons {"Continue"} default button "Continue" with text and hidden answer
set fvPass to (text returned of result)
display dialog "Re-enter your macOS password to verify it was entered correctly" buttons {"Continue"} with icon file "System:Library:CoreServices:CoreTypes.bundle:Contents:Resources:FileVaultIcon.icns" default answer "" default button "Continue" with text and hidden answer
if text returned of result is equal to fvPass then
set validatedPass to true
fvPass
else
display dialog "The passwords you have entered do not match. Please enter matching passwords." with title "FileVault Password Validation Failed" buttons {"Re-Enter Password"} default button "Re-Enter Password" with icon file "System:Library:CoreServices:CoreTypes.bundle:Contents:Resources:FileVaultIcon.icns"
end if
end repeat
AppleScript
)
##Heading to be used for jamfHelper
heading="Please wait as we prepare your computer for macOS Monterey. Keep plugged in. Do not close lid..."
##Title to be used for jamfHelper
description="
This process will take approximately 20-30 minutes.
Once completed your computer will reboot and begin the upgrade which can take an additional 20-30 minutes."
##Icon to be used for jamfHelper
icon=/Applications/Install\ macOS\ Monterey.app/Contents/Resources/InstallAssistant.icns
##Launch jamfHelper
/Library/Application\ Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper -windowType fs -title "" -icon "$icon" -heading "$heading" -description "$description" &
jamfHelperPID=$!
##Start macOS Upgrade
echo $fvPass | /Applications/Install\ macOS\ Monterey.app/Contents/Resources/startosinstall --agreetolicense --forcequitapps --nointeraction --user $currUser --stdinpass --pidtosignal $jamfHelperPID >> /var/log/startosinstall.log 2>&1 &
Posted on 08-18-2022 12:50 PM
I'm getting following error in /var/log/startosinstall.log while trying to upgrade an M1 pro 16" macbook.
Error: could not get authorization...
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
Posted on 08-19-2022 09:18 AM
I would test and use this process: https://github.com/grahampugh/erase-install
It is really robust and deployable but I would test it for your environment.
Thank you.
Posted on 08-19-2022 09:50 AM
Thanks, I will definitely start testing that. The process I was testing just worked without me doing anything. It doesn't seem to be 100% working so having another process is great. Thanks again I'll give that one a shot.
Posted on 09-27-2022 02:41 PM
Mentioned this above too. It’s the only proven solution that I’ve made work, and it’s very intuitive and a time-saver.
Posted on 12-05-2022 11:21 AM
I downloaded 12.6.1 from the link below and have it installed to the /Application folder. When it runs, it errors out pretty quick with the below error message. I'm looking for other options to deploy 12.6.1, because I'm having issues with the erase-install.sh installing correctly on users devices.
https://scriptingosx.com/2021/10/download-full-installer-update/
Error:
Script result: 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... Preparing:
Preparing: 32.6% Failed to download required installer asset (SFR).
Posted on 12-05-2022 01:00 PM
Posted on 02-01-2023 06:16 AM
I've used this script successfully in the past with Monterey but having issues with Ventura. The MacOS Ventura installer is present on the Mac and it's starts ok but then never quits (as in reboots to install the actually update).
Anyone else come across this?
Posted on 02-01-2023 06:19 AM
I've been using it with Ventura, but I have had occasional instances that sound like what you describe (on both Monterey and Ventura). In our environment, it seems it's tied to high uptime, so I'm just asking everyone to restart before they run the script. Haven't had time yet, but I'm also going to play with adding kickstart to this script or maybe even running a "pre" install script that runs kickstart and clears the update plist...it's cumbersome, though.
Posted on 02-01-2023 07:34 AM
Thanks for letting me know. I will try to restart first and see how it behaves.
Posted on 05-25-2023 08:24 AM
So i know this post is about a year old, but im trying to use this scrip on an Appel Silicon laptop, and it just gets stuck on the Jamf Helper screen saying to wait.
The password prompt worked fine no issues, but then it just sits here, Jamf policy says it completed, i have it download the Ventura Installer first and put it into the Applications folder, i know that worked because the Ventura icon is showing on the helper screen. then run this script and nothing it has been over 1 hour now since the installer downloaded.
How are you guys initiating this script with a policy?
Posted on 05-30-2023 12:36 PM
AtillaTheC is my hero for this base script - it was a life saver. I've been using it for a while with great success. Recently I made some modifications to address some of the more common issues we were seeing with it hanging on that screen.
My updated logic checks the password against the Keychain (instead of just verifying that the same password was entered twice), checks for sufficient available storage, checks uptime (won't proceed if the machine hasn't been restarted in [choose the number] of days, make sure the installer is in place in the /Applications directory (I run a separate policy to cache the installer first so that the update takes less time for the end users), and verifies power is connected...all that really helped with consistency for us.
There is the fact also that JamfHelper is inherently glitchy in full screen mode, so you can either set it to not run in full screen, or if it hangs, just Command + Q to quit out of JamfHelper and the installer, from my observations, usually finishes fairly soon after.
Also been trying to find time to swap from JamfHelper calls to using swiftDialog, which I think would be more reliable.