在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):trodemaster/packer-macOS-11开源软件地址(OpenSource Url):https://github.com/trodemaster/packer-macOS-11开源编程语言(OpenSource Language):Shell 72.8%开源软件介绍(OpenSource Introduction):packer-macOS-11This a packer template for macOS 11 or 12 built on VMware fusion 12. It's created using the newer packer hcl2 syntax. These templates only support x86 platform as Apple has introduced breaking changes with the new Applesilicon platform. Discussion thread for usage questionsSee this hashicorp discuss thread for general usage questions & answers. --> building-macos-12-x-vms-with-packer-and-fusion <-- Key capabilities
Building macOS 11+ with this packer template
Prerequisite installer bitsThe current version of this project now uses mist to create macOS x86 installer iso files. Grab a copy from https://github.com/ninxsoft/Mist and make sure it's available on your path before the next steps. For generating the boot iso and matching shasum run the macosiso.sh script providing the OS major version you want to create. Generating the iso directly with mist also works. You will just need to povide packer the sha256 via input variable.
With the customize build I'm installing Xcode command line tools 13. Grab both the latest Xcode Command Line tools installer dmg from developer.apple.com. Toss them into the Here is what your
NOTE: Filenames will change as newer versions are released Named buildsThis template has two named builds Building the base imageBuilds just the OS including VMware tools
Building the customize imageUseful for testing customizations without waiting for the whole OS to install.
Input variablesThis template uses input variables for a bunch of customizable values. Run packer inspect to see the defaults and what can be changed. See the docs for more options like creating a local variables file for customization https://www.packer.io/docs/templates/hcl_templates/variables .
Varibles fileThe recommended way to tweak settings in the template is by creating a packer variables file. Any of the Input variables can be adjusted this way. Specify a var file with the build commands to change the defaults.
Here is an example var file named bigsur.pkrvars.hcl
Adjust resourcesIf you need to adjust the cpu and RAM requirements to match your available resources.
Adjust timingThe process for starting the installer is very dependant on timing, unfortunately. If you run into unexpected results when the installer is starting up you may need to adjust the timing to match your system. Each release of the OS and specific hardware running the build can change the optimal timing. When in doubt add some time to these values to see if that fixes the issue.
Customize computer serial and modelVariables have been added to customize board id, hardware model & serial number. This can be handy for testing DEP workflows.
Install pre-release software updatesApple has been seeding pre-release builds as software update only more often. To configure the installation of these pre-release versions pass the seed value you want to configure on the OS.
Possible values are
Customize username, password, hostname & ssh keyChanging the username/pass in the http/packer.pkg has been deprecated. The current version supports passing user details as packer variables. Configuring the following vars will remove the packer user and add a new one with the provided variables. Setting a hostname and ssh key simplifies connecting to the VM once the build is completed.
Apple GPU supportIf the host system is running macOS 11.x or later enabling the virtualized GPU provides a dramatic speedup of the GUI. This version of the template uses a post-processor to add the needed vmx config if the host OS is macOS 11.x+. This capability is a beta VMware Fusion feature and has some known issues. Use downloaded version of VMware tools .isoSometimes newer versions of VMware tools are available from vmware.com . Check https://vmware.com/go/tools . If you want to use an iso besides the one included with VMware fusion then update the variable tools_path
Add your own config scriptAdditionally a new variable bootstrapper_script has been added. Using this is an easy way to add a few more commands to the build or pull down a script to extend the build process to your needs. I use it to install golang, macports and dotfiles via a script in another repo. See below for an example.
Simple wrapper script to run both base & customize buildsIncluded is a simple wrapper script used to build the base image and then the customized image. It takes a single parameter that is a packer variable file. This simplifies the build process if you maintain multiple versions of macOS VMs.
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论