All AMIs are built from the default AWS AMIs.
The macOS AMI is an EBS-backed, AWS-supported image. This AMI includes the AWS Command Line Interface, Command Line Tools for Xcode, Amazon SSM Agent, and Homebrew. The AWS Homebrew Tap includes the latest versions of multiple AWS packages included in the AMI.
Root device type: ebs | Virtualization type: hvm | ENA Enabled: Yes
What we add, regardless of macOS version:
anka virtualization
jq
: Lightweight and flexible command-line JSON processorll
alias tols -laht
The official Veertu AMIs in AWS have these steps already performed inside of them:
- ALWAYS USE
unset HISTFILE;
at the end of commands
cd /Users/ec2-user && git clone https://github.com/veertuinc/aws-ec2-mac-amis.git && cd aws-ec2-mac-amis && ANKA_LICENSE="skip" ./$(sw_vers | grep ProductVersion | cut -d: -f2 | xargs)/prepare.bash; unset HISTFILE
- Resizing of the disk may take a while. The instance may seem stuck, so be patient and only create the AMI once it's done (check
/var/log/resize-disk.log
to confirm) - Test
anka create
using generate getting-started scripts + delete VM it creates after starting and running command inside - Ensure cloud connect service works with user-data
- Restart without user-data
- As user AND root (only if you're going to make the AMI public):
anka registry delete --all; anka delete --yes --all; echo "" | tee /Library/Logs/Anka/anka.log; echo "" | tee /var/log/cloud-connect.log; echo "" | tee /var/log/resize-disk.log; rm -f ~/.ssh/authorized_keys; rm -f ~/.*_history; history -p; rm -rf /tmp/anka-mac-resources; rm -rf /Applications/Install*; rm -rf ~/.zsh_*; find "$(anka config img_lib_dir)" -mindepth 1 -delete; find "$(anka config state_lib_dir)" -mindepth 1 -delete; find "$(anka config vm_lib_dir)" -mindepth 1 -delete; unset HISTFILE;
- Remove license
sudo anka license remove
This should install everything you need (the script is idempotent). You can then sanity check and then save the AMI.
/var/log/resize-disk.log
/var/log/cloud-connect.log