GithubHelp home page GithubHelp logo

timsutton / osx-vm-templates Goto Github PK

View Code? Open in Web Editor NEW
1.1K 73.0 248.0 300 KB

macOS templates for Packer and VeeWee.

License: MIT License

Shell 73.73% PHP 3.22% Python 18.90% HTML 1.93% Ruby 2.21%
virtualization packer vmware virtualbox macos vagrant parallels

osx-vm-templates's Introduction

OS X templates for Packer and VeeWee

This is a set of Packer templates and support scripts that will prepare an OS X installer media that performs an unattended install for use with Packer and VeeWee. These were originally developed for VeeWee, but support for the VeeWee template has not been maintained since Packer's release and so it is only provided for historical purposes. I plan on removing VeeWee support from this repo soon, but VeeWee can still make use of the preparation script and the OS X template remains in the core VeeWee repo.

The machine built by this Packer template defaults to being configured for use with Vagrant, and supports three Vagrant providers by using Packer's respective builders:

It's possible to build a machine with different admin account settings, and without the vagrant ssh keys, for use with other systems, e.g. continuous integration.

Use with the Fusion provider requires Vagrant 1.3.0, and use with the VirtualBox provider Vagrant 1.6.3 if using the Rsync file sync mechanism. Note that the VeeWee template also does not have any VirtualBox or Parallels support.

Provisioning steps that are defined in the template via items in the scripts directory:

Supported guest OS versions

Currently this prepare script and template supports all versions of OS X that are distributed through the App Store: OS X Lion (10.7) through El Capitan (10.11), and macOS Sierra (10.12).

This project currently only supplies a single Packer template (template.json), so the hypervisor's configured guest OS version (i.e. darwin12-64) does not accurately reflect the actual installed OS. I haven't found there to be any functional differences depending on these configured guest versions.

To build a VMware box of an OS version less than El Capitan (10.11), note that as of VMare Fusion 8.5.4, you will need to change the tools_upload_flavor from darwin to darwinPre15.

Issue with 10.12.4

Important note: The Sierra 10.12.4 installer seems to no longer support including custom packages as part of the installer, unless they are signed by Apple. This produces an error with the text, "macOS could not be installed on your computer.. The package veewee-config.pkg is not signed."

The prepare_iso.sh script in this repo makes use of functionality Apple supports as part of a NetInstall workflow, but because of this (undocumented) additional requirement of additional packages needing to be signed by Apple as of 10.12.4, these tools can't currently install the necessary configuration for Packer to log in to perform additional configuration, installing guest tools, etc. The rest of the OS install still completes successfully.

It may be possible to work around this by modifying the rc script directly with the contents of our postinstall script.

The prepare_vdi.sh script uses AutoDMG's approach running the installer's OSInstall.pkg creating a fresh install in a temporary DMG sparse disk image which is converted into a VDI disk image using VirtualBox's command line tools.

Preparing the ISO

OS X's installer cannot be bootstrapped as easily as can Linux or Windows, and so exists the prepare_iso.sh script to perform modifications to it that will allow for an automated install and ultimately allow Packer and later, Vagrant, to have SSH access.

Note: VirtualBox users currently have to disable Remote Management to avoid periodic freezing of the VM by adding -D DISABLE_REMOTE_MANAGEMENT to the prepare_iso.sh options. See Remote Management freezing issue for more information.

Run the prepare_iso.sh script with two arguments: the path to an Install OS X.app or the InstallESD.dmg contained within, and an output directory. Root privileges are required in order to write a new DMG with the correct file ownerships. For example, with a 10.8.4 Mountain Lion installer:

sudo prepare_iso/prepare_iso.sh "/Applications/Install OS X Mountain Lion.app" out

...should output progress information ending in something this:

-- MD5: dc93ded64396574897a5f41d6dd7066c
-- Done. Built image is located at out/OSX_InstallESD_10.8.4_12E55.dmg. Add this iso and its checksum to your template.

prepare_iso.sh accepts command line switches to modify the details of the admin user installed by the script.

  • -u modifies the name of the admin account, defaulting to vagrant
  • -p modifies the password of the same account, defaulting to vagrant
  • -i sets the path of the account's avatar image, defaulting to prepare_iso/support/vagrant.jpg

For example:

sudo prepare_iso/prepare_iso.sh -u admin -p password -i /path/to/image.jpg "/Applications/Install OS X Mountain Lion.app" out

Additionally, flags can be set to disable certain default configuration options.

  • -D DISABLE_REMOTE_MANAGEMENT disables the Remote Management service.
  • -D DISABLE_SCREEN_SHARING disables the Screen Sharing service.

Clone this repository

The prepare_iso.sh script needs the support directory and its content. In other words, the easiest way to run the script is after cloning this repository.

Use with Packer

The path can now be added to your Packer template or provided as user variables. The packer directory contains a template that can be used with the vmware-iso and virtualbox-iso builders. The checksum does not need to be added because the iso_checksum_type has been set to "none". The veewee directory contains a definition, though as mentioned above it is not currently being maintained.

The Packer template adds some additional VM options required for OS X guests. Note that the paths given in the Packer template's iso_url builder key accepts file paths, both absolute and relative (to the current working directory).

Given the above output, we could run then run packer:

cd packer
packer build \
  -var iso_url=../out/OSX_InstallESD_10.8.4_12E55.dmg \
  template.json

You might also use the -only option to restrict to either the vmware-iso or virtualbox-iso builders.

If you modified the name or password of the admin account in the prepare_iso stage, you'll need to pass in the modified details as packer variables. You can also prevent the vagrant SSH keys from being installed for that user.

For example:

packer build \
  -var iso_url=../out/OSX_InstallESD_10.8.4_12E55.dmg \
  -var username=youruser \
  -var password=yourpassword \
  -var install_vagrant_keys=false \
  template.json

Building to a device with more space

Local VM builds take up a lot of space. It's possible to make packer work in different directories.

  • PACKER_CACHE_DIR is an out-of-the-box environment variable that configures where it will cache ISOs etc.
  • PACKER_OUTPUT_DIR: configure where packer will build artifacts (like OVF files) to
  • PACKER_VAGRANT_BOX_DIR: configure where packer will build vagrant boxes via the post-processor to.

Note: don't make PACKER_OUTPUT_DIR and PACKER_VAGRANT_BOX_DIR the same place. keep_input_artifacts in the post-processor defaults to false, and it removes them by removing the directory, not the individual files. So if you use the same place, you'll end up with no output at all (packer v1.0.0).

Automated installs on OS X

OS X's installer supports a kind of bootstrap install functionality similar to Linux and Windows, however it must be invoked using pre-existing files placed on the booted installation media. This approach is roughly equivalent to that used by Apple's System Image Utility for deploying automated OS X installations and image restoration.

The prepare_iso.sh script in this repo takes care of mounting and modifying a vanilla OS X installer downloaded from the Mac App Store. The resulting .dmg file can then be added to the Packer template. Because the preparation is done up front, no boot command sequences, attached devices or web server access is required.

More details as to the modifications to the installer media are provided in the comments of the script.

Automated GUI logins

For some kinds of automated tasks, it may be necessary to have an active GUI login session (for example, test suites requiring a GUI, or Jenkins SSH slaves requiring a window server for their tasks). The Packer templates support enabling this automatically by using the autologin user variable, which can be set to 1 or true, for example:

packer build -var autologin=true template.json

This was easily made possible thanks to Per Olofsson's CreateUserPkg utility, which was used to help create the box's vagrant user in the prepare_iso script, and which also supports generating the magic kcpassword file with a particular hash format to set up the auto-login.

Configuration management

By default, the packer template does not install the Chef or Puppet configuration management tools. You can enable the installation of configuration management by setting the chef_version, puppet_agent_version, puppet_version, facter_version, and hiera_version variables to latest, or to a specific version.

To install the latest version of Chef:

packer build -var chef_version=latest template.json

To install the last version of Puppet Agent:

packer build -var pupet_agent_version=latest template.json

To install the last versions of the deprecated standalone Puppet, Facter and Hiera packages:

packer build -var puppet_version=latest facter_version=latest hiera_version=latest template.json

Xcode Command Line Tools

The Xcode CLI tools are installed by the packer template by default. To disable the installation, set the install_xcode_cli_tools variable to false:

packer build -var install_xcode_cli_tools=false template.json

System updates

Packer will instruct the system to download and install all available OS X updates, if you want to disable this default behaviour, use update_system variable:

packer build -var update_system=0 template.json

Provisioning delay

In some cases, it may be helpful to insert a delay into the beginning of the provisioning process. Adding a delay of about 30 seconds may help subsequent provisioning steps that install software from the internet complete successfully. By default, the delay is set to 0, but you can change the delay by setting the provisioning_delay variable:

packer build -var provisioning_delay=30 template.json`

VirtualBox support

VirtualBox support is thanks entirely to contributions by Matt Behrens (@zigg) to this repo, Vagrant and Packer.

Caveats

Remote Management freezing issue

The default prepare_iso.sh configuration enables Remote Management during installation, which causes the resulting virtual machine to periodically freeze. You can avoid enabling Remote Management when using prepare_iso.sh by passing -D DISABLE_REMOTE_MANAGEMENT this:

sudo ./prepare_iso/prepare_iso.sh -D DISABLE_REMOTE_MANAGEMENT "/Applications/Install OS X El Capitan.app" out

Shared folders

Oracle's support for OS X in VirtualBox is very limited, including the lack of guest tools to provide a shared folder mechanism. If using the VirtualBox provider in Vagrant, you will need to configure the shared folder that's set up by default (current folder mapped to /vagrant) to use either the rsync or nfs synced folder mechanisms. You can do this like any other synced folder config in your Vagrantfile:

Vagrant.configure("2") do |config|
  config.vm.provider "virtualbox" do |vb|
    config.vm.synced_folder ".", "/vagrant", type: "rsync"
  end
end

Alternative method using prepare_vdi.sh, prepare_ovf.sh and packer virtualbox-ovf

This approach requires VirtualBox and unfortunately almost 30GB of free space.

Installing and exporting to a VirtualBox virtual disk image.

The prepare_vdi.sh command will run the installer's OSInstall.pkg creating a fresh install in a temporary disk image which is converted into a VDI disk image.

cd packer
sudo ../prepare_iso/prepare_vdi.sh \
  -D DISABLE_REMOTE_MANAGEMENT \
  -o macOS_10.12.vdi \
   /Applications/Install\ macOS\ Sierra.app/ \
  .

Generating a VirtualBox machine and exporting it into packed virtual machine OVF

The prepare_ovf.sh command takes a virtual image disk and adds it into a temporary VirtualBox machine which is exported into a packed virtual machine using the OVF (Open Virtualization Format).

../prepare_iso/prepare_ovf.sh \
  macOS_10.12.vdi

Generating a packer box using the virtualbox-ovf builder

Finally the virtualbox-ovf allows to use the previously generated exported virtual machine to generate the provisioned packer box.

packer build \
  -var provisioning_delay=30 \
  -var source_path=macOS_10.12.ovf \
  template.json

Box sizes

A built box with CLI tools, Puppet and Chef is over 5GB in size. It might be advisable to remove (with care) some unwanted applications in an additional postinstall script. It should also be possible to modify the OS X installer package to install fewer components, but this is non-trivial. One can also supply a custom "choice changes XML" file to modify the installer choices in a supported way, but from my testing, this only allows removing several auxiliary packages that make up no more than 6-8% of the installed footprint (for example, multilingual voices and dictionary files).

Alternate approaches to VM provisioning

Joe Chilcote has written a tool, vfuse, which converts a never-booted OS X image (such as created with a tool like AutoDMG) into a VMDK and configures a VMware Fusion VM. vfuse can also configure a Packer template alongside the VM, configured with the vmware-vmx builder.

osx-vm-templates's People

Contributors

abradner avatar amosshapira avatar bacongravy avatar bradfeehan avatar dazwin avatar gotcha avatar grahamgilbert avatar jonanh avatar lstoll avatar mattieb avatar radeksimko avatar rjocoleman avatar rodm avatar timsutton avatar tomtaylor avatar upekkha avatar zchee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

osx-vm-templates's Issues

vagrant with virtual box keeps logging out

Not sure I see what the error is yet, but getting regular logout of the vagrant user at the GUI. The timing seems random. Are there specific display settings that need to be set beyond the 128MB?

Currently using VirtualBox 5.1.10, but was happening with 5.0.28 also.

Nov 29 07:56:10 mac-os-el-capitan loginwindow[688]: ERROR | -[LoginApp windowServerExited] | Window Server exited, closing down the session immediately
Nov 29 07:56:10 mac-os-el-capitan SystemUIServer[730]: HIToolbox: received notification of WindowServer event port death.
Nov 29 07:56:10 mac-os-el-capitan SystemUIServer[730]: port matched the WindowServer port created in BindCGSToRunLoop
Nov 29 07:56:10 mac-os-el-capitan diagnosticd[120]: error evaluating process info - pid: 694, puniqueid: 694
Nov 29 07:56:10 mac-os-el-capitan com.apple.xpc.launchd[1] (com.apple.WindowServer[694]): Service exited due to signal: Illegal instruction: 4
Nov 29 07:56:10 mac-os-el-capitan sessionlogoutd[853]: sessionlogoutd Launched
Nov 29 07:56:10 mac-os-el-capitan com.apple.xpc.launchd[1] (com.apple.ReportCrash.Root[854]): Endpoint has been activated through legacy launch(3) APIs. Please switch to XPC or bootstrap_check_in(): com.apple.ReportCrash.DirectoryService
Nov 29 07:56:10 mac-os-el-capitan loginwindow[688]: HIToolbox: received notification of WindowServer event port death.
Nov 29 07:56:10 mac-os-el-capitan loginwindow[688]: port matched the WindowServer port created in BindCGSToRunLoop
Nov 29 07:56:10 mac-os-el-capitan sessionlogoutd[853]: CGSLookupServerRootPort: Failed to look up the port for "com.apple.windowserver.active" (1102)
Nov 29 07:56:10 mac-os-el-capitan sessionlogoutd[853]: DEAD_PROCESS: 688 console
Nov 29 07:56:10 mac-os-el-capitan sessionlogoutd[853]: CGSLookupServerRootPort: Failed to look up the port for "com.apple.windowserver.active" (1102)
Nov 29 07:56:10 mac-os-el-capitan sessionlogoutd[853]: numberOfConsoleUsers:216: ERROR: CGSCopySessionList returned NULL.
Nov 29 07:56:10 mac-os-el-capitan Dock[728]: HIToolbox: received notification of WindowServer event port death.
Nov 29 07:56:10 mac-os-el-capitan Dock[728]: port matched the WindowServer port created in BindCGSToRunLoop
Nov 29 07:56:10 mac-os-el-capitan com.apple.dock.extra[743]: HIToolbox: received notification of WindowServer event port death.
Nov 29 07:56:10 mac-os-el-capitan com.apple.dock.extra[743]: port matched the WindowServer port created in BindCGSToRunLoop
Nov 29 07:56:10 mac-os-el-capitan CoreServicesUIAgent[747]: HIToolbox: received notification of WindowServer event port death.
Nov 29 07:56:10 mac-os-el-capitan CoreServicesUIAgent[747]: port matched the WindowServer port created in BindCGSToRunLoop
Nov 29 07:56:10 mac-os-el-capitan cloudphotosd[765]: HIToolbox: received notification of WindowServer event port death.
Nov 29 07:56:10 mac-os-el-capitan cloudphotosd[765]: port matched the WindowServer port created in BindCGSToRunLoop
Nov 29 07:56:10 mac-os-el-capitan Terminal[727]: HIToolbox: received notification of WindowServer event port death.
Nov 29 07:56:10 mac-os-el-capitan AirPlayUIAgent[795]: HIToolbox: received notification of WindowServer event port death.
Nov 29 07:56:10 mac-os-el-capitan AirPlayUIAgent[795]: port matched the WindowServer port created in BindCGSToRunLoop
Nov 29 07:56:10 mac-os-el-capitan Terminal[727]: port matched the WindowServer port created in BindCGSToRunLoop
Nov 29 07:56:10 mac-os-el-capitan Finder[731]: HIToolbox: received notification of WindowServer event port death.
Nov 29 07:56:10 mac-os-el-capitan Spotlight[744]: HIToolbox: received notification of WindowServer event port death.
Nov 29 07:56:10 mac-os-el-capitan Finder[731]: port matched the WindowServer port created in BindCGSToRunLoop
Nov 29 07:56:10 mac-os-el-capitan Spotlight[744]: port matched the WindowServer port created in BindCGSToRunLoop
Nov 29 07:56:10 mac-os-el-capitan FolderActionsDispatcher[781]: HIToolbox: received notification of WindowServer event port death.
Nov 29 07:56:10 mac-os-el-capitan FolderActionsDispatcher[781]: port matched the WindowServer port created in BindCGSToRunLoop
Nov 29 07:56:10 mac-os-el-capitan Keychain Circle Notification[786]: HIToolbox: received notification of WindowServer event port death.
Nov 29 07:56:10 mac-os-el-capitan Keychain Circle Notification[786]: port matched the WindowServer port created in BindCGSToRunLoop
Nov 29 07:56:10 mac-os-el-capitan LaterAgent[828]: HIToolbox: received notification of WindowServer event port death.
Nov 29 07:56:10 mac-os-el-capitan LaterAgent[828]: port matched the WindowServer port created in BindCGSToRunLoop
Nov 29 07:56:10 mac-os-el-capitan NotificationCenter[788]: HIToolbox: received notification of WindowServer event port death.
Nov 29 07:56:10 mac-os-el-capitan NotificationCenter[788]: port matched the WindowServer port created in BindCGSToRunLoop
Nov 29 07:56:10 mac-os-el-capitan Safari[722]: HIToolbox: received notification of WindowServer event port death.
Nov 29 07:56:10 mac-os-el-capitan Safari[722]: port matched the WindowServer port created in BindCGSToRunLoop
Nov 29 07:56:10 mac-os-el-capitan com.apple.WebKit.WebContent[761]: HIToolbox: received notification of WindowServer event port death.
Nov 29 07:56:10 mac-os-el-capitan com.apple.WebKit.WebContent[761]: port matched the WindowServer port created in BindCGSToRunLoop
Nov 29 07:56:11 mac-os-el-capitan com.apple.xpc.launchd[1] (com.apple.WebKit.Networking.6648D00F-2E3C-4FBA-A4B7-B225382FB692[760]): Service exited with abnormal code: 1
Nov 29 07:56:10 mac-os-el-capitan identityservicesd[726]: Quit - notifying about shutdown
Nov 29 07:56:10 mac-os-el-capitan identityservicesd[726]: Quit - shutting down daemon
Nov 29 07:56:11 mac-os-el-capitan com.apple.dock.extra[743]: SOHelperCenter main connection interrupted
Nov 29 07:56:11 mac-os-el-capitan imagent[750]: Quit - notifying about shutdown
Nov 29 07:56:11 mac-os-el-capitan Dock[728]: Lost connection with usernoted.
Nov 29 07:56:11 mac-os-el-capitan AirPlayXPCHelper[93]: 2016-11-29 07:56:11.016734 AM [APBrowser] IPv4 listener stopped.
Nov 29 07:56:11 mac-os-el-capitan com.apple.dock.extra[743]: LaunchServices: disconnect event received for service com.apple.lsd.mapdb
Nov 29 07:56:11 mac-os-el-capitan Dock[728]: LaunchServices: disconnect event received for service com.apple.lsd.mapdb
Nov 29 07:56:11 mac-os-el-capitan UserEventAgent[38]: Captive: [UserAgentDied:143] User Agent @PORT=78871 Died
Nov 29 07:56:11 mac-os-el-capitan CommCenter[720]: Notification dispatch shutdown
Nov 29 07:56:11 mac-os-el-capitan spindump[639]: Got xpc error message in libspindump client connection: Connection invalid
Nov 29 07:56:11 mac-os-el-capitan imagent[750]: Quit - shutting down daemon
Nov 29 07:56:11 mac-os-el-capitan CommCenter[720]: Communications Center shutdown.
Nov 29 07:56:11 mac-os-el-capitan login[767]: DEAD_PROCESS: 767 ttys000
Nov 29 07:56:11 mac-os-el-capitan com.apple.xpc.launchd[1] (com.apple.WebKit.WebContent.B86367C2-F54C-4203-9A42-FB342C345AB2[761]): Service exited with abnormal code: 1
Nov 29 07:56:11 mac-os-el-capitan com.apple.dock.extra[743]: SOHelperCenter main connection interrupted
Nov 29 07:56:11 mac-os-el-capitan loginwindow[856]: Login Window Application Started
Nov 29 07:56:11 mac-os-el-capitan wirelessproxd[68]: identityservicesd's WPDContinuity connection died
Nov 29 07:56:11 --- last message repeated 1 time ---

VirtualBox stuck after the restart

Hi,
I created the iso using the prepare_iso.sh script and then ran

packer build \
    -var iso_url=OSX_InstallESD_10.11.6_15G31.dmg \
    -var autologin=true \
    -only virtualbox-iso \
    template.json

The box successfully started and installed OS X, but after the restart it got stuck at

hfs: created HFBT on Macintosh HD

screen shot 2016-08-23 at 17 04 47

packer then always times out waiting for the SSH connection.

Do you know what could cause this / how I can fix it to successfully build the vagrant box?

vagrant.sh hangs

I'm not sure what exactly is wrong, but vagrant.sh always hangs at the curl command, where it gets the weak key from hashicorp. Even copying the key locally and echoing it to authorized doesn't work, so I'm sure it's something else that I'm doing wrong.

This is for OS X 10.10

Thanks!

USB port forwarding

Is USB port forwarding available on any of these templates? I would like to have Linux as my host OS, but I've been having problems with this as I need a webcam for Skype and would like the ability to build to iPhone.

Thanks.

DISABLE_SIP doesn't seem to be working

I thought that there was an issue with the way the prepare_iso.sh script was working with matches at first but now I've moved the csrutil disable line out of the conditional and redirected output to a file. I see now that when it's run there is a Successfully disabled System Integrity Protection. Please restart the machine for the changes to take effect. but when the system imported and brought up it is not disabled. I've been trying to boot the system into recovery so I can try again but I haven't figured out the magic needed to catch that at boot yet.

prepare-iso.sh and El Cap Beta 8

Running the prepare-iso.sh script on the latest El Capitan Beta completes without errors, but the OS installer image is invalid. VMWare Fusion just boots to the "OMG I DON'T KNOW WHAT TO DO WHERE IS THE OS?" screen and trying to mount the DMG manually and install it in OSX nets the following error message:

image

I dug around in the script and in the .DMG but I'm not experienced enough with OSX to know what the trouble is / everything looked pretty normal when I compared it to the 10.10.x .DMGs that I've cooked with this process. Any help appreciated!

Sierra 10.12.4 possible?

I saw the note in the readme about Apple having now enforced signed PKGs during setup. I think I'm suffering from https://www.virtualbox.org/ticket/16644.

I'm not a subject matter expert by any means, but came across http://osxdaily.com/2016/09/27/allow-apps-from-anywhere-macos-gatekeeper/ which sounds like it could be related? sudo spctl --master-disable sounds ... promising?

Or am I conflating Apps with PKGs? This really isn't my expertise, all I want is to make a VM I can run some QA with.

suppress Sierra Siri prompt

After a successful VM create and vagrant up, the user login is blocked by a Siri setup prompt.

screen shot 2016-11-20 at 1 06 11

This prevents the creation of some HOME/ folders, like ~/Desktop.

Workaround: restarting the VM, e.g. with vagrant halt && vagrant up, the second boot skips the prompt.

Root partition often not created at boot

I am using those templates to create vagrant OS X boxes w/ vmware. It worked great for 10.7, but I see some issues w/ 10.9. In most cases (but not always), the install would stop early because the install cannot find a disk (see attachment).

The issue is not w/ my .dmg created through prepare_iso.sh, since installing that normally in vmware works w/o any issue. Also, if under packer, I go back in the install, manually create the partition, and continue the install works as expected (up to complete vagrant box build).

What is maddening is that it does not always fail :( Has anybody else encountered this ? Is there something I can do to debug this issue ?

I am using vmware 6.0.6 on Yosemite w/ packer 0.8.6

Sometimes xcode-cli-tools.sh hangs running softwareupdate

Very often when I run packer to build the template, the xcode-cli-tools.sh provisioning script hangs forever (well, at least for up to a few hours, before I give up and kill the build).

To debug this, I have logged in to the VM to investigate the running processes, and it appears that the softwareupdate tool is just sitting idle, and there is no evidence that the download ever started. If I kill the softwareupdate tool then provisioning continues.

I have noticed a similar issue with the system-update.sh step, if I get past the xcode-cli-tools.sh step.

I have attempted to work around this issue by adding a delay to the start of the xcode-cli-tools.sh script; a sleep 30 seems to make the build work much more reliably for me.

I'm using OSX_InstallESD_10.11.3_15D21.dmg, packer 0.9.0, and VMware 8.1.0 with the vmnet-natd patch.

User created by `prepare_ios.sh` is not in group 'staff'

The creating user behaviour between prepare_ios.sh and sysadminctl -addUser $user -admin is different.

The mainly issue here is user created by prepare_ios.sh is not a member of staff.

Other observes

  • gid created by prepare_ios.sh is 80(admin) while sysadminctl is 20(staff)

HyperV support?

Hiya, thank you for publishing Vagrant boxes for macOS!

Would it be possible to offer HyperV provided boxes as well? Unfortunately, Docker in Windows relies on HyperV these days, and HyperV is unable to run concurrently with the VirtualBox hypervisor. In other words, developers working with Windows hosts must choose to boot with either HyperV enabled to run Docker, or else HyperV disabled to run VirtualBox and Vagrant. But if the macOS Vagrant boxes were integrated with the HyperV provider, then Windows users would be able to hack on Docker and Vagrant projects at the same time, without having to constantly reboot. What do you think?

High Sierra support

Hello,

prepare_iso.sh fails with High Sierra installer app:

sudo prepare_iso/prepare_iso.sh /Applications/Install\ macOS\ High\ Sierra.app/ ./out/

The InstallESD.dmg layout has changed since 10.12, so that now it contains only Packages directory. BaseSystem.dmg has moved to the install app:

$ ls /Applications/Install\ macOS\ High\ Sierra.app/Contents/SharedSupport/
AppleDiagnostics.chunklist  BaseSystem.chunklist        InstallESD.dmg
AppleDiagnostics.dmg        BaseSystem.dmg              InstallInfo.plist

I changed prepare_iso.sh to take BaseSystem.dmg from there, and the script executed without issues. However, the resulting image boots into gray screen with a movable cursor.

dscl crashing

The command /usr/bin/dscl -plist . readall /Users results in a error of:

dscl[999:76826] -[__NSCFNumber length]: unrecognized selector sent to instance 0xffffffc00000ff37
*** Uncaught Exception: <NSInvalidArgumentException> (-[__NSCFNumber length]: unrecognized selector sent to instance 0xffffffc00000ff37)

It seems to be caused by these two lines: https://github.com/timsutton/osx-vm-templates/blob/master/prepare_iso/support/pkg-postinstall#L40-L41

When they're commented out, the error disappears. I've never used ARD to access a Vagrant-built VM, so if there's no easy fix for what this does, I'd vote to remove it.

Unattended Setup on a Physical Mac

This is a follow-up on #70

I am using osx-vm-templates to bootstrap an image for my packer script. I would like to use the same (or similar) dmg to install physical macs. AutoDMG is not really an alternative, because it does not create bootable images. I am not aiming for having a complicated netboot setup. I just need to reinstall a mac without the need to have physical access.

What is the difference between booting the image in a VM or on a physical mac? Would it boot on a mac when it was on a DVD instead of USB? (VMware/Virtualbox are emulating disk drives, instead of booting from USB).

I know, this project is not about booting natively, but it would be nice to see it happen, and this project is way closer to what I want to achieve than everything else I have seen so far.

Virtualbox provider has error

Hi,
has anyone encountered an error like this. Is this a virtual box version problem ?

==> virtualbox-iso: Deleting output directory...
Build 'virtualbox-iso' errored: Error creating disk controller: VBoxManage error: Oracle VM VirtualBox Command Line Management Interface Version 5.0.0
(C) 2005-2015 Oracle Corporation
All rights reserved.

Usage:

VBoxManage storagectl       <uuid|vmname>
                            --name <name>
                            [--add ide|sata|scsi|floppy|sas]
                            [--controller LSILogic|LSILogicSAS|BusLogic|
                                          IntelAHCI|PIIX3|PIIX4|ICH6|I82078]
                            [--portcount <1-n>]
                            [--hostiocache on|off]
                            [--bootable on|off]
                            [--rename <name>]
                            [--remove]

VBoxManage: error: Unknown option: --sataportcount

VirtualBox VM freezes periodically

This is a strange one, and I'm trying to figure it out, but I'm coming up somewhat empty-handed.

A new El Capitan VM built using the Packer template for VirtualBox will freeze for ~5 seconds every ~10 seconds, making interactive use somewhat troublesome. However, VirtualBox's OS X support is not necessarily broken outright.

Here's what I've observed:

  • If I build a straight DMG using these steps and VirtualBox's default OS X 10.11 configuration, the resulting VM does not freeze at all.
  • If I modify the Packer template to build a machine that more closely resembles VirtualBox's default configuration, the resulting box still freezes. (I've diffed the .vbox files—they're pretty much identical save UUIDs and names of things.)
  • The VM does not appear to freeze during the initial installation from the installation media. You can see the freezing if you swirl your mouse around inside the VM's console window for >10 seconds.
  • I noticed that shrink.sh is failing due to System Integrity Protection not allowing dynamic_pager to be unloaded, but if I attempt to build a box with these lines commented out, the resulting box still freezes.

It seems that something installed in the prepare_iso process is responsible, since the freezing is in play even before Packer starts running the scripts in scripts. But I've gone over what prepare_iso adds and I'm not sure what could be causing it.

Has anyone seen this or does anyone have any ideas what might be at fault? I'm currently looking over pkg-postinstall to see if anything looks suspicious.

Specifying a disk size larger than 20 gb does not work!

When I try to create an osx Yosemite vagrant box (with following packer command):

packer build
-var iso_url=../out/OSX_InstallESD_10.10.5_14F27.dmg
-var iso_checksum=xxxxxxxxxxxxxxxxxxxxxxxxxx
-var disk_size=40960
-var username=vagrant
-var password=vagrant
-var autologin=true
-var install_vagrant_keys=true
-except vmware-iso,parallels-iso
template.json

The initial .vdi file is created with 40 gb of disk space, but when its exported to a vagrant box (and changed to a .vdmk file) the disk size is changed to 20gb. When XCode requires 10+ gb of space alone this can be a problem. Has anyone found a workaround for this?

Post-processor failed: open /packer_virtualbox-iso_virtualbox.box: permission denied

$ packer build \
→   -var iso_url=../out/OSX_InstallESD_10.12.3_16D32.dmg \
→   -var update_system=0 \
→   -var autologin=true \
→   template.json


parallels-iso output will be in this color.
virtualbox-iso output will be in this color.
vmware-iso output will be in this color.

Warnings for build 'parallels-iso':

* A checksum type of 'none' was specified. Since ISO files are so big,
a checksum is highly recommended.

Warnings for build 'virtualbox-iso':

* A checksum type of 'none' was specified. Since ISO files are so big,
a checksum is highly recommended.

Warnings for build 'vmware-iso':

* A checksum type of 'none' was specified. Since ISO files are so big,
a checksum is highly recommended.

Build 'parallels-iso' errored: Failed creating Parallels driver: exec: "prlctl": executable file not found in $PATH
Build 'vmware-iso' errored: Failed creating VMware driver: Unable to initialize any driver for this platform. The errors
from each driver are shown below. Please fix at least one driver
to continue:
* Fusion application not found at path: /Applications/VMware Fusion.app
* Fusion application not found at path: /Applications/VMware Fusion.app

==> virtualbox-iso: Downloading or copying ISO
    virtualbox-iso: Downloading or copying: file:///Volumes/SSD%20750G/Users/vlad/Documents/vagrant/osx-vm-templates/out/OSX_InstallESD_10.12.3_16D32.dmg
==> virtualbox-iso: Creating virtual machine...
==> virtualbox-iso: Creating hard drive...
==> virtualbox-iso: Creating forwarded port mapping for communicator (SSH, WinRM, etc) (host port 2957)
==> virtualbox-iso: Executing custom VBoxManage commands...
    virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1496153385 --audiocontroller hda
    virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1496153385 --boot1 dvd
    virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1496153385 --boot2 disk
    virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1496153385 --chipset ich9
    virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1496153385 --firmware efi
    virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1496153385 --hpet on
    virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1496153385 --keyboard usb
    virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1496153385 --memory 2048
    virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1496153385 --mouse usbtablet
    virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1496153385 --vram 128
    virtualbox-iso: Executing: storagectl packer-virtualbox-iso-1496153385 --name IDE Controller --remove
==> virtualbox-iso: Starting the virtual machine...
==> virtualbox-iso: Waiting 2s for boot...
==> virtualbox-iso: Typing the boot command...
==> virtualbox-iso: Waiting for SSH to become available...
==> virtualbox-iso: Connected to SSH!
==> virtualbox-iso: Uploading VirtualBox version info (5.1.22)
==> virtualbox-iso: Executing local command: sleep 0
==> virtualbox-iso: Uploading ../scripts/support/set_kcpassword.py => /private/tmp/set_kcpassword.py
==> virtualbox-iso: Provisioning with shell script: ../scripts/vagrant.sh
    virtualbox-iso: Installing vagrant keys for vagrant user
    virtualbox-iso: % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
    virtualbox-iso: Dload  Upload   Total   Spent    Left  Speed
    virtualbox-iso: 100   409  100   409    0     0    848      0 --:--:-- --:--:-- --:--:--   850
==> virtualbox-iso: Provisioning with shell script: ../scripts/vmware.sh
==> virtualbox-iso: Provisioning with shell script: ../scripts/parallels.sh
==> virtualbox-iso: Provisioning with shell script: ../scripts/xcode-cli-tools.sh
    virtualbox-iso: Software Update Tool
    virtualbox-iso: Copyright 2002-2015 Apple Inc.
    virtualbox-iso:
    virtualbox-iso:
    virtualbox-iso: Downloading Command Line Tools (macOS Sierra version 10.12) for Xcode
    virtualbox-iso: Downloaded Command Line Tools (macOS Sierra version 10.12) for Xcode
    virtualbox-iso: Installing Command Line Tools (macOS Sierra version 10.12) for Xcode
    virtualbox-iso: Done with Command Line Tools (macOS Sierra version 10.12) for Xcode
    virtualbox-iso: Done.
==> virtualbox-iso: Provisioning with shell script: ../scripts/chef-omnibus.sh
==> virtualbox-iso: Provisioning with shell script: ../scripts/puppet.sh
==> virtualbox-iso: Provisioning with shell script: ../scripts/add-network-interface-detection.sh
==> virtualbox-iso: Provisioning with shell script: ../scripts/autologin.sh
    virtualbox-iso: Enabling automatic GUI login for the 'vagrant' user..
==> virtualbox-iso: Provisioning with shell script: ../scripts/system-update.sh
==> virtualbox-iso: Provisioning with shell script: ../scripts/shrink.sh
==> virtualbox-iso: Gracefully halting virtual machine...
    virtualbox-iso: shutdown: / is busy updating; waiting for lock
    virtualbox-iso: Shutdown NOW!
    virtualbox-iso:
    virtualbox-iso: System shutdown time has arrived
==> virtualbox-iso: Preparing to export machine...
    virtualbox-iso: Deleting forwarded port mapping for the communicator (SSH, WinRM, etc) (host port 2957)
==> virtualbox-iso: Exporting virtual machine...
    virtualbox-iso: Executing: export packer-virtualbox-iso-1496153385 --output output-virtualbox-iso/packer-virtualbox-iso-1496153385.ovf
==> virtualbox-iso: Unregistering and deleting virtual machine...
==> virtualbox-iso: Running post-processor: vagrant
==> virtualbox-iso (vagrant): Creating Vagrant box for 'virtualbox' provider
    virtualbox-iso (vagrant): Copying from artifact: output-virtualbox-iso/packer-virtualbox-iso-1496153385-disk001.vmdk
    virtualbox-iso (vagrant): Copying from artifact: output-virtualbox-iso/packer-virtualbox-iso-1496153385.ovf
    virtualbox-iso (vagrant): Renaming the OVF to box.ovf...
Build 'virtualbox-iso' errored: 1 error(s) occurred:

* Post-processor failed: open /packer_virtualbox-iso_virtualbox.box: permission denied

==> Some builds didn't complete successfully and had errors:
--> parallels-iso: Failed creating Parallels driver: exec: "prlctl": executable file not found in $PATH
--> vmware-iso: Failed creating VMware driver: Unable to initialize any driver for this platform. The errors
from each driver are shown below. Please fix at least one driver
to continue:
* Fusion application not found at path: /Applications/VMware Fusion.app
* Fusion application not found at path: /Applications/VMware Fusion.app

--> virtualbox-iso: 1 error(s) occurred:

* Post-processor failed: open /packer_virtualbox-iso_virtualbox.box: permission denied

==> Builds finished but no artifacts were created.

macOS Server support?

Is macOS Server like a stripped down version of macOS for command line workflows and such? If so, could we include a shell script to generate ISO's for macOS Server, and packer configuration for running macOS Server in Vagrant?

Yosemite 10.10 support?

I've attempted using the prepare_iso.sh script on the OS X Yosemite installer. It creates the image, and packer can even boot it using Chef's bento project (new packer definition), but then I get here:

yosemite-install-fail

I understand that there's a lot of different things at play here that could be the culprit:

  1. The Yosemite image itself (from the App Store) - it is beta software after all.
  2. VMware Fusion
  3. Packer
  4. The prepare_iso script doesn't work for 10.10 yet.

Thoughts? Have you built any Yosemite systems using these templates?

`shrink.sh` script causes build failure on VMware Fusion 7 and Yosemite

I am trying to use to get an OS X VM Running in VMware Fusion. My test system:

  • Commit: 0cad0b9 (with minor modifications to template.json)
  • Host OS: OS X Yosemite 10.10.3
  • Guest OS: OS X Yosemite 10.10.3
  • VMware Fusion: Professional Version 7.1.1 (2498930)
  • Vagrant: 1.7.2
  • Packer: 0.7.5

At the end of packer build template.json, the vmware-iso builder fails with the following error messages:

==> vmware-iso: Provisioning with shell script: ../scripts/shrink.sh
    vmware-iso: Please disregard any warnings about disk space for the duration of shrink process.
    vmware-iso: Progress: 100 [===========>]
==> vmware-iso: Gracefully halting virtual machine...
==> vmware-iso: Failed to send shutdown command: dial tcp 172.16.96.142:22: i/o timeout
==> vmware-iso: Stopping virtual machine...
==> vmware-iso: Deleting output directory...
Build 'vmware-iso' errored: Failed to send shutdown command: dial tcp 172.16.96.142:22: i/o timeout

==> Some builds didn't complete successfully and had errors:
--> vmware-iso: Failed to send shutdown command: dial tcp 172.16.96.142:22: i/o timeout

==> Builds finished but no artifacts were created.

While the shrink process was running, I noticed that, there was a pop-up box in the guest VM with a warning that there is no disk space left. (The build log obviously says that such warnings should be disregarded). I didn't click "OK" (when I had the chance). I think that it may have been because this pop-up was not closed that the VM could not be shutdown gracefully.

I haven't yet checked whether the user closing this pop-up in time will save the build. However, I have checked that removing shrink.sh from the list of scripts in the template.json does allow the build to run to completion. Presumably, removing just the call to vmware-tools-cli would be a sufficient workaround:

# VMware Fusion specific items
if [ -e .vmfusion_version ] || [[ "$PACKER_BUILDER_TYPE" == vmware* ]]; then
    # Shrink the disk
    sudo /Library/Application\ Support/VMware\ Tools/vmware-tools-cli disk shrink /
fi

Command line tools trick seems to have stopped working for Mavericks

Wonderful project - thank you!

The touch & softwareupdate trick doesn't seem to be working for the 10.9 VM I'm attempting to build.

==> 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: : No such update
    vmware-iso: No updates are available.

This causes follow-up scripts to become rather sad, e.g.:

==> vmware-iso: Provisioning with shell script: ../scripts/puppet.sh
    vmware-iso: xcode-select: error: no developer tools were found at '/Applications/Xcode.app', and no install could be requested (perhaps no UI is present), please install manually from 'developer.apple.com'.
    vmware-iso: /tmp/script.sh: line 54: /tmp/autopkg-Hc0Z/Code/autopkg: No such file or directory
    vmware-iso: /tmp/script.sh: line 41: /tmp/autopkg-Hc0Z/Code/autopkg: No such file or directory
    vmware-iso: Cannot parse a NULL or zero-length data
    vmware-iso: /tmp/script.sh: line 41: /tmp/autopkg-Hc0Z/Code/autopkg: No such file or directory
    vmware-iso: Cannot parse a NULL or zero-length data
    vmware-iso: /tmp/script.sh: line 41: /tmp/autopkg-Hc0Z/Code/autopkg: No such file or directory
    vmware-iso: Cannot parse a NULL or zero-length data

I'm looking into flipping back to the DMG-downloading strategy to see if that fixes things.

system-update.sh seems to keep failing (10.9 / Mavericks)

It looks like the updates are totally failing for Mavericks:

2015/11/13 14:41:22 ui:     virtualbox-iso: Downloading and installing system updates...
    virtualbox-iso: Downloading and installing system updates...
2015/11/13 14:41:34 ui:     virtualbox-iso: Software Update Tool
    virtualbox-iso: Software Update Tool
2015/11/13 14:41:34 ui:     virtualbox-iso: Copyright 2002-2012 Apple Inc.
    virtualbox-iso: Copyright 2002-2012 Apple Inc.
2015/11/13 14:41:34 ui:     virtualbox-iso:
    virtualbox-iso:
2015/11/13 14:41:34 ui:     virtualbox-iso: Finding available software
    virtualbox-iso: Finding available software
2015/11/13 14:41:34 ui:     virtualbox-iso:
    virtualbox-iso:
2015/11/13 14:41:34 ui:     virtualbox-iso: Downloading OS X Update Combined
    virtualbox-iso: Downloading OS X Update Combined
2015/11/13 14:41:34 ui:     virtualbox-iso: Downloading iBooks Update
    virtualbox-iso: Downloading iBooks Update
2015/11/13 14:45:45 ui:     virtualbox-iso: Downloading iTunes
    virtualbox-iso: Downloading iTunes
2015/11/13 14:45:52 ui:     virtualbox-iso: Error downloading iTunes: Didn't get a response from the Apple Software Update server when downloading iTunes.
    virtualbox-iso: Error downloading iTunes: Didn't get a response from the Apple Software Update server when downloading iTunes.
2015/11/13 14:47:00 ui:     virtualbox-iso: Error downloading iBooks Update: Didn't get a response from the Apple Software Update server when downloading iBooks Update.
    virtualbox-iso: Error downloading iBooks Update: Didn't get a response from the Apple Software Update server when downloading iBooks Update.
2015/11/13 14:47:00 ui:     virtualbox-iso: Downloaded OS X Update Combined
    virtualbox-iso: Downloaded OS X Update Combined
2015/11/13 14:53:45 ui:     virtualbox-iso: Installing OS X Update Combined, iBooks Update, iTunes
    virtualbox-iso: Installing OS X Update Combined, iBooks Update, iTunes
2015/11/13 14:53:45 ui:     virtualbox-iso: Done with OS X Update Combined
    virtualbox-iso: Done with OS X Update Combined
2015/11/13 14:53:45 ui:     virtualbox-iso: Done.
    virtualbox-iso: Done.
2015/11/13 14:53:45 ui:     virtualbox-iso:
    virtualbox-iso:
2015/11/13 14:53:45 ui:     virtualbox-iso: Error downloading updates.
    virtualbox-iso: Error downloading updates.

I saw some errors in the "Closed" list which sound a lot like these. Is this possibly a problem with Apple no longer providing these downloads?

Headless builds

Does anyone know if headless builds are even possible? Tried it with vmware but they seem to hang on installation process.
Didn't debug with VNC yet, but wanted to know if anyone tried it already.

Packer fails with `Error waiting for SSH`

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

packer build hangs with virtualbox, waiting for SSH to become available

Hi,
First, thanks for providing this tool that looks promising for a newcomer to OS X virtualization like me.
I followed your instructions to prepare a Mavericks image and the following command line hangs:
/Applications/packer/packer build -only virtualbox-iso
-var so_checksum=e2810991daed651f6ded9c8c739b1705
-var iso_url=/Users/admin/out/OSX_InstallESD_10.9.4_13E28.dmg
/Users/admin/osx-vm-templates-master/packer/template.json

It launches the OS X installer in VirtualBox but hangs indefinately waiting for SSH to become available:
virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1410853896 --vram 9
==> virtualbox-iso: Starting the virtual machine...
==> virtualbox-iso: Waiting 2s for boot...
==> virtualbox-iso: Typing the boot command...
==> virtualbox-iso: Waiting for SSH to become available...

I tried to click on the various installer dialogs but it didn't solve the issue. There seems to be something wrong with the SSH availability but I'm brand new to OS X (I'm familiar with Linux) so I'd appreciate any clue on what could be wrong.

Pat

Prevent OSX guests going into suspend automatically

I'm running Parallels but I suspect OSX power management is putting the guest into suspend for all providers. This is not the default behavior for other boxes I know of - can it be turned off as part of prepare_iso.sh?

AutoPartition problem on 10.7.5

The VMware disk does not get partitioned on my 10.7.5 (host+guest) setup. Here is the output of the prepare script. See the error when copying AutoPartition.app.

sh-3.2# ./prepare_iso/prepare_iso.sh "/Applications/Install Mac OS X Lion.app" out
-- Destination dir out doesn't exist, creating..
-- Attaching input OS X installer image with shadow file..
Checksumming Driver Descriptor Map (DDM : 0)…
     Driver Descriptor Map (DDM : 0): verified   CRC32 $7F02BC54
Checksumming  (Apple_Free : 1)…
                    (Apple_Free : 1): verified   CRC32 $00000000
Checksumming Apple (Apple_partition_map : 2)…
     Apple (Apple_partition_map : 2): verified   CRC32 $4A98BE26
Checksumming Macintosh (Apple_Driver_ATAPI : 3)…
  Macintosh (Apple_Driver_ATAPI : 3): verified   CRC32 $F1E8BA9E
Checksumming  (Apple_Free : 4)…
                    (Apple_Free : 4): verified   CRC32 $00000000
Checksumming disk image (Apple_HFS : 5)…
..................................................................................................................................................................................
          disk image (Apple_HFS : 5): verified   CRC32 $761F622D
Checksumming  (Apple_Free : 6)…
                    (Apple_Free : 6): verified   CRC32 $00000000
verified   CRC32 $D61C13C2
/dev/disk2              Apple_partition_scheme
/dev/disk2s1            Apple_partition_map
/dev/disk2s2            Apple_Driver_ATAPI
/dev/disk2s3            Apple_HFS                       /private/tmp/veewee-osx-esd.7yT4
-- OS X version detected: 10.7.5, build 11G63
-- Building OS X 10.7, so trying to locate System Image Utility from Server Admin Tools..
-- It doesn't seem to be installed and VeeWee hasn't yet cached it in the support dir..
-- Attempting download of the Server Admin Tools..
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  195M  100  195M    0     0   640k      0  0:05:12  0:05:12 --:--:--  785k
-- Attaching Server Admin Tools..
Checksumming Driver Descriptor Map (DDM : 0)…
     Driver Descriptor Map (DDM : 0): verified   CRC32 $EB1AA362
Checksumming  (Apple_Free : 1)…
                    (Apple_Free : 1): verified   CRC32 $00000000
Checksumming Apple (Apple_partition_map : 2)…
     Apple (Apple_partition_map : 2): verified   CRC32 $59E84DAA
Checksumming Macintosh (Apple_Driver_ATAPI : 3)…
  Macintosh (Apple_Driver_ATAPI : 3): verified   CRC32 $F1E8BA9E
Checksumming  (Apple_Free : 4)…
                    (Apple_Free : 4): verified   CRC32 $00000000
Checksumming disk image (Apple_HFS : 5)…
..................................................................................................................................................................................
          disk image (Apple_HFS : 5): verified   CRC32 $1E17A3E6
Checksumming  (Apple_Free : 6)…
                    (Apple_Free : 6): verified   CRC32 $00000000
verified   CRC32 $C8E667B6
/dev/disk3              Apple_partition_scheme
/dev/disk3s1            Apple_partition_map
/dev/disk3s2            Apple_Driver_ATAPI
/dev/disk3s3            Apple_HFS                       /private/tmp/server-admin-tools.j3Ha/mnt
-- Expanding package..
"disk3" unmounted.
"disk3" ejected.
-- Extracting payload..
-- Copying out AutoPartition.app
-- Making firstboot installer pkg..
-- Adding automated components..
cp: /Volumes/Data/Users/ringods/Projects/automate.dev/osx-vm-templates/prepare_iso/support/AutoPartition-10.7/AutoPartition.app: No such file or directory
-- Unmounting..
"disk2" unmounted.
"disk2" ejected.
-- Converting to final output file..
Preparing imaging engine…
Reading Driver Descriptor Map (DDM : 0)…
   (CRC32 $7F02BC54: Driver Descriptor Map (DDM : 0))
Reading  (Apple_Free : 1)…
   (CRC32 $00000000:  (Apple_Free : 1))
Reading Apple (Apple_partition_map : 2)…
   (CRC32 $4A98BE26: Apple (Apple_partition_map : 2))
Reading Macintosh (Apple_Driver_ATAPI : 3)…
   (CRC32 $F1E8BA9E: Macintosh (Apple_Driver_ATAPI : 3))
Reading  (Apple_Free : 4)…
   (CRC32 $00000000:  (Apple_Free : 4))
Reading disk image (Apple_HFS : 5)…
..................................................................................................................................................................................
   (CRC32 $B13D1AEF: disk image (Apple_HFS : 5))
Reading  (Apple_Free : 6)…
...................................................................................................................................................................................
   (CRC32 $00000000:  (Apple_Free : 6))
Adding resources…
...................................................................................................................................................................................
Elapsed Time:  1m 54.800s
File size: 4706339170 bytes, Checksum: CRC32 $8AF9414E
Sectors processed: 10055348, 9326954 compressed
Speed: 39.7Mbytes/sec
Savings: 8.6%
created: /Volumes/Data/Users/ringods/Projects/automate.dev/osx-vm-templates/out/OSX_InstallESD_10.7.5_11G63.dmg
-- Fixing permissions..
-- Checksumming output image..
-- MD5: 4f100776c1669888e1659d8c37873fbd
-- Done. Built image is located at out/OSX_InstallESD_10.7.5_11G63.dmg. Add this iso and its checksum to your template.

10.7 Error

-- Attaching input OS X installer image with shadow file..
/dev/disk4 Apple_partition_scheme
/dev/disk4s1 Apple_partition_map
/dev/disk4s2 Apple_HFS /private/tmp/veewee-osx-esd.Bi2u
-- OS X version detected: 10.7., build 11A511
-- Building OS X 10.7, so trying to locate System Image Utility from Server Admin Tools..
-- It doesn't seem to be installed and VeeWee hasn't yet cached it in the support dir..
-- Attempting download of the Server Admin Tools..
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 434 100 434 0 0 123 0 0:00:03 0:00:03 --:--:-- 166
100 195M 100 195M 0 0 133k 0 0:25:00 0:25:00 --:--:-- 113k
-- Attaching Server Admin Tools..
Efetuando soma de verificação Driver Descriptor Map (DDM : 0)…
Driver Descriptor Map (DDM : 0): verificado CRC32 $EB1AA362
Efetuando soma de verificação (Apple_Free : 1)…
(Apple_Free : 1): verificado CRC32 $00000000
Efetuando soma de verificação Apple (Apple_partition_map : 2)…
Apple (Apple_partition_map : 2): verificado CRC32 $59E84DAA
Efetuando soma de verificação Macintosh (Apple_Driver_ATAPI : 3)…
Macintosh (Apple_Driver_ATAPI : 3): verificado CRC32 $F1E8BA9E
Efetuando soma de verificação (Apple_Free : 4)…
(Apple_Free : 4): verificado CRC32 $00000000
Efetuando soma de verificação disk image (Apple_HFS : 5)…
...........................................................................................................................................................................
disk image (Apple_HFS : 5): verificado CRC32 $1E17A3E6
Efetuando soma de verificação (Apple_Free : 6)…
(Apple_Free : 6): verificado CRC32 $00000000
verificado CRC32 $C8E667B6
/dev/disk5 Apple_partition_scheme
/dev/disk5s1 Apple_partition_map
/dev/disk5s2 Apple_Driver_ATAPI
/dev/disk5s3 Apple_HFS /private/tmp/server-admin-tools.RBt4/mnt
-- Expanding package..
"disk5" unmounted.
"disk5" ejected.
-- Extracting payload..
-- Copying out AutoPartition.app
cp: /tmp/server-admin-tools.RBt4/cpio-extract/Applications/Server/System Image Utility.app/Contents/Frameworks/SIUFoundation.framework/Versions/A/XPCServices/com.apple.SIUAgent.xpc/Contents/Resources/AutoPartition.app: No such file or directory
-- Making firstboot installer pkg..
-- Adding automated components..
mkdir: /tmp/veewee-osx-esd.Bi2u/Packages: No such file or directory
cp: directory /tmp/veewee-osx-esd.Bi2u/Packages/Extras does not exist
cp: directory /tmp/veewee-osx-esd.Bi2u/Packages does not exist
cp: directory /tmp/veewee-osx-esd.Bi2u/Packages/Extras does not exist
cp: /Volumes/Repository/warsaw/scripts/osx-vm-templates/prepare_iso/support/AutoPartition-10.7/AutoPartition.app: No such file or directory
cp: directory /tmp/veewee-osx-esd.Bi2u/Packages does not exist
-- Unmounting..
"disk4" unmounted.
"disk4" ejected.
-- Converting to final output file..
Preparando mecanismo de criação de imagens…
Lendo Driver Descriptor Map (DDM : 0)…
(CRC32 $CF18C6E6: Driver Descriptor Map (DDM : 0))
Lendo Apple (Apple_partition_map : 1)…
(CRC32 $48B5BD3A: Apple (Apple_partition_map : 1))
Lendo MACOSXBASESYSTEM (Apple_ISO : 2)…
.
(CRC32 $99F6F773: MACOSXBASESYSTEM (Apple_ISO : 2))
Lendo DiscRecording 6.0d1 (Apple_HFS : 3)…
............................................................................................................................................................................
(CRC32 $F4BE8927: DiscRecording 6.0d1 (Apple_HFS : 3))
Adicionando recursos…
............................................................................................................................................................................
Tempo Decorrido: 1m 52.601s
Tam. de arq.: 3818659662 bytes, Soma de verif.: CRC32 $7FE29996
Setores processados: 8736660, 8736657 comprimidos
Velocidade: 37.9Mbytes/seg
Salvando: 14.6%
created: /Volumes/Repository/warsaw/scripts/osx-vm-templates/out/OSX_InstallESD_10.7_11A511.dmg
-- Fixing permissions..
-- Checksumming output image..
-- MD5: a95463f02a87fd012bf322fde30d5c0c
-- Done. Built image is located at out/OSX_InstallESD_10.7_11A511.dmg. Add this iso and its checksum to your template.

Output directory?

Hi - I have limited space on my drive, so do my VM building on an external one. Would you accept a PR to add output_directory attributes that are settable via variables?

How to integrate with System Image Utility to create NetRestore/NetBoot image

I'm able to create a workable VirtualBox VM with packer. I'm wonder how can I convert the vmdk to NetRestore/NetBoot Image, so that I can deploy images to real hardwares.

Currently I have tried to mount vmdk with Paragon VMDK Mounter, it's failed to create NetRestore Image from mounted volume with both System Image Utility and Automator Flow

I also observed that when the creating process is finished, vmdk disk is unmounted.

But I can create NetBoot Image successfully with same mounted volume.

screen shot 2015-10-22 at 00 19 49

From the following screenshot you can see Image Source has been reset to Install OS X EI Capitan as the vmdk was unmounted.

screen shot 2015-10-21 at 23 37 26

Prepare VDI Recovery Partition Empty

I am successfully using the new prepare_vdi.sh script to generate a macOS 10.13.2 VM.

Unfortunately, it looks like Recovery Partition is not present in the resulting disk image. I assume that is
committed on purpose to save disk space. Is there an easy way to transfer that partition from the sparse bundle?

I am using VMware Fusion Professional so that I can make use of the NVRAM to disable SIP and enable Kexts to be default imported.

Unable to share folders under Parallels

    ==> default: Mounting shared folders...
    default: /vagrant => /Users/darrenw/Projects/####/#####
    default: /var/cache/apt/archives => /Users/darrenw/Projects/###/####/cache/apt/archives

The following interesting log entries are in /var/log/system.log:

com.apple.xpc.launchd[1] (com.parallels.vm.prl_fsd): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.

...however, the process did start up by the time I logged in...

local:~ vagrant$ ps -ef | grep prl
    0    79     1   0  9:04PM ??         0:00.07 /Library/Parallels Guest Tools/prltoolsd
    0   181     1   0  9:04PM ??         0:00.06 /Library/Parallels Guest Tools/prl_fsd /Volumes/SharedFolders --share

If I open the GUI and try sharing a folder, it appears to work but, again, nothing actually gets shared. This might mean it's a Parallels issue, so I'll try installing directly (without osx-vm-templates) to see if that makes a difference.

-D DISABLE_SIP causes sporadic freezing on sierra

I'm not sure if this is a supported flag as I don't see it in the readme but it exists in prepare_iso.sh. I've noticed enabling this flag on a macos sierra build causes the resulting vm to lock up every 20-30 seconds or so. This is using VMWare Professional Version 8.5.0 (4352717).

xcode-cli-tools.sh fails to install Command Line Tools

Somehow the Command Line Tools won't get installed:
The PROD match (031-00536-5.1.0.0) seems to be wrong.

==> virtualbox-iso: Provisioning with shell script: ../scripts/xcode-cli-tools.sh
    virtualbox-iso: Software Update Tool
    virtualbox-iso: Copyright 2002-2012 Apple Inc.
    virtualbox-iso:
    virtualbox-iso: Finding available software
    virtualbox-iso: 031-00536-5.1.0.0: No such update
    virtualbox-iso: No updates are available.

Therefore puppet fails to install:

==> virtualbox-iso: Provisioning with shell script: ../scripts/puppet.sh
    virtualbox-iso: xcode-select: error: no developer tools were found at '/Applications/Xcode.app', and no install could be requested (perhaps no UI is present), please install manually from 'developer.apple.com'.
    virtualbox-iso: /tmp/script.sh: line 52: /tmp/autopkg-IB89/Code/autopkg: No such file or directory
    virtualbox-iso: /tmp/script.sh: line 41: /tmp/autopkg-IB89/Code/autopkg: No such file or directory
    virtualbox-iso: Cannot parse a NULL or zero-length data
    virtualbox-iso: /tmp/script.sh: line 41: /tmp/autopkg-IB89/Code/autopkg: No such file or directory
    virtualbox-iso: Cannot parse a NULL or zero-length data
    virtualbox-iso: /tmp/script.sh: line 41: /tmp/autopkg-IB89/Code/autopkg: No such file or directory
    virtualbox-iso: Cannot parse a NULL or zero-length data
    virtualbox-iso: Installing: Puppet
    virtualbox-iso: -- Mounting DMG...
    virtualbox-iso: hdiutil: attach failed - No such file or directory
    virtualbox-iso: -- Installing pkg...
    virtualbox-iso: installer: Error the package path specified was invalid: ''.
    virtualbox-iso: -- Unmounting and ejecting DMG...
    virtualbox-iso: hdiutil: eject failed - No such file or directory
    virtualbox-iso: Installing: Facter
    virtualbox-iso: -- Mounting DMG...
    virtualbox-iso: hdiutil: attach failed - No such file or directory
    virtualbox-iso: -- Installing pkg...
    virtualbox-iso: installer: Error the package path specified was invalid: ''.
    virtualbox-iso: -- Unmounting and ejecting DMG...
    virtualbox-iso: hdiutil: eject failed - No such file or directory
    virtualbox-iso: Installing: Hiera
    virtualbox-iso: -- Mounting DMG...
    virtualbox-iso: hdiutil: attach failed - No such file or directory
    virtualbox-iso: -- Installing pkg...
    virtualbox-iso: installer: Error the package path specified was invalid: ''.
    virtualbox-iso: -- Unmounting and ejecting DMG...
    virtualbox-iso: hdiutil: eject failed - No such file or directory

Running the script xcode-cli-tools.sh after the OS has been installed matches the correct version: Command Line Tools (OS X Mavericks)-6.0.

OS X Version: 10.9.5_13F34

User home directory not populated until Finder is launched

I am having a super weird issue.

Building the packer box with the 10.11.5 Installer and all the default packer build settings, folders like the Documents folder are NOT in my vagrant user's home directory:

image

Opening a Finder window will generate the directories, but until I reboot the VM the Documents shortcut icon in Finder is blank

image

I started having this issue with modified version of this build that I've been using internally (all credit given in the documentation), and honestly this has probably been going on for months and I've just ignored it.

I decided to just pull down your build clean and see if the issue persisted and it seems to. The weird thing is that I've build this project a few times, trying different things like skipping updates, and it has generated the home folders a couple of times - but I can't figure out what setting seems to help it along.

It's totally possible that this is expected, but I'm honestly still pretty new to OSX administration. This project has been crucial in helping me learn how to effectively manage OSX clients, I really appreciate you sharing it with us!

Here is all the relevant information I can think of:

Building with the OS 10.11.5 Installer via the latest commit of this project into packer .10.1 and vagrant 1.8.4 into VMWare Fusion Pro 8.1.1 with the vagrant-vmware-fusion plugin (4.0.10)

Clarify OSInstall.collection array

Is there any particular reason that OSInstall.mkpkg is listed twice in OSInstall.collection? Is that some kind of workaround for some specific oddity, or is this perhaps a typo?

xcode-cli-tools.sh failed with softwareupdate XPC error

The xcode-cli-tools.sh script failed with the following output:

==> vmware-iso: Provisioning with shell script: ../scripts/xcode-cli-tools.sh
    vmware-iso: Mar  3 00:34:29  softwareupdate CLI[314] <Error>: /usr/sbin/softwareupdate: Service connection interrupted!
    vmware-iso: Mar  3 00:34:29  softwareupdate CLI[314] <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})
    vmware-iso: Couldn’t communicate with a helper application.
    vmware-iso: : No such update
    vmware-iso: No updates are available.
    vmware-iso: Software Update Tool
    vmware-iso: Copyright 2002-2015 Apple Inc.
    vmware-iso:

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.

Enable ARDAgent via prepare_iso.sh

Not sure if it's possible, but it would be great if ARD could be turned on similar to screen sharing when building the new DMG.

The command I run after OS X boot is:

/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -off -restart -agent -privs -all -allowAccessFor -allUsers

Alternatively enabling just regular screen sharing would work too, but RDP is better.

Question - the prepare iso script.

I'm attempting to use the prepare_iso script to modify generate an installer image that can be used to install OS X onto a physical mac computer.

I'm aware this isn't the original point of this repository, but the SSH access is ideal for setting up a machine which can be further modified with ansible over SSH. Is there any advice you can offer, or reasons why this approach wouldn't work?

So far, I've managed to successfully generate the custom ISO, however booting from it on a Macbook Pro results in a 'no entry' symbol displayed on screen, while restoring the machines image from the generated image results in a boot process that takes hours to not finish, eventually logging a disk queue error.

Any advice much appreciated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.