This issue was originally opened by @jason-azze as hashicorp/packer#9998. It was migrated here as a result of the Packer plugin split. The original body of the issue is below.
Overview of the Issue
A vsphere-iso build for Windows VMs that used to work began failing after I added a few more provisioning scripts to it. The specific symptom I encountered was that the Windows setup wizard began to complain that it could not find Autounattend.xml (which is the "answer file" for a quiet Windows installation). I eventually determined that the copy of Autounattend.xml on the packer-tmp-created-floppy.flp was corrupt, as were several other files. So Windows was telling the truth when it would hang during what was supposed to be an unattended setup.
I began to suspect that the provisioning scripts that I had added to my build were at fault because that was the only change I had made. I suspected that something in the file names was causing the data stream to be corrupted during floppy creation, or perhaps I had a weird, unprintable unicode character in my script from a bad copy-paste out of Slack! While I played around with this idea, I began shortening the file names of my new scripts. I eventually discovered (after a generous application of profanity) that a combination of shortening file names and deleting an unneeded file resulted in an uncorrupted flp file and the build was able to proceed. (Note, I checked to be sure was not exceeding the size of a typical floppy.)
So, I think I'm running into something like "too many arguments" for whatever code rolls up the files into the packer-tmp-created-floppy.flp, or perhaps too many total characters. ?
Reproduction Steps
Run a build with more than this many characters:
ls setup |wc -m
1670
or perhaps this many files:
ls setup |wc -l
69
in your packer-tmp-created-floppy.flp
My build failed because Autounattend.xml happened to be corrupted during the floppy image creation. YMMV.
To prove this to myself, I snagged the temporary .flp file that Packer creates during the build. In my case, the file appears in /tmp. I cracked the file open with Archive Manager (it's some kind of zip) and tried opening files one by one. Several were corrupted, including Autounattend.xml.
Packer version
packer version
Packer v1.6.2
I tried with 1.6.1 and 1.6.0 as well. Same problem.
Simplified Packer Buildfile
In the reproduction steps above I show that I have 69 files in my setup directory (which works, add more to repro the bug). This is what I use setup for (roughly):
This issue was originally opened by @jason-azze as hashicorp/packer#9998. It was migrated here as a result of the Packer plugin split. The original body of the issue is below.
Overview of the Issue
A vsphere-iso build for Windows VMs that used to work began failing after I added a few more provisioning scripts to it. The specific symptom I encountered was that the Windows setup wizard began to complain that it could not find Autounattend.xml (which is the "answer file" for a quiet Windows installation). I eventually determined that the copy of Autounattend.xml on the packer-tmp-created-floppy.flp was corrupt, as were several other files. So Windows was telling the truth when it would hang during what was supposed to be an unattended setup.
I began to suspect that the provisioning scripts that I had added to my build were at fault because that was the only change I had made. I suspected that something in the file names was causing the data stream to be corrupted during floppy creation, or perhaps I had a weird, unprintable unicode character in my script from a bad copy-paste out of Slack! While I played around with this idea, I began shortening the file names of my new scripts. I eventually discovered (after a generous application of profanity) that a combination of shortening file names and deleting an unneeded file resulted in an uncorrupted flp file and the build was able to proceed. (Note, I checked to be sure was not exceeding the size of a typical floppy.)
So, I think I'm running into something like "too many arguments" for whatever code rolls up the files into the packer-tmp-created-floppy.flp, or perhaps too many total characters. ?
Reproduction Steps
Run a build with more than this many characters:
or perhaps this many files:
in your packer-tmp-created-floppy.flp
My build failed because Autounattend.xml happened to be corrupted during the floppy image creation. YMMV.
To prove this to myself, I snagged the temporary .flp file that Packer creates during the build. In my case, the file appears in /tmp. I cracked the file open with Archive Manager (it's some kind of zip) and tried opening files one by one. Several were corrupted, including Autounattend.xml.
Packer version
I tried with 1.6.1 and 1.6.0 as well. Same problem.
Simplified Packer Buildfile
In the reproduction steps above I show that I have 69 files in my setup directory (which works, add more to repro the bug). This is what I use setup for (roughly):
Notice the files called 123 and glorp? That's me shortening descriptive names.
Operating system and Environment details
Log Fragments and crash.log files
PACKER_LOG=1
gives lots of nice detail, but there's no error logged when the floppy is created.