Skip to main content
Solved

Big Sur Upgrade Bash Command


Did this topic help you find an answer to your question?
Show first post

88 replies

dan-snelson
Forum|alt.badge.img+28
  • Honored Contributor
  • 632 replies
  • November 18, 2020

Forum|alt.badge.img+8
  • Valued Contributor
  • 50 replies
  • November 22, 2020

Has anyone been able to get this to work through a self service policy? Big Sur now requires you to use the --user, --stdinpass or --passprompt. I believe when you use the startosinstall with --newvolumen then you have to authenticate with one of those methods.


Forum|alt.badge.img+8
  • Valued Contributor
  • 50 replies
  • November 23, 2020

When I use the --stdinpass, the policy just says "running" and runs forever. Nothing happens. Any ideas anyone?


Cayde-6
Forum|alt.badge.img+22
  • Honored Contributor
  • 606 replies
  • November 23, 2020

@mwu1876 are you sure? I just ran the Big Sur startosinstall binary without those arguments and it installed fine


Forum|alt.badge.img+8
  • Valued Contributor
  • 50 replies
  • November 23, 2020

the binary works fine.The issue is when you call it from a policy WITH the --eraseinstall. You have to use either the -stdinpass or the --passprompt. Either of those cases the error. if I just run it from terminal it works fine.


hodgesji
Forum|alt.badge.img+16
  • Contributor
  • 63 replies
  • November 23, 2020

It doesn't require the --stdinpass or --passprompt for me when run from a Self Service policy using the --eraseinstall command. Here is what I'm calling in a policy with the variable paths to the startOSinstall command and the macOS installer respectively:

"$startOSinstaller" --applicationpath "$macOSinstaller" --eraseinstall --forcequitapps --newvolumename "Macintosh HD" --agreetolicense --nointeraction

Forum|alt.badge.img+10
  • Valued Contributor
  • 143 replies
  • November 24, 2020

Regarding:
"
SOLVED Posted: 11/13/2020 at 9:48 AM CST by Cayde-6
I find that opening the installer app for the first time takes ages, itโ€™ll just bounce in the dock and terminal command to it also hang.

Not sure if the app on first load does some verification steps to Apple, once it opens I then find terminal commands work instantly.
"
Does it mean the scripting should be
> Open Install macOS Big Sur.app
> Wait 10 seconds
> Close Install macOS Big Sur.app
> wait 10 seconds
> then execute
Applications/Install macOS Big Sur.app/Contents/Resources/startosinstall --agreetolicense --forcequitapps --nointeraction

?


Forum|alt.badge.img+8
  • Valued Contributor
  • 50 replies
  • November 24, 2020

@hodgesji Thanks. Are you using this in the scripts section? Or files and processes?


Cayde-6
Forum|alt.badge.img+22
  • Honored Contributor
  • 606 replies
  • November 24, 2020

@Bernard.Huang Open the app and allow it to verify then package it up into a PKG.


Forum|alt.badge.img+8
  • Valued Contributor
  • 50 replies
  • November 24, 2020

@hodgesji It worked! So I used the commands in the scripts section and it worked. Using that same command from the files and processes tab did not work. Thanks!


Forum|alt.badge.img+10
  • Valued Contributor
  • 143 replies
  • November 24, 2020

Hi @hodgesji & @mwu1876 ,

How did you guys that it working with those parameters? I couldn't get it working, and here's the error log I got:

Running a command as '"/Applications/Install macOS Big Sur.app/Contents/Resources/startosinstall" --applicationpath "/Applications/Install macOS Big Sur.app" --agreetolicense --nointeraction --forcequitapps --eraseinstall --newvolumename 'Macintosh HD''...
WARNING: "--applicationpath" is deprecated in macOS 10.14 and greater. Please remove it from your invocation.
Error: Error: Could not create a new APFS volume. Please try again.
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.

I did put in the "--applicationpath "$macOSInstaller" ", but got rejected because we are upgrading from Mojave (10.14) or Catalina (10.15).

Edited: Sorry about that. I actually did have the command to startosinstall. I didn't fully copy the log properly.


hodgesji
Forum|alt.badge.img+16
  • Contributor
  • 63 replies
  • November 24, 2020

@Bernard.Huang As you noted, the --applicationpath argument can be removed now according to their documentation but it still worked in when I left it in mine. I think you need to point your path all the way to the startosinstall command inside the installer:
/Applications/Install macOS Big Sur.app/Contents/Resources/startosinstall --eraseinstall --forcequitapps --newvolumename "Macintosh HD" --agreetolicense --nointeraction


MLBZ521
Forum|alt.badge.img+11
  • Valued Contributor
  • 218 replies
  • November 24, 2020

Yeah, I mentioned --applicationpath was deprecated back on the 14th.

That said, it was still required to use when running the startosinstall from Recovery.


Forum|alt.badge.img+10
  • Valued Contributor
  • 143 replies
  • November 24, 2020

I waited a log time for the Installation to start.
After 30 minutes, I quit the process, and check the install.log.
I can see

<Macbook serial number> osinstallersetupplaind[2041]: Wrong process invoked.
<Macbook serial number> osinstallersetupplaind[2042]: Wrong process invoked.
etc

Log entry happens every 10 seconds.
My usually script
"/Applications/Install macOS Big Sur.app/Contents/Resources/startosinstall" --agreetolicense --forcequitapps --eraseinstall --newvolumename 'Macintosh HD'"
is really not liking this.


Cayde-6
Forum|alt.badge.img+22
  • Honored Contributor
  • 606 replies
  • November 25, 2020

If you are adding this to a script to stage the verify bit. How can you tell when its completed or worked even with terminal?
${bigSurInstaller}/Contents/Resources/startosinstall --usage &>/dev/null


Forum|alt.badge.img+10
  • Valued Contributor
  • 143 replies
  • November 25, 2020

Thanks @Cayde-6 ,

Still, only your solution of starting and quitting out of Install macOS Big Sur.app worked for me.

So now, my working code is:

open -a "/Applications/Install macOS Big Sur.app"
/bin/sleep 120
osascript -e 'quit app "/Applications/Install macOS Big Sur.app"'
/bin/sleep 3

'"/Applications/Install macOS Big Sur.app/Contents/Resources/startosinstall" --agreetolicense --forcequitapps --nointeraction  --applicationpath "/Applications/Install macOS Big Sur.app" >> /var/log/startosinstall.log

The first wait (sleep 120) is 120 seconds because starting Install macOS Big Sur.app for the first time really does take around 2 minutes.
This still seems silly to me why I need this section at all.
If any other people can come up with a more elegant way to kick off the Install macOS Big Sur, I would love to hear it and test it :)


Forum|alt.badge.img+1
  • New Contributor
  • 2 replies
  • November 26, 2020

@dan-snelson i tried using that script as i used it previously for catalina and it doesn't seem to work as expected. it will get to the point where it prompts the user that a reboot will occur, but the reboot actually occurs about 24 hours later. Not sure what else needs to be changed, but it shouldn't take that long.


Forum|alt.badge.img+10
  • Valued Contributor
  • 143 replies
  • November 26, 2020

Hi all,

I've coming up to another error. This time the test case is to Erase existing macOS first, then perform macOS Big Sur installation from scratch. Practical use of this is:

if an end-user finds something is wrong, willing to refresh his/her Macbook.

if the Macbook is to be wiped out of all existing data, ready for the next user to be handed this Macbook to.

The command line I am attempting is this

'"/Applications/Install macOS Big Sur.app/Contents/Resources/startosinstall" --agreetolicense --nointeraction --forcequitapps --eraseinstall --newvolumename 'Macintosh HD''

On the Macbook itself, when triggering this command line off, it pop up with a notification:
"osinstallersetupd wants to make changes"
It is also asking for admin cridentials, which end-users do not have.

From JAMF log, the error message is:

Error: Error: Could not create a new APFS volume. Please try again.
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.

Anyone got any ideas how to make Erase then Install macOS Big Sur work?
This is the exact command line I used for macOS Catalina, and it works fine then. Again not sure what has changed between Big Sur & Catalina.

Edited: I am trying to wipe out macOS Big Sur, then reinstall macOS Big Sur, btw.
Maybe Big Sur treats APFS differently.


Forum|alt.badge.img+10
  • Valued Contributor
  • 143 replies
  • November 27, 2020

Extra note on my failed Erase then reinstall macOS Big Sur,

If I run this command line within terminal, it works fine.

sudo "/Applications/Install macOS Big Sur.app/Contents/Resources/startosinstall" --agreetolicense --nointeraction --forcequitapps --eraseinstall --newvolumename 'Macintosh HD'

One thing I notice is I have to create a admin account, then run the command so I can type in a password to execute this.
If I was to run it as a normal user account (without admin rights), it still wouldn't start because it is waiting for admin password.

I have tried it via JAMF policy > Files & Processes > Execute Command, so I am trying this command line a simple as possible.
All fail as it ask for admin password before it can execute :(


Forum|alt.badge.img+8
  • Valued Contributor
  • 50 replies
  • November 30, 2020

When I run this command I get a strange result. The upgrade worked fine but when it restarts, the username "System Administrator" is automatically populated. I can just changed it and use a local user and it works fine. But strange. If I do a manual upgrade from the App Store that System Administrator user does not come up. Anyone seen this?


Forum|alt.badge.img+3
  • New Contributor
  • 8 replies
  • November 30, 2020

Trying to use this method to allow our Standard users to do an in-place upgrade to Big Sur via Self Service. I've got it almost all the way working by leveraging the command below in the Scripts section:

/Applications/Install macOS Big Sur.app/Contents/Resources/startosinstall --agreetolicense --forcequitapps --nointeraction

The Mac will restart and begin the upgrade almost immediately, but only after I quit Self Service manually. Otherwise Self Service just displays "running" indefinitely and the policy never completes. The --forcequitapps flag doesn't seem to do the trick to close Self Service. Does anyone have any feedback on how I might force Self Service to quit or any other suggestions on how I might approach this?


Forum|alt.badge.img+10
  • Valued Contributor
  • 143 replies
  • November 30, 2020

HI @jmackbnd When you were running this via Self Service, was the Big Sur policy opened in the description page? (as in you are seeing the Big Sur policy only, no other policy icons?) At first few tries, I also experienced not able to close Self Service, but then I realise the Policy description view needs to be close before it can quit properly. But then again, the --forcequitapps should have closed Self Service, so this is very weird.

Hi @mwu1876 , Haven't experienced once where it ask for admin rights after it had successfully upgraded. Maybe try a different Macbook to test on. Perhaps there's a start up policy that is triggering off for this particular Macbook.

So far I have tested:
- Upgrade from Mojave to Big Sur - Success
- Upgrade from Catalina to Big Sur - Success
- Reinstall from Big Sur to Big Sur - Fail. Ask for admin rights before starting. The results never seem consistent. Does anyone thing JAMF Pro needs upgrading? We are currently running 10.25.2, haven't upgraded to10.26 yet.


Forum|alt.badge.img+3
  • New Contributor
  • 8 replies
  • December 1, 2020

@Bernard.Huang - Thanks so much for that! That was indeed the issue. When I ran the command in Self Service from the main Self Service window rather than with the Description overlay open, it worked! In my testing, the target Mac takes anywhere from 3-10 minutes to restart and begin the upgrade, but it always eventually does.

Also, in chatting back and forth with Jamf support I switched the policy back over to using Files & Processes instead of Scripts and added a bit to the end of the command to encourage Self Service to close. Here's what finally ended up working for me:

/Applications/Install macOS Big Sur.app/Contents/Resources/startosinstall --agreetolicense --forcequitapps --nointeraction && sleep 10 && osascript -e 'tell application "Self Service" to quit'

Hope this is helpful to someone else out there!


Forum|alt.badge.img+8
  • Contributor
  • 33 replies
  • December 3, 2020

@mwu1876, @Bernard.Huang
I've got similar issue - policy to erase and install Big Sur works fine on Catalina, but fails on M1 MacBook running Big Sur.
"Running command '/Applications/Install macOS Big Sur.app/Contents/Resources/startosinstall' --eraseinstall --agreetolicense --forcequitapps --newvolumename 'Macintosh HD'
Result of command:
Error: failed to authorize for installation. Provide a password with --stdinpass or --passprompt."

If I add flag --stdinpass the policy gets stuck at "Running" and nothing happens. Can't see any errors in Install and Jamf logs on the computer.
Running policy from Self Service.
Any suggestions?


Forum|alt.badge.img+8
  • Valued Contributor
  • 50 replies
  • December 3, 2020

I ended up getting this to work if I out the same command into a script, without the stdinpass.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings