Amazon EC2 Mac instances: Provisioning macOS compute environments in the AWS cloud

Launched in 2006, Amazon EC2 (Amazon Elastic Compute Cloud) is one of the best-known AWS services offering elastic compute capacity in the cloud. With EC2, one can easily provision virtually any number of virtual machines (EC2 instances) that come in a variety of user-selectable types such as t2.micro and c4.large.

For a long time, EC2 had only supported Linux and Windows-based AMIs (Amazon Machine Images) ranging from Ubuntu to Microsoft Windows Server. All of these AMIs can be used to launch instances backed by single or multi-tenant hardware with different purchasing options.

In November 2020, AWS announced the general availability of EC2 Mac instances with support for macOS Mojave and Catalina AMIs. This meant that for the first time in the history of the AWS cloud, macOS compute environments could be provisioned as EC2 instances similar to Linux and Windows-based instances.

A note on the hardware and the purchasing model

There is only one type of Amazon EC2 Mac instance available and it is mac1.metal. Importantly, Mac1 instances can only be launched onto pre-allocated single-tenant dedicated hosts, one instance per host. Each of this hosts represents a real, fully-featured Intel Core i7-based Apple Mac mini device running in an AWS data center. A mac1.metal instance running on the cloud Apple Mac mini gets 12 vCPUs and 32 GiB of memory.

The minimum allocation and billing duration for these dedicated Mac mini hosts is 24 hours. EC2 Mac instances can only be launched as on-demand instances which are billed by the second, however these costs can be reduced by purchasing a savings plan.

How to provision an EC2 Mac instance

Provisioning a mac1.metal instance involves allocating a dedicated host and launching an instance onto the host. Both of these steps can be performed via the AWS Management Console, AWS CLI, AWS SDK, or by making requests directly to the Amazon EC2 API.

#Allocating a dedicated host for a Mac instance

All types of dedicated hosts can be allocated using the AllocateHosts API. To allocate a dedicated Mac1 host, the InstanceType parameter needs to be set to mac1.metal. Mac1 hosts are only available in the following AWS Regions:

  • us-east-1 (US East (N. Virginia)),

  • us-east-2 (US East (Ohio)),

  • us-west-2 (US West (Oregon)),

  • eu-west-1 (Europe (Ireland)),

  • ap-southeast-1 (Asia Pacific (Singapore)).

Note that by default, the maximum number of dedicated Mac1 hosts that can be allocated by an AWS account in any region is zero. An adjustment to this limit should be requested by using AWS Support Center.

Launching an EC2 Mac instance

Once the Mac1 host has been allocated within the account, an EC2 Mac instance can be launched onto this host via the RunInstances API.

In the request, the ImageId parameter needs to be set to the ID of the macOS Catalina or Mojave AMI and InstanceType needs to be set to mac1.metal. To specify the tenancy of "dedicated host", the Placement.Tenancy value needs to be set to host.

See also

Made by Anton Vasetenkov.

If you want to say hi, you can reach me on LinkedIn or via email. If you like my work, you can support me by buying me a coffee.