Skip to content

Instantly share code, notes, and snippets.

@rmoriz
Last active April 14, 2023 20:30

Revisions

  1. rmoriz revised this gist May 28, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion howto.md
    Original file line number Diff line number Diff line change
    @@ -87,7 +87,7 @@
    ## Notes
    Vagrant seems to have a bug, that [will be fixed soon](https://github.com/mitchellh/vagrant/issues/5513):
    Vagrant seems to have a bug, that [will be fixed soon](https://github.com/mitchellh/vagrant/issues/5204):
    ```
    Vagrant insecure key detected. Vagrant will automatically replace
  2. rmoriz revised this gist May 28, 2015. 1 changed file with 27 additions and 1 deletion.
    28 changes: 27 additions & 1 deletion howto.md
    Original file line number Diff line number Diff line change
    @@ -50,7 +50,7 @@
    -var username=vagrant \
    -var password=vagrant \
    -var autologin=true \
    -var install_vagrant_keys=false \
    -var install_vagrant_keys=true \
    -except vmware-iso,parallels-iso \
    template.json

    @@ -85,6 +85,32 @@
    attributes:
    ```
    ## Notes
    Vagrant seems to have a bug, that [will be fixed soon](https://github.com/mitchellh/vagrant/issues/5513):
    ```
    Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    Vagrant is configured to generate a random keypair and insert it
    onto the guest machine, but it appears Vagrant doesn't know how to do
    this with your guest OS. Please disable key insertion by setting
    `config.ssh.insert_key = false` in the Vagrantfile.

    After doing so, run `vagrant reload` for the setting to take effect.

    If you'd like Vagrant to learn how to insert keys on this OS, please
    open an issue with details about your environment.

    ```

    You can find the Vagrantfile(s) inside `.kitchen`, add `config.ssh.insert_key = false` and execute `vagrant reload` in each directory containing a `Vagrantfile`.



    ## Status



    Tested on:
    2015-05-28
  3. rmoriz revised this gist May 28, 2015. 1 changed file with 4 additions and 3 deletions.
    7 changes: 4 additions & 3 deletions howto.md
    Original file line number Diff line number Diff line change
    @@ -43,14 +43,15 @@
    4. Start packer. This will take a lot of time and disk space (10+ GB)

    ```bash
    # update filename and checksum!
    packer build \
    -var iso_url=../out/OSX_InstallESD_10.10.3_14D136.dmg \ # <-- update filename here
    -var iso_checksum=3d379eb82fd8417974aa94d76157d511 \ # <-- update checksum here
    -var iso_url=../out/OSX_InstallESD_10.10.3_14D136.dmg \
    -var iso_checksum=3d379eb82fd8417974aa94d76157d511 \
    -var username=vagrant \
    -var password=vagrant \
    -var autologin=true \
    -var install_vagrant_keys=false \
    -except vmware-iso, parallels-iso \
    -except vmware-iso,parallels-iso \
    template.json

    ```
  4. rmoriz revised this gist May 28, 2015. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions howto.md
    Original file line number Diff line number Diff line change
    @@ -63,6 +63,8 @@

    6. Enjoy test-kitchen

    .kitchen.yml:

    ```yaml
    ---
    driver:
  5. rmoriz revised this gist May 28, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion howto.md
    Original file line number Diff line number Diff line change
    @@ -58,7 +58,7 @@
    5. Import box to Vagrant

    ```sh
    vagrant box add packer_virtualbox-iso_virtualbox.box --name maxosx-10.10
    vagrant box add packer_virtualbox-iso_virtualbox.box --name macosx-10.10
    ```

    6. Enjoy test-kitchen
  6. rmoriz revised this gist May 28, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion howto.md
    Original file line number Diff line number Diff line change
    @@ -42,7 +42,7 @@

    4. Start packer. This will take a lot of time and disk space (10+ GB)

    ```sh
    ```bash
    packer build \
    -var iso_url=../out/OSX_InstallESD_10.10.3_14D136.dmg \ # <-- update filename here
    -var iso_checksum=3d379eb82fd8417974aa94d76157d511 \ # <-- update checksum here
  7. rmoriz revised this gist May 28, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion howto.md
    Original file line number Diff line number Diff line change
    @@ -40,7 +40,7 @@
    "../scripts/system-update.sh",
    ```

    4. Start packer. This will take a lot of time and disk space (10+ GB)
    4. Start packer. This will take a lot of time and disk space (10+ GB)

    ```sh
    packer build \
  8. rmoriz revised this gist May 28, 2015. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions howto.md
    Original file line number Diff line number Diff line change
    @@ -44,8 +44,8 @@

    ```sh
    packer build \
    -var iso_url=../out/OSX_InstallESD_10.10.3_14D136.dmg \
    -var iso_checksum=3d379eb82fd8417974aa94d76157d511 \
    -var iso_url=../out/OSX_InstallESD_10.10.3_14D136.dmg \ # <-- update filename here
    -var iso_checksum=3d379eb82fd8417974aa94d76157d511 \ # <-- update checksum here
    -var username=vagrant \
    -var password=vagrant \
    -var autologin=true \
    @@ -90,5 +90,5 @@
    - VirtualBox 4.3.28
    - Vagrant 1.7.2
    - Packer v0.7.5
    - OSX 10.10
    - OSX 10.10.3_14D136
    - [timsutton/osx-vm-templates@ 0cad0b939b65e790f7cb5549f460dfa4cc273bbc](https://github.com/timsutton/osx-vm-templates/tree/0cad0b939b65e790f7cb5549f460dfa4cc273bbc)
  9. rmoriz revised this gist May 28, 2015. 1 changed file with 13 additions and 2 deletions.
    15 changes: 13 additions & 2 deletions howto.md
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@

    # Steps

    1. Open OSX App Store, download Yosemite. Once download is finished, the installer starts. Close it right away.
    1. Open OSX App Store, download Yosemite. Once the download is finished, the installer starts. Close it right away.

    2. Execute:
    ```sh
    @@ -80,4 +80,15 @@
    run_list:
    - recipe[your-cookbook::default]
    attributes:
    ```
    ```
    Tested on:
    2015-05-28
    Tested with:
    - VirtualBox 4.3.28
    - Vagrant 1.7.2
    - Packer v0.7.5
    - OSX 10.10
    - [timsutton/osx-vm-templates@ 0cad0b939b65e790f7cb5549f460dfa4cc273bbc](https://github.com/timsutton/osx-vm-templates/tree/0cad0b939b65e790f7cb5549f460dfa4cc273bbc)
  10. rmoriz revised this gist May 28, 2015. 1 changed file with 40 additions and 2 deletions.
    42 changes: 40 additions & 2 deletions howto.md
    Original file line number Diff line number Diff line change
    @@ -40,6 +40,44 @@
    "../scripts/system-update.sh",
    ```

    4. Start packer. This will take a lot of time and disk space (10+ GB)



    ```sh
    packer build \
    -var iso_url=../out/OSX_InstallESD_10.10.3_14D136.dmg \
    -var iso_checksum=3d379eb82fd8417974aa94d76157d511 \
    -var username=vagrant \
    -var password=vagrant \
    -var autologin=true \
    -var install_vagrant_keys=false \
    -except vmware-iso, parallels-iso \
    template.json

    ```

    5. Import box to Vagrant

    ```sh
    vagrant box add packer_virtualbox-iso_virtualbox.box --name maxosx-10.10
    ```

    6. Enjoy test-kitchen

    ```yaml
    ---
    driver:
    name: vagrant

    provisioner:
    name: chef_zero


    platforms:
    - name: macosx-10.10

    suites:
    - name: default
    run_list:
    - recipe[your-cookbook::default]
    attributes:
    ```
  11. rmoriz revised this gist May 28, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion howto.md
    Original file line number Diff line number Diff line change
    @@ -11,7 +11,7 @@
    1. Open OSX App Store, download Yosemite. Once download is finished, the installer starts. Close it right away.

    2. Execute:
    ```
    ```sh
    mkdir /tmp/osxvm
    cd /tmp/osxvm
    git clone https://github.com/timsutton/osx-vm-templates
  12. rmoriz revised this gist May 28, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion howto.md
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@

    # Steps

    1. Open OSX App Store, download Yosemite. Once download is finished, the installer start. Close it.
    1. Open OSX App Store, download Yosemite. Once download is finished, the installer starts. Close it right away.

    2. Execute:
    ```
  13. rmoriz revised this gist May 28, 2015. 1 changed file with 23 additions and 22 deletions.
    45 changes: 23 additions & 22 deletions howto.md
    Original file line number Diff line number Diff line change
    @@ -10,7 +10,7 @@

    1. Open OSX App Store, download Yosemite. Once download is finished, the installer start. Close it.

    2.
    2. Execute:
    ```
    mkdir /tmp/osxvm
    cd /tmp/osxvm
    @@ -21,24 +21,25 @@
    cd packer
    ```

    For use with test-kitchen we want a base image without chef, puppet, other stuff. Also we're only going to build the virtualbox image. Open the `template.json` file and adjust:

    ```diff
    --- i/packer/template.json
    +++ w/packer/template.json
    @@ -101,11 +101,7 @@
    "execute_command": "chmod +x {{ .Path }}; sudo {{ .Vars }} {{ .Path }}",
    "scripts": [
    "../scripts/vagrant.sh",
    - "../scripts/vmware.sh",
    - "../scripts/parallels.sh",
    "../scripts/xcode-cli-tools.sh",
    - "../scripts/chef-omnibus.sh",
    - "../scripts/puppet.sh",
    "../scripts/add-network-interface-detection.sh",
    "../scripts/autologin.sh",
    "../scripts/system-update.sh",
    ```



    3. For use with test-kitchen we want a base image without chef, puppet, other stuff. Also we're only going to build the virtualbox image. Open the `template.json` file and adjust:

    ```diff
    --- i/packer/template.json
    +++ w/packer/template.json
    @@ -101,11 +101,7 @@
    "execute_command": "chmod +x {{ .Path }}; sudo {{ .Vars }} {{ .Path }}",
    "scripts": [
    "../scripts/vagrant.sh",
    - "../scripts/vmware.sh",
    - "../scripts/parallels.sh",
    "../scripts/xcode-cli-tools.sh",
    - "../scripts/chef-omnibus.sh",
    - "../scripts/puppet.sh",
    "../scripts/add-network-interface-detection.sh",
    "../scripts/autologin.sh",
    "../scripts/system-update.sh",
    ```




  14. rmoriz revised this gist May 28, 2015. 1 changed file with 9 additions and 9 deletions.
    18 changes: 9 additions & 9 deletions howto.md
    Original file line number Diff line number Diff line change
    @@ -11,15 +11,15 @@
    1. Open OSX App Store, download Yosemite. Once download is finished, the installer start. Close it.

    2.
    ```
    mkdir /tmp/osxvm
    cd /tmp/osxvm
    git clone https://github.com/timsutton/osx-vm-templates
    cd osx-vm-templates
    sudo prepare_iso/prepare_iso.sh "/Applications/Install OS X Yosemite.app" out # note result .dmg filename
    md5 out/OSX_InstallESD_10.10.3_14D136.dmg # note result checksum
    cd packer
    ```
    ```
    mkdir /tmp/osxvm
    cd /tmp/osxvm
    git clone https://github.com/timsutton/osx-vm-templates
    cd osx-vm-templates
    sudo prepare_iso/prepare_iso.sh "/Applications/Install OS X Yosemite.app" out # note result .dmg filename
    md5 out/OSX_InstallESD_10.10.3_14D136.dmg # note result checksum
    cd packer
    ```

    For use with test-kitchen we want a base image without chef, puppet, other stuff. Also we're only going to build the virtualbox image. Open the `template.json` file and adjust:

  15. rmoriz created this gist May 28, 2015.
    44 changes: 44 additions & 0 deletions howto.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,44 @@
    # Requirements

    - VirtualBox
    - Vagrant
    - Packer
    - a Mac with a lot of Memory/CPU/Disk
    - great Templates/Tools from https://github.com/timsutton/osx-vm-templates

    # Steps

    1. Open OSX App Store, download Yosemite. Once download is finished, the installer start. Close it.

    2.
    ```
    mkdir /tmp/osxvm
    cd /tmp/osxvm
    git clone https://github.com/timsutton/osx-vm-templates
    cd osx-vm-templates
    sudo prepare_iso/prepare_iso.sh "/Applications/Install OS X Yosemite.app" out # note result .dmg filename
    md5 out/OSX_InstallESD_10.10.3_14D136.dmg # note result checksum
    cd packer
    ```

    For use with test-kitchen we want a base image without chef, puppet, other stuff. Also we're only going to build the virtualbox image. Open the `template.json` file and adjust:

    ```diff
    --- i/packer/template.json
    +++ w/packer/template.json
    @@ -101,11 +101,7 @@
    "execute_command": "chmod +x {{ .Path }}; sudo {{ .Vars }} {{ .Path }}",
    "scripts": [
    "../scripts/vagrant.sh",
    - "../scripts/vmware.sh",
    - "../scripts/parallels.sh",
    "../scripts/xcode-cli-tools.sh",
    - "../scripts/chef-omnibus.sh",
    - "../scripts/puppet.sh",
    "../scripts/add-network-interface-detection.sh",
    "../scripts/autologin.sh",
    "../scripts/system-update.sh",
    ```