Fix unattended installation when deploying a virtual machine using Packer on a Mac computer with Apple M1 Chip

2 users found this article helpful

When deploying a virtual machine using Packer on a Mac computer with Apple M1 Chip, you may find that the unattended installation does not begin.

This can happen if the files are for the unattended installation are added using the floppy_files parameter. It's because virtual floppy drives are not supported in Parallels Desktop on Mac computers with Apple M1 Chip, and an ISO image should be used instead.

To set up an iso and to make Packer connect it when deploying the virtual machine, please perform the following steps:

1. Create an .iso image containing all the necessary unattended installation components:

1.0. Put all the contents of the future unattended.iso into a single folder.
1.1. Open macOS Disk Utility, click File > Create new image Image from Folder... and select that folder.
1.2. You will be presented with a number of preferences. In Image Format, select CDR image will be generated.
1.2. Convert CDR into ISO by executing the a Terminal command with the following syntax:

hdiutil makehybrid -iso -joliet -o unattended.iso <path_to_folder>

2. Put the resulting iso file in the same folder as your Packer template.

3. Edit the prlctl section of your Packer template by adding:

["set", "{{ .Name }}", "--device-add", "cdrom", "--image", "./unattended.iso", "--connect"]

This will mount unattended.iso right at the start of the virtual machine, and the unattended installation should be successful.

Was this article helpful?

Tell us how we can improve it.