parallels / packer-examples Goto Github PK
View Code? Open in Web Editor NEWPacker Templates and examples to use with Parallels Desktop provider
License: MIT License
Packer Templates and examples to use with Parallels Desktop provider
License: MIT License
When I run script ./scripts/ubuntu/base/minimize.sh
line 16 triggered an error.
# Whiteout /boot
count=$(df --sync -kP /boot | tail -n1 | awk -F ' ' '{print $4}')
count=$((count - 1))
dd if=/dev/zero of=/boot/whitespace bs=1M count=$count || echo "dd exit code $? is suppressed";
rm /boot/whitespace
I got an error:
==> parallels-iso.image: Provisioning with shell script: ./scripts/ubuntu/base/minimize.sh
==> parallels-iso.image: + awk -F {print $4}
==> parallels-iso.image: + tail -n1
==> parallels-iso.image: + df --sync -kP /
==> parallels-iso.image: + count=24176156
==> parallels-iso.image: + count=24176155
==> parallels-iso.image: + dd if=/dev/zero of=/tmp/whitespace bs=1M count=24176155
parallels-iso.image: dd exit code 1 is suppressed
==> parallels-iso.image: dd: error writing '/tmp/whitespace': No space left on device
==> parallels-iso.image: 25170+0 records in
==> parallels-iso.image: 25169+0 records out
==> parallels-iso.image: 26392330240 bytes (26 GB, 25 GiB) copied, 7.57125 s, 3.5 GB/s
==> parallels-iso.image: + echo dd exit code 1 is suppressed
==> parallels-iso.image: + rm /tmp/whitespace
==> parallels-iso.image: + + awk -F {print $4}
==> parallels-iso.image: df --sync -kP /boot
==> parallels-iso.image: + tail -n1
==> parallels-iso.image: + count=1739576
==> parallels-iso.image: + count=1739575
==> parallels-iso.image: + dd if=/dev/zero of=/boot/whitespace bs=1M count=1739575
==> parallels-iso.image: dd: error writing '/boot/whitespace': No space left on device
parallels-iso.image: dd exit code 1 is suppressed
==> parallels-iso.image: 1802+0 records in
==> parallels-iso.image: 1801+0 records out
==> parallels-iso.image: 1888694272 bytes (1.9 GB, 1.8 GiB) copied, 0.494161 s, 3.8 GB/s
==> parallels-iso.image: + echo dd exit code 1 is suppressed
==> parallels-iso.image: + rm /boot/whitespace
==> parallels-iso.image: + set +e
==> parallels-iso.image: + /sbin/blkid -o value -l -s UUID -t TYPE=swap
==> parallels-iso.image: + swapuuid=
==> parallels-iso.image: + set -e
==> parallels-iso.image: + [ x != x ]
==> parallels-iso.image: + sync
When I run packer build .
I got an error, 404 file not found.
In provisioner.pkr.hcl path in line 13instead of
"https://releases.ubuntu.com/${var.version}/ubuntu-${var.version}-live-server-arm64.iso"
should be
"https://cdimage.ubuntu.com/releases/${var.version}/release/ubuntu-${var.version}-live-server-arm64.iso"
Let me start with: I am not Packer fluent, just barely literate.
When building a box with redhat/build.pkr.hcl
, the resulting image doesn't have Parallels Tools installed, despite running scripts/rhel/base/parallels.sh
.
I believe that this is due to a race condition, introduced by scripts/rhel/base/init.sh
.
Most of the provisioners run in a list in the same provisioner block. init.sh
is the first one to run, and ends with a reboot
command. I separated all of these provisioners, and eventually added breakpoints, and discovered that the reboot takes some time to take effect. So the next provisoning script, sshd.sh
, runs and completes, but the parallels.sh
gets interrupted while preparing to install prerequisites. The next script, parallels_folders.sh
, runs after the box reboots.
I have a version of redhat/build.pkr.hcl
in which I've separated the provisoners into three groups, and had the second group wait before executing. This makes sure that the box starts booting before Packer tries to run the parallels.sh
script. This doesn't eliminate the problem, but seems to make it much less likely.
Are the maintainers willing to accept this half-step-fix for the problem? I can do more restructuring of the provisioners, but that would make them less like the other platforms, and I didn't want to make a mess without asking about direction...
Thank you!
Current README.md has
git clone https://github.com/Parallels/parallels-packer-examples.git
correct one would be
79d5985 is a huge step forward for the user and building for multiple versions of macOS!
Unfortunately, when validating variables:
Error: Unknown source parallels-macvm.sonoma
on build.pkr.hcl line 1:
(source code not available)
Known: [parallels-ipsw.monterey parallels-ipsw.sequoia parallels-ipsw.sonoma
parallels-ipsw.ventura]
The file provisioner.pkr.hcl
defines variable version_source
. Most of the values have macvm in them, and I'm guessing it's supposed to be ipsw.
I don't really understand how this part works, but I think that I could start the build with an existing virtual machine, and somehow reference it's name, rather than using the macOS installer to create a brand new one?
At any rate, there is now #54 in case that is actually correct. I tested it and it seems to work.
Following this documentation windows-readme
I got this error:
windows git:(main) โ packer validate -var-file variables.pkrvars.hcl .
Warning: Bundled plugins used
This template relies on the use of plugins bundled into the Packer binary.
The practice of bundling external plugins into Packer will be removed in an
upcoming version.
To remove this warning, add the following section to your template:
packer {
required_plugins {
vagrant = {
source = "github.com/hashicorp/vagrant"
version = "~> 1"
}
}
}
Then run 'packer init' to manage installation of the plugins
Error: Unknown source type parallels-iso
on build.pkr.hcl line 1:
(source code not available)
known builders: [virtualbox-vm azure-chroot virtualbox-ovf azure-arm amazon-ebs
vsphere-iso vmware-vmx virtualbox-iso vagrant amazon-chroot googlecompute qemu
amazon-instance amazon-ebsvolume file vmware-iso docker amazon-ebssurrogate null
azure-dtl vsphere-clone]
My setup:
MacBook Pro M1
I installed:
Packer
- by following this for macos packer-install
PD-19
- already was on my laptop
Steps to reproduce:
variables.TEMPLATE.pkrvars.hcl
according to the readmeiso_url = "~/Downloads/win11-arm.iso" #path to your generated iso
iso_checksum = "" #the generated iso checksum in this format "sha256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", check readme in how to generate
machine_specs = {
cpus = 2,
memory = 8182,
disk_size = "65536",
}
addons = ["git", "vscode"] # list of addons to be installed, check readme for more info
create_vagrant_box = false # set to true if you want to create a vagrant bo
variables.TEMPLATE.pkrvars.hcl
to variables.override.pkrvars.hcl
packer validate -var-file variables.override.pkrvars.hcl .
After creating a local variables file, running packer validate -var-file variables.local.pkrvars.hcl .
results in an error.
ulmer@SLU-MacBook-Pro-2 macos % packer validate -var-file variables.local.pkrvars.hcl .
Error: Unsupported argument
on build.pkr.hcl line 2:
(source code not available)
An argument named "count" is not expected here.
Removing count=0
from build.pkr.hcl
makes the error go away, but I don't know if it affects anything else. I couldn't find any obvious references with grep, but I'm definitely not a packer expert.
This is variables.local.pkvars.hcl:
machine_name = "macOS-14.5"
machine_specs = {
cpus = 4,
memory = 8192,
}
addons = [
]
create_vagrant_box = true
ipsw_url = "/Users/ulmer/Downloads/UniversalMac_14.5_23F79_Restore.ipsw"
I created #53, which just removes that line, just in case this looks like an obvious mistake to you.
Been anxiously waiting for 19 to drop since I saw changes in the plugin and the creation of this repo, so thank you to all involved ๐ !
I noticed that one of the links that points to this repo in the blog post uses a bad ref (branch was deleted?) https://github.com/Parallels/packer-examples/tree/add-macOs#readme
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.