This repository contains Packer configurations for building macOS virtual machines on Apple Silicon that create an enrollment profile for Jamf Pro or install the Microsoft Intune Company Portal for testing.
It's inspired by MotionBug's "The Cookbook: Baking up your perfect Jamf Pro Test VM" and uses Apple's Virtualization framework with Packer to simulate real-world MDM environments.
Packer is a tool that lets you create identical machine images for multiple platforms from a single source template. Packer can create golden images to use in image pipelines.
Tart is a virtualization toolset to build, run and manage macOS and Linux virtual machines on Apple Silicon. Tart uses Apple's own Virtualization.Framework for near-native performance.
Note: macOS 26.1 has an Apple bug where VM serial numbers come back empty, blocking MDM enrollment. It's fixed in macOS 26.2, which is the build the Tahoe template targets.
- Three macOS versions, one workflow — dedicated templates for Sequoia, Tahoe, and Golden Gate, each producing a ready-to-clone Tart VM image.
- Fully hands-off provisioning — Setup Assistant is driven end-to-end via Tart's
boot_commandkeystrokes on Sequoia/Tahoe; Golden Gate instead creates the account directly through Tart's--provisioning-opts, skipping Setup Assistant entirely. - MDM enrollment, your choice of vendor — generates a Jamf Pro
.mobileconfigenrollment profile on the Desktop (with a fresh UUID, your invitation ID, and Jamf URL baked in), downloads and silently installs the Microsoft Intune Company Portal, or skips MDM altogether — controlled by a singlemdm_vendorvariable. - Configurable local account — username and password are both variables, applied consistently across SSH access, account creation, and every automated step that needs to authenticate.
- Auto-login — the created account logs in automatically on boot, toggleable.
- Passwordless sudo — grants the account NOPASSWD sudo via
sudoers.d, so the rest of the build (and any post-build automation) can run privileged commands non-interactively. - Gatekeeper disabled — both via
spctl --global-disableand by walking through the Privacy & Security confirmation in System Settings, so unsigned/ad-hoc test builds run without friction. - Remote access enabled — Screen Sharing and Remote Login (SSH) are turned on during setup, so the VM is reachable the moment it boots.
- Spotlight indexing disabled — toggleable, reduces background CPU/disk load in lab VMs.
- Safari pre-automated — launches Safari once to populate its defaults and enables
safaridriver, so Safari-based automation/testing works immediately. - Screen lock disabled — toggleable, keeps the session unlocked for unattended lab use.
- System sleep prevented — the VM won't sleep mid-test.
- Clipboard sharing — installs the Tart Guest Agent so copy/paste works between host and guest, toggleable.
- Unique Computer Name — sets a random
VM-TART-XXXXhostname on every build, avoiding name collisions across clones. - Thin-provisioned disks — Tahoe and Golden Gate use Tart's
asifdisk format for a smaller on-disk image footprint. - Recovery partition kept — so
softwareupdatestill works inside the finished VM. - Everything overridable — every credential, URL, and toggle above is a Packer variable, so a single template file supports many different builds via
-var/-var-fileat build time.
| File | Target macOS | Default vm_name |
Setup method |
|---|---|---|---|
macos15.6.1_sequoia-tart.pkr.hcl |
15.6.1 (24G90) | sequoia-jamfdev-1561 |
Setup Assistant boot_command keystrokes |
macos26.2_tahoe-tart.pkr.hcl |
26.2 (25C56) | tahoe-jamfdev-261 |
Setup Assistant boot_command keystrokes |
macos27.0_golden-gate-tart.pkr.hcl |
27.0 (26A428) | goldengate-jamfdev-270 |
Tart's --provisioning-opts (no Setup Assistant); requires Tart CLI ≥ 2.33.0 and macOS 27+ on the host |
- Apple Silicon
- Homebrew
- Packer ≥ 1.16 and Tart ≥ 1.16.0 (Sequoia/Tahoe); the Golden Gate template needs Tart CLI ≥ 2.33.0 for
--provisioning-optsand a macOS 27+ host. - Jamf Pro access to create enrollment invitations (only needed if
mdm_vendor = jamf). - Internet connectivity for IPSW and Homebrew installs.
- IPSW Links: mrmacintosh.com's Apple Silicon IPSW database
brew install openai/tools/tart
brew tap hashicorp/tap
brew install hashicorp/tap/packer
| Name | Type | Description |
|---|---|---|
vm_name |
string | Name of the VM to create. Default differs per template — see the table above. |
ipsw_url |
string | macOS IPSW restore image URL used to build the VM. Each template pins the build it was verified against; get newer builds from mrmacintosh.com. |
account_userName |
string | Local macOS account username created during setup. Default: admin. |
account_password |
string (sensitive) | Local macOS account password. Default: karthik123 — override via -var or a var-file rather than relying on the checked-in default. |
mdm_vendor |
string | jamf or intune (case-insensitive). Set it to anything else, e.g. none, to skip MDM enrollment entirely. |
jamf_url |
string | Jamf Cloud URL. Default: https://karthik.jamfcloud.com. |
mdm_invitation_id |
string | Jamf Pro enrollment invitation ID; only used when mdm_vendor = jamf. Default differs per template — see that file. |
| Name | Type | Default | Description |
|---|---|---|---|
enable_auto_login |
bool | true | Enables automatic login for the specified user. On the Golden Gate template, login always happens once during provisioning (required to reach the desktop and complete the build) — this toggle only controls whether it's still enabled on the finished image. |
enable_passwordless_sudo |
bool | true | Grants passwordless sudo to the specified user via sudoers.d. Several steps later in the build assume this is on and call sudo non-interactively — turning it off without another way to authenticate will stall those steps. |
enable_spotlight_disable |
bool | true | Disables Spotlight indexing to reduce background load in lab VMs. |
enable_safari_automation |
bool | true | Launches Safari once and enables safaridriver for automation. |
enable_screenlock_disable |
bool | true | Disables screen lock for the specified user. |
enable_clipboard_sharing |
bool | true | Installs Tart Guest Agent to enable host–guest clipboard sharing. |
- Log in to Jamf Pro → Computers → PreStage Enrollments → Invitations
- Create a new invitation.
- Copy the URL that looks like:
https://your.jamfcloud.com/enroll?invitation=XXXXXXXXXXXX - The part after
invitation=is your Invitation ID. - Add it to the
mdm_invitation_idvariable.
packer init macos26.2_tahoe-tart.pkr.hcl
packer validate macos26.2_tahoe-tart.pkr.hcl
packer build macos26.2_tahoe-tart.pkr.hclReplace with macos15.6.1_sequoia-tart.pkr.hcl or macos27.0_golden-gate-tart.pkr.hcl to build the Sequoia or Golden Gate image instead.
packer build -var="account_userName=macadmin" -var="account_password=supersecurepass" -var="enable_auto_login=true" macos26.2_tahoe-tart.pkr.hcl🟥
tart clone your-image prod-test-vm
tart set prod-test-vm --display-refit --random-serial --random-mac
tart run my-test-vm
tart run my-test-vm --dir=SharedFolder:~ # Shared Folders from host to vm
tart run my-test-vm --recovery # Boot into recovery mode
tart run my-test-vm --no-graphics # Don't open a UI window.
tart run my-test-vm --vnc # Use screen sharing instead of the built-in UI.
tart run my-test-vm --vnc-experimental # Use Virtualization.Framework's VNC server instead of the built-in UI.
tart help run # tart run manual pages for all other options
- Use
--random-serialand--random-macto avoid collisions across clones. tart runsupports headful workflows; pair with--display-refitduring OS first boot if needed.
- The Cookbook: Baking up your perfect Jamf Pro Test VM
- Packer Docs
- Tart
- cirruslabs/macos-image-templates — upstream reference templates these boot_commands are adapted from