Skip to content

trycua/packer-plugin-lume

Repository files navigation

Shows my svg

Go macOS Discord

packer-plugin-lume is a Packer plugin for building macOS and Linux VM images with Lume on Apple Silicon. It provides automated VM creation and provisioning through Lume's CLI/API.

Installation

Prerequisites

# Install Go
brew install golang

# Install Packer
brew tap hashicorp/tap
brew install hashicorp/tap/packer

Steps

  1. Install Lume if you haven't already:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/lume/scripts/install.sh)"
  1. Obtain a macOS IPSW restore image:
# Get the latest macOS IPSW download URL
lume ipsw

# Download the IPSW image (this may take a while)
curl -o macOS.ipsw [URL from previous command]
  1. Build and install the plugin:
make dev
  1. Navigate to the bin directory and customize variables.hcl with your desired configuration and full path to the IPSW image:
cd bin

# Edit variables.hcl to set vm_name, cpu_count, memory, and path of a IPSW image.

Usage Example

Run the build:

packer build -var-file=variables.hcl macOS-15.arm64.lume.prepare-01.pkr.hcl

Configuration Reference

Builder Configuration

Parameter Description Type Default
vm_name Name for the VM string Required
vm_base_name Base VM to clone string Optional
ipsw Path to IPSW file or 'latest' string Optional
cpu_count Number of CPU cores number 4
memory Memory size string "4GB"
disk_size Disk size string "40GB"
display Display resolution string "1024x768"
headless Run without display boolean false
recovery_mode Start in recovery mode boolean false
ssh_username SSH username string Required
ssh_password SSH password string Required
ssh_timeout SSH connection timeout string "10m"

Contributing

We welcome and greatly appreciate contributions to packer-plugin-lume! Whether you're improving documentation, adding new features, fixing bugs, your efforts help make this packer plugin better for everyone.

Join our Discord community to discuss ideas or get assistance.

Acknowledgements

Special thanks to PrashantRaj18198 for the original implementation of the Lume plugin for Packer.

License

This project is licensed under the MPL-2.0 License - see the LICENSE file for details.

Trademarks

Apple, macOS, and Apple Silicon are trademarks of Apple Inc. Ubuntu and Canonical are registered trademarks of Canonical Ltd. This project is not affiliated with, endorsed by, or sponsored by Apple Inc. or Canonical Ltd.