Skip to main content

Questions tagged [packer]

Packer is a tool which automates building and provisioning of VM and Docker images.

Filter by
Sorted by
Tagged with
0 votes
0 answers
50 views

What is the best way to partition Ubuntu22 with Packer (and ansible?)

I have this all working, but I am wondering if there is a better way to do this? It seems very difficult to make small changes this way. I'm using the vsphere-iso provisioner here, but I can also work ...
Jlom84's user avatar
  • 1
0 votes
1 answer
243 views

Where does Packer look for scripts?

I have a packer template that I'm trying to run. It generally does what I want it to do in that it creates an Azure VM, generalizes it and uploads it to a compute gallery. I'm now trying to expand it ...
theillien's user avatar
  • 449
0 votes
0 answers
146 views

Create Azure Red hat template with custom LVM partitions

I want to prepare Azure template for Red Hat 8 servers with packer and I'm facing problem with setting custom LVM partitions. For example, I want separate /var/tmp, /var/log etc. I deployed some VMs ...
matix324's user avatar
1 vote
1 answer
248 views

windows 2019 unattended install on kvm via libvirt can't find licence error

I'm trying to install windows server 2019 with autounattend.xml configuration on kvm via libvirt. Installation fail on dialog with sign: "Can't find microsoft software license terms" Despite ...
npc3257's user avatar
  • 11
1 vote
0 answers
361 views

Can Packer connect to a VM in vSphere via SSH?

I'm just getting started with configuring a VM on VMware vSphere and I'm using HashiCorp Packer to create the VM template. I'm very pleased with how most things are working out for me, but I have a ...
lindhe's user avatar
  • 136
0 votes
2 answers
3k views

Advices on automating installation for Debian 11

I'm currently trying to automate Debian 11 template creation through Packer for Nutanix environment and need some advices about preseeding/automating Debian installation. First of all, after reading ...
motorbass's user avatar
  • 353
1 vote
0 answers
453 views

Unwanted partition after partman-auto configuration

I have an issue while i'm trying to automate the creation for my debian VM template. I tried to create a specific disk partitioning with lvm, everything goes on correctly. But after boot, I see that I ...
jimmy zahgbib's user avatar
1 vote
0 answers
910 views

Force non-interactive setup on Debian/Ubuntu

I'm using packer to update an RStudio image that I maintain (https://marketplace.digitalocean.com/apps/rstudio), this is something I do for the community. The 1st script in the pipeline starts with ...
pachadotdev's user avatar
0 votes
0 answers
1k views

Packer build with Ubuntu 20.4 and autoinstall with vSphere 7.0

I am trying to build a packer image with packer 1.8.1 and Ubuntu 20.4 My HCL manifest is correct but I always get the prompt with " Continue with Autoinstall ? Add autoinstall in kernel command ...
Mandala's user avatar
  • 23
1 vote
2 answers
3k views

Adding a machine to a domain fails with internal error

I've enabled winrm, disabled firewall, enable remoting, GPOs for winrm, enabled SMBv1 and completed updates first as troubleshooting but I still get the error. I can ping the DC as well. The error I ...
rumplesmyboy's user avatar
0 votes
0 answers
2k views

Centos Stream 9 boot iso stuck during kickstart

I am trying to install a Centos Stream 9 boot iso on my mac M1 via VMware Fusion. I already solved a lot of issues that were preventing me to start installation. Now I get to the installation (I am ...
YFrickx's user avatar
3 votes
1 answer
556 views

Best practice for unattended upgrades on immutable servers

I use packer to build immutable Ubuntu 20.04 servers. How can it work smoothly with unattended upgrades? Since the image is not bundled like it was in the past the updates do not apply to new ...
Niro's user avatar
  • 1,451
0 votes
2 answers
1k views

Add Windows VM to domain using Packer

I'm trying to create Windows images for usage on Azure using Packer. As part of this process, I need to put some files, which are located on an existing VM in Azure, in the image. My idea was to add ...
Pieter's user avatar
  • 101
1 vote
0 answers
414 views

Run script in Windows Azure VM after launch during packer build to configure WinRM and the firewall

Background: Apparently Packer has major issues configuring WinRM on Azure VMs created from the Microsoft Windows Server publisher. This is only one of the several issues and threads I've found on this ...
codewario's user avatar
  • 558
0 votes
3 answers
739 views

Immutable Linux images - how far can and should I go?

Immutability is cool in order to realize consistency, predictability and reliability, and I don’t see any reason why I shouldn’t strive for OS-level immutability when deploying my application on Linux ...
Findus Pedersen's user avatar
1 vote
0 answers
409 views

How to end-to-end provision a virtual machine including OS on ESXi standalone using Terraform?

For a small environment I'm tasked to create automated infrastructure deployment for a couple of virtual machines running on a single ESXi host (without vCenter). The VMs should run CentOS 8 and I ...
Daniel's user avatar
  • 165
-1 votes
1 answer
3k views

Adding arguments to Packer's Ansible provisioner

My Friday brain is really struggling to convert an Ansible command line into the format my Packer .json wants. The Ansible: ansible-playbook playbook.yml -e @env/users/user01.yml --ask-vault --ask-...
Sam's user avatar
  • 183
0 votes
1 answer
523 views

journalctl stops working randomly after boot on DigitalOcean droplet

I am building servers from a custom image I made using Packer on DigitalOcean, and I'm having a recurring issue where journalctl doesn't have any logs: # journalctl No journal files were found. ...
ZoFreX's user avatar
  • 308
1 vote
1 answer
187 views

OpenVPN AMI's built with packer incorrectly use the old public IP from the build in generated config files

When I build AMI's using Hashicorp Packer, based off the AWS OpenVPN AMI, the public ip address from the first instance performing the build will persist in later usage of the AMI when it should ...
openCivilisation's user avatar
1 vote
0 answers
740 views

Heisenbug: ansible.windows.win_user fails with "Illegal operation attempted on a registry key that has been marked for deletion."

Using Packer to build an AMI based on Windows Server 2019, and Ansible as provisioner. This is the provisioners part of my packer-build.json: "provisioners": [ { &...
Amedee Van Gasse's user avatar
2 votes
1 answer
3k views

Replace WinRM with OpenSSH on Windows for use with Ansible on AWS

Currently when running extended builds (Packer/Ansible based) on Windows we have found that WinRM has errors so frequently as to be unusable and have had to fall back to running some large build jobs ...
Adam C's user avatar
  • 5,242
1 vote
3 answers
3k views

Can't connect to Windows EC2 instance built by Packer via SSM Agent

I'm using Packer to set up a Windows VM on the free tier of AWS EC2. The image is properly set up and I'm able to launch it, but I can't connect to it with SSM. Here's my Packer template: { "...
JesseTG's user avatar
  • 113
0 votes
1 answer
2k views

Disconnected NIC on customized & deployed Ubuntu 18.04 templates

Within my vSphere 6.7 U3 environment, I have an Ubuntu 18.04 template generated by packer which I am then using Terraform to deploy two copies of. I am running into an issue where the deployed VMs ...
stevenmiller's user avatar
2 votes
2 answers
3k views

Proxmox & Packer: VM quit/powerdown failed during a Packer build. Anyone have any ideas why?

I am trying to create a Proxmox VM template using Packer. However I am getting a Proxmox error saying Build 'proxmox' errored: Error converting VM to template, could not stop: VM quit/powerdown failed ...
Eddingston's user avatar
0 votes
2 answers
5k views

How to provide sudo pwd in packer shell provisioner

I want to create an AWS AMI using packer. Part of the setup process is running a build script, that will setup services and configure the environment for a system user averagejoe that is not root. The ...
rexford's user avatar
  • 111
0 votes
0 answers
3k views

Issues getting networking working Packer VSphere-ISO Centos 7

While new to Packer and Kickstart scripts, I am trying to automate the setup of CentOS 7 (eventually 8) boxes in a VSphere cluster. My Packer code is calling a Kickstart script to complete the setup, ...
THIRSTY GNOMES's user avatar
0 votes
1 answer
216 views

Make image with packer for Google cloud

when I user packer build command I face this error and I gave the service account user but still have same issue googlecompute: * The user does not have access to service account 'service-76109290228@...
farzin's user avatar
  • 1
3 votes
0 answers
3k views

What the best way to export a Vagrant box to OVF?

My goal was to create a Virtual Machine programmatically like you would do for a container with docker and be able to export it in an OVF. So I used Vagrant to create the VM. Combining Vagrant and ...
noraj's user avatar
  • 297
0 votes
1 answer
4k views

unable to ssh into local qemu instance via port forward

I am trying to build a custom Ubuntu (ISO built from bionic - 18.04.2) qcow2 image via packer. This fails in the step where packer tries to SSH to the instance via port forward. I can see from VNC ...
Ani's user avatar
  • 32
0 votes
1 answer
979 views

How to update existing manage packer image in Azure?

I have created a ubuntu image by following code { "builders": [{ "type": "azure-arm", "subscription_id": "XXXXXX",XXXXXXXX "client_id": "XXXXXXX", "client_secret": "06XXXXXXX", ...
sanjayparmar's user avatar
1 vote
1 answer
280 views

Partially Immutable infrastructure in AWS with Packer?

I'm a very young systems engineer/contractor sysadmin with a bandwidth-heavy workload that just moved to an area where I get 2mbps download and 20 upload on my internet connection. I'm moving my ...
user avatar
1 vote
1 answer
1k views

How to provide ssh_username when using packer to build a windows AMI

When I run packer build -var aws_access_key=$AWS_ACCESS_KEY_ID -var aws_secret_key=$AWS_SECRET_ACCESS_KEY windows-2012.json I got this error: 1 error(s) occurred: * An ssh_username must be ...
Anthony Kong's user avatar
  • 3,488
0 votes
1 answer
2k views

packer unable to parse json due to invalid character

I want to use packer to build an ami. The AMI was initially built by an aws_instance resource in terraform. It contains the following user_data <powershell> winrm quickconfig -q winrm set ...
Anthony Kong's user avatar
  • 3,488
0 votes
1 answer
310 views

xenserver-iso: Error downloading: open : no such file or directory

I'm trying to build a "vdi_vhd" image using packer on xenserver,but i have got the below error, could you please anyone help me on this,Thanks in advance. [root@localhost bin]# packer build /usr/...
Antony nixson's user avatar
0 votes
1 answer
445 views

cannot connect to ec2 instance created by packer image

I have written packer script to create image in aws. After executing the packer script it is running a ec2 instance which is using pem file created by packer. But how can I know which pem file packer ...
MD. Ashfaqur Rahman Tahashin's user avatar
1 vote
1 answer
2k views

Packer errors with qemu-system-aarch64

I have some success creating Vagrant base boxes with Packer for x86 and x86_64 guests, including VirtualBox, VMware, and qemu hypervisors. Now, I want to start making ARM guests with Packer and qemu, ...
mcandre's user avatar
  • 168
-2 votes
1 answer
2k views

Create a VM using terraform on an Azure image created by Packer

Team, I need to provision an Azure VM (Windows/Linux) and I followed the below link to create the image first. https://docs.microsoft.com/en-us/azure/virtual-machines/windows/build-image-with-packer ...
Learning_Terraform's user avatar
1 vote
0 answers
2k views

Packer Works Locallly but fails in Gitlab CI/CD w/ executable file not found in $PATH

Here is a snippet of my JSON file for packer. Pretty much running packer build example.json via adhoc - it works smoothly and builds the AMI out in AWS. When i execute this in my GitLabCI Pipeline, it ...
user509226's user avatar
2 votes
1 answer
1k views

Packer failing sysprep on AWS windows 2016 AMI

Packer seems to fail at the Amazon Scripts to sysprep the machine. I have tried a bunch of different things. Putting the scripts in their own script, running, them 'inline' like many people show but ...
tingels's user avatar
  • 21
1 vote
1 answer
504 views

Running VMWare Workstation 14 on a VM [closed]

I have set up VMWare Workstation on a esxi 6.0 hosted VM. (Ubuntu 16.04.05) I am trying to run some packer builds that use the specific (VMWare Workstation) hypervisor. The builds get stuck ...
pkaramol's user avatar
  • 131
5 votes
3 answers
2k views

inconsistent `apt-get update` behaviour on official Ubuntu AWS AMI

I get various and inconsistent errors with apt on the official Ubuntu images (ami-83e769fb). I'm using Packer to build my AMI and it fails about 40% of the time. Rerunning the script succeeds. My ...
Mystic's user avatar
  • 151
0 votes
1 answer
246 views

serverspec nginx should be listening using packer

I am using packer to build an ami on aws, after the provision of the ami, I am testing the image using serverspec, but the test fail testing nginx, this is the test cat test/spec/localhost/...
c4f4t0r's user avatar
  • 5,411
0 votes
1 answer
240 views

How do I use debconf in salt with pillars?

I have the following: newrelic-debconf: debconf.set: - name: newrelic-php5 - data: 'newrelic-php5/application-name': { 'type': 'string', 'value': '{{ salt['pillar.get']('newrelic:...
Andrei Dascalu's user avatar
3 votes
0 answers
4k views

How to pass environment variables to packer in AWS?

I am building a custom AMI in AWS using packer and bash + salt provisioning. However, I am in need of being able to pass some variables from my local environment to the build system and I don't really ...
Andrei Dascalu's user avatar
1 vote
1 answer
2k views

Packer with ansible from local works but from another server ask for root permissions

For a bit of context, I'm using packer with an ansible provisioner to create AMI images on AWS. The relevant parts of the packer and ansible: packer.json "provisioners": [{ "type": "shell", "...
fmartingr's user avatar
4 votes
3 answers
3k views

Removing install user with Packer

When a VM is first created, it gets an install user that is used to run the provisioning. I want to remove this user at the last step because it's not necessarily secure and it's unnecessary. However, ...
siride's user avatar
  • 609
7 votes
1 answer
8k views

Packer won't correctly use private key for SSH auth in provisioning step

I use Packer to build VirtualBox images, with the Ansible provisioner to set up the images. The builder step creates a temporary user (ssh_username and ssh_password). The Ansible provisioner runs ...
siride's user avatar
  • 609
1 vote
0 answers
116 views

Data disappears after launching EC2 instance from AMI

I am launching an EC2 instance out of an AMI that i am building using packer . In packer build i specify a provisioning shell script which will mount the drives as well as get some files from S3 ...
Krishna Sangeeth's user avatar
3 votes
2 answers
3k views

Packer - AWS Windows 2016 SysPrep returns exit code 1

When attempting to SysPrep an AWS Windows Server 2016 instance using Packer the following error is thrown: Build 'amazon-ebs' errored: Script exited with non-zero exit status: 1. Allowed exit codes ...
Castrohenge's user avatar
2 votes
1 answer
2k views

Building an AMI using Packer with a shell provisioner

I'm trying to create an AMI (based on ubuntu; ami-2d39803a) that I can reuse for a project with the a set of components installed. I'm using packer to achieve this with a shell script that gets ...
Aziz Alfoudari's user avatar