Skip to main content

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:

Error: failed to authorize for installation. Provide a password with --stdinpass or --passprompt.
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.

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?


Both on the M1 and Intel Chips we get the error message. We tried the solutions from AtillaTheC.
Anyone experiencing the same issues? Any help regarding this?


Do you have any software ristrictions still in place i.e install asssistant or the monterey app?


Hello Everyone

What am i doing wrong here this did not work on a M1 and Intel as well

#!/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"} with text and hidden answer default button "Continue"
set fvPass to (text returned of result)
display dialog "Re-enter your macOS password to verify it was entered correctly" with text and hidden answer buttons {"Continue"} with icon file "System:Library:CoreServices:CoreTypes.bundle:Contents:Resources:FileVaultIcon.icns" default answer "" default button "Continue"
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 messageIcon
end if
end repeat
APPLESCRIPT
)

##Heading to be used for jamfHelper

heading="Please wait as we prepare your Mac for macOS Monterey....."

##Title to be used for jamfHelper

description="

This process will take approximately 60 minutes to complete.

Once completed your computer will reboot and begin the upgrade which can take an additional 45 minutes."

##Icon to be used for jamfHelper

icon=/Library/MicronJamf/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=$(echo $!)

##Start macOS Upgrade

echo $fvPass | /Library/MicronJamf/Install\\ macOS\\ Monterey.app/Contents/Resources/startosinstall --agreetolicense --forcequitapps --nointeraction --user $currUser --stdinpass

exit 0

 


Do you have any software ristrictions still in place i.e install asssistant or the monterey app?


Seems to be working now... I guess I was just not patient enough waiting for the command to run. Also I found out that the Install Monterey App can not be running or else it will break the cycle of the command for some reason.

 


Hello Everyone

What am i doing wrong here this did not work on a M1 and Intel as well

#!/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"} with text and hidden answer default button "Continue"
set fvPass to (text returned of result)
display dialog "Re-enter your macOS password to verify it was entered correctly" with text and hidden answer buttons {"Continue"} with icon file "System:Library:CoreServices:CoreTypes.bundle:Contents:Resources:FileVaultIcon.icns" default answer "" default button "Continue"
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 messageIcon
end if
end repeat
APPLESCRIPT
)

##Heading to be used for jamfHelper

heading="Please wait as we prepare your Mac for macOS Monterey....."

##Title to be used for jamfHelper

description="

This process will take approximately 60 minutes to complete.

Once completed your computer will reboot and begin the upgrade which can take an additional 45 minutes."

##Icon to be used for jamfHelper

icon=/Library/MicronJamf/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=$(echo $!)

##Start macOS Upgrade

echo $fvPass | /Library/MicronJamf/Install\\ macOS\\ Monterey.app/Contents/Resources/startosinstall --agreetolicense --forcequitapps --nointeraction --user $currUser --stdinpass

exit 0

 


You havent actually put whats not working for you, or what  errors your getting? or the script output


I have an M1 that I believe i've followed all the steps on - it runs the script, goes to a black screen with the Please wait.... and then never reboots. When I look at the Policy Log it shows it running, downloading monterey and then verifying the package and installing, then closing the package, then step 4 and 5 and shows completed. But the device is still sitting at the initial full screen splash page and hasn't gone anywhere from there.  Not sure what I'm missing.


I have an M1 that I believe i've followed all the steps on - it runs the script, goes to a black screen with the Please wait.... and then never reboots. When I look at the Policy Log it shows it running, downloading monterey and then verifying the package and installing, then closing the package, then step 4 and 5 and shows completed. But the device is still sitting at the initial full screen splash page and hasn't gone anywhere from there.  Not sure what I'm missing.


I would pre-download monterey in a separate policy and verify its there then a separate one to call the script. 


Appreciate the advice. I had done that previously in my efforts. I am beginning to suspect the original upload had an issue. So I'm going to push a new version up and see if I fair better. Taking of course your advice to keep the steps separate. Will let you know how it goes. Thank you.

 


You havent actually put whats not working for you, or what  errors your getting? or the script output


Hi SCCM, Actually M1 macs are looking for admin rights to proceed with upgrade. I got this when I tried: 

echo $fvPass(local admin password) | /Library/Jamf/Install\\ macOS\\ Monterey.app/Contents/Resources/startosinstall --agreetolicense --forcequitapps --nointeraction --user $LocalAdmin --stdinpass

If you do not agree, press CTRL-C and cancel this process immediately.
Error: could not get authorization...

Do you have any other thoughts on this?

 

for FV2 enabled user: Error: You must provide authorisation for this volume by setting it as your startup disk.


Hi SCCM, Actually M1 macs are looking for admin rights to proceed with upgrade. I got this when I tried: 

echo $fvPass(local admin password) | /Library/Jamf/Install\\ macOS\\ Monterey.app/Contents/Resources/startosinstall --agreetolicense --forcequitapps --nointeraction --user $LocalAdmin --stdinpass

If you do not agree, press CTRL-C and cancel this process immediately.
Error: could not get authorization...

Do you have any other thoughts on this?

 

for FV2 enabled user: Error: You must provide authorisation for this volume by setting it as your startup disk.


it shouldnt be asking for admin if your running the script via jamf on a computer level, but the users will need to put there logged in account password in for the install to complete. Are the users getting the prompt, and are they typing it in?
Plus your line reads echo $fvPass(local admin password) | where in the dump above it shows echo $fvPass | . Try checking that line again
echo $fvPass | /Applications/Install\\ macOS\\ Monterey.app/Contents/Resources/startosinstall --agreetolicense --forcequitapps --nointeraction --user $currUser --stdinpass

Also worth checking that the users are filevault enabled or it will not work

 


Appreciate the advice. I had done that previously in my efforts. I am beginning to suspect the original upload had an issue. So I'm going to push a new version up and see if I fair better. Taking of course your advice to keep the steps separate. Will let you know how it goes. Thank you.

 


I don't even push the installer from JAMF I just run the below to have each machine download it from apple. 

softwareupdate --fetch-full-installer

I have an M1 that I believe i've followed all the steps on - it runs the script, goes to a black screen with the Please wait.... and then never reboots. When I look at the Policy Log it shows it running, downloading monterey and then verifying the package and installing, then closing the package, then step 4 and 5 and shows completed. But the device is still sitting at the initial full screen splash page and hasn't gone anywhere from there.  Not sure what I'm missing.


My Intel chip Macs did this exact thing. No luck with actually executing the script on Intel macs.


My Intel chip Macs did this exact thing. No luck with actually executing the script on Intel macs.


After more testing the M1 script is working on both Intel and M1 macs, try using that one. 


I don't even push the installer from JAMF I just run the below to have each machine download it from apple. 

softwareupdate --fetch-full-installer

I ended up using the below instead due to inconsistencies in the version people were pulling. 

softwareupdate --fetch-full-installer --full-installer-version=12.1

After more testing the M1 script is working on both Intel and M1 macs, try using that one. 


I'll try the M1 script again.

The below is not working for me either at this point... IDK why its different with every OS version. 

Super frustrating. This "script worked flawlessly on the Big Sur upgrade (changing the app name within the script)

 

'Applications/Install macOS Monterey.app/Contents/Resources/startosinstall' --agreetolicense --forcequitapps --nointeraction


I ended up using the below instead due to inconsistencies in the version people were pulling. 

softwareupdate --fetch-full-installer --full-installer-version=12.1

Can confirm, the above works flawlessly for my Intel devices. Haven't tested the M1 with this command yet.

I entered this in the Files and Processes>Execute Command section of a new Policy. 


Did anyone found a solution for upgrading the Intel Macs to monterey via script ? Above mentioned scripts didn't work for me on Big Sur to Monterey upgrade. the Jamf helper screen simply sits on the desktop after running the above script (I'm mentioning intel Macs only)


Did anyone found a solution for upgrading the Intel Macs to monterey via script ? Above mentioned scripts didn't work for me on Big Sur to Monterey upgrade. the Jamf helper screen simply sits on the desktop after running the above script (I'm mentioning intel Macs only)


the M1 script is working for both M1 and intel at our org. 


the M1 script is working for both M1 and intel at our org. 


@AtillaTheC -- do you users has admin rights? 


@AtillaTheC -- do you users has admin rights? 


mixed bag here but I have tested on a standard account and its working for us. 


we have local standard users and the script doesn't work for us either (Intel macs)
@AtillaTheC if you can mention the script here


we have local standard users and the script doesn't work for us either (Intel macs)
@AtillaTheC if you can mention the script here


#!/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"} with text and hidden answer default button "Continue"
set fvPass to (text returned of result)
display dialog "Re-enter your macOS password to verify it was entered correctly" with text and hidden answer buttons {"Continue"} with icon file "System:Library:CoreServices:CoreTypes.bundle:Contents:Resources:FileVaultIcon.icns" default answer "" default button "Continue"
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 messageIcon
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

exit 0

Not sure if it helps someone, but it might save you the hassle that I had. The script in question has an Applescript section for the password prompt which ends with the string "APPLESCRIPT". This was causing the variable to be incorrectly populated in my case for some reason and I kept getting "Error: could not get authorization..." until I outputed the value of $fvPass and saw that it was "APPLESCRIPT". After removing said line, everything works as expected.

Edit: I'm wrong, see explanation below.


Not sure if it helps someone, but it might save you the hassle that I had. The script in question has an Applescript section for the password prompt which ends with the string "APPLESCRIPT". This was causing the variable to be incorrectly populated in my case for some reason and I kept getting "Error: could not get authorization..." until I outputed the value of $fvPass and saw that it was "APPLESCRIPT". After removing said line, everything works as expected.

Edit: I'm wrong, see explanation below.


Correction: the string is actually needed, so do not remove it. Upon reordering my script and moving the string at the beginning of the line, it seems it is working as expected.


Not able to execute this script successfully anymore on our Intel devices.  It worked last week for my test devices, and is not working anymore. I am still lacking a reliable way to execute the update through Self Service. 


Not able to execute this script successfully anymore on our Intel devices.  It worked last week for my test devices, and is not working anymore. I am still lacking a reliable way to execute the update through Self Service. 


Have you tried the script I posted above with the FVpass?


Reply