mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 08:58:41 +00:00
| .. | ||
| macos-vm-auto-enroll.sh | ||
| README.md | ||
macOS VM Auto Enroll
A script to automate the manual enrollment process in a macOS virtual machine.
Usage
The script takes no arguments, but can be configured through three environment variables.
FLEET_ENROLL_SECRET(required) The fleet enrollment secretFLEET_URL(required) The fleet base urlMACOS_ENROLLMENT_VM_NAME(optional) The name of the VM. If nothing is specified, the default name isenrollment-test.MACOS_ENROLLMENT_VM_IMAGE(optional) The image to use for the VM. If nothing is specified, the default image isghcr.io/cirruslabs/macos-sonoma-base:latest
The entire process from the generation of the pkg file to the installation is automated. The only part that requires user intervention is installing the MDM profile.
Steps
The script goes through the following steps.
- Change to the correct directory
- Delete the old
pkgfile if one exists - Build a new
pkgfile using the supplied variables - Delete the existing VM if one with the same name exists
- Create a new VM with the chosen name
- Launch the VM
- Copy the
pkgfile into the VM - Install the fleet and orbit
- Fetch the MDM profile from the fleet server after registration is complete
- Open the MDM profile, adding it to the profile list
- Open the settings app to the profile page
- [ACTION REQUIRED] The user has to double click on the new profile and then click
Enroll. - Open a shell in the terminal running the script
- Once the shell is exited, the VM process is reattached to the terminal