timsutton/osx-vm-templates

Packer fails with `Error waiting for SSH`

dotherightthing opened this issue · 12 comments

I've been following the steps in the README but I'm getting a failure every time. Am I missing something obvious?

packer dan$ packer build -var iso_checksum=cf12ad81e6aa219a49b15d389cb81185 -var iso_url=../out/OSX_InstallESD_10.9.5_13F34.dmg -only vmware-iso -var autologin=true template.json
vmware-iso output will be in this color.

==> vmware-iso: Downloading or copying ISO
    vmware-iso: Downloading or copying: file:///PATH/TO/osx-vm-templates/out/OSX_InstallESD_10.9.5_13F34.dmg
==> vmware-iso: Creating virtual machine disk
==> vmware-iso: Building and writing VMX file
==> vmware-iso: Starting virtual machine...
==> vmware-iso: Waiting 2s for boot...
==> vmware-iso: Connecting to VM via VNC
==> vmware-iso: Typing the boot command over VNC...
==> vmware-iso: Waiting for SSH to become available...
vagrant==> vmware-iso: Error waiting for SSH: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none keyboard-interactive], no supported methods remain
==> vmware-iso: Stopping virtual machine...
==> vmware-iso: Deleting output directory...
Build 'vmware-iso' errored: Build was halted.

==> Some builds didn't complete successfully and had errors:
--> vmware-iso: Build was halted.

==> Builds finished but no artifacts were created.
Dans-MacBook-Pro:packer dan$ vagrant
  • I'm using this with VMware Fusion 7 Pro trial, I also tried with VMware Fusion 7 trial
  • I limited the install to vmware-iso as I was getting (red) errors when the installer tried to use the virtualbox-iso, despite VirtualBox being installed
  • I set autologin to true to try and force login of the vagrant user, as Packer was failing to login after the OS X install was complete, but it still failed
  • I tried manually entering vagrant for username and password after the OS X install was complete, but those credentials weren't accepted
  • I also tried earlier in the day with Mountain Lion installer, but that failed with VNC errors. I may log that separately but Mavericks is the OS I'm interested in, I just needed to download it first

Thanks

Could you also paste your terminal output from running the prepare_iso.sh script? We might be able to see if there were any errors there.

@timsutton Here it is, are the spaces in the file path causing issues? It's unclear to me whether these affect the script or not as it keeps running in spite of the warnings.

Dans-MacBook-Pro:osx-vm-templates dan$ sudo prepare_iso/prepare_iso.sh "/Volumes/VRMiniBackup/Backups/Software & Hardware/Operating Systems/OS X 10.9 Mavericks/Install OS X Mavericks.app" out
Password:
prepare_iso/prepare_iso.sh: line 119: cd: /Volumes/VRMiniBackup/Backups/Software: No such file or directory
-- Attaching input OS X installer image with shadow file..
expected   CRC32 $B65198C1
/dev/disk3              Apple_partition_scheme          
/dev/disk3s1            Apple_partition_map             
/dev/disk3s2            Apple_HFS                       /private/tmp/veewee-osx-esd.OIEV
-- Mounting BaseSystem..
Checksumming Driver Descriptor Map (DDM : 0)…
     Driver Descriptor Map (DDM : 0): verified   CRC32 $C156524D
Checksumming  (Apple_Free : 1)…
                    (Apple_Free : 1): verified   CRC32 $00000000
Checksumming Apple (Apple_partition_map : 2)…
     Apple (Apple_partition_map : 2): verified   CRC32 $91289632
Checksumming disk image (Apple_HFS : 3)…
................................................................................................
          disk image (Apple_HFS : 3): verified   CRC32 $B1441639
Checksumming  (Apple_Free : 4)…
                    (Apple_Free : 4): verified   CRC32 $00000000
verified   CRC32 $FDDE11E4
/dev/disk4              Apple_partition_scheme          
/dev/disk4s1            Apple_partition_map             
/dev/disk4s2            Apple_HFS                       /private/tmp/veewee-osx-basesystem.ZV4f
-- OS X version detected: 10.9.5, build 13F34
-- Making firstboot installer pkg..
cat: /Volumes/VRMiniBackup/Backups/Software: No such file or directory
cat: &: No such file or directory
cat: Hardware/Vagrant/Packer/OS: No such file or directory
cat: X: No such file or directory
cat: templates: No such file or directory
cat: for: No such file or directory
cat: Packer: Is a directory
cat: and: No such file or directory
cat: VeeWee/osx-vm-templates/prepare_iso/support/user.plist: No such file or directory
prepare_iso/prepare_iso.sh: line 196: /Volumes/VRMiniBackup/Backups/Software: No such file or directory
productbuild: Wrote product to /Volumes/VRMiniBackup/Backups/Software & Hardware/Vagrant/Packer/OS X templates for Packer and VeeWee/osx-vm-templates/prepare_iso/support/tmp/veewee-config.pkg
"disk4" unmounted.
"disk4" ejected.
-- Converting BaseSystem.dmg to a read-write DMG located at /tmp/veewee-osx-basesystem-rw.Kw81.dmg..
Reading Driver Descriptor Map (DDM : 0)…
Reading  (Apple_Free : 1)…
Reading Apple (Apple_partition_map : 2)…
Reading disk image (Apple_HFS : 3)…
.............................................................................................
Reading  (Apple_Free : 4)…
Elapsed Time:  1m 15.877s
Speed: 16.1Mbytes/sec
Savings: 0.0%
created: /tmp/veewee-osx-basesystem-rw.Kw81.dmg
-- Growing new BaseSystem..
-- Mounting new BaseSystem..
/dev/disk4              Apple_partition_scheme          
/dev/disk4s1            Apple_partition_map             
/dev/disk4s2            Apple_HFS                       /private/tmp/veewee-osx-basesystem.ZV4f
-- Moving 'Packages' directory from the ESD to BaseSystem..
/tmp/veewee-osx-esd.OIEV/Packages -> /tmp/veewee-osx-basesystem.ZV4f/System/Installation/Packages
/tmp/veewee-osx-esd.OIEV/Packages/AdditionalEssentials.pkg -> /tmp/veewee-osx-basesystem.ZV4f/System/Installation/Packages/AdditionalEssentials.pkg
/tmp/veewee-osx-esd.OIEV/Packages/AdditionalSpeechVoices.pkg -> /tmp/veewee-osx-basesystem.ZV4f/System/Installation/Packages/AdditionalSpeechVoices.pkg
/tmp/veewee-osx-esd.OIEV/Packages/AsianLanguagesSupport.pkg -> /tmp/veewee-osx-basesystem.ZV4f/System/Installation/Packages/AsianLanguagesSupport.pkg
/tmp/veewee-osx-esd.OIEV/Packages/BaseSystemBinaries.pkg -> /tmp/veewee-osx-basesystem.ZV4f/System/Installation/Packages/BaseSystemBinaries.pkg
/tmp/veewee-osx-esd.OIEV/Packages/BaseSystemResources.pkg -> /tmp/veewee-osx-basesystem.ZV4f/System/Installation/Packages/BaseSystemResources.pkg
/tmp/veewee-osx-esd.OIEV/Packages/BSD.pkg -> /tmp/veewee-osx-basesystem.ZV4f/System/Installation/Packages/BSD.pkg
/tmp/veewee-osx-esd.OIEV/Packages/Essentials.pkg -> /tmp/veewee-osx-basesystem.ZV4f/System/Installation/Packages/Essentials.pkg
/tmp/veewee-osx-esd.OIEV/Packages/InstallableMachines.plist -> /tmp/veewee-osx-basesystem.ZV4f/System/Installation/Packages/InstallableMachines.plist
/tmp/veewee-osx-esd.OIEV/Packages/JavaEssentials.pkg -> /tmp/veewee-osx-basesystem.ZV4f/System/Installation/Packages/JavaEssentials.pkg
/tmp/veewee-osx-esd.OIEV/Packages/JavaTools.pkg -> /tmp/veewee-osx-basesystem.ZV4f/System/Installation/Packages/JavaTools.pkg
/tmp/veewee-osx-esd.OIEV/Packages/MediaFiles.pkg -> /tmp/veewee-osx-basesystem.ZV4f/System/Installation/Packages/MediaFiles.pkg
/tmp/veewee-osx-esd.OIEV/Packages/OSInstall.mpkg -> /tmp/veewee-osx-basesystem.ZV4f/System/Installation/Packages/OSInstall.mpkg
/tmp/veewee-osx-esd.OIEV/Packages/OSInstall.pkg -> /tmp/veewee-osx-basesystem.ZV4f/System/Installation/Packages/OSInstall.pkg
/tmp/veewee-osx-esd.OIEV/Packages/OSUpgrade.pkg -> /tmp/veewee-osx-basesystem.ZV4f/System/Installation/Packages/OSUpgrade.pkg
/tmp/veewee-osx-esd.OIEV/Packages/OxfordDictionaries.pkg -> /tmp/veewee-osx-basesystem.ZV4f/System/Installation/Packages/OxfordDictionaries.pkg
/tmp/veewee-osx-esd.OIEV/Packages/X11redirect.pkg -> /tmp/veewee-osx-basesystem.ZV4f/System/Installation/Packages/X11redirect.pkg
-- Copying in original BaseSystem dmg and chunklist..
-- Adding automated components..
-- Unmounting BaseSystem..
"disk4" unmounted.
"disk4" ejected.
-- Unmounting ESD..
"disk3" unmounted.
"disk3" ejected.
-- On Mavericks and later, the entire modified BaseSystem is our output dmg.
Preparing imaging engine…
Reading Driver Descriptor Map (DDM : 0)…
   (CRC32 $6993F249: Driver Descriptor Map (DDM : 0))
Reading  (Apple_Free : 1)…
   (CRC32 $00000000:  (Apple_Free : 1))
Reading Apple (Apple_partition_map : 2)…
   (CRC32 $7DCDE153: Apple (Apple_partition_map : 2))
Reading disk image (Apple_HFS : 3)…
................................................................................................
   (CRC32 $7991E350: disk image (Apple_HFS : 3))
Reading  (Apple_Free : 4)…
.................................................................................................
   (CRC32 $00000000:  (Apple_Free : 4))
Adding resources…
.................................................................................................
Elapsed Time:  1m 26.484s
File size: 5847119995 bytes, Checksum: CRC32 $BD0BB0B1
Sectors processed: 14680140, 12798694 compressed
Speed: 72.3Mbytes/sec
Savings: 22.2%
created: /Volumes/VRMiniBackup/Backups/Software & Hardware/Vagrant/Packer/OS X templates for Packer and VeeWee/osx-vm-templates/out/OSX_InstallESD_10.9.5_13F34.dmg
-- Fixing permissions..
-- Checksumming output image..
-- MD5: cf12ad81e6aa219a49b15d389cb81185
-- Done. Built image is located at out/OSX_InstallESD_10.9.5_13F34.dmg. Add this iso and its checksum to your template.

OK, looks like the file path was the issue. I'd appreciate any advice there, as I had to delete half my computer to get the box generated which was quite inconvenient, I'd rather use a backup drive as that's where the space is.

Here's a log of the entire install, so you can see the Virtualbox errors at the top.

Cheers


template.json:

  "variables": {
        "iso_checksum": "54c12427557cf430829ab77eae890c39",
        "iso_url": "../out/OSX_InstallESD_10.9.5_13F34.dmg",
        "username": "vagrant",
        "password": "vagrant",
        "autologin": true,
        "install_vagrant_keys": true
      }

packer dan$ packer build template.json
parallels-iso output will be in this color.
vmware-iso output will be in this color.
virtualbox-iso output will be in this color.

Build 'parallels-iso' errored: Failed creating Parallels driver: exec: "prlctl": executable file not found in $PATH
==> virtualbox-iso: Downloading or copying ISO
    virtualbox-iso: Downloading or copying: file:///Users/dan/Development_Local/osx-vm-templates/out/OSX_InstallESD_10.9.5_13F34.dmg
==> vmware-iso: Downloading or copying ISO
    vmware-iso: Downloading or copying: file:///Users/dan/Development_Local/osx-vm-templates/out/OSX_InstallESD_10.9.5_13F34.dmg
==> virtualbox-iso: Creating virtual machine...
==> virtualbox-iso: Error creating VM: VBoxManage error: VBoxManage: error: Guest OS type 'MacOS109_64' is invalid
==> virtualbox-iso: VBoxManage: error: Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component VirtualBox, interface IVirtualBox, callee nsISupports
==> virtualbox-iso: VBoxManage: error: Context: "CreateMachine(bstrSettingsFile.raw(), bstrName.raw(), ComSafeArrayAsInParam(groups), bstrOsTypeId.raw(), createFlags.raw(), machine.asOutParam())" at line 263 of file VBoxManageMisc.cpp
==> virtualbox-iso: Deleting output directory...
Build 'virtualbox-iso' errored: Error creating VM: VBoxManage error: VBoxManage: error: Guest OS type 'MacOS109_64' is invalid
VBoxManage: error: Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component VirtualBox, interface IVirtualBox, callee nsISupports
VBoxManage: error: Context: "CreateMachine(bstrSettingsFile.raw(), bstrName.raw(), ComSafeArrayAsInParam(groups), bstrOsTypeId.raw(), createFlags.raw(), machine.asOutParam())" at line 263 of file VBoxManageMisc.cpp
==> vmware-iso: Creating virtual machine disk
==> vmware-iso: Building and writing VMX file
==> vmware-iso: Starting virtual machine...
==> vmware-iso: Waiting 2s for boot...
==> vmware-iso: Connecting to VM via VNC
==> vmware-iso: Typing the boot command over VNC...
==> vmware-iso: Waiting for SSH to become available...
==> vmware-iso: Connected to SSH!
==> vmware-iso: Uploading the 'darwin' VMware Tools
==> vmware-iso: Provisioning with shell script: ../scripts/vagrant.sh
    vmware-iso: Installing vagrant keys for vagrant user
    vmware-iso: % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
    vmware-iso: Dload  Upload   Total   Spent    Left  Speed
    vmware-iso: 100   409  100   409    0     0    319      0  0:00:01  0:00:01 --:--:--   319
==> vmware-iso: Provisioning with shell script: ../scripts/vmware.sh
    vmware-iso: /dev/disk2              Apple_partition_scheme
    vmware-iso: /dev/disk2s1            Apple_partition_map
    vmware-iso: /dev/disk2s2            Apple_HFS                       /private/tmp/vmware-tools.6hkd
    vmware-iso: Installing VMware tools..
    vmware-iso: installer: Package name is VMware Tools
    vmware-iso: installer: Installing at base path /
    vmware-iso: installer: The install was successful.
    vmware-iso: installer: The install requires restarting now.
    vmware-iso: "disk2" unmounted.
    vmware-iso: "disk2" ejected.
==> vmware-iso: Provisioning with shell script: ../scripts/parallels.sh
    vmware-iso:
==> vmware-iso: Provisioning with shell script: ../scripts/xcode-cli-tools.sh
    vmware-iso: Software Update Tool
    vmware-iso: Copyright 2002-2012 Apple Inc.
    vmware-iso:
    vmware-iso: Finding available software
    vmware-iso:
    vmware-iso: Downloading Command Line Tools (OS X 10.9)
    vmware-iso: Progress: 1%
    vmware-iso: Progress: 2%
    vmware-iso: Progress: 3%
    vmware-iso: Progress: 4%
    vmware-iso: Progress: 5%
    vmware-iso: Progress: 6%
    vmware-iso: Progress: 7%
    vmware-iso: Progress: 8%
    vmware-iso: Progress: 9%
    vmware-iso: Progress: 10%
    vmware-iso: Progress: 11%
    vmware-iso: Progress: 12%
    vmware-iso: Progress: 13%
    vmware-iso: Progress: 14%
    vmware-iso: Progress: 15%
    vmware-iso: Progress: 16%
    vmware-iso: Progress: 17%
    vmware-iso: Progress: 18%
    vmware-iso: Progress: 19%
    vmware-iso: Progress: 20%
    vmware-iso: Progress: 21%
    vmware-iso: Progress: 22%
    vmware-iso: Progress: 23%
    vmware-iso: Progress: 24%
    vmware-iso: Progress: 25%
    vmware-iso: Progress: 26%
    vmware-iso: Progress: 28%
    vmware-iso: Progress: 29%
    vmware-iso: Progress: 30%
    vmware-iso: Progress: 31%
    vmware-iso: Progress: 32%
    vmware-iso: Progress: 33%
    vmware-iso: Progress: 34%
    vmware-iso: Progress: 35%
    vmware-iso: Progress: 36%
    vmware-iso: Progress: 37%
    vmware-iso: Progress: 38%
    vmware-iso: Progress: 39%
    vmware-iso: Progress: 40%
    vmware-iso: Progress: 41%
    vmware-iso: Progress: 42%
    vmware-iso: Progress: 43%
    vmware-iso: Progress: 44%
    vmware-iso: Progress: 45%
    vmware-iso: Progress: 46%
    vmware-iso: Progress: 47%
    vmware-iso: Progress: 48%
    vmware-iso: Progress: 49%
    vmware-iso: Progress: 50%
    vmware-iso: Downloaded Command Line Tools (OS X 10.9)
    vmware-iso: Installing Command Line Tools (OS X 10.9)
    vmware-iso: Progress: 52%
    vmware-iso: Progress: 53%
    vmware-iso: Progress: 54%
    vmware-iso: Progress: 55%
    vmware-iso: Progress: 57%
    vmware-iso: Progress: 59%
    vmware-iso: Progress: 60%
    vmware-iso: Progress: 61%
    vmware-iso: Progress: 62%
    vmware-iso: Progress: 63%
    vmware-iso: Progress: 64%
    vmware-iso: Progress: 65%
    vmware-iso: Progress: 67%
    vmware-iso: Progress: 91%
    vmware-iso: Progress: 93%
    vmware-iso: Progress: 94%
    vmware-iso: Progress: 97%
    vmware-iso: Done with Command Line Tools (OS X 10.9)
    vmware-iso: Done.
    vmware-iso:
    vmware-iso:
    vmware-iso:
==> vmware-iso: Provisioning with shell script: ../scripts/chef-omnibus.sh
    vmware-iso: % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
    vmware-iso: Dload  Upload   Total   Spent    Left  Speed
    vmware-iso: 100 18285  100 18285    0     0   3382      0  0:00:05  0:00:05 --:--:--  3581
    vmware-iso: Downloading Chef  for mac_os_x...
    vmware-iso: downloading https://www.opscode.com/chef/metadata?v=&prerelease=false&nightlies=false&p=mac_os_x&pv=10.9&m=x86_64
    vmware-iso: to file /tmp/install.sh.312/metadata.txt
    vmware-iso: trying curl...
    vmware-iso: url https://opscode-omnibus-packages.s3.amazonaws.com/mac_os_x/10.7/x86_64/chef-12.0.3-1.dmg
    vmware-iso: md5 f099be3f6ab88f45872e4be6444a114d
    vmware-iso: sha256  5af3cf3da298f1d891b6cdcca24b6d338f365186ee858c2b89ae627c84910034
    vmware-iso: downloaded metadata file looks valid...
    vmware-iso: downloading https://opscode-omnibus-packages.s3.amazonaws.com/mac_os_x/10.7/x86_64/chef-12.0.3-1.dmg
    vmware-iso: to file /tmp/install.sh.312/chef-12.0.3-1.dmg
    vmware-iso: trying curl...
    vmware-iso: Comparing checksum with shasum...
    vmware-iso: Installing Chef
    vmware-iso: installing dmg file...
    vmware-iso: Checksumming Protective Master Boot Record (MBR : 0)…
    vmware-iso: Protective Master Boot Record (MBR :: verified   CRC32 $A63E199D
    vmware-iso: Checksumming GPT Header (Primary GPT Header : 1)…
    vmware-iso: GPT Header (Primary GPT Header : 1): verified   CRC32 $E0550152
    vmware-iso: Checksumming GPT Partition Data (Primary GPT Table : 2)…
    vmware-iso: GPT Partition Data (Primary GPT Tabl: verified   CRC32 $21021DF4
    vmware-iso: Checksumming  (Apple_Free : 3)…
    vmware-iso: (Apple_Free : 3): verified   CRC32 $00000000
    vmware-iso: Checksumming disk image (Apple_HFS : 4)…
    vmware-iso: ......................................
    vmware-iso: disk image (Apple_HFS : 4): verified   CRC32 $DDC460A6
    vmware-iso: Checksumming  (Apple_Free : 5)…
    vmware-iso: (Apple_Free : 5): verified   CRC32 $00000000
    vmware-iso: Checksumming GPT Partition Data (Backup GPT Table : 6)…
    vmware-iso: GPT Partition Data (Backup GPT Table: verified   CRC32 $21021DF4
    vmware-iso: Checksumming GPT Header (Backup GPT Header : 7)…
    vmware-iso: GPT Header (Backup GPT Header : 7): verified   CRC32 $7F985EFC
    vmware-iso: verified   CRC32 $C6ECA05D
    vmware-iso: /dev/disk2              GUID_partition_scheme
    vmware-iso: /dev/disk2s1            Apple_HFS                       /Volumes/chef_software
    vmware-iso: installer: Package name is Chef Client
    vmware-iso: installer: Installing at base path /
    vmware-iso: installer: The install was successful.
    vmware-iso: "disk2" unmounted.
    vmware-iso: "disk2" ejected.
    vmware-iso:
==> vmware-iso: Provisioning with shell script: ../scripts/puppet.sh
    vmware-iso: Cloning into '/tmp/autopkg-I5BT'...
    vmware-iso: remote: Counting objects: 3904, done.
    vmware-iso: remote: Total 3904 (delta 0), reused 0 (delta 0)
    vmware-iso: Receiving objects: 100% (3904/3904), 1013.39 KiB | 116.00 KiB/s, done.
    vmware-iso: Resolving deltas: 100% (2408/2408), done.
    vmware-iso: Checking connectivity... done.
    vmware-iso: Attempting git clone...
    vmware-iso:
    vmware-iso: Adding /Users/vagrant/Library/AutoPkg/RecipeRepos/com.github.autopkg.recipes to RECIPE_SEARCH_DIRS...
    vmware-iso: Updated search path:
    vmware-iso: '.'
    vmware-iso: '~/Library/AutoPkg/Recipes'
    vmware-iso: '/Library/AutoPkg/Recipes'
    vmware-iso: '/Users/vagrant/Library/AutoPkg/RecipeRepos/com.github.autopkg.recipes'
    vmware-iso: Installing: Puppet
    vmware-iso: -- Mounting DMG...
    vmware-iso: Checksumming Protective Master Boot Record (MBR : 0)…
    vmware-iso: Protective Master Boot Record (MBR :: verified   CRC32 $88A75E04
    vmware-iso: Checksumming GPT Header (Primary GPT Header : 1)…
    vmware-iso: GPT Header (Primary GPT Header : 1): verified   CRC32 $7D5ACA41
    vmware-iso: Checksumming GPT Partition Data (Primary GPT Table : 2)…
    vmware-iso: GPT Partition Data (Primary GPT Tabl: verified   CRC32 $7E172DBF
    vmware-iso: Checksumming  (Apple_Free : 3)…
    vmware-iso: (Apple_Free : 3): verified   CRC32 $00000000
    vmware-iso: Checksumming disk image (Apple_HFS : 4)…
    vmware-iso: ......................................
    vmware-iso: disk image (Apple_HFS : 4): verified   CRC32 $B5ED4CAD
    vmware-iso: Checksumming  (Apple_Free : 5)…
    vmware-iso: (Apple_Free : 5): verified   CRC32 $00000000
    vmware-iso: Checksumming GPT Partition Data (Backup GPT Table : 6)…
    vmware-iso: GPT Partition Data (Backup GPT Table: verified   CRC32 $7E172DBF
    vmware-iso: Checksumming GPT Header (Backup GPT Header : 7)…
    vmware-iso: GPT Header (Backup GPT Header : 7): verified   CRC32 $924754A8
    vmware-iso: verified   CRC32 $EA16F54F
    vmware-iso: /dev/disk2              GUID_partition_scheme
    vmware-iso: /dev/disk2s1            Apple_HFS                       /private/tmp/puppet-dmg.e96e
    vmware-iso: -- Installing pkg...
    vmware-iso: installer: Package name is puppet-3.7.4
    vmware-iso: installer: Installing at base path /
    vmware-iso: installer: The install was successful.
    vmware-iso: -- Unmounting and ejecting DMG...
    vmware-iso: "disk2" unmounted.
    vmware-iso: "disk2" ejected.
    vmware-iso: Installing: Facter
    vmware-iso: -- Mounting DMG...
    vmware-iso: Checksumming Protective Master Boot Record (MBR : 0)…
    vmware-iso: Protective Master Boot Record (MBR :: verified   CRC32 $A5182E0F
    vmware-iso: Checksumming GPT Header (Primary GPT Header : 1)…
    vmware-iso: GPT Header (Primary GPT Header : 1): verified   CRC32 $DFE3F032
    vmware-iso: Checksumming GPT Partition Data (Primary GPT Table : 2)…
    vmware-iso: GPT Partition Data (Primary GPT Tabl: verified   CRC32 $CB74ECF5
    vmware-iso: Checksumming  (Apple_Free : 3)…
    vmware-iso: (Apple_Free : 3): verified   CRC32 $00000000
    vmware-iso: Checksumming disk image (Apple_HFS : 4)…
    vmware-iso: ......................................
    vmware-iso: disk image (Apple_HFS : 4): verified   CRC32 $A61D236C
    vmware-iso: Checksumming  (Apple_Free : 5)…
    vmware-iso: (Apple_Free : 5): verified   CRC32 $00000000
    vmware-iso: Checksumming GPT Partition Data (Backup GPT Table : 6)…
    vmware-iso: GPT Partition Data (Backup GPT Table: verified   CRC32 $CB74ECF5
    vmware-iso: Checksumming GPT Header (Backup GPT Header : 7)…
    vmware-iso: GPT Header (Backup GPT Header : 7): verified   CRC32 $8EF22070
    vmware-iso: verified   CRC32 $3C1A7A20
    vmware-iso: /dev/disk2              GUID_partition_scheme
    vmware-iso: /dev/disk2s1            Apple_HFS                       /private/tmp/puppet-dmg.1zEa
    vmware-iso: -- Installing pkg...
    vmware-iso: installer: Package name is facter-2.4.0
    vmware-iso: installer: Installing at base path /
    vmware-iso: installer: The install was successful.
    vmware-iso: -- Unmounting and ejecting DMG...
    vmware-iso: "disk2" unmounted.
    vmware-iso: "disk2" ejected.
    vmware-iso: Installing: Hiera
    vmware-iso: -- Mounting DMG...
    vmware-iso: Checksumming Driver Descriptor Map (DDM : 0)…
    vmware-iso: Driver Descriptor Map (DDM : 0): verified   CRC32 $DC63FF18
    vmware-iso: Checksumming Apple (Apple_partition_map : 1)…
    vmware-iso: Apple (Apple_partition_map : 1): verified   CRC32 $93282707
    vmware-iso: Checksumming disk image (Apple_HFS : 2)…
    vmware-iso: ......................................
    vmware-iso: disk image (Apple_HFS : 2): verified   CRC32 $4991B1D9
    vmware-iso: Checksumming  (Apple_Free : 3)…
    vmware-iso: (Apple_Free : 3): verified   CRC32 $00000000
    vmware-iso: verified   CRC32 $99123DD9
    vmware-iso: /dev/disk2              Apple_partition_scheme
    vmware-iso: /dev/disk2s1            Apple_partition_map
    vmware-iso: /dev/disk2s2            Apple_HFS                       /private/tmp/puppet-dmg.zffw
    vmware-iso: -- Installing pkg...
    vmware-iso: installer: Package name is hiera-1.3.4
    vmware-iso: installer: Installing at base path /
    vmware-iso: installer: The install was successful.
    vmware-iso: -- Unmounting and ejecting DMG...
    vmware-iso: "disk2" unmounted.
    vmware-iso: "disk2" ejected.
==> vmware-iso: Provisioning with shell script: ../scripts/add-network-interface-detection.sh
==> vmware-iso: Uploading ../scripts/support/set_kcpassword.py => /private/tmp/set_kcpassword.py
==> vmware-iso: Provisioning with shell script: /var/folders/3h/kclb6kc919g6xp8z0bbwrh3h0000gp/T/packer-shell702962194
    vmware-iso: Enabling automatic GUI login for the 'vagrant' user..
==> vmware-iso: Gracefully halting virtual machine...
    vmware-iso: Waiting for VMware to clean up after itself...
==> vmware-iso: Deleting unnecessary VMware files...
    vmware-iso: Deleting: output-vmware-iso/packer-vmware-iso.plist
    vmware-iso: Deleting: output-vmware-iso/packer-vmware-iso.vmx.lck/M09263.lck
    vmware-iso: Deleting: output-vmware-iso/vmware.log
==> vmware-iso: Cleaning VMX prior to finishing up...
    vmware-iso: Unmounting floppy from VMX...
    vmware-iso: Detaching ISO from CD-ROM device...
==> vmware-iso: Running post-processor: vagrant
==> vmware-iso (vagrant): Creating Vagrant box for 'vmware' provider
    vmware-iso (vagrant): Copying: output-vmware-iso/disk-s001.vmdk
    vmware-iso (vagrant): Copying: output-vmware-iso/disk-s002.vmdk
    vmware-iso (vagrant): Copying: output-vmware-iso/disk-s003.vmdk
    vmware-iso (vagrant): Copying: output-vmware-iso/disk-s004.vmdk
    vmware-iso (vagrant): Copying: output-vmware-iso/disk-s005.vmdk
    vmware-iso (vagrant): Copying: output-vmware-iso/disk-s006.vmdk
    vmware-iso (vagrant): Copying: output-vmware-iso/disk.vmdk
    vmware-iso (vagrant): Copying: output-vmware-iso/packer-vmware-iso.nvram
    vmware-iso (vagrant): Copying: output-vmware-iso/packer-vmware-iso.vmsd
    vmware-iso (vagrant): Copying: output-vmware-iso/packer-vmware-iso.vmx
    vmware-iso (vagrant): Copying: output-vmware-iso/packer-vmware-iso.vmxf
    vmware-iso (vagrant): Compressing: Vagrantfile
    vmware-iso (vagrant): Compressing: disk-s001.vmdk
    vmware-iso (vagrant): Compressing: disk-s002.vmdk
    vmware-iso (vagrant): Compressing: disk-s003.vmdk
    vmware-iso (vagrant): Compressing: disk-s004.vmdk
    vmware-iso (vagrant): Compressing: disk-s005.vmdk
    vmware-iso (vagrant): Compressing: disk-s006.vmdk
    vmware-iso (vagrant): Compressing: disk.vmdk
    vmware-iso (vagrant): Compressing: metadata.json
    vmware-iso (vagrant): Compressing: packer-vmware-iso.nvram
    vmware-iso (vagrant): Compressing: packer-vmware-iso.vmsd
    vmware-iso (vagrant): Compressing: packer-vmware-iso.vmx
    vmware-iso (vagrant): Compressing: packer-vmware-iso.vmxf
Build 'vmware-iso' finished.

==> Some builds didn't complete successfully and had errors:
--> parallels-iso: Failed creating Parallels driver: exec: "prlctl": executable file not found in $PATH
--> virtualbox-iso: Error creating VM: VBoxManage error: VBoxManage: error: Guest OS type 'MacOS109_64' is invalid
VBoxManage: error: Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component VirtualBox, interface IVirtualBox, callee nsISupports
VBoxManage: error: Context: "CreateMachine(bstrSettingsFile.raw(), bstrName.raw(), ComSafeArrayAsInParam(groups), bstrOsTypeId.raw(), createFlags.raw(), machine.asOutParam())" at line 263 of file VBoxManageMisc.cpp

==> Builds finished. The artifacts of successful builds are:
--> vmware-iso: 'vmware' provider box: packer_vmware-iso_vmware.box
Dans-MacBook-Pro:packer dan$ 

You're right, there are some issues caused by the spaces (possibly both in your ESD path and the path from which you're running the script). I've hopefully addressed these in f4d5cbd.. can you pull and try again?

As for the VBox error, it looks like it doesn't know about the Guest OS type of MacOS109_64.

Since VBox builds worked for me up until very recently (maybe not the most recent version but whatever was most current a month or so ago), can you tell me what version of VirtualBox you're running?

So far I've managed to keep a single generic template that works well enough across different versions of OS X guests and Packer builders types, but it might be necessary to do some tweaking to get the right settings. Still, the default Guest OS type for a Vbox builder should work, so if it's not, let's open another issue and fix it.

Cheers, I'm at work now but I'll give it another go tonight (in 7-8 hours).

On Monday, February 2, 2015, Timothy Sutton notifications@github.com
wrote:

You're right, there are some issues caused by the spaces (possibly both in
your ESD path and the path from which you're running the script). I've
hopefully addressed these in f4d5cbd
f4d5cbd..
can you pull and try again?


Reply to this email directly or view it on GitHub
#27 (comment)
.

can you tell me what version of VirtualBox you're running?

I'm running 4.2.12 r84980 on OS X 10.9.5.

Still, the default Guest OS type for a Vbox builder should work

How do I test this? Should I replace "guest_os_type": "MacOS109_64" with "guest_os_type": "default"?

I didn't mean literally default. What happens if you try a more recent release? 4.2.12 is getting close to two years old, and predates when Vbox support was added to these templates.

Ah sorry, the 'Check for Updates' function within VirtualBox said that I was up to date so I assumed that 4.2.12 was the latest version.

Also, the updated Packer prepare_iso.sh is now successfully generating a .box file from my external drive, though the OS X install failed the first time and required a restart within the Virtual Machine. There's also a size difference for some reason:

  • When I ran the old prepare_iso.sh + Packer from my laptop drive, the generated packer_vmware-iso_vmware.box was 6,265,493,182 bytes.
  • When I ran the updated prepare_iso.sh + Packer from my external drive, the generated packer_vmware-iso_vmware.box was only 6,250,250,602 bytes.

I've installed the latest version of VirtualBox (4.3.20 r96996) and will try it again and let you know what happens. Cheers.

I wouldn't worry about the small difference in file size, it will never be exactly the same, and it could be the result of differences in system-cached files, etc.

Can you describe the install failure? If it happens again, you can also get an install log from the menubar and screenshot it.

I've retested the Packer script with VMware and packer_vmware-iso_vmware.box is now being generated with no errors. The old error was one from OS X saying that that there was a problem with the install. I wonder if usage of some other apps, while Packer was running, might have been the issue, perhaps the focus moved on to the VMware window at some point and interrupted the automatic install process?

I've also rested the Packer script with my updated version of VirtualBox, and successfully generated packer_virtualbox-iso_virtualbox.box with no errors.

I haven't had a chance to use the new boxes with Vagrant yet, but your script seems to be working as it should.

Thanks for your help ironing out my issues.

Hard to say, but while I've had issues in the past with the guest install process, it was usually related to some resources not being copied in by prepare_iso.sh, and so pieces needed to complete the install weren't there, and thus a failure. Maybe it was just aftermath of your testing and the broken state of the script initially.

Glad it works for you, and that you were able to point out a pretty major issue with the script in the process 🎉