Skip to content

Instantly share code, notes, and snippets.

@alanmur
Last active September 10, 2021 20:56
Show Gist options
  • Save alanmur/8fe02d61501f93c7fad524c86449b4bc to your computer and use it in GitHub Desktop.
Save alanmur/8fe02d61501f93c7fad524c86449b4bc to your computer and use it in GitHub Desktop.
How to launch a mac1.metal EC2 instance in the AWS console

How to launch a mac1.metal EC2 instance in the AWS console

Procedure

Go to the AWS EC2 dashboard in your AWS account. Select a region where EC2 instances are available, as at the time of writing, they are not available in all regions.You can see in this image that I have selected us-east-2 (by its display name, Ohio) top right of the window. Click the Launch Instance button.

mac001

Select the AMI with the preferred OSX operating system version. The newest looks good to me here.

mac002

Then select the instance type. Because I selected an OSX operating system, only mac1 family instances are available here. Proceed to the next step.

mac003

Mac instances require to be run on a dedicated host. In other words, you get the actual hardware for your instance. In the data center, mac1.metal are essentially Mac Mini hardware, racked onto Nitro hypervisor/virtualization chips. Let's therefore allocate a dedicated host. A new browser tab will open for this. Don't close the old tab as we will go back to it.

mac004

Fill the fields for name, instance family, instance type, availability zone, and quantity. Proceed to allocate.

mac005

If the operation fails, it may be that there is insufficient availability in the selected availability zone, so try another until the operation succeeds.

mac006

After successful creation of the host, return to the previous tab to continue launching. You can close the dedicated host tab if you like. Refresh the list of hosts as shown.

mac007

Open the host drop-down and select the dedicated host that you just created.

mac008

I didn't need to change any other settings. Proceed to add storage.

mac009

Select the amount of EBS storage for the root volume. I need to install a bunch of big applications for development on my instance, so I selected a large root volume, however your needs may be different, and you are billed for the quantity of EBS that you use. It is actually possible to take a snapshot of this root volume later, restore it to a larger volume, and replace the volume with a larger one without replacing the instance, however it's better to have a large enough volume to begin with. To be precise the time to do this replacement is probably more expensive than having a generously sized volume for the life of the instance.

Choose gp3 storage under most circumstances. It's faster than gp2 or magnetic storage, and actually 20% (at time of writing) cheaper than gp2.

Proceed to review and launch.

mac010

You will notice that the security group has no rule to allow SSH. That's okay for most production instances. Only open an SSH port if you want to make a connection, and don't forget to close it afterwards.

Launch the instance if everything looks good.

mac011

You will need a key pair to access the instance. In my case here, I create a new key pair.

mac012

Give it a name, and download it.

mac013

Save the file that is downloaded somewhere safe where you can find it.

(Note that this is a pretty informal method. The keypair file contains a cryptographic private key. There are stricter guidelines around creation and use of SSH keys if your circumstances dictate it.)

mac014

Once you have secured your keypair file Launch Instances.

mac015

The launch status popup appears. Use the link to see the instances screen.

mac016

The instance will take a moment to get into the running state, and you will be able to see the public DNS for the instance. The little copy icon allows the string to be easily copied to the clipboard.

Note: Terminating the instance

When you terminate the instance, don't forget to delete the dedicated host, as you are billed for the host, not the instance, so you don't want unused dedicated hosts just sitting around.

Connect to the instance with SSH

Connect to the mac1.metal instance using SSH. My other gist covers this procedure.

Connect to the instance by tunneling VNC over SSH

You can connect to the mac1.metal instance using its public IP address, by setting up screen sharing and opening the port on the security group. This is not advised however, as the connection is unencrypted. It is better to tunnel the VNC connection over SSH to secure it.

See also:

The procedure is documented in the official documentation here.

This YouTube video also has some information: https://www.youtube.com/watch?v=FtU2_bBfSgM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment