Open bacongravy opened 8 years ago
I wonder if this issue might have occurred because the VM is set to only use 2 GB of memory. I noticed that the boxcutter osx VM template recently bumped their memory configuration for El Capitan to 4 GB of memory, perhaps that would help here, too.
Would you be open to a pull request that makes the memory
and cpus
values into variables?
If you do find bumping the RAM solves this problem reliably, it may be worth doing. We did find that upping VRAM allowed us to go past 2048 MB on VirtualBox; until that time, it wasn't possible to (see https://github.com/timsutton/osx-vm-templates/issues/39.)
I'm seeing a similar error with both vmware and virtualbox
==> virtualbox-iso: Provisioning with shell script: ../scripts/system-update.sh
virtualbox-iso: Downloading and installing system updates...
virtualbox-iso: Dec 22 13:09:41 softwareupdate CLI[438] <Error>: /usr/sbin/softwareupdate: Service connection interrupted!
virtualbox-iso: Dec 22 13:09:41 softwareupdate CLI[438] <Error>: /usr/sbin/softwareupdate: XPC error in __45-[SUCommandLineTool _refreshAvailableUpdates]_block_invoke (Error Domain=NSCocoaErrorDomain Code=4097 "connection to service named com.apple.softwareupdated" UserInfo={NSDebugDescription=connection to service named com.apple.softwareupdated})
virtualbox-iso: Software Update Tool
virtualbox-iso: Copyright 2002-2015 Apple Inc.
virtualbox-iso:
virtualbox-iso: Finding available software
==> virtualbox-iso: Provisioning with shell script: ../scripts/shrink.sh
I found that adding a sleep 60
to the beginning of the script seemed to resolve this kind of unreliability with the softwareupdate
tool for me. My suspicion is that sshd
begins accepting connections before the OS is fully booted, and that the softwareupdate
tool hangs or returns an error if some service it depends on hasn't been fully started yet. I spent some time trying to find something to block on (e.g. waiting for a specific process to be running) that would indicate when the system was really ready to be provisioned, but came up short. I also tried shorter sleep durations, but 60 seconds was the shortest duration I could find that seemed 100% reliable.
@bacongravy thanks. I didn't have success with 60 but did with 120. I'd advise using packer with -var provisioning_delay=120
based on my experience
The
xcode-cli-tools.sh
script failed with the following output:I've only seen this happen once.
I'm using OSX_InstallESD_10.11.3_15D21.dmg, packer 0.9.0, and VMware 8.1.0 with the vmnet-natd patch.