Installing Rosetta on Mac computers with M1 processors

Mac computers with the M1 processor use the Rosetta translation environment to install and run Intel-based Auto Apps

The new M1 processor for the Mac is built on the arm64 Apple Silicon CPU architecture that is very different from the x86_64 Intel architecture used in other Mac models. Software applications have to be recompiled to run on the new architecture, and can then be distributed as universal binary packages that include both the new Apple Silicon version alongside the Intel version. Many current software titles have not been updated to include the Apple Silicon version of the application in a universal binary package and only include the Intel version of the application.

Mac computers with the M1 are still capable of running software built for Intel processors using the Rosetta translation environment. This translation technology is not pre-installed on computers with the M1 but can be installed by the user or with the softwareupdate command-line tool.

Intel-based Auto Apps Require Rosetta

As of November 2020, when Apple first introduced computers with Apple Silicon, many of the Auto Apps from Kandji are only available as Intel-based software applications. When a computer with the M1 processor detects an installer package for Intel-based software, it will send that package to the Rosetta translation environment for processing. If Rosetta is not already installed, then one of two things will happen. If the user opened the installer package, the user will be prompted by the system to install Rosetta. If Kandji runs the installer package, the install will stop because Rosetta 2 is not available on the system.

A script that will allow the system to install the Rosetta translation environment, if it is not already present, on a computer with M1 is provided below.

Install Rosetta with Kandji

In order to install Intel-based Auto Apps on a computer with M1, the Kandji Blueprint for that computer will need to install Rosetta first. This can be accomplished by adding a custom script to your Blueprint. You should name this script "00 Install Rosetta for M1" to ensure that it runs first before any other items. You can follow the steps below to create this custom script in your Kandji instance.

  1. Login to Kandji.
  2. Go to your Library and click + Add New.
  3. Click Custom Script, then Add & Configure +.

  4. Set the name of the Custom Script to "00 Install Rosetta for M1".
  5. Assign the item to the blueprints as necessary.
  6. Set the execution frequency to Once per device.
  7. In the script details, paste in the script block that appears below.
  8. Click Save.

Script to install Rosetta

This script is maintained in the Kandji Support GitHub repo.

#!/bin/zsh

################################################################################################
# Created by Nicholas McDonald | se@kandji.io | Kandji, Inc. | Solutions Engineering
################################################################################################
# Created on 11/24/2020
################################################################################################
# Software Information
################################################################################################
# This script checks the architecture of a macOS Device, if the Mac is running on Apple Silicon
# The script then checks if Rosetta is installed, and if not, installs it silently
################################################################################################
# License Information
################################################################################################
# Copyright 2020 Kandji, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this
# software and associated documentation files (the "Software"), to deal in the Software
# without restriction, including without limitation the rights to use, copy, modify, merge,
# publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
# to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or
# substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
# INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
# FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#
################################################################################################

#Determine the processor brand
processorBrand=$(/usr/sbin/sysctl -n machdep.cpu.brand_string)

if [[ "${processorBrand}" = *"Apple"* ]]; then
echo "Apple Processor is present..."
else
echo "Apple Processor is not present... rosetta not needed"
exit 0
fi

#Check if the Rosetta service is running
checkRosettaStatus=$(/bin/launchctl list | /usr/bin/grep "com.apple.oahd-root-helper")

if [[ "${checkRosettaStatus}" != "" ]]; then
echo "Rosetta is installed... no action needed"
exit 0
else
echo "Rosetta is not installed... installing now"
fi

#Installs Rosetta
/usr/sbin/softwareupdate --install-rosetta --agree-to-license

#Checks the outcome of the Rosetta install
if [[ $? -eq 0 ]]; then
echo "Rosetta installed... exiting"
exit 0
else
echo "Rosetta install failed..."
exit 1
fi

exit 0