From 07233cc552c43030e5104a9741ae27091e8ece53 Mon Sep 17 00:00:00 2001 From: zeus Date: Mon, 13 Mar 2023 16:33:21 +0200 Subject: [PATCH] insert --- AMZ_README_FIRST.md | 12 + AMZ_build_virtualbox-ovf.sh | 67 + CHANGELOG.md | 1225 +++++++++++++++++ CONTRIBUTING.md | 1 + LICENSE | 420 +++--- NOTICE.md | 11 + README.md | 174 ++- TESTING.md | 1 + build-ubuntu-18.04-iso.sh | 5 + builds/.gitkeep | 0 .../almalinux/almalinux-8-aarch64.pkrvars.hcl | 9 + .../almalinux/almalinux-8-x86_64.pkrvars.hcl | 9 + .../almalinux/almalinux-9-aarch64.pkrvars.hcl | 9 + .../almalinux/almalinux-9-x86_64.pkrvars.hcl | 9 + .../amazonlinux-2-x86_64.pkrvars.hcl | 21 + .../centos/centos-7-aarch64.pkrvars.hcl | 9 + os_pkrvars/centos/centos-7-x86_64.pkrvars.hcl | 9 + .../centos-stream-8-aarch64.pkrvars.hcl | 9 + .../centos/centos-stream-8-x86_64.pkrvars.hcl | 9 + .../centos-stream-9-aarch64.pkrvars.hcl | 9 + .../centos/centos-stream-9-x86_64.pkrvars.hcl | 9 + .../debian/debian-10-aarch64.pkrvars.hcl | 9 + .../debian/debian-10-x86_64.pkrvars.hcl | 9 + .../debian/debian-11-aarch64.pkrvars.hcl | 9 + .../debian/debian-11-x86_64.pkrvars.hcl | 9 + .../fedora/fedora-36-aarch64.pkrvars.hcl | 9 + .../fedora/fedora-36-x86_64.pkrvars.hcl | 9 + .../fedora/fedora-37-aarch64.pkrvars.hcl | 9 + .../fedora/fedora-37-x86_64.pkrvars.hcl | 9 + .../freebsd/freebsd-12-x86_64.pkrvars.hcl | 9 + .../freebsd/freebsd-13-x86_64.pkrvars.hcl | 9 + .../opensuse-leap-15-x86_64.pkrvars.hcl | 9 + .../oraclelinux-7-aarch64.pkrvars.hcl | 9 + .../oraclelinux-7-x86_64.pkrvars.hcl | 9 + .../oraclelinux-8-aarch64.pkrvars.hcl | 9 + .../oraclelinux-8-x86_64.pkrvars.hcl | 9 + .../oraclelinux-9-aarch64.pkrvars.hcl | 9 + .../oraclelinux-9-x86_64.pkrvars.hcl | 9 + os_pkrvars/rhel/rhel-7-aarch64.pkrvars.hcl | 9 + os_pkrvars/rhel/rhel-7-x86_64.pkrvars.hcl | 9 + os_pkrvars/rhel/rhel-8-aarch64.pkrvars.hcl | 9 + os_pkrvars/rhel/rhel-8-x86_64.pkrvars.hcl | 9 + os_pkrvars/rhel/rhel-9-aarch64.pkrvars.hcl | 9 + os_pkrvars/rhel/rhel-9-x86_64.pkrvars.hcl | 9 + .../rockylinux-8-aarch64.pkrvars.hcl | 9 + .../rockylinux-8-x86_64.pkrvars.hcl | 9 + .../rockylinux-9-aarch64.pkrvars.hcl | 9 + .../rockylinux-9-x86_64.pkrvars.hcl | 9 + .../scientificlinux-7-x86_64.pkrvars.hcl | 9 + os_pkrvars/sles/sles-12-x86_64.pkrvars.hcl | 9 + os_pkrvars/sles/sles-15-x86_64.pkrvars.hcl | 9 + .../solaris/solaris-11-x86_64.pkrvars.hcl | 9 + .../springdalelinux-7-x86_64.pkrvars.hcl | 9 + .../springdalelinux-8-x86_64.pkrvars.hcl | 9 + .../springdalelinux-9-x86_64.pkrvars.hcl | 9 + .../ubuntu/ubuntu-18.04-aarch64.pkrvars.hcl | 10 + .../ubuntu/ubuntu-18.04-x86_64.pkrvars.hcl | 10 + .../ubuntu/ubuntu-20.04-aarch64.pkrvars.hcl | 10 + .../ubuntu/ubuntu-20.04-x86_64.pkrvars.hcl | 11 + .../ubuntu/ubuntu-22.04-aarch64.pkrvars.hcl | 10 + .../ubuntu/ubuntu-22.04-x86_64.pkrvars.hcl | 10 + .../ubuntu/ubuntu-22.10-aarch64.pkrvars.hcl | 10 + .../ubuntu/ubuntu-22.10-x86_64.pkrvars.hcl | 10 + .../windows/windows-10-x86_64.pkrvars.hcl | 9 + .../windows/windows-10gen2-x86_64.pkrvars.hcl | 12 + .../windows/windows-11-x86_64.pkrvars.hcl | 11 + .../windows/windows-11gen2-x86_64.pkrvars.hcl | 13 + .../windows/windows-2012r2-x86_64.pkrvars.hcl | 9 + .../windows/windows-2016-x86_64.pkrvars.hcl | 9 + .../windows/windows-2019-x86_64.pkrvars.hcl | 9 + .../windows/windows-2022-x86_64.pkrvars.hcl | 9 + packer_templates/amz_seed_iso/README.md | 1 + packer_templates/amz_seed_iso/meta-data | 1 + packer_templates/amz_seed_iso/user-data | 29 + packer_templates/amz_working_files/README.md | 1 + packer_templates/cookbooks/packer/Berksfile | 3 + packer_templates/cookbooks/packer/chefignore | 115 ++ packer_templates/cookbooks/packer/kitchen.yml | 41 + packer_templates/cookbooks/packer/metadata.rb | 7 + .../cookbooks/packer/recipes/cleanup.rb | 79 ++ .../packer/recipes/configure_power.rb | 16 + .../cookbooks/packer/recipes/defrag.rb | 20 + .../packer/recipes/disable_restore.rb | 5 + .../packer/recipes/disable_screensaver.rb | 5 + .../cookbooks/packer/recipes/disable_uac.rb | 5 + .../packer/recipes/disable_windows_update.rb | 4 + .../packer/recipes/enable_file_sharing.rb | 3 + .../packer/recipes/enable_remote_desktop.rb | 10 + .../cookbooks/packer/recipes/features.rb | 3 + .../packer/recipes/remove_defender.rb | 3 + .../set_local_account_token_filter_policy.rb | 7 + .../cookbooks/packer/recipes/ui_tweaks.rb | Bin 0 -> 3851 bytes .../cookbooks/packer/recipes/updates.rb | 13 + .../cookbooks/packer/recipes/vm_tools.rb | 37 + packer_templates/http/debian/preseed.cfg | 104 ++ packer_templates/http/fedora/ks.cfg | 47 + packer_templates/http/freebsd/installerconfig | 55 + packer_templates/http/opensuse/autoinst.xml | 235 ++++ packer_templates/http/rhel/7ks.cfg | 77 ++ packer_templates/http/rhel/8ks.cfg | 77 ++ packer_templates/http/rhel/9ks.cfg | 76 + packer_templates/http/sles/12-autoinst.xml | 283 ++++ packer_templates/http/sles/15-autoinst.xml | 293 ++++ packer_templates/http/solaris/default.xml | 68 + packer_templates/http/solaris/profile.xml | 87 ++ packer_templates/http/springdalelinux/7ks.cfg | 81 ++ packer_templates/http/springdalelinux/8ks.cfg | 84 ++ packer_templates/http/springdalelinux/9ks.cfg | 82 ++ packer_templates/http/ubuntu/meta-data | 0 .../http/ubuntu/preseed-hyperv.cfg | 37 + packer_templates/http/ubuntu/preseed.cfg | 90 ++ packer_templates/http/ubuntu/user-data | 19 + packer_templates/pkr-builder.pkr.hcl | 254 ++++ packer_templates/pkr-sources.pkr.hcl | 277 ++++ packer_templates/pkr-variables.pkr.hcl | 307 +++++ packer_templates/scripts/_common/metadata.sh | 6 + packer_templates/scripts/_common/minimize.sh | 36 + packer_templates/scripts/_common/motd.sh | 21 + .../scripts/_common/parallels-rhel.sh | 47 + packer_templates/scripts/_common/parallels.sh | 39 + packer_templates/scripts/_common/sshd.sh | 21 + packer_templates/scripts/_common/vagrant.sh | 19 + .../scripts/_common/virtualbox.sh | 55 + .../scripts/_common/vmware_debian_ubuntu.sh | 11 + .../scripts/_common/vmware_fedora.sh | 9 + .../scripts/_common/vmware_rhel.sh | 18 + .../scripts/_common/vmware_suse.sh | 10 + .../scripts/debian/cleanup_debian.sh | 65 + .../scripts/debian/hyperv_debian.sh | 7 + .../scripts/debian/networking_debian.sh | 9 + .../scripts/debian/sudoers_debian.sh | 9 + .../scripts/debian/systemd_debian.sh | 4 + .../scripts/debian/update_debian.sh | 26 + .../scripts/fedora/build-tools_fedora.sh | 3 + .../scripts/fedora/cleanup_dnf.sh | 48 + .../install-supporting-packages_fedora.sh | 3 + .../scripts/fedora/networking_fedora.sh | 16 + .../scripts/fedora/real-tmp_fedora.sh | 3 + packer_templates/scripts/fedora/update_dnf.sh | 7 + .../scripts/freebsd/cleanup_freebsd.sh | 17 + .../scripts/freebsd/minimize_freebsd.sh | 16 + .../scripts/freebsd/postinstall_freebsd.sh | 39 + .../scripts/freebsd/sudoers_freebsd.sh | 4 + .../scripts/freebsd/update_freebsd.sh | 16 + .../scripts/freebsd/vmtools_freebsd.sh | 48 + packer_templates/scripts/rhel/cleanup_dnf.sh | 62 + packer_templates/scripts/rhel/cleanup_yum.sh | 62 + .../scripts/rhel/networking_rhel7.sh | 15 + packer_templates/scripts/rhel/update_dnf.sh | 7 + packer_templates/scripts/rhel/update_yum.sh | 5 + .../scripts/solaris/minimize_solaris.sh | 7 + .../scripts/solaris/update_solaris.sh | 4 + .../scripts/solaris/vmtools_solaris.sh | 24 + packer_templates/scripts/suse/cleanup_suse.sh | 32 + .../scripts/suse/remove-dvd-source_suse.sh | 4 + .../scripts/suse/repositories_suse.sh | 12 + packer_templates/scripts/suse/sudoers_suse.sh | 5 + .../scripts/suse/unsupported-modules_suse.sh | 4 + packer_templates/scripts/suse/update_suse.sh | 6 + .../scripts/suse/vagrant_group_suse.sh | 7 + .../scripts/suse/zypper-locks_suse.sh | 4 + .../scripts/ubuntu/cleanup_ubuntu.sh | 106 ++ .../scripts/ubuntu/hyperv_ubuntu.sh | 7 + .../scripts/ubuntu/networking_ubuntu.sh | 23 + .../scripts/ubuntu/sudoers_ubuntu.sh | 7 + .../scripts/ubuntu/systemd_ubuntu.sh | 4 + .../scripts/ubuntu/update_ubuntu.sh | 35 + .../scripts/windows/base_setup.ps1 | 54 + packer_templates/scripts/windows/cleanup.ps1 | 43 + .../windows/disable-windows-defender.ps1 | 49 + .../windows/disable-windows-updates.ps1 | 90 ++ .../scripts/windows/eject-media.ps1 | 60 + .../scripts/windows/enable-remote-desktop.ps1 | 43 + packer_templates/scripts/windows/optimize.ps1 | 216 +++ .../scripts/windows/provision-winrm.ps1 | 100 ++ .../scripts/windows/provision.ps1 | 135 ++ .../scripts/windows/remove-apps.ps1 | 110 ++ .../scripts/windows/remove-one-drive.ps1 | 69 + ...albox-prevent-vboxsrv-resolution-delay.ps1 | 34 + packer_templates/vagrantfile-freebsd.template | 16 + .../vagrantfile-windows-gen2.template | 22 + packer_templates/vagrantfile-windows.template | 24 + .../win_answer_files/10/Autounattend.xml | 217 +++ .../win_answer_files/10/gen2_Autounattend.xml | 253 ++++ .../win_answer_files/11/Autounattend.xml | 221 +++ .../win_answer_files/11/gen2_Autounattend.xml | 257 ++++ .../win_answer_files/2012/Autounattend.xml | 289 ++++ .../win_answer_files/2012r2/Autounattend.xml | 289 ++++ .../win_answer_files/2016/Autounattend.xml | 289 ++++ .../win_answer_files/2019/Autounattend.xml | 289 ++++ .../win_answer_files/2022/Autounattend.xml | 289 ++++ 191 files changed, 9839 insertions(+), 229 deletions(-) create mode 100644 AMZ_README_FIRST.md create mode 100755 AMZ_build_virtualbox-ovf.sh create mode 100644 CHANGELOG.md create mode 100644 CONTRIBUTING.md create mode 100644 NOTICE.md create mode 100644 TESTING.md create mode 100755 build-ubuntu-18.04-iso.sh create mode 100644 builds/.gitkeep create mode 100644 os_pkrvars/almalinux/almalinux-8-aarch64.pkrvars.hcl create mode 100644 os_pkrvars/almalinux/almalinux-8-x86_64.pkrvars.hcl create mode 100644 os_pkrvars/almalinux/almalinux-9-aarch64.pkrvars.hcl create mode 100644 os_pkrvars/almalinux/almalinux-9-x86_64.pkrvars.hcl create mode 100644 os_pkrvars/amazonlinux/amazonlinux-2-x86_64.pkrvars.hcl create mode 100644 os_pkrvars/centos/centos-7-aarch64.pkrvars.hcl create mode 100644 os_pkrvars/centos/centos-7-x86_64.pkrvars.hcl create mode 100644 os_pkrvars/centos/centos-stream-8-aarch64.pkrvars.hcl create mode 100644 os_pkrvars/centos/centos-stream-8-x86_64.pkrvars.hcl create mode 100644 os_pkrvars/centos/centos-stream-9-aarch64.pkrvars.hcl create mode 100644 os_pkrvars/centos/centos-stream-9-x86_64.pkrvars.hcl create mode 100644 os_pkrvars/debian/debian-10-aarch64.pkrvars.hcl create mode 100644 os_pkrvars/debian/debian-10-x86_64.pkrvars.hcl create mode 100644 os_pkrvars/debian/debian-11-aarch64.pkrvars.hcl create mode 100644 os_pkrvars/debian/debian-11-x86_64.pkrvars.hcl create mode 100644 os_pkrvars/fedora/fedora-36-aarch64.pkrvars.hcl create mode 100644 os_pkrvars/fedora/fedora-36-x86_64.pkrvars.hcl create mode 100644 os_pkrvars/fedora/fedora-37-aarch64.pkrvars.hcl create mode 100644 os_pkrvars/fedora/fedora-37-x86_64.pkrvars.hcl create mode 100644 os_pkrvars/freebsd/freebsd-12-x86_64.pkrvars.hcl create mode 100644 os_pkrvars/freebsd/freebsd-13-x86_64.pkrvars.hcl create mode 100644 os_pkrvars/opensuse/opensuse-leap-15-x86_64.pkrvars.hcl create mode 100644 os_pkrvars/oraclelinux/oraclelinux-7-aarch64.pkrvars.hcl create mode 100644 os_pkrvars/oraclelinux/oraclelinux-7-x86_64.pkrvars.hcl create mode 100644 os_pkrvars/oraclelinux/oraclelinux-8-aarch64.pkrvars.hcl create mode 100644 os_pkrvars/oraclelinux/oraclelinux-8-x86_64.pkrvars.hcl create mode 100644 os_pkrvars/oraclelinux/oraclelinux-9-aarch64.pkrvars.hcl create mode 100644 os_pkrvars/oraclelinux/oraclelinux-9-x86_64.pkrvars.hcl create mode 100644 os_pkrvars/rhel/rhel-7-aarch64.pkrvars.hcl create mode 100644 os_pkrvars/rhel/rhel-7-x86_64.pkrvars.hcl create mode 100644 os_pkrvars/rhel/rhel-8-aarch64.pkrvars.hcl create mode 100644 os_pkrvars/rhel/rhel-8-x86_64.pkrvars.hcl create mode 100644 os_pkrvars/rhel/rhel-9-aarch64.pkrvars.hcl create mode 100644 os_pkrvars/rhel/rhel-9-x86_64.pkrvars.hcl create mode 100644 os_pkrvars/rockylinux/rockylinux-8-aarch64.pkrvars.hcl create mode 100644 os_pkrvars/rockylinux/rockylinux-8-x86_64.pkrvars.hcl create mode 100644 os_pkrvars/rockylinux/rockylinux-9-aarch64.pkrvars.hcl create mode 100644 os_pkrvars/rockylinux/rockylinux-9-x86_64.pkrvars.hcl create mode 100644 os_pkrvars/scientificlinux/scientificlinux-7-x86_64.pkrvars.hcl create mode 100644 os_pkrvars/sles/sles-12-x86_64.pkrvars.hcl create mode 100644 os_pkrvars/sles/sles-15-x86_64.pkrvars.hcl create mode 100644 os_pkrvars/solaris/solaris-11-x86_64.pkrvars.hcl create mode 100644 os_pkrvars/springdalelinux/springdalelinux-7-x86_64.pkrvars.hcl create mode 100644 os_pkrvars/springdalelinux/springdalelinux-8-x86_64.pkrvars.hcl create mode 100644 os_pkrvars/springdalelinux/springdalelinux-9-x86_64.pkrvars.hcl create mode 100644 os_pkrvars/ubuntu/ubuntu-18.04-aarch64.pkrvars.hcl create mode 100644 os_pkrvars/ubuntu/ubuntu-18.04-x86_64.pkrvars.hcl create mode 100644 os_pkrvars/ubuntu/ubuntu-20.04-aarch64.pkrvars.hcl create mode 100644 os_pkrvars/ubuntu/ubuntu-20.04-x86_64.pkrvars.hcl create mode 100644 os_pkrvars/ubuntu/ubuntu-22.04-aarch64.pkrvars.hcl create mode 100644 os_pkrvars/ubuntu/ubuntu-22.04-x86_64.pkrvars.hcl create mode 100644 os_pkrvars/ubuntu/ubuntu-22.10-aarch64.pkrvars.hcl create mode 100644 os_pkrvars/ubuntu/ubuntu-22.10-x86_64.pkrvars.hcl create mode 100644 os_pkrvars/windows/windows-10-x86_64.pkrvars.hcl create mode 100644 os_pkrvars/windows/windows-10gen2-x86_64.pkrvars.hcl create mode 100644 os_pkrvars/windows/windows-11-x86_64.pkrvars.hcl create mode 100644 os_pkrvars/windows/windows-11gen2-x86_64.pkrvars.hcl create mode 100644 os_pkrvars/windows/windows-2012r2-x86_64.pkrvars.hcl create mode 100644 os_pkrvars/windows/windows-2016-x86_64.pkrvars.hcl create mode 100644 os_pkrvars/windows/windows-2019-x86_64.pkrvars.hcl create mode 100644 os_pkrvars/windows/windows-2022-x86_64.pkrvars.hcl create mode 100644 packer_templates/amz_seed_iso/README.md create mode 100644 packer_templates/amz_seed_iso/meta-data create mode 100644 packer_templates/amz_seed_iso/user-data create mode 100644 packer_templates/amz_working_files/README.md create mode 100644 packer_templates/cookbooks/packer/Berksfile create mode 100644 packer_templates/cookbooks/packer/chefignore create mode 100644 packer_templates/cookbooks/packer/kitchen.yml create mode 100644 packer_templates/cookbooks/packer/metadata.rb create mode 100644 packer_templates/cookbooks/packer/recipes/cleanup.rb create mode 100644 packer_templates/cookbooks/packer/recipes/configure_power.rb create mode 100644 packer_templates/cookbooks/packer/recipes/defrag.rb create mode 100644 packer_templates/cookbooks/packer/recipes/disable_restore.rb create mode 100644 packer_templates/cookbooks/packer/recipes/disable_screensaver.rb create mode 100644 packer_templates/cookbooks/packer/recipes/disable_uac.rb create mode 100644 packer_templates/cookbooks/packer/recipes/disable_windows_update.rb create mode 100644 packer_templates/cookbooks/packer/recipes/enable_file_sharing.rb create mode 100644 packer_templates/cookbooks/packer/recipes/enable_remote_desktop.rb create mode 100644 packer_templates/cookbooks/packer/recipes/features.rb create mode 100644 packer_templates/cookbooks/packer/recipes/remove_defender.rb create mode 100644 packer_templates/cookbooks/packer/recipes/set_local_account_token_filter_policy.rb create mode 100644 packer_templates/cookbooks/packer/recipes/ui_tweaks.rb create mode 100644 packer_templates/cookbooks/packer/recipes/updates.rb create mode 100644 packer_templates/cookbooks/packer/recipes/vm_tools.rb create mode 100644 packer_templates/http/debian/preseed.cfg create mode 100644 packer_templates/http/fedora/ks.cfg create mode 100644 packer_templates/http/freebsd/installerconfig create mode 100644 packer_templates/http/opensuse/autoinst.xml create mode 100644 packer_templates/http/rhel/7ks.cfg create mode 100644 packer_templates/http/rhel/8ks.cfg create mode 100644 packer_templates/http/rhel/9ks.cfg create mode 100644 packer_templates/http/sles/12-autoinst.xml create mode 100644 packer_templates/http/sles/15-autoinst.xml create mode 100644 packer_templates/http/solaris/default.xml create mode 100644 packer_templates/http/solaris/profile.xml create mode 100644 packer_templates/http/springdalelinux/7ks.cfg create mode 100644 packer_templates/http/springdalelinux/8ks.cfg create mode 100644 packer_templates/http/springdalelinux/9ks.cfg create mode 100644 packer_templates/http/ubuntu/meta-data create mode 100755 packer_templates/http/ubuntu/preseed-hyperv.cfg create mode 100644 packer_templates/http/ubuntu/preseed.cfg create mode 100644 packer_templates/http/ubuntu/user-data create mode 100644 packer_templates/pkr-builder.pkr.hcl create mode 100644 packer_templates/pkr-sources.pkr.hcl create mode 100644 packer_templates/pkr-variables.pkr.hcl create mode 100755 packer_templates/scripts/_common/metadata.sh create mode 100644 packer_templates/scripts/_common/minimize.sh create mode 100644 packer_templates/scripts/_common/motd.sh create mode 100644 packer_templates/scripts/_common/parallels-rhel.sh create mode 100644 packer_templates/scripts/_common/parallels.sh create mode 100644 packer_templates/scripts/_common/sshd.sh create mode 100644 packer_templates/scripts/_common/vagrant.sh create mode 100644 packer_templates/scripts/_common/virtualbox.sh create mode 100644 packer_templates/scripts/_common/vmware_debian_ubuntu.sh create mode 100644 packer_templates/scripts/_common/vmware_fedora.sh create mode 100644 packer_templates/scripts/_common/vmware_rhel.sh create mode 100644 packer_templates/scripts/_common/vmware_suse.sh create mode 100644 packer_templates/scripts/debian/cleanup_debian.sh create mode 100755 packer_templates/scripts/debian/hyperv_debian.sh create mode 100644 packer_templates/scripts/debian/networking_debian.sh create mode 100644 packer_templates/scripts/debian/sudoers_debian.sh create mode 100644 packer_templates/scripts/debian/systemd_debian.sh create mode 100644 packer_templates/scripts/debian/update_debian.sh create mode 100644 packer_templates/scripts/fedora/build-tools_fedora.sh create mode 100644 packer_templates/scripts/fedora/cleanup_dnf.sh create mode 100644 packer_templates/scripts/fedora/install-supporting-packages_fedora.sh create mode 100644 packer_templates/scripts/fedora/networking_fedora.sh create mode 100644 packer_templates/scripts/fedora/real-tmp_fedora.sh create mode 100644 packer_templates/scripts/fedora/update_dnf.sh create mode 100644 packer_templates/scripts/freebsd/cleanup_freebsd.sh create mode 100644 packer_templates/scripts/freebsd/minimize_freebsd.sh create mode 100644 packer_templates/scripts/freebsd/postinstall_freebsd.sh create mode 100644 packer_templates/scripts/freebsd/sudoers_freebsd.sh create mode 100644 packer_templates/scripts/freebsd/update_freebsd.sh create mode 100644 packer_templates/scripts/freebsd/vmtools_freebsd.sh create mode 100644 packer_templates/scripts/rhel/cleanup_dnf.sh create mode 100644 packer_templates/scripts/rhel/cleanup_yum.sh create mode 100644 packer_templates/scripts/rhel/networking_rhel7.sh create mode 100644 packer_templates/scripts/rhel/update_dnf.sh create mode 100644 packer_templates/scripts/rhel/update_yum.sh create mode 100644 packer_templates/scripts/solaris/minimize_solaris.sh create mode 100644 packer_templates/scripts/solaris/update_solaris.sh create mode 100644 packer_templates/scripts/solaris/vmtools_solaris.sh create mode 100644 packer_templates/scripts/suse/cleanup_suse.sh create mode 100644 packer_templates/scripts/suse/remove-dvd-source_suse.sh create mode 100644 packer_templates/scripts/suse/repositories_suse.sh create mode 100644 packer_templates/scripts/suse/sudoers_suse.sh create mode 100644 packer_templates/scripts/suse/unsupported-modules_suse.sh create mode 100644 packer_templates/scripts/suse/update_suse.sh create mode 100644 packer_templates/scripts/suse/vagrant_group_suse.sh create mode 100644 packer_templates/scripts/suse/zypper-locks_suse.sh create mode 100644 packer_templates/scripts/ubuntu/cleanup_ubuntu.sh create mode 100755 packer_templates/scripts/ubuntu/hyperv_ubuntu.sh create mode 100644 packer_templates/scripts/ubuntu/networking_ubuntu.sh create mode 100644 packer_templates/scripts/ubuntu/sudoers_ubuntu.sh create mode 100644 packer_templates/scripts/ubuntu/systemd_ubuntu.sh create mode 100644 packer_templates/scripts/ubuntu/update_ubuntu.sh create mode 100644 packer_templates/scripts/windows/base_setup.ps1 create mode 100644 packer_templates/scripts/windows/cleanup.ps1 create mode 100644 packer_templates/scripts/windows/disable-windows-defender.ps1 create mode 100644 packer_templates/scripts/windows/disable-windows-updates.ps1 create mode 100644 packer_templates/scripts/windows/eject-media.ps1 create mode 100644 packer_templates/scripts/windows/enable-remote-desktop.ps1 create mode 100644 packer_templates/scripts/windows/optimize.ps1 create mode 100644 packer_templates/scripts/windows/provision-winrm.ps1 create mode 100644 packer_templates/scripts/windows/provision.ps1 create mode 100644 packer_templates/scripts/windows/remove-apps.ps1 create mode 100644 packer_templates/scripts/windows/remove-one-drive.ps1 create mode 100644 packer_templates/scripts/windows/virtualbox-prevent-vboxsrv-resolution-delay.ps1 create mode 100644 packer_templates/vagrantfile-freebsd.template create mode 100644 packer_templates/vagrantfile-windows-gen2.template create mode 100644 packer_templates/vagrantfile-windows.template create mode 100644 packer_templates/win_answer_files/10/Autounattend.xml create mode 100644 packer_templates/win_answer_files/10/gen2_Autounattend.xml create mode 100644 packer_templates/win_answer_files/11/Autounattend.xml create mode 100644 packer_templates/win_answer_files/11/gen2_Autounattend.xml create mode 100644 packer_templates/win_answer_files/2012/Autounattend.xml create mode 100644 packer_templates/win_answer_files/2012r2/Autounattend.xml create mode 100644 packer_templates/win_answer_files/2016/Autounattend.xml create mode 100644 packer_templates/win_answer_files/2019/Autounattend.xml create mode 100644 packer_templates/win_answer_files/2022/Autounattend.xml diff --git a/AMZ_README_FIRST.md b/AMZ_README_FIRST.md new file mode 100644 index 0000000..5393c82 --- /dev/null +++ b/AMZ_README_FIRST.md @@ -0,0 +1,12 @@ +This is not your normal Bento box. Instead of building a system from an ISO we're building a system from an Amazon provided VirtualBox VDI file. This means the process is a bit different than usual. + +# Building this box + +Simply run the AMZ_build_virtualbox-ovf.sh script + +This script will: + +1. Download the VirtualBox .vdi file for Amazon Linux 2 and place it in the amz_working_files directory. Amazon hosts these at . It will name it amazon.vdi instead of the version specific name that Amazon gives it on their site +1. It will prepare this VDI file for packer and export it as a OVF file +1. It will run the packer build +1. Lastly it will clean up the leftover files in the working directory diff --git a/AMZ_build_virtualbox-ovf.sh b/AMZ_build_virtualbox-ovf.sh new file mode 100755 index 0000000..87497a1 --- /dev/null +++ b/AMZ_build_virtualbox-ovf.sh @@ -0,0 +1,67 @@ +#!/bin/bash + +# Getting script directory location +SCRIPT_RELATIVE_DIR=$(dirname "${BASH_SOURCE[0]}") +cd "$SCRIPT_RELATIVE_DIR" || exit + +# set tmp dir for files +AMZDIR="$(pwd)/packer_templates/amz_working_files" + +# Get virtualbox vdi file name with latest version number +IMG="$(wget -q https://cdn.amazonlinux.com/os-images/latest/virtualbox/ -O - | grep ".vdi" | cut -d "\"" -f 2)" + +# Download vbox vdi +wget -q -O "$AMZDIR"/amazon.vdi -c https://cdn.amazonlinux.com/os-images/latest/virtualbox/"$IMG" + +if [ ! -f "$AMZDIR"/amazon.vdi ]; then + echo There must be a file named amazon.vdi in "$AMZDIR"! + echo You can download the vdi file at https://cdn.amazonlinux.com/os-images/latest/virtualbox/ + exit 1 +fi + +echo "Cleaning up old files" +rm -f "$AMZDIR"/*.iso "$AMZDIR"/*.ovf "$AMZDIR"/*.vmdk + +echo "Creating ISO" +hdiutil makehybrid -o "$AMZDIR"/seed.iso -hfs -joliet -iso -default-volume-name cidata "$AMZDIR"/../amz_seed_iso + +VM="AmazonLinuxBento" +echo Powering off and deleting any existing VMs named $VM +VBoxManage controlvm $VM poweroff --type headless 2> /dev/null +VBoxManage unregistervm $VM --delete 2> /dev/null +sleep 5 + +echo "Creating the VM" +# from https://www.perkin.org.uk/posts/create-virtualbox-vm-from-the-command-line.html +VBoxManage createvm --name $VM --ostype "RedHat_64" --register +VBoxManage storagectl $VM --name "SATA Controller" --add sata --controller IntelAHCI +VBoxManage storageattach $VM --storagectl "SATA Controller" --port 0 --device 0 --type hdd --medium "$AMZDIR"/amazon.vdi +VBoxManage storagectl $VM --name "IDE Controller" --add ide +VBoxManage storageattach $VM --storagectl "IDE Controller" --port 0 --device 0 --type dvddrive --medium "$AMZDIR"/seed.iso +VBoxManage modifyvm $VM --memory 1024 +VBoxManage modifyvm $VM --cpus 2 +VBoxManage modifyvm $VM --audio none +VBoxManage modifyvm $VM --ioapic on +sleep 5 + +echo Sleeping for 120 seconds to let the system boot and cloud-init to run +VBoxManage startvm $VM --type headless +sleep 120 +VBoxManage controlvm $VM poweroff --type headless +VBoxManage storageattach $VM --storagectl "IDE Controller" --port 0 --device 0 --type dvddrive --medium none +sleep 5 + +echo Exporting the VM to an OVF file +vboxmanage export $VM -o "$AMZDIR"/amazon2.ovf +sleep 5 + +echo Deleting the VM +vboxmanage unregistervm $VM --delete + +echo starting packer build of amazonlinux +if packer build -timestamp-ui -only=virtualbox-ovf.amazonlinux -var-file="$AMZDIR"/../../os_pkrvars/amazonlinux/amazonlinux-2-x86_64.pkrvars.hcl "$AMZDIR"/../../packer_templates; then + echo "Cleaning up files" + rm -f "$AMZDIR"/*.ovf "$AMZDIR"/*.vmdk "$AMZDIR"/*.iso +else + exit 1 +fi diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..07677f2 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,1225 @@ +# Change Log + +## Working Builds + +***Note:** +Markdown table generated at + +| | hyperv
x86_64 | parallels
x86_64 | parallels
aarch64 | qemu
x86_64 | qemu
aarch64 | virtualbox
x86_64 | virtualbox
aarch64 | vmware
x86_64 | vmware
aarch64 | +|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:| +| almalinux-8 | | x | | x | | x | | x | | +| almalinux-9 | | x | x | | | x | | x | | +| amazonlinux-2 | | na | na | na | na | x | | na | na | +| amazonlinux-2022 | na | na | na | na | na | na | na | na | na | +| centos-7 | | x | | x | | x | | x | | +| centos-stream-8 | | x | | x | | x | | x | | +| centos-stream-9 | | | | | | x | | x | | +| debian-10 | | | x | | | x | | x | | +| debian-11 | | x | x | | | x | | x | | +| fedora-36 | | x | x | x | | x | | x | | +| fedora-37 | | x | x | x | | x | | x | | +| freebsd-12 | | | na | | na | x | na | | na | +| freebsd-13 | | | na | | na | x | na | | na | +| opensuse-leap-15 | | | na | x | na | | na | x | na | +| oraclelinux-7 | | x | | x | | x | | x | | +| oraclelinux-8 | | | | x | | x | | x | | +| oraclelinux-9 | | x | x | | | x | | x | | +| rhel-7 | | | | | | | | | | +| rhel-8 | | | | | | | | | | +| rhel-9 | | | | | | | | | | +| rockylinux-8 | | x | | x | | x | | x | | +| rockylinux-9 | | x | x | | | x | | x | | +| scientificlinux-7 | | x | na | x | na | x | na | x | na | +| sles-12 | | | na | | na | | na | | na | +| sles-13 | | | na | | na | | na | | na | +| solaris-11 | | | na | | na | | na | | na | +| springdalelinux-7 | | x | na | x | na | | na | | na | +| springdalelinux-8 | | x | na | x | na | x | na | x | na | +| springdalelinux-9 | | x | na | | na | x | na | x | na | +| ubuntu-18.04 | | x | | | | x | | x | | +| ubuntu-20.04 | | | x | | | | | | | +| ubuntu-22.04 | | x | x | x | | x | | x | | +| ubuntu-22.10 | | x | x | x | | x | | x | | +| ubuntu-23.04 | na | na | na | na | na | na | na | na | na | +| windows-10 | x | x | na | | na | x | na | | na | +| windows-10gen2 | | na | na | na | na | na | na | na | na | +| windows-11 | x | x | na | | na | x | na | | na | +| windows-11gen2 | | na | na | na | na | na | na | na | na | +| windows-2012r2 | | x | na | | na | x | na | | na | +| windows-2016 | x | x | na | | na | x | na | x | na | +| windows-2019 | x | x | na | | na | x | na | | na | +| windows-2022 | x | x | na | | na | x | na | | na | + +## [unreleased] (2023-03-07) + +## [v202303.06] (2023-03-07) + +- Added a cleanup step in build pipelines for cancelled jobs that otherwise leave vm in place + +## [v202303.05.0] (2023-03-05) + +### Fixes and updates + +- added aarch64 builds and runner + +### Todo + +- Fix failing builds +- Finish removal of deprecated chef-solo provider to powershell provider for windows +- migrate from http directory for hosting files to cd_files in source templates + - This makes all builds compatable with hyper-v gen 2 which removes floppy disk capability + - This also makes things universal for Virtualbox 6.1 to 7.x due to latter requiring extra config for guests on NAT to be able to connect to host +- Update pipelines to only run on updated pkrvars files +- Look into making all build uefi default builds +- Create CD pipeline to upload vagrant boxes after PR is merged +- Create CD pipeline to build and upload new versions of vagrant boxes once every 3 months with the latest patches + +## [v202302.22.0] (2023-02-22) + +### New Platforms + +- Ubuntu 18.04 aarch64 + +### Fixes and updates + +- fixed Ubuntu aarch64 builds +- various box fixes as found +- added qemu pipeline builds +- added hyperv pipeline builds +- added vmware pipeline builds + +### Todo + +- Fix failing builds +- Add more Virtualization providers to build pipelines + - vmware + - aarch64 - vmware plugin has issues with fusion 13 + - virtualbox + - aarch64 - Vbox Beta support currently +- Finish removal of deprecated chef-solo provider to powershell provider for windows +- migrate from http directory for hosting files to cd_files in source templates + - This makes all builds compatable with hyper-v gen 2 which removes floppy disk capability + - This also makes things universal for Virtualbox 6.1 to 7.x due to latter requiring extra config for guests on NAT to be able to connect to host +- Update pipelines to only run on updated pkrvars files +- Create CD pipeline to upload vagrant boxes after PR is merged +- Create CD pipeline to build and upload new versions of vagrant boxes once every 3 months with the latest patches + +## [v202301.19.0] (2023-01-19) + +### Notes + +- When running packer build command the output directory is relative to the working directory the command is currently running in. Suggest running packer build commands from bento root directory for build working files to be placed in bento/builds/(build_name) directory by default. If the output_directory variable isn't overwritten a directory called builds/(build_name) will be created in the current working directory that you are running the command from + +### Fixes and updates + +- fixed x86_64 Ubuntu 22.10 build +- set qemu_accelerator to null +- fixed bug in output_directory variable - the provisioner option doesn't take template variables only hcl variables +- updated AMZ_README_FIRST.md with how to use the updated script and actions it'll perform +- updated README.md with vbox 7 fix and added note on builds directory being relative to the current working directory + +### Known Issues + +#### Failing Builds + +- OpenSUSE Leap 15 - x86_64 +- SpringdaleLinux 7 - x86_64 +- almalinux 8 - aarch64 +- CentOS 7 - aarch64 +- CentOS-Stream 8 - aarch64 +- CentOS-Stream - aarch64 +- Fedora 36 - aarch64 +- Fedora 37 - aarch64 +- OracleLinux 7 - aarch64 +- OracleLinux 8 - aarch64 +- Ubuntu 22.04 - aarch64 +- Ubuntu 22.10 - aarch64 + +### Todo + +- Fix failing builds +- Add more Virtualization providers to build pipelines +- Finish removal of deprecated chef-solo provider to powershell provider for windows +- migrate from http directory for hosting files to cd_files in source templates + - This makes all builds compatable with hyper-v gen 2 which removes floppy disk capability + - This also makes things universal for Virtualbox 6.1 to 7.x due to latter requiring extra config for guests on NAT to be able to connect to host +- Update pipelines to only run on updated pkrvars files +- Create CD pipeline to upload vagrant boxes after PR is merged +- Create CD pipeline to build and upload new versions of vagrant boxes once every 3 months with the latest patches + +## [v202301.09.0] (2023-01-09) + +### Notes + +- Manual run command from within the bento directory `packer build -only=virtualbox-iso.vm -var-file=os_pkrvars/almalinux/almalinux-9-x86_64.pkrvars.hcl ./packer_templates` +- Old Bento code and Json templates moved to protected branch `bento_old_json_templates` +- All x86_64 builds are currently tested on macos-12 with virtualbox 6.1.38 in Github Actions +- All aarch64 buiils are currently tested on internal runner with M1 macos-13.1 and parallels 18.1.1 +- Source, builder, variable hcl code found in packer_templates folder +- Pkrvars.hcl files representing each OS, version, architecture found in os_pkrvars folders + +### New Platforms + +- CentOS 7.9 - aarch64 +- CentOS-Stream 8 - aarch64 +- CentOS-Stream 9 - aarch64 +- Fedora 37 - aarch64 +- OracleLinux 7.9 - aarch64 +- OracleLinux 8.7 - aarch64 +- OracleLinux 9.1 - aarch64 +- Rhel 7.9 - aarch64 +- Rhel 8.7 - aarch64 +- Rhel 9.1 - aarch64 +- Rhel 9.1 - x86_64 +- RockyLinux 8.7 - aarch64 +- RockyLinux 9.1 - aarch64 +- Springdalelinux 9.1 - x86_64 +- Ubuntu 22.10 - aarch64 + +### Removed Platforms + +- Debian 9 - all archs +- Debian 10.13 - i386 +- Debian 11.6 - i386 +- Freebsd 12.3 - all archs +- Freebsd 12.4 - i386 +- OracleLinux 6 - all archs +- Rhel 6 - all archs +- Sles 11 - all archs +- Ubuntu 16.04 - all archs +- Windows 2012 - all archs + +### Fixes and updates + +- rewrite of json templates to hcl2 +- Added linting checks of files and scripts +- Added a build pipeline for integration testing +- Removed 32bit OS builds +- Added several more aarch64(arm64) builds + +### Known Issues + +#### Failing Builds + +- OpenSUSE Leap 15 - x86_64 +- SpringdaleLinux 8 - x86_64 +- Ubuntu 22.10 - x86_64 +- CentOS 7 - aarch64 +- CentOS-Stream 8 - aarch64 +- CentOS-Stream - aarch64 +- Fedora 36 - aarch64 +- Fedora 37 - aarch64 +- OracleLinux 7 - aarch64 +- OracleLinux 8 - aarch64 +- Ubuntu 22.04 - aarch64 +- Ubuntu 22.10 - aarch64 + +### Todo + +- Fix failing builds +- Add more Virtualization providers to build pipelines +- Finish removal of deprecated chef-solo provider to powershell provider for windows +- migrate from http directory for hosting files to cd_files in source templates + - This makes all builds compatable with hyper-v gen 2 which removes floppy disk capability + - This also makes things universal for Virtualbox 6.1 to 7.x due to latter requiring extra config for guests on NAT to be able to connect to host +- Update pipelines to only run on updated pkrvars files +- Create CD pipeline to upload vagrant boxes after PR is merged +- Create CD pipeline to build and upload new versions of vagrant boxes once every 3 months with the latest patches + +## [v202206.14.0] (2022-06-14) + +### New Platforms + +- almalinux 8.6 [\#1414](https://github.com/chef/bento/pull/1414) ([stromweld](https://github.com/stromweld)) +- almalinux 9.0 [\#1414](https://github.com/chef/bento/pull/1414) ([stromweld](https://github.com/stromweld)) +- rocklinux 8.6 [\#1414](https://github.com/chef/bento/pull/1414) ([stromweld](https://github.com/stromweld)) +- windows 11 [\#1414](https://github.com/chef/bento/pull/1414) ([stromweld](https://github.com/stromweld)) +- windows 2022 [\#1414](https://github.com/chef/bento/pull/1414) ([stromweld](https://github.com/stromweld)) + +### Deprecated Platforms + +### Fixes and updates + +- update windows builds to be created in builds folder [\#1414](https://github.com/chef/bento/pull/1414) ([stromweld](https://github.com/stromweld)) + +## [v201812.27.0] (2019-01-16) + +### New Platforms + +- Debian 9.6 [\#1138](https://github.com/chef/bento/pull/1138) ([cheeseplus](https://github.com/cheeseplus)) +- Fedora 29 [\#1126](https://github.com/chef/bento/pull/1126) ([avanzzzi](https://github.com/avanzzzi)) +- CentOS 7.6 [\#1152](https://github.com/chef/bento/pull/1152) ([artem-sidorenko](https://github.com/artem-sidorenko)) +- Oracle Linux 7.6 [\#1146](https://github.com/chef/bento/pull/1146) ([tas50](https://github.com/tas50)) +- FreeBSD 12.0-RELEASE [\#1153](https://github.com/chef/bento/pull/1153) ([lwhsu](https://github.com/lwhsu)) +- Ubuntu 18.10 [\#1124](https://github.com/chef/bento/pull/1124) ([chenhan1218](https://github.com/chenhan1218)) + +### Deprecated Platforms + +- FreeBSD 11.1 [\#1120](https://github.com/chef/bento/pull/1120) ([juliandunn](https://github.com/juliandunn)) +- FreeBSD 10.4 [\#1142](https://github.com/chef/bento/pull/1142) ([tas50](https://github.com/tas50)) + +### Fixes and updates + +- Whiteout all spaces [\#1151](https://github.com/chef/bento/pull/1151) ([Sorbog](https://github.com/Sorbog)) +- Reduce centos locale size [\#1149](https://github.com/chef/bento/pull/1149) ([Sorbog](https://github.com/Sorbog)) +- Update from rhel 7.5 to 7.6 [\#1143](https://github.com/chef/bento/pull/1143) ([chrispoupart](https://github.com/chrispoupart)) +- Support for fedora29 in libvirt and public release [\#1137](https://github.com/chef/bento/pull/1137) ([avanzzzi](https://github.com/avanzzzi)) +- Fix build/upload of freebsd-11.2-i386 [\#1136](https://github.com/chef/bento/pull/1136) ([tmm1](https://github.com/tmm1)) +- Update for Ubuntu 16.04.5 i386 [\#1134](https://github.com/chef/bento/pull/1134) ([sheurich](https://github.com/sheurich)) +- Update for Ubuntu 16.04.5 amd64 [\#1133](https://github.com/chef/bento/pull/1133) ([sheurich](https://github.com/sheurich)) +- add vmware-iso to windows 2016 [\#1132](https://github.com/chef/bento/pull/1132) ([mkinney](https://github.com/mkinney)) +- update debian provision: purge installation-report in cleanup.sh [\#1131](https://github.com/chef/bento/pull/1131) ([UniIsland](https://github.com/UniIsland)) +- Make sure to disable UAC on windows [\#1130](https://github.com/chef/bento/pull/1130) ([tas50](https://github.com/tas50)) +- Fix the download link for Windows 2012R2 [\#1128](https://github.com/chef/bento/pull/1128) ([tas50](https://github.com/tas50)) +- Fix startup mount error on Parallels 14 guest tools [\#1122](https://github.com/chef/bento/pull/1122) ([max-arnold](https://github.com/max-arnold)) + +## [v201808.24.0](https://github.com/chef/bento/tree/v201808.24.0) (2018-09-02) + +### New Platforms + +- CentOS 5.11 (resurrected) +- OpenSUSE 15 + +## [v201807.12.0] (2018-07-16) + +### New Platforms + +- FreeBSD 11.2-RELEASE [\#1068](https://github.com/chef/bento/pull/1068) ([lwhsu](https://github.com/lwhsu)) +- Debian 8.11 [\#1064](https://github.com/chef/bento/pull/1064) ([kenhys](https://github.com/kenhys)) +- Debian 9.5 +- CentOS 6.10 + +### Deprecated Platforms + +- Debian 7 [\#1059](https://github.com/chef/bento/pull/1059) ([tas50](https://github.com/tas50)) +- Fedora 26 [\#1074](https://github.com/chef/bento/pull/1074) ([tas50](https://github.com/tas50)) +- Ubuntu 17.10 [\#1077](https://github.com/chef/bento/pull/1077) ([tas50](https://github.com/tas50)) +- macOS 10.9 [\#1076](https://github.com/chef/bento/pull/1076) ([tas50](https://github.com/tas50)) + +### Fixes and Improvements + +- Use a faster scientific mirror [\#1081](https://github.com/chef/bento/pull/1081) ([tas50](https://github.com/tas50)) +- Install the latest 2008-06 update for 2k8r2 [\#1080](https://github.com/chef/bento/pull/1080) ([tas50](https://github.com/tas50)) +- Update RHELs to 6.10 / 7.5 [\#1079](https://github.com/chef/bento/pull/1079) ([tas50](https://github.com/tas50)) +- Blank netplan machine-id \(DUID\) so Ubuntu machines get unique ID generated on boot. [\#1073](https://github.com/chef/bento/pull/1073) ([NoahO](https://github.com/NoahO)) +- openSUSE: no space issue and SLES network persistence [\#1072](https://github.com/chef/bento/pull/1072) ([bkonick](https://github.com/bkonick)) +- Set correct permissions on /etc/sudoers.d/vagrant [\#1067](https://github.com/chef/bento/pull/1067) ([kbpease](https://github.com/kbpease)) +- Ubuntu 18.04: Use en\_US.UTF-8 locale instead of en\_US [\#1066](https://github.com/chef/bento/pull/1066) ([davejagoda](https://github.com/davejagoda)) +- Increase build time memory to 4GB on Windows boxes [\#1061](https://github.com/chef/bento/pull/1061) ([tas50](https://github.com/tas50)) + +## [v201806.08.0](https://github.com/chef/bento/tree/v201806.08.0) (2018-06-07) + +### New Platforms + +- Ubuntu 18.04 (Release version) +- CentOS 7.5 [\#1037](https://github.com/chef/bento/pull/1037) ([artem-sidorenko](https://github.com/artem-sidorenko)) +- Fedora 28 [\#1035](https://github.com/chef/bento/pull/1035) ([fkrull](https://github.com/fkrull)) +- HardenedBSD v1100055.2 [\#1033](https://github.com/chef/bento/pull/1033) ([nusenu](https://github.com/nusenu)) + +### Deprecated Platforms + +- Remove EOL'd FreeBSD-10.3 [\#1060](https://github.com/chef/bento/pull/1060) ([lwhsu](https://github.com/lwhsu)) + +### Fixes and Improvements + +- fedora, centos, rhel: added deltarpm to kickstart files [\#1030](https://github.com/chef/bento/pull/1030) ([muellerbe](https://github.com/muellerbe)) +- Clean up network configs [\#1025](https://github.com/chef/bento/pull/1025) ([Superdawg](https://github.com/Superdawg)) +- OpenSuse: Create a new 'vagrant' group for vagrant user [\#1020](https://github.com/chef/bento/pull/1020) ([hwoarang](https://github.com/hwoarang)) +- Improvements for Windows 2008 R2 [\#1057](https://github.com/chef/bento/pull/1057) ([tas50](https://github.com/tas50)) +- Update for Ubuntu 16.04.4 [\#1056](https://github.com/chef/bento/pull/1056) ([JBenPiel](https://github.com/JBenPiel)) +- Initial windows support [\#1053](https://github.com/chef/bento/pull/1053) ([tas50](https://github.com/tas50)) +- centos, rhel, oracle: remove previous kernels to minimize image size [\#1052](https://github.com/chef/bento/pull/1052) ([ceetav](https://github.com/ceetav)) +- Scientific Linux templates [\#1051](https://github.com/chef/bento/pull/1051) ([githubfoam](https://github.com/githubfoam)) +- Fix Fedora cleanup script not to cause unintended software removal. [\#1050](https://github.com/chef/bento/pull/1050) ([mgruner](https://github.com/mgruner)) + +### Tooling + +- VirtualBox 5.2.12 +- Parallels 13.3.1 +- VMware Fusion 10.1.2 +- Packer 1.2.3 +- Vagrant 2.1.1 + +## [201803.24.0] (2018-03-24) + +### New Platforms + +- Ubuntu 18.04 (pre-release) +- HardenedBSD 11 +- FreeBSD 10/11 32bit + +## Improvements + +- Ubuntu 16.04+ and Debian 9: fix issues with disabling predictable interface names +- Ubuntu/Debian: further mitigate apt locks at startup +- Multiple platforms: cleanup errant \*.iso files +- OpenSUSE Leap: disable Snappter/btrfs snapshots, increase disk size + +### Tooling + +- VirtualBox 5.2.6 (Note: we are not using 5.2.8) +- Parallels 13.3.0 +- VMware Fusion 10.1.1 +- Packer 1.2.1 +- Vagrant 2.0.3 +- Hyper-V 10.0.16299.15 + +## [201802.02.0] (2018-02-02) + +### Improvements + +- Ubuntu: remove linux-firmware bloat w/o removing package and breaking upgrades +- macOS: enable autologin for vagrant user + +### EOL + +- Ubuntu 17.04 +- Windows Nano TP3 + +### Tooling + +- VirtualBox 5.2.6 +- Parallels 13.2.0 +- VMware Fusion 10.1.1 +- Packer 1.1.3 +- Vagrant 2.0.1 + +## [201801.05.0] (2018-01-05) + +### New Platforms + +- Oracle Linux 7.4 + +### Tooling + +- VirtualBox 5.2.4 +- Parallels 13.2.0 +- Packer 1.1.3 +- Vagrant 2.0.1 + +## [201801.02.0] (2018-01-02) + +### New Platforms + +- Debian 9.3 +- Debian 8.10 +- Fedora 27 + +### Hyper-V Boxes (experimental) + +- centos-7.4 +- centos-6.9 +- ubuntu-17.10 +- ubuntu-17.04 +- ubuntu-16.04 +- ubuntu-14.04 + +### Tooling + +- VirtualBox 5.2.4 +- VMware Fusion 10.1.0 +- Parallels 13.2.0 +- Hyper-V 10.0.16299.15 +- Packer 1.1.3 +- Vagrant 2.0.1 + +## [201710.31.0] (2017-10-31) + +### New Platforms + +- Ubuntu 17.10 +- Debian 9.2 +- Debian 8.10 +- FreeBSD 10.4 +- CentOS 7.4 + +### Tooling + +- VirtualBox 5.1.30 +- VMware Fusion 10.0.1 +- Parallels 13.1.1 +- Packer 1.1.1 +- Vagrant 2.0.0 + +### Fixes/Updates + +- SLES fixes +- 1GB of RAM as default for boxen +- re-organized into platform folders +- hyper-V fixes +- qemu fixes + +## [201708.22.0] (2017-08-22) + +### New + +- Debian 9.1 +- Debian 8.9 +- FreeBSD 11.1 + +### Improvements + +- Top level slugs for point release platforms, i.e. centos-7 -> centos-7.3 +- Move to date based versioning scheme `YYYYMM.DD.PATCH` +- Automatically update RHEL-ish platforms as we do with other platforms + +### Tooling + +- VirtualBox 5.1.26 +- VMware Fusion 8.5.8 +- VMware Workstation 12.5.7 +- Parallels 13.0.0 +- Packer 1.0.4 + +## [2.3.8](https://github.com/chef/bento/tree/2.3.8) (2017-07-20) + +### New + +- Fedora 26 + +### Improvements + +- Suppress VMX whitelisting warning by removing interfaces at end of build +- Use archive.ubuntu.com instead of US specific domain +- Latest Tooling + - VirtualBox 5.1.24 + - VMware Fusion 8.5.8 + - Parallels 12.2.1 + - Packer 1.0.3 + +## [2.3.7] (2017-07-03) + +### New + +- Debian 8.8 +- Debian 9.0 [\#818](https://github.com/chef/bento/pull/818) +- Oracle 6.9 +- Ubuntu 17.04 [\#808](https://github.com/chef/bento/pull/808) + +### Removed + +- OmniOS +- Ubuntu 12.04 +- SLES 12 / 12 SP1 + +### Fixes + +- Fedora cleanup and size reduction + +## [2.3.6] (2017-05-03) + +- Release for fixed VirtualBox 5.1.22 + +## [2.3.5] (2017-04-24) + +- Release primarily around broken VirtualBox 5.1.20/21 (fixed) + +### New + +- CentOS 6.9 [\#788](https://github.com/chef/bento/pull/788) + +### Fixes + +- Oracle 6.8 `box_basename` [\#784](https://github.com/chef/bento/pull/784) +- MacOS 10.12 issue w/ memory var [\#768](https://github.com/chef/bento/pull/768) + +## [2.3.4] (2017-03-23) + +- Mostly rebuilt for updated hypervisors: VirtualBox 5.1.18 and VMware Fusion 8.5.5 +- Better cleanup for Fedora boxes + +## [2.3.3] (2017-02-19) + +### Added and Updated Platforms + +- Debian 8.7 + +## [2.3.2](https://github.com/chef/bento/tree/2.3.2) (2016-12-19) + +[Full Changelog](https://github.com/chef/bento/compare/2.3.1...2.3.2) + +### Added and Updated Platforms + +- CentOS and RHEL 7.3 [\#739](https://github.com/chef/bento/pull/739) ([rickard-von-essen](https://github.com/rickard-von-essen)) +- SLES 12 SP2 [\#735](https://github.com/chef/bento/pull/735) ([mattiasgiese]) + +### Improvements + +- Update VMware tools to fix CentOS 7.3 build [\#743](https://github.com/chef/bento/pull/743) ([cheeseplus](https://github.com/cheeseplus)) +- Remove CentOS requiretty sudoers workaround, this is now the default [\#740](https://github.com/chef/bento/pull/740) ([mvermaes](https://github.com/mvermaes)) + +### Pipeline + +- Use the bento-ya gem, add builds.yml [\#745](https://github.com/chef/bento/pull/745) ([cheeseplus](https://github.com/cheeseplus)) + +## [2.3.1](https://github.com/chef/bento/tree/2.3.1) (2016-11-30) + +[Full Changelog](https://github.com/chef/bento/compare/2.3.0...2.3.1) + +### Added and Updated Platforms + +- Fedora 25 [\#725](https://github.com/chef/bento/pull/725) ([rickard-von-essen](https://github.com/rickard-von-essen)) +- FreeBSD 11.0 [\#492](https://github.com/chef/bento/pull/492) ([rickard-von-essen](https://github.com/rickard-von-essen)) +- macOS Sierra [\#715](https://github.com/chef/bento/pull/715) ([kameghamegha](https://github.com/kameghamegha)) +- OpenSUSE Leap 42.2 [\#723](https://github.com/chef/bento/pull/723) ([rickard-von-essen](https://github.com/rickard-von-essen)) +- Oracle Linux 6.8 [\#733](https://github.com/chef/bento/pull/733) ([cheeseplus](https://github.com/cheeseplus)) +- Oracle Linux 7.3 [\#733](https://github.com/chef/bento/pull/733) ([cheeseplus](https://github.com/cheeseplus)) +- Oracle Linux 5.11 +- Ubuntu 16.10 [\#697](https://github.com/chef/bento/pull/697) ([rickard-von-essen](https://github.com/rickard-von-essen)) + +### Improvements + +- RFC: Switch FreeBSD installation to bsdinstall [\#558](https://github.com/chef/bento/issues/558) +- Reduce size of Linux images [\#718](https://github.com/chef/bento/pull/718) ([tas50](https://github.com/tas50)) +- Avoid breaking of chef package resource on fedora [\#709](https://github.com/chef/bento/pull/709) ([artem-sidorenko](https://github.com/artem-sidorenko)) +- Use UTF-8 locale on Debian / Ubuntu boxes [\#702](https://github.com/chef/bento/pull/702) ([iamthad](https://github.com/iamthad)) +- Install libpam-systemd on systemd-enabled Debian versions. Fix [\#712](https://github.com/chef/bento/issues/712). [\#693](https://github.com/chef/bento/pull/693) ([jfilip](https://github.com/jfilip)) +- Provisionally keeping Perl. Redux of \#714 [\#731](https://github.com/chef/bento/pull/731) ([cheeseplus](https://github.com/cheeseplus)) +- Remove unused http files [\#700](https://github.com/chef/bento/pull/700) ([rickard-von-essen](https://github.com/rickard-von-essen)) +- Remove unused scripts [\#698](https://github.com/chef/bento/pull/698) ([rickard-von-essen](https://github.com/rickard-von-essen)) + +### Fixed bugs + +- CentOS 5.11-x86\_64 building w/ vbox 5.1.x. Fix \#729. [\#730](https://github.com/chef/bento/pull/730) ([cheeseplus](https://github.com/cheeseplus)) +- Get Solaris 11 to build again [\#687](https://github.com/chef/bento/pull/687) ([tas50](https://github.com/tas50)) +- Get OmniOS boxes building again [\#683](https://github.com/chef/bento/pull/683) ([tas50](https://github.com/tas50)) +- Fix SLES builds [\#684](https://github.com/chef/bento/pull/684), [\#707](https://github.com/chef/bento/pull/707) ([tas50](https://github.com/tas50)) + +### Known Issues + +- OpenSuSE 13.2 builds for all providers but will not start properly under VMware Fusion/Workstation +- OpenSuSE Leap 42.2 builds for all providers but will _only_ start properly under VMware Fusion/Workstation + +## [2.3.0](https://github.com/chef/bento/tree/2.3.0) (2016-09-30) + +[Full Changelog](https://github.com/chef/bento/compare/2.2.9...2.3.0) + +### SPECIAL NOTE + +Due to issues with upstream projects that bento relies upon, the 2.3.0 release may appear to break. +Please ensure that Virtualbox is at least 5.1.6 and Vagrant at least 1.8.6 before reporting issues. + +### Added Platforms + +- add Debian 8.6 [\#669](https://github.com/chef/bento/issues/669) + +### Improvements + +- Changed the vagrant users UID from 900 to 1000. Fix \#688 [\#675](https://github.com/chef/bento/pull/675) ([rickard-von-essen](https://github.com/rickard-von-essen)) +- Updating build.sh with more env vars [\#672](https://github.com/chef/bento/pull/672) ([cheeseplus](https://github.com/cheeseplus)) +- Add script to disable system sleep for Mac OS X [\#656](https://github.com/chef/bento/pull/656) ([cblecker](https://github.com/cblecker)) +- Renames "ubuntu-server" task -\> "server" for Ubuntu 14.04 [\#654](https://github.com/chef/bento/pull/654) ([conorsch](https://github.com/conorsch)) +- Speed up booting process for FreeBSD saving 10 seconds in boot time [\#648](https://github.com/chef/bento/pull/648) ([amontalban](https://github.com/amontalban)) +- Check to see if release has already taken place [\#644](https://github.com/chef/bento/pull/644) ([cheeseplus](https://github.com/cheeseplus)) +- Add script for sles-12-sp1 [\#643](https://github.com/chef/bento/pull/643) ([oven](https://github.com/oven)) +- Refactored vmware tools scripts [\#638](https://github.com/chef/bento/pull/638) ([svpace](https://github.com/svpace)) + +### Known Issues + +- CentOS 5 guests in VirtualBox 5.1.x fatally exit with a guru mediation error so v2.3.0 does not exist on Atlas + +### Tool Versions + +- Packer 0.11.0 (master) +- VirtualBox 5.1.16 +- VMware Fusion 8.5.1 +- VMware Workstation 12.5.1 +- Parallels Pro 12.0.2 +- Vagrant 1.8.6 + +## [2.2.9](https://github.com/chef/bento/tree/2.2.9) (2016-08-01) + +[Full Changelog](https://github.com/chef/bento/compare/2.2.8...2.2.9) + +### Improvements + +- OpenSUSE Leap 42.1: requires 768 Mb memory. [\#632](https://github.com/chef/bento/pull/632) ([rickard-von-essen](https://github.com/rickard-von-essen)) +- Update for 16.04.1 iso [\#629](https://github.com/chef/bento/pull/629) +- For reals fixed 16.04 pkg lock bug [\#637](https://github.com/chef/bento/pull/637) ([cheeseplus](https://github.com/cheeseplus)) + +### Fixed bugs + +- VMware: HGFS not working - Ubuntu 16.04 [\#591](https://github.com/chef/bento/issues/591) + +### EOL + +- Fedora 22 + +### Tool Versions + +- Packer 0.10.1 +- VirtualBox 5.0.26 +- VMware Fusion 8.1.1 +- VMware Workstation 12.1.1 +- Parallels Pro 11.2.1 + +## [2.2.8](https://github.com/chef/bento/tree/2.2.8) (2016-07-22) + +[Full Changelog](https://github.com/chef/bento/compare/2.2.7...2.2.8) + +### Improvements + +- Archiving all non-current builds [\#622](https://github.com/chef/bento/pull/622) ([cheeseplus](https://github.com/cheeseplus)) +- Add Fedora 24 and dedupe kickstart scripts [\#623](https://github.com/chef/bento/pull/623) ([tas50](https://github.com/tas50)) +- 16.04 should use open-vm-tools [\#621](https://github.com/chef/bento/pull/621) ([cheeseplus](https://github.com/cheeseplus)) +- Updated Debian 7 to 7.11 [\#608](https://github.com/chef/bento/pull/608) ([rickard-von-essen](https://github.com/rickard-von-essen)) +- Updated Debian 8 to 8.5 [\#607](https://github.com/chef/bento/pull/607) ([rickard-von-essen](https://github.com/rickard-von-essen)) +- Updated CentOS and RHEL to 6.8 [\#605](https://github.com/chef/bento/pull/605) ([rickard-von-essen](https://github.com/rickard-von-essen)) +- Disable automated package upgrades on Debian-like boxes [\#612](https://github.com/chef/bento/pull/612) ([jrb](https://github.com/jrb)) +- Fix new-style device naming from Network Manager on RHEL/CentOS 7 [\#617](https://github.com/chef/bento/pull/617) ([legal90](https://github.com/legal90)) +- update apt sources to use archive.debian.org for packages [\#614](https://github.com/chef/bento/pull/614) ([apollocatlin](https://github.com/apollocatlin)) + +### Fixed bugs + +- apt.systemd.daily creates conflict in xenial64 box [\#616](https://github.com/chef/bento/issues/616) +- FreeBSD: Root password not set! [\#610](https://github.com/chef/bento/issues/610) +- ubuntu-16.04: unattended updates locking dpkg [\#609](https://github.com/chef/bento/issues/609) +- Fix vagrant.sh failing on Solaris nodes [\#606](https://github.com/chef/bento/pull/606) ([tas50](https://github.com/tas50)) + +### Tool Versions + +- Packer 0.10.1 +- VirtualBox 5.0.24 +- VMware Fusion 8.1.1 +- Parallels Pro 11.2.0 + +## [2.2.7](https://github.com/chef/bento/tree/2.2.7) (2016-05-20) + +[Full Changelog](https://github.com/chef/bento/compare/2.2.6...2.2.7) + +### Improvements + +- Ubuntu: HWE BEGONE! pt 1 - Fix for VMware HGFS on 14.04 [\#584](https://github.com/chef/bento/pull/584) ([davidmnoriega](https://github.com/davidmnoriega)) +- Ubuntu: HWE BEGONE! pt 2 - The Pangolining [\#587](https://github.com/chef/bento/pull/587) ([cheeseplus](https://github.com/cheeseplus)) +- OpenSuSE: Switching to more reliable mirror [\#583](https://github.com/chef/bento/pull/583) ([cheeseplus](https://github.com/cheeseplus)) +- Added "disk\_size" user variable [\#596](https://github.com/chef/bento/pull/596) ([svpace](https://github.com/svpace)) + +### Fixed bugs + +- Ubuntu 16.04: 70-persistent-net.rules "hack" messes with update-initramfs triggers [\#592](https://github.com/chef/bento/issues/592) +- VMware: use correct script flags based on version [\#590](https://github.com/chef/bento/issues/590) + +### Tool Versions + +- Packer 0.10.1 +- VirtualBox 5.0.20 +- VMware Fusion 8.1.1 +- VMware Workstation 12.1.1 +- Parallels Pro 11.2.0 + +## [2.2.6](https://github.com/chef/bento/tree/2.2.6) (2016-04-28) + +[Full Changelog](https://github.com/chef/bento/compare/2.2.5...2.2.6) + +### Tool Versions + +- Packer 0.10.0 +- VirtualBox 5.0.16 +- VMware Fusion 8.1.1 +- Parallels Pro 11.1.3 + +### Added platforms + +- Debian 8.4 [\#559](https://github.com/chef/bento/pull/559) ([kenhys](https://github.com/kenhys)) +- Debian 7.10 [\#563](https://github.com/chef/bento/pull/563) ([kenhys](https://github.com/kenhys)) +- FreeBSD 10.3 [\#557](https://github.com/chef/bento/pull/557) ([tas50](https://github.com/tas50)) +- OmniOS 151018 [\#565](https://github.com/chef/bento/pull/565) ([tas50](https://github.com/tas50)) +- Ubuntu 16.04 [\#545](https://github.com/chef/bento/pull/545) ([cheeseplus](https://github.com/cheeseplus)) + +### Fixed bugs + +- VMWare: tie network device to pci slot 32 [\#566](https://github.com/chef/bento/pull/566) ([rmoriz](https://github.com/rmoriz)) +- VMware: Fedora 23 box builds but can't connect [\#521](https://github.com/chef/bento/issues/521) +- Publish Ubuntu 15.10 boxes on Atlas [\#506](https://github.com/chef/bento/issues/506) + +### Improvements + +- Standardize on 512MB minimum memory [\#574](https://github.com/chef/bento/issues/574) +- Added headless option for QEMU builders [\#570](https://github.com/chef/bento/pull/570) ([jmatt](https://github.com/jmatt)) + +## [2.2.5](https://github.com/chef/bento/tree/2.2.5) (2016-03-29) + +[Full Changelog](https://github.com/chef/bento/compare/2.2.4...2.2.5) + +### Merged pull requests + +- Ubuntu: use dist-upgrade and install build packages in preseed [\#551](https://github.com/chef/bento/pull/551) ([cheeseplus](https://github.com/cheeseplus)) + +## [2.2.4](https://github.com/chef/bento/tree/2.2.4) (2016-03-29) + +[Full Changelog](https://github.com/chef/bento/compare/2.2.3...2.2.4) + +### Closed issues + +- CALL FOR MAINTAINERS [\#537](https://github.com/chef/bento/issues/537) +- Proposal: Move bento under test-kitchen org [\#536](https://github.com/chef/bento/issues/536) +- /tmp directory is cleaned upon restart? [\#535](https://github.com/chef/bento/issues/535) +- bento/centos-7.2 missing from atlas [\#524](https://github.com/chef/bento/issues/524) +- sles 12 mirror no more exist [\#520](https://github.com/chef/bento/issues/520) +- Pipeline: Update to VMware Fusion 8.1.0 [\#519](https://github.com/chef/bento/issues/519) +- error when building boxes with packer [\#514](https://github.com/chef/bento/issues/514) +- Ubuntu 12.04 HGFS module failing in VMWare [\#512](https://github.com/chef/bento/issues/512) +- Uncompressed boxes for VMware and Parallels are to large [\#505](https://github.com/chef/bento/issues/505) +- OpenSUSE Leap \(and Tumbleweed\) [\#504](https://github.com/chef/bento/issues/504) +- Ubuntu 14.04 HGFS kernel module not working for VMWare 8.0.2 [\#496](https://github.com/chef/bento/issues/496) +- Any support \(or planned support\) for building Amazon AMIs? [\#490](https://github.com/chef/bento/issues/490) +- ARM builds [\#486](https://github.com/chef/bento/issues/486) +- Minimize script results in large \(non-sparse\) image file for QEMU builder [\#369](https://github.com/chef/bento/issues/369) + +### Merged pull requests + +- Cutting 2.2.4 [\#550](https://github.com/chef/bento/pull/550) ([cheeseplus](https://github.com/cheeseplus)) +- Update mirror URL for Debian 8.2 [\#544](https://github.com/chef/bento/pull/544) ([legal90](https://github.com/legal90)) +- Updating maintainers [\#543](https://github.com/chef/bento/pull/543) ([cheeseplus](https://github.com/cheeseplus)) +- Updating for 14.04.4 release [\#542](https://github.com/chef/bento/pull/542) ([cheeseplus](https://github.com/cheeseplus)) +- Update the packer download URL and use 0.9.0 [\#540](https://github.com/chef/bento/pull/540) ([tas50](https://github.com/tas50)) +- Minor readme updates [\#539](https://github.com/chef/bento/pull/539) ([tas50](https://github.com/tas50)) +- Fix guest\_os\_type for VirtualBox [\#534](https://github.com/chef/bento/pull/534) ([juliandunn](https://github.com/juliandunn)) +- Sudo path changed [\#530](https://github.com/chef/bento/pull/530) ([scotthain](https://github.com/scotthain)) +- update solaris 11 box to 11.3 [\#528](https://github.com/chef/bento/pull/528) ([chris-rock](https://github.com/chris-rock)) +- update sha1 for omnios [\#527](https://github.com/chef/bento/pull/527) ([chris-rock](https://github.com/chris-rock)) +- Add support for Debian GNU/Linux 8.3 [\#526](https://github.com/chef/bento/pull/526) ([kenhys](https://github.com/kenhys)) +- simplify distro detection for RHEL-derivatives [\#525](https://github.com/chef/bento/pull/525) ([ceetav](https://github.com/ceetav)) +- Add support for OpenSUSE Leap 42.1 - x86\_64 [\#523](https://github.com/chef/bento/pull/523) ([rickard-von-essen](https://github.com/rickard-von-essen)) +- Fix links to Fedora 23 boxes. [\#518](https://github.com/chef/bento/pull/518) ([juliandunn](https://github.com/juliandunn)) +- Cutting 2.2.3 [\#515](https://github.com/chef/bento/pull/515) ([cheeseplus](https://github.com/cheeseplus)) + +## [2.2.3](https://github.com/chef/bento/tree/2.2.3) (2015-12-28) + +[Full Changelog](https://github.com/chef/bento/compare/2.2.2...2.2.3) + +### Fixed bugs + +- minimize.sh fails with no swap partition [\#420](https://github.com/chef/bento/issues/420) +- Workstation 11.1.2 Tools incompatible with current builds [\#377](https://github.com/chef/bento/issues/377) + +### Closed issues + +- Debian cleanup script removes C/C++ compiler and therefore breaks DKMS support [\#509](https://github.com/chef/bento/issues/509) +- RHEL 6.7 image has wrong guest [\#501](https://github.com/chef/bento/issues/501) +- Fedora 23 x86\_64 and virtualbox: no vboxsf [\#500](https://github.com/chef/bento/issues/500) +- Broken url on description [\#493](https://github.com/chef/bento/issues/493) +- Porposal Fedora 23 [\#491](https://github.com/chef/bento/issues/491) +- Ubuntu 15.10 [\#482](https://github.com/chef/bento/issues/482) +- /dev/sr0 is readonly [\#480](https://github.com/chef/bento/issues/480) +- Ubuntu 14.04 Fails to build with bento/packer [\#477](https://github.com/chef/bento/issues/477) +- The download link to fedora 21 vmware 64 is broken [\#472](https://github.com/chef/bento/issues/472) +- Debian 8.2 vagrant box doesn't have HGFS kernel module [\#463](https://github.com/chef/bento/issues/463) +- Unable to have synced\_folder with Fedora 22 VirtualBox [\#459](https://github.com/chef/bento/issues/459) +- Fedora 22 VM Tools not installed [\#458](https://github.com/chef/bento/issues/458) +- Update Virtualbox Guest Addition from 5.0.2 to 5.0.4 [\#448](https://github.com/chef/bento/issues/448) +- Standardize iso\_checksum / iso\_checksum\_type on sha256 [\#440](https://github.com/chef/bento/issues/440) +- rhel/centos 6 and 7, virtualbox guest additions [\#412](https://github.com/chef/bento/issues/412) +- opscode-centos-7.1 Virtualbox box not able to NFS mount [\#388](https://github.com/chef/bento/issues/388) +- Vagrant public key file could be empty [\#258](https://github.com/chef/bento/issues/258) + +### Merged pull requests + +- Revert "fix or suppress all shellcheck warnings" [\#513](https://github.com/chef/bento/pull/513) ([cheeseplus](https://github.com/cheeseplus)) +- Stops DKMS package from being removed. [\#510](https://github.com/chef/bento/pull/510) ([RobertDeRose](https://github.com/RobertDeRose)) +- Enterprise Linux 7.2 \(RHEL/CentOS/OEL\) [\#508](https://github.com/chef/bento/pull/508) ([rickard-von-essen](https://github.com/rickard-von-essen)) +- Fix error in cleanup.sh script introduced in d01cb1d7 [\#507](https://github.com/chef/bento/pull/507) ([rickard-von-essen](https://github.com/rickard-von-essen)) +- Fix RHEL 6.7 guest type [\#503](https://github.com/chef/bento/pull/503) ([juliandunn](https://github.com/juliandunn)) +- Fix dhcp settings cleanup in Ubuntu 12.04 and higher [\#498](https://github.com/chef/bento/pull/498) ([legal90](https://github.com/legal90)) +- Disable automatic udev rules for network interfaces in CentOS [\#497](https://github.com/chef/bento/pull/497) ([legal90](https://github.com/legal90)) +- Fix grep character class syntax in sshd.sh script [\#495](https://github.com/chef/bento/pull/495) ([legal90](https://github.com/legal90)) +- fix or suppress all shellcheck warnings [\#494](https://github.com/chef/bento/pull/494) ([jhoblitt](https://github.com/jhoblitt)) +- Support Fedora 23 [\#489](https://github.com/chef/bento/pull/489) ([rickard-von-essen](https://github.com/rickard-von-essen)) +- attempt to manage sshd\_config in an \[more\] idempotent manner [\#487](https://github.com/chef/bento/pull/487) ([jhoblitt](https://github.com/jhoblitt)) +- Add template for OS X 10.11 El Capitan [\#484](https://github.com/chef/bento/pull/484) ([legal90](https://github.com/legal90)) +- Ubuntu 15.10 support [\#483](https://github.com/chef/bento/pull/483) ([rickard-von-essen](https://github.com/rickard-von-essen)) +- Support swapless builders in minimize.sh [\#479](https://github.com/chef/bento/pull/479) ([sheldonh](https://github.com/sheldonh)) +- Be more aggressive about removing "bento-\*" vagrant boxes [\#476](https://github.com/chef/bento/pull/476) ([cheeseplus](https://github.com/cheeseplus)) +- \[DRY\] up rhel [\#475](https://github.com/chef/bento/pull/475) ([cheeseplus](https://github.com/cheeseplus)) +- \[DRY\] SLES [\#474](https://github.com/chef/bento/pull/474) ([cheeseplus](https://github.com/cheeseplus)) +- \[DRY\] Oracle Linux [\#473](https://github.com/chef/bento/pull/473) ([cheeseplus](https://github.com/cheeseplus)) +- Minimized AutoYaST profiles for SLES 11.3/12 to enhance readability [\#373](https://github.com/chef/bento/pull/373) ([mattiasgiese]) + +## [2.2.2](https://github.com/chef/bento/tree/2.2.2) (2015-10-07) + +[Full Changelog](https://github.com/chef/bento/compare/2.2.1...2.2.2) + +### Closed issues + +- bento/centos-6.7 won't vagrant up after halt or reload [\#468](https://github.com/chef/bento/issues/468) +- Build process broken under VMware Workstation 11.1.2 [\#467](https://github.com/chef/bento/issues/467) +- minimize.sh leads to unexpected error in packer \(vagrant 1.7.2\) [\#320](https://github.com/chef/bento/issues/320) +- Ubuntu 14.04 VMware HGFS modules not loaded [\#283](https://github.com/chef/bento/issues/283) + +### Merged pull requests + +- Cutting 2.2.2 release [\#471](https://github.com/chef/bento/pull/471) ([cheeseplus](https://github.com/cheeseplus)) +- The sha changed :/ [\#470](https://github.com/chef/bento/pull/470) ([cheeseplus](https://github.com/cheeseplus)) +- Adding shared folder as part of test-kitchen run [\#469](https://github.com/chef/bento/pull/469) ([cheeseplus](https://github.com/cheeseplus)) +- Adding OmniOS r151014 [\#466](https://github.com/chef/bento/pull/466) ([cheeseplus](https://github.com/cheeseplus)) +- Fixing Fedora 22 build tools to fix vm tools [\#465](https://github.com/chef/bento/pull/465) ([cheeseplus](https://github.com/cheeseplus)) +- Adds host only network for nano and enables file and printer sharing [\#464](https://github.com/chef/bento/pull/464) ([mwrock](https://github.com/mwrock)) +- Windows Nano [\#462](https://github.com/chef/bento/pull/462) ([mwrock](https://github.com/mwrock)) +- squashed commit to add qemu options for all boxes [\#461](https://github.com/chef/bento/pull/461) ([dmlb2000](https://github.com/dmlb2000)) +- bento command needs two dashes [\#457](https://github.com/chef/bento/pull/457) ([mmckinst](https://github.com/mmckinst)) +- remove duplicate auth/authconfig and use sha512 algorithm for password hashing [\#456](https://github.com/chef/bento/pull/456) ([mmckinst](https://github.com/mmckinst)) +- Making upload/release optional [\#455](https://github.com/chef/bento/pull/455) ([cheeseplus](https://github.com/cheeseplus)) +- use --force-install for VMware tools [\#454](https://github.com/chef/bento/pull/454) ([cheeseplus](https://github.com/cheeseplus)) +- Fixing templates [\#453](https://github.com/chef/bento/pull/453) ([cheeseplus](https://github.com/cheeseplus)) +- Remove the headless option for Parallels builder. [\#452](https://github.com/chef/bento/pull/452) ([rickard-von-essen](https://github.com/rickard-von-essen)) +- Adding verification \(tk\) stage to build process [\#451](https://github.com/chef/bento/pull/451) ([cheeseplus](https://github.com/cheeseplus)) + +## [2.2.1](https://github.com/chef/bento/tree/2.2.1) (2015-09-16) + +[Full Changelog](https://github.com/chef/bento/compare/2.2.0...2.2.1) + +### Closed issues + +- Debian 7.9 [\#444](https://github.com/chef/bento/issues/444) +- Building boxes results in files with unhelpful names [\#433](https://github.com/chef/bento/issues/433) +- fedora-22 Bento Box Corruption? [\#432](https://github.com/chef/bento/issues/432) +- Manually building baseboxes [\#430](https://github.com/chef/bento/issues/430) +- Missing 13 Boxes [\#427](https://github.com/chef/bento/issues/427) +- "yum update" for RHEL/CentOS boxes [\#425](https://github.com/chef/bento/issues/425) +- We need fedora-22 for DNF testing [\#419](https://github.com/chef/bento/issues/419) +- Ubuntu 12.04 downloadable box up-to-date? [\#417](https://github.com/chef/bento/issues/417) +- Using bento boxes with Vagrant [\#410](https://github.com/chef/bento/issues/410) +- chef.github.io/bento is outdated [\#409](https://github.com/chef/bento/issues/409) +- vagrant box `chef/freebsd-10.0`: Unable to install packages [\#407](https://github.com/chef/bento/issues/407) +- debian-7.8 box broken by VMWare Fusion 7.1.1 to 7.1.2 update [\#397](https://github.com/chef/bento/issues/397) +- Parallels boxes? [\#371](https://github.com/chef/bento/issues/371) +- Building a Windows image [\#343](https://github.com/chef/bento/issues/343) +- chef/fedora-21 [\#333](https://github.com/chef/bento/issues/333) +- Ubuntu sudoers file only allows to run as root [\#302](https://github.com/chef/bento/issues/302) +- Puppet support in bento? [\#251](https://github.com/chef/bento/issues/251) +- rename box prefixes to bento- instead of opscode- [\#208](https://github.com/chef/bento/issues/208) + +### Merged pull requests + +- DRY up opensuse [\#450](https://github.com/chef/bento/pull/450) ([cheeseplus](https://github.com/cheeseplus)) +- \[fedora-\*\] DRYness pass [\#449](https://github.com/chef/bento/pull/449) ([cheeseplus](https://github.com/cheeseplus)) +- Updating platforms to use sha256 [\#447](https://github.com/chef/bento/pull/447) ([cheeseplus](https://github.com/cheeseplus)) +- Add Debian 7.9 template [\#446](https://github.com/chef/bento/pull/446) ([cheeseplus](https://github.com/cheeseplus)) +- Use bento prefix for box names in README [\#445](https://github.com/chef/bento/pull/445) ([leejones](https://github.com/leejones)) +- Setting basename to a more sensible default [\#442](https://github.com/chef/bento/pull/442) ([cheeseplus](https://github.com/cheeseplus)) +- Debian 8.2 [\#439](https://github.com/chef/bento/pull/439) ([cheeseplus](https://github.com/cheeseplus)) +- Add "vm\_name" parameter to Mac OS X templates for Parallels builder [\#438](https://github.com/chef/bento/pull/438) ([legal90](https://github.com/legal90)) +- Revert "Rename centos images for clarity" [\#437](https://github.com/chef/bento/pull/437) ([cheeseplus](https://github.com/cheeseplus)) +- Add Parallels builder to Mac OS X templates [\#436](https://github.com/chef/bento/pull/436) ([legal90](https://github.com/legal90)) +- Updating readme to reflect reality [\#434](https://github.com/chef/bento/pull/434) ([cheeseplus](https://github.com/cheeseplus)) +- Add Fedora 22 box links [\#431](https://github.com/chef/bento/pull/431) ([cheeseplus](https://github.com/cheeseplus)) +- Adding s3 upload to Rakefile and add buildkite shell script [\#429](https://github.com/chef/bento/pull/429) ([cheeseplus](https://github.com/cheeseplus)) +- Adding Fedora 21 back to matrix [\#428](https://github.com/chef/bento/pull/428) ([cheeseplus](https://github.com/cheeseplus)) +- Add Fedora 22 boxes [\#418](https://github.com/chef/bento/pull/418) ([rickard-von-essen](https://github.com/rickard-von-essen)) +- Enable key insertion on OS X [\#415](https://github.com/chef/bento/pull/415) ([tas50](https://github.com/tas50)) +- Rename centos images for clarity [\#406](https://github.com/chef/bento/pull/406) ([patcon](https://github.com/patcon)) +- CentOS kickstarts: Change sed to not rewrite sudo comments [\#326](https://github.com/chef/bento/pull/326) ([mvermaes](https://github.com/mvermaes)) + +## [2.2.0](https://github.com/chef/bento/tree/2.2.0) (2015-08-26) + +[Full Changelog](https://github.com/chef/bento/compare/2.1.0...2.2.0) + +### Merged pull requests + +- Update Readme and small fixes/cleanup to Rake tasks [\#426](https://github.com/chef/bento/pull/426) ([cheeseplus](https://github.com/cheeseplus)) +- Freebsd 10.2 [\#424](https://github.com/chef/bento/pull/424) ([geoffgarside](https://github.com/geoffgarside)) +- CentOS 6.6 -\> 6.7 [\#423](https://github.com/chef/bento/pull/423) ([cheeseplus](https://github.com/cheeseplus)) +- Update to Ubuntu 14.04.3. [\#421](https://github.com/chef/bento/pull/421) ([William-Yeh](https://github.com/William-Yeh)) +- Opscode -\> Chefs and other minor stuff [\#414](https://github.com/chef/bento/pull/414) ([tas50](https://github.com/tas50)) +- \[macosx-\*\] Increase disk\_size to ~40G from ~20G. [\#413](https://github.com/chef/bento/pull/413) ([fnichol](https://github.com/fnichol)) + +## [2.1.0](https://github.com/chef/bento/tree/2.1.0) (2015-08-07) + +[Full Changelog](https://github.com/chef/bento/compare/2.0.0...2.1.0) + +### Fixed bugs + +- Shortening vm\_name to avoid Parallels box corruption [\#400](https://github.com/chef/bento/pull/400) ([cheeseplus](https://github.com/cheeseplus)) + +### Closed issues + +- Debian 8.1 [\#379](https://github.com/chef/bento/issues/379) +- Chef on Centos boxes seems not be installed [\#352](https://github.com/chef/bento/issues/352) + +### Merged pull requests + +- \[debian-\*\] Improve DRYness, correctness, & speed of Debian templates. [\#404](https://github.com/chef/bento/pull/404) ([fnichol](https://github.com/fnichol)) +- \[freebsd-\*\] Improve DRYness, correctness, & speed of FreeBSD templates. [\#403](https://github.com/chef/bento/pull/403) ([fnichol](https://github.com/fnichol)) +- Fixing headless check [\#401](https://github.com/chef/bento/pull/401) ([cheeseplus](https://github.com/cheeseplus)) +- Adding support for headless mode [\#399](https://github.com/chef/bento/pull/399) ([cheeseplus](https://github.com/cheeseplus)) +- Box build pipeline [\#398](https://github.com/chef/bento/pull/398) ([cheeseplus](https://github.com/cheeseplus)) +- \[centos-\*\] Improve DRYness, correctness, and speed of CentOS templates. [\#396](https://github.com/chef/bento/pull/396) ([fnichol](https://github.com/fnichol)) +- \[macosx-\*, ubuntu-\*\] Remove name prefixes from templates. [\#395](https://github.com/chef/bento/pull/395) ([fnichol](https://github.com/fnichol)) +- \[ubuntu-\*\] Improve DRYness, correctness, and speed of Ubuntu templates. [\#394](https://github.com/chef/bento/pull/394) ([fnichol](https://github.com/fnichol)) +- Adding Debian 8.1 links, removing Debian 8.0 templates [\#393](https://github.com/chef/bento/pull/393) ([cheeseplus](https://github.com/cheeseplus)) +- Add @cheeseplus to MAINTAINERS.md [\#392](https://github.com/chef/bento/pull/392) ([fnichol](https://github.com/fnichol)) + +## [2.0.0](https://github.com/chef/bento/tree/2.0.0) (2015-07-03) + +### Fixed bugs + +- Do not write metadata files when `bento build` is in dry run mode [\#368](https://github.com/chef/bento/issues/368) +- fix OmniOS build under VMWare [\#178](https://github.com/chef/bento/issues/178) +- Don't write metadata file in `bento build` dry run mode. [\#380](https://github.com/chef/bento/pull/380) ([fnichol](https://github.com/fnichol)) + +### Closed issues + +- Release Debian 8.0 boxes [\#381](https://github.com/chef/bento/issues/381) +- Upload Ubuntu 15.04 to S3 Bucket [\#376](https://github.com/chef/bento/issues/376) +- Add build metadata to boxes and build artifacts [\#364](https://github.com/chef/bento/issues/364) +- Add support for Debian 8 [\#355](https://github.com/chef/bento/issues/355) +- centos-7.1 vmware box got uploaded as virtualbox [\#351](https://github.com/chef/bento/issues/351) +- chef/centos-7.1 on atlas [\#346](https://github.com/chef/bento/issues/346) +- Add support for Ubuntu 15.04 [\#345](https://github.com/chef/bento/issues/345) +- Why are definitions removed \(RHEL 7.0 was just removed\) [\#344](https://github.com/chef/bento/issues/344) +- Please fix CentOS 7 README links [\#340](https://github.com/chef/bento/issues/340) +- Latest Ubuntu 14.04 Fails to install kernel headers [\#335](https://github.com/chef/bento/issues/335) +- centos 7.1 image request [\#334](https://github.com/chef/bento/issues/334) +- Guest Additions are installed without dkms support [\#332](https://github.com/chef/bento/issues/332) +- need to get the correct cacert.pem for AWS on CentOS boxes [\#325](https://github.com/chef/bento/issues/325) +- Use the SATA HDD controller for faster disk IO speeds [\#324](https://github.com/chef/bento/issues/324) +- Better package miror for Debian [\#322](https://github.com/chef/bento/issues/322) +- Error building debian7.8-amd-64 [\#319](https://github.com/chef/bento/issues/319) +- Fedora kickstart script downloads CA cert bundle over HTTP [\#318](https://github.com/chef/bento/issues/318) +- CentOS and Fedora boxes packed without docs? [\#317](https://github.com/chef/bento/issues/317) +- Create Fedora 21 box [\#312](https://github.com/chef/bento/issues/312) +- \[SLES\] zypper-locks.sh not working [\#309](https://github.com/chef/bento/issues/309) +- Upload Boxes for Parallels to Atlas [\#308](https://github.com/chef/bento/issues/308) +- Single disk configuration for VMware [\#307](https://github.com/chef/bento/issues/307) +- Build new boxes for VMware Fusion 7 [\#304](https://github.com/chef/bento/issues/304) +- FreeBSD 9.3 \(amd64\) box broken [\#301](https://github.com/chef/bento/issues/301) +- OpenSUSE 13.2 should specify netdevice=eth0 [\#299](https://github.com/chef/bento/issues/299) +- vagrant-vbguest plugin compatibility [\#297](https://github.com/chef/bento/issues/297) +- Ubuntu 14.04.1 [\#290](https://github.com/chef/bento/issues/290) +- Everything looks fine, but not able to mount the device? [\#279](https://github.com/chef/bento/issues/279) +- opscode.github.io/bento is out-of-date \(centos-6.4\) [\#277](https://github.com/chef/bento/issues/277) +- sudo with SSH agent forwarding [\#273](https://github.com/chef/bento/issues/273) +- Upload rhel-6.5 box to bento AWS repo [\#271](https://github.com/chef/bento/issues/271) +- Importing opscode-centos-6.4 fails with virtualbox error [\#264](https://github.com/chef/bento/issues/264) +- Chef should get permission to distribute proprietary boxes for testing use [\#261](https://github.com/chef/bento/issues/261) +- Should the CentOS 7.0 box be listed in the README? [\#260](https://github.com/chef/bento/issues/260) +- Chef binary not installed on FreeBSD 9.2 and 10.0 [\#250](https://github.com/chef/bento/issues/250) +- chef\debian-7.4 not able to run sudo apt-get update with error in description. [\#242](https://github.com/chef/bento/issues/242) +- Box chef/ubuntu-12.10 / 13.04 fails to install any packages [\#240](https://github.com/chef/bento/issues/240) +- chef/ubuntu-13.10 no chef\_solo? [\#238](https://github.com/chef/bento/issues/238) +- virtualbox - opscode\_ubuntu-1204\_chef-provisionerless.box 404 [\#236](https://github.com/chef/bento/issues/236) +- VirtualBox: Mounting shared folder with vboxsf failed [\#234](https://github.com/chef/bento/issues/234) +- Ubuntu 14.04: No guest IP was given to the Vagrant core NFS helper [\#232](https://github.com/chef/bento/issues/232) +- VMware boxes claim to be built on VMware Fusion, but report VMware Desktop [\#231](https://github.com/chef/bento/issues/231) +- add more swap [\#228](https://github.com/chef/bento/issues/228) +- error processing drive [\#227](https://github.com/chef/bento/issues/227) +- centos-5.10 add net-tools [\#226](https://github.com/chef/bento/issues/226) +- merge bento and packer-windows [\#225](https://github.com/chef/bento/issues/225) +- Deploy all those boxes to vagrant cloud [\#224](https://github.com/chef/bento/issues/224) +- Example of establishing SSH keys [\#223](https://github.com/chef/bento/issues/223) +- \[Enhancement\] Packer template for Windows [\#222](https://github.com/chef/bento/issues/222) +- Missing credentials for root [\#217](https://github.com/chef/bento/issues/217) +- Virtualbox and debian-7.4: cannot download preseed.cfg [\#215](https://github.com/chef/bento/issues/215) +- Bug with minimize.sh \(Ubuntu 14.04 amd64\) [\#214](https://github.com/chef/bento/issues/214) +- Ubuntu 14.04 box vboxvfs broken? [\#207](https://github.com/chef/bento/issues/207) +- Can we disable SELinux in the CentOS box images? [\#200](https://github.com/chef/bento/issues/200) +- Debian 7.4 64bit [\#198](https://github.com/chef/bento/issues/198) +- Links for FreeBSD 10 boxes give NoSuchKey error \(HTTP 404\) [\#197](https://github.com/chef/bento/issues/197) +- Unable to provision a fedora-19 machine with private-network [\#196](https://github.com/chef/bento/issues/196) +- Vagrant 1.5.1 errors with opscode\_ubuntu-12.04\_chef-provisionerless.box [\#193](https://github.com/chef/bento/issues/193) +- Fixed size /tmp in Fedora 19 box [\#188](https://github.com/chef/bento/issues/188) +- Configure Oracle Linux boxes with an update source [\#186](https://github.com/chef/bento/issues/186) +- slim down CentOS/RHEL box builds with updated ks.cfg [\#179](https://github.com/chef/bento/issues/179) +- add Oracle Linux templates [\#177](https://github.com/chef/bento/issues/177) +- red hat linux 5.10 box cannot download packages [\#173](https://github.com/chef/bento/issues/173) +- 'Error downloading kickstart file' within Oracle VM VirtualBox [\#172](https://github.com/chef/bento/issues/172) +- move single-request-reopen from ks.cfg [\#171](https://github.com/chef/bento/issues/171) + +### Merged pull requests + +- \[macosx-\*\] Add support for {http,https,no}\_proxy environment variables. [\#391](https://github.com/chef/bento/pull/391) ([fnichol](https://github.com/fnichol)) +- Remove files that are no longer referenced by any templates. [\#390](https://github.com/chef/bento/pull/390) ([fnichol](https://github.com/fnichol)) +- \[macosx-\*\] Improve DRYness & correctness of Mac templates. [\#389](https://github.com/chef/bento/pull/389) ([fnichol](https://github.com/fnichol)) +- Add provider metadata to metdata files on build. [\#387](https://github.com/chef/bento/pull/387) ([fnichol](https://github.com/fnichol)) +- updated debian's download redirector address [\#386](https://github.com/chef/bento/pull/386) ([rmoriz](https://github.com/rmoriz)) +- preliminary debian 8.1 templates [\#385](https://github.com/chef/bento/pull/385) ([rmoriz](https://github.com/rmoriz)) +- Add Mac OS X 10.10 template. [\#384](https://github.com/chef/bento/pull/384) ([fnichol](https://github.com/fnichol)) +- Update README with Debian 8.0 boxes. [\#383](https://github.com/chef/bento/pull/383) ([fnichol](https://github.com/fnichol)) +- Add Debian 8.0 amd64/i386 templates. [\#382](https://github.com/chef/bento/pull/382) ([fnichol](https://github.com/fnichol)) +- Update README with Ubuntu 15.04 boxes. [\#378](https://github.com/chef/bento/pull/378) ([fnichol](https://github.com/fnichol)) +- Add Ubuntu 15.04 amd64/i386 templates. [\#375](https://github.com/chef/bento/pull/375) ([fnichol](https://github.com/fnichol)) +- Add build metadata to boxes and build artifacts. [\#365](https://github.com/chef/bento/pull/365) ([fnichol](https://github.com/fnichol)) +- Remove `chef\_version` user variable & remove Chef installation option. [\#362](https://github.com/chef/bento/pull/362) ([fnichol](https://github.com/fnichol)) +- Normalize Bento templates [\#361](https://github.com/chef/bento/pull/361) ([fnichol](https://github.com/fnichol)) +- TravisCI project updates [\#360](https://github.com/chef/bento/pull/360) ([fnichol](https://github.com/fnichol)) +- \[ubuntu-12.04-\*\] Update URL paths to use 12.04.5. [\#359](https://github.com/chef/bento/pull/359) ([fnichol](https://github.com/fnichol)) +- Remove VeeWee definitions from project [\#358](https://github.com/chef/bento/pull/358) ([fnichol](https://github.com/fnichol)) +- Add packer/bin/bento for building templates. [\#357](https://github.com/chef/bento/pull/357) ([fnichol](https://github.com/fnichol)) +- update README to point to Boxcutter intead of basebox [\#354](https://github.com/chef/bento/pull/354) ([OBrienCommaJosh](https://github.com/OBrienCommaJosh)) +- Add MAINTAINERS.md file. [\#347](https://github.com/chef/bento/pull/347) ([fnichol](https://github.com/fnichol)) +- Add RHEL 7.1 JSON file. [\#342](https://github.com/chef/bento/pull/342) ([lopaka](https://github.com/lopaka)) +- Solaris 10u11 - zfs base box [\#341](https://github.com/chef/bento/pull/341) ([scotthain](https://github.com/scotthain)) +- Updated README with CentOS 7.1 boxes [\#339](https://github.com/chef/bento/pull/339) ([juliandunn](https://github.com/juliandunn)) +- Fix "sudoers.sh" for Ubuntu [\#338](https://github.com/chef/bento/pull/338) ([legal90](https://github.com/legal90)) +- Switch to SATA HDD for Linux VMs on virtualbox [\#331](https://github.com/chef/bento/pull/331) ([irvingpop](https://github.com/irvingpop)) +- Update to Ubuntu 14.04.2. [\#330](https://github.com/chef/bento/pull/330) ([juliandunn](https://github.com/juliandunn)) +- Remove extraneous ks.cfg [\#329](https://github.com/chef/bento/pull/329) ([juliandunn](https://github.com/juliandunn)) +- Fixes \#325, \#318 - don't download cacert.pem [\#328](https://github.com/chef/bento/pull/328) ([jtimberman](https://github.com/jtimberman)) +- change mirror to http.debian.net, fixes \#322 [\#323](https://github.com/chef/bento/pull/323) ([rmoriz](https://github.com/rmoriz)) +- Fix mac address issue for ens33 on centos 7 [\#321](https://github.com/chef/bento/pull/321) ([alappe](https://github.com/alappe)) +- Update to Ubuntu 14.04.1 [\#315](https://github.com/chef/bento/pull/315) ([juliandunn](https://github.com/juliandunn)) +- Update travis.yml for opscode to chef org rename [\#314](https://github.com/chef/bento/pull/314) ([cmluciano](https://github.com/cmluciano)) +- Added Fedora 21 VB base boxes to README [\#313](https://github.com/chef/bento/pull/313) ([dfarrell07](https://github.com/dfarrell07)) +- Remove EOL Fedora 19 content [\#311](https://github.com/chef/bento/pull/311) ([juliandunn](https://github.com/juliandunn)) +- Make script zypper-locks.sh workable [\#310](https://github.com/chef/bento/pull/310) ([berendt](https://github.com/berendt)) +- centos-6.6: Force to set SELinux to a permissive mode [\#306](https://github.com/chef/bento/pull/306) ([legal90](https://github.com/legal90)) +- added Fedora 21 support [\#305](https://github.com/chef/bento/pull/305) ([juliandunn](https://github.com/juliandunn)) +- Removed some more unnecessary firmware packages [\#303](https://github.com/chef/bento/pull/303) ([yves-vogl](https://github.com/yves-vogl)) +- \#299 OpenSUSE 13.2 should specify netdevice=eth0 [\#300](https://github.com/chef/bento/pull/300) ([rickard-von-essen](https://github.com/rickard-von-essen)) +- FreeBSD/i386: Fixed incorrect output filename. [\#293](https://github.com/chef/bento/pull/293) ([juliandunn](https://github.com/juliandunn)) +- Minimal support for a compilation environment. [\#291](https://github.com/chef/bento/pull/291) ([yzl](https://github.com/yzl)) +- Update all box links to latest [\#288](https://github.com/chef/bento/pull/288) ([nshemonsky](https://github.com/nshemonsky)) +- Remove curl from CentOS boxes from here on in. [\#287](https://github.com/chef/bento/pull/287) ([juliandunn](https://github.com/juliandunn)) +- adds ubuntu 14.10 configuration [\#286](https://github.com/chef/bento/pull/286) ([vincentaubert](https://github.com/vincentaubert)) +- update debian packer json to 7.7 [\#285](https://github.com/chef/bento/pull/285) ([vincentaubert](https://github.com/vincentaubert)) +- add note in readme about vmware fusion provider [\#284](https://github.com/chef/bento/pull/284) ([smith](https://github.com/smith)) +- Reduce Linux box size by not packing a swap partition gubbish [\#281](https://github.com/chef/bento/pull/281) ([ceetav](https://github.com/ceetav)) +- Parallels: Support of FreeBSD and OmniOS. Some fixes [\#278](https://github.com/chef/bento/pull/278) ([legal90](https://github.com/legal90)) +- Updated RHEL to 5.11. [\#276](https://github.com/chef/bento/pull/276) ([juliandunn](https://github.com/juliandunn)) +- Updated Oracle Enterprise Linux definitions to 5.11 [\#275](https://github.com/chef/bento/pull/275) ([juliandunn](https://github.com/juliandunn)) +- Upgrade CentOS 5 to 5.11 [\#274](https://github.com/chef/bento/pull/274) ([eshamow](https://github.com/eshamow)) +- Fix syntax and typo share\_folder -\> synced\_folder of console message. [\#272](https://github.com/chef/bento/pull/272) ([jevonearth](https://github.com/jevonearth)) +- Fix packer validation failures. [\#269](https://github.com/chef/bento/pull/269) ([juliandunn](https://github.com/juliandunn)) +- Fix erroneous virtualbox output directory for vmware-iso build [\#267](https://github.com/chef/bento/pull/267) ([eshamow](https://github.com/eshamow)) +- Remove EOL Ubuntu 12.10 [\#266](https://github.com/chef/bento/pull/266) ([eshamow](https://github.com/eshamow)) +- Update 12.04 logic to handle outdated apt cache on distro [\#265](https://github.com/chef/bento/pull/265) ([eshamow](https://github.com/eshamow)) +- Document CentOS 7.0 box. [\#262](https://github.com/chef/bento/pull/262) ([juliandunn](https://github.com/juliandunn)) +- update to FreeBSD 9.3 [\#259](https://github.com/chef/bento/pull/259) ([juliandunn](https://github.com/juliandunn)) +- Update README to reflect current Debian boxes and remove old Ubuntu [\#254](https://github.com/chef/bento/pull/254) ([juliandunn](https://github.com/juliandunn)) +- Updated to Ubuntu 12.04.5 LTS. [\#253](https://github.com/chef/bento/pull/253) ([juliandunn](https://github.com/juliandunn)) +- Update Debian 6.0.9 to 6.0.10 [\#252](https://github.com/chef/bento/pull/252) ([juliandunn](https://github.com/juliandunn)) +- Update documentation [\#246](https://github.com/chef/bento/pull/246) ([juliandunn](https://github.com/juliandunn)) +- Remove Ubuntu 13.10 as it is EOL as of July 17, 2014. [\#245](https://github.com/chef/bento/pull/245) ([juliandunn](https://github.com/juliandunn)) +- Upgrade to OmniOS r151010j [\#244](https://github.com/chef/bento/pull/244) ([juliandunn](https://github.com/juliandunn)) +- Fix bugs on building VMWare box [\#243](https://github.com/chef/bento/pull/243) ([juliandunn](https://github.com/juliandunn)) +- Support OpenSUSE 13.1 [\#241](https://github.com/chef/bento/pull/241) ([simonoff](https://github.com/simonoff)) +- Switch to newest Debian release \(7.5 -\> 7.6\) [\#239](https://github.com/chef/bento/pull/239) ([fadenb](https://github.com/fadenb)) +- Support CentOS 7.0 [\#237](https://github.com/chef/bento/pull/237) ([andytson](https://github.com/andytson)) +- Updated checksum and mirror to GA release [\#233](https://github.com/chef/bento/pull/233) ([juliandunn](https://github.com/juliandunn)) +- fix vmware-vmx tools install [\#230](https://github.com/chef/bento/pull/230) ([rjocoleman](https://github.com/rjocoleman)) +- Corrected some copy paste errors in SLES configuration. [\#221](https://github.com/chef/bento/pull/221) ([rickard-von-essen](https://github.com/rickard-von-essen)) +- Cleanup the boxes to actually work [\#219](https://github.com/chef/bento/pull/219) ([sethvargo](https://github.com/sethvargo)) +- Dependency Fix [\#218](https://github.com/chef/bento/pull/218) ([bdwyertech](https://github.com/bdwyertech)) +- Update Debian Wheezy to 7.5 [\#216](https://github.com/chef/bento/pull/216) ([tmatilai](https://github.com/tmatilai)) +- Update to OmniOS r151008t [\#212](https://github.com/chef/bento/pull/212) ([juliandunn](https://github.com/juliandunn)) +- Support Red Hat Enterprise Linux 7 Release Candidate. [\#210](https://github.com/chef/bento/pull/210) ([juliandunn](https://github.com/juliandunn)) +- Add links to new ubuntu images [\#209](https://github.com/chef/bento/pull/209) ([Maks3w](https://github.com/Maks3w)) +- Cleanup inconsistencies in Ubuntu templates. [\#206](https://github.com/chef/bento/pull/206) ([juliandunn](https://github.com/juliandunn)) +- Add templates for Ubuntu 14.04 [\#205](https://github.com/chef/bento/pull/205) ([rjocoleman](https://github.com/rjocoleman)) +- Update vagrant.sh [\#204](https://github.com/chef/bento/pull/204) ([sbarber](https://github.com/sbarber)) +- The wget failed in Debian distro [\#199](https://github.com/chef/bento/pull/199) ([rhacker](https://github.com/rhacker)) +- Make sure to update checksums and ISOs for vmware-iso builder too. [\#191](https://github.com/chef/bento/pull/191) ([juliandunn](https://github.com/juliandunn)) +- BENTO-116: use ISO for Ubuntu 12.04.04, not 12.04.03 [\#190](https://github.com/chef/bento/pull/190) ([client9](https://github.com/client9)) +- Bugfixes for FreeBSD 10 [\#189](https://github.com/chef/bento/pull/189) ([juliandunn](https://github.com/juliandunn)) +- slim down Fedora boxes using same ks.cfg minimizations as CentOS [\#187](https://github.com/chef/bento/pull/187) ([juliandunn](https://github.com/juliandunn)) +- Remove Ubuntu 13.04: EOL as of January 27, 2014 [\#185](https://github.com/chef/bento/pull/185) ([juliandunn](https://github.com/juliandunn)) +- Slim down box builds by removing unnecessary firmware and docs. [\#183](https://github.com/chef/bento/pull/183) ([juliandunn](https://github.com/juliandunn)) +- Force CRLF on Autounattend files for Windows [\#175](https://github.com/chef/bento/pull/175) ([juliandunn](https://github.com/juliandunn)) +- Update Debian 6.0.8 to 6.0.9 [\#170](https://github.com/chef/bento/pull/170) ([tmatilai](https://github.com/tmatilai)) +- Updated to OmniOS r151008j [\#169](https://github.com/chef/bento/pull/169) ([juliandunn](https://github.com/juliandunn)) +- End-of-life: Fedora 18 and Debian 7.2 [\#168](https://github.com/chef/bento/pull/168) ([juliandunn](https://github.com/juliandunn)) +- BENTO-112 add single-request-reopen to resolv.conf [\#165](https://github.com/chef/bento/pull/165) ([rjocoleman](https://github.com/rjocoleman)) +- Add Packer templates for Debian 7.4 [\#164](https://github.com/chef/bento/pull/164) ([tmatilai](https://github.com/tmatilai)) +- Use sudoers.d in Debian [\#163](https://github.com/chef/bento/pull/163) ([tmatilai](https://github.com/tmatilai)) +- Fix DHCP lease directory name in Debian [\#162](https://github.com/chef/bento/pull/162) ([tmatilai](https://github.com/tmatilai)) +- Allow `packer\_cache` to be symlink [\#161](https://github.com/chef/bento/pull/161) ([tmatilai](https://github.com/tmatilai)) +- Debian 7.3.0 support [\#160](https://github.com/chef/bento/pull/160) ([fadenb](https://github.com/fadenb)) +- Finalize FreeBSD 10 support [\#159](https://github.com/chef/bento/pull/159) ([juliandunn](https://github.com/juliandunn)) +- support mirror variable for iso\_url in all centos/vmware builders [\#158](https://github.com/chef/bento/pull/158) ([adler](https://github.com/adler)) +- \[BENTO-111\] Added a .gitattributes and a note for Windows hosts [\#157](https://github.com/chef/bento/pull/157) ([maoueh](https://github.com/maoueh)) +- Don't disable selinux on Fedora; just make it Permissive. [\#156](https://github.com/chef/bento/pull/156) ([juliandunn](https://github.com/juliandunn)) +- Fixing outdated command in README [\#155](https://github.com/chef/bento/pull/155) ([apetresc](https://github.com/apetresc)) +- Update vmtools branch logic to reflect new providers in packer 0.5.1- [\#154](https://github.com/chef/bento/pull/154) ([lwieske](https://github.com/lwieske)) +- Repair FreeBSD definitions after they got corrupted by a Packer bug. [\#153](https://github.com/chef/bento/pull/153) ([juliandunn](https://github.com/juliandunn)) +- Update to packer 0.5.1 [\#152](https://github.com/chef/bento/pull/152) ([lwieske](https://github.com/lwieske)) +- Update sshd.sh [\#150](https://github.com/chef/bento/pull/150) ([sc0ttruss](https://github.com/sc0ttruss)) +- Update to packer 0.4.1. [\#148](https://github.com/chef/bento/pull/148) ([juliandunn](https://github.com/juliandunn)) +- Allow building provisionered OmniOS boxes. [\#146](https://github.com/chef/bento/pull/146) ([juliandunn](https://github.com/juliandunn)) +- Rewrite chef.sh to be more cross-platform. [\#145](https://github.com/chef/bento/pull/145) ([juliandunn](https://github.com/juliandunn)) +- Fix FreeBSD i386 not passing env vars through properly [\#141](https://github.com/chef/bento/pull/141) ([juliandunn](https://github.com/juliandunn)) +- Update readme for CentOS 6.5 [\#137](https://github.com/chef/bento/pull/137) ([juliandunn](https://github.com/juliandunn)) +- Make Thor actually exit non-zero when a validation error occurs. [\#136](https://github.com/chef/bento/pull/136) ([juliandunn](https://github.com/juliandunn)) +- Fix broken CentOS 6.5 i386 template [\#135](https://github.com/chef/bento/pull/135) ([juliandunn](https://github.com/juliandunn)) +- Allow RHEL mirror URL to be customized at box build time [\#134](https://github.com/chef/bento/pull/134) ([juliandunn](https://github.com/juliandunn)) +- \[BENTO-83\] Add working templates for SuSE Linux Enterprise Server 11 [\#132](https://github.com/chef/bento/pull/132) ([juliandunn](https://github.com/juliandunn)) +- Reduce memory usage of FreeBSD box to 512M [\#129](https://github.com/chef/bento/pull/129) ([juliandunn](https://github.com/juliandunn)) +- Repair incorrect SHA1 checksum on Ubuntu 12.04-i386 box [\#128](https://github.com/chef/bento/pull/128) ([juliandunn](https://github.com/juliandunn)) +- Upgrade FreeBSD box to 9.2 [\#127](https://github.com/chef/bento/pull/127) ([juliandunn](https://github.com/juliandunn)) +- Fix incorrect FreeBSD i386 guest\_os\_type [\#126](https://github.com/chef/bento/pull/126) ([juliandunn](https://github.com/juliandunn)) +- Bash is dead, Long live Bash. [\#120](https://github.com/chef/bento/pull/120) ([petecheslock](https://github.com/petecheslock)) +- Migrate to RHEL 6.5. Also be consistent about the output package name. [\#119](https://github.com/chef/bento/pull/119) ([juliandunn](https://github.com/juliandunn)) +- Fix incorrect CPU type on Ubuntu 12.10. [\#117](https://github.com/chef/bento/pull/117) ([juliandunn](https://github.com/juliandunn)) +- \[BENTO-91\] Re-fix sudoers rules for Ubuntu \>= 12.04 [\#116](https://github.com/chef/bento/pull/116) ([juliandunn](https://github.com/juliandunn)) +- BENTO-96 fix execute\_command for debian to include env vars [\#115](https://github.com/chef/bento/pull/115) ([fourseven](https://github.com/fourseven)) +- BENTO-94 and BENTO-95 Fixes [\#114](https://github.com/chef/bento/pull/114) ([bflad](https://github.com/bflad)) +- Fix documentation in README; add info on how to build legacy veewee base... [\#112](https://github.com/chef/bento/pull/112) ([juliandunn](https://github.com/juliandunn)) +- Fix .gitignore for iso dir [\#110](https://github.com/chef/bento/pull/110) ([juliandunn](https://github.com/juliandunn)) +- Add Windows 2012R2 server definitions. [\#107](https://github.com/chef/bento/pull/107) ([juliandunn](https://github.com/juliandunn)) +- Added templates for RHEL. [\#106](https://github.com/chef/bento/pull/106) ([juliandunn](https://github.com/juliandunn)) +- \[BENTO-5\] Add NFS client capability to CentOS and Fedora templates. [\#105](https://github.com/chef/bento/pull/105) ([andytson](https://github.com/andytson)) +- Fix all Packer validation errors [\#104](https://github.com/chef/bento/pull/104) ([juliandunn](https://github.com/juliandunn)) +- CentOS 6.4 won't install with only 384MB of RAM [\#102](https://github.com/chef/bento/pull/102) ([juliandunn](https://github.com/juliandunn)) +- Debian 6.0.8 [\#100](https://github.com/chef/bento/pull/100) ([someara](https://github.com/someara)) +- Debian 7.2.0 [\#99](https://github.com/chef/bento/pull/99) ([someara](https://github.com/someara)) +- Upgrade to CentOS 5.10 [\#97](https://github.com/chef/bento/pull/97) ([juliandunn](https://github.com/juliandunn)) +- added ubuntu-13.10 packer templates w/debian sudoers scripts [\#96](https://github.com/chef/bento/pull/96) ([routelastresort](https://github.com/routelastresort)) +- Use proper packer env var for checking VirtualBox [\#95](https://github.com/chef/bento/pull/95) ([juliandunn](https://github.com/juliandunn)) +- fixing packer templates to work on vmware [\#93](https://github.com/chef/bento/pull/93) ([someara](https://github.com/someara)) +- Fix box names [\#90](https://github.com/chef/bento/pull/90) ([tduffield](https://github.com/tduffield)) +- Clean FreeBSD boxes to save space. [\#89](https://github.com/chef/bento/pull/89) ([juliandunn](https://github.com/juliandunn)) +- Remove bash from the FreeBSD image. [\#88](https://github.com/chef/bento/pull/88) ([juliandunn](https://github.com/juliandunn)) +- Cleanup shutdown scripts [\#87](https://github.com/chef/bento/pull/87) ([tduffield](https://github.com/tduffield)) +- removed name field from all templates [\#86](https://github.com/chef/bento/pull/86) ([tduffield](https://github.com/tduffield)) +- Since the 12.04 release, Ubuntu uses the more standard "sudo" group [\#84](https://github.com/chef/bento/pull/84) ([whiteley](https://github.com/whiteley)) +- Fixup readme for packer [\#83](https://github.com/chef/bento/pull/83) ([juliandunn](https://github.com/juliandunn)) +- \[BENTO-84\] Update Ubuntu LTS definitions to 12.04.3 [\#81](https://github.com/chef/bento/pull/81) ([juliandunn](https://github.com/juliandunn)) +- Updated to vagrant-windows that works under Vagrant 1.2 and 1.3 [\#80](https://github.com/chef/bento/pull/80) ([juliandunn](https://github.com/juliandunn)) +- Added Fedora 19 to list of documented boxes. [\#78](https://github.com/chef/bento/pull/78) ([juliandunn](https://github.com/juliandunn)) +- \[BENTO-82\] Import same fix from PR\#72 to i386 box. [\#77](https://github.com/chef/bento/pull/77) ([juliandunn](https://github.com/juliandunn)) +- Bump to Vagrant 1.2.7 [\#76](https://github.com/chef/bento/pull/76) ([juliandunn](https://github.com/juliandunn)) +- \[BENTO-13\] ensure `kudzu` is uninstalled on CentOS boxes [\#75](https://github.com/chef/bento/pull/75) ([schisamo](https://github.com/schisamo)) +- Ensure /etc/sudoers sed replacement works for Debian 7.x. [\#73](https://github.com/chef/bento/pull/73) ([justsee](https://github.com/justsee)) +- Add preseed command to comment out cdrom in /etc/apt/sources.list. [\#72](https://github.com/chef/bento/pull/72) ([justsee](https://github.com/justsee)) +- \[BENTO-80\] Sudoer should use secure\_path by default [\#70](https://github.com/chef/bento/pull/70) ([jamesonjlee](https://github.com/jamesonjlee)) +- Added definitions for SUSE Linux Enterprise Server 11 SP3. [\#68](https://github.com/chef/bento/pull/68) ([juliandunn](https://github.com/juliandunn)) +- Added definitions for Fedora 19, Schrodinger's Cat [\#66](https://github.com/chef/bento/pull/66) ([juliandunn](https://github.com/juliandunn)) +- \[BENTO-58\] Switch to manual partitioning since autopart makes /tmp too small to actually run tests sensibly [\#65](https://github.com/chef/bento/pull/65) ([juliandunn](https://github.com/juliandunn)) +- \[BENTO-50\] Add documentation for all current baseboxes [\#64](https://github.com/chef/bento/pull/64) ([juliandunn](https://github.com/juliandunn)) +- \[BENTO-56\] Fix missing vagrant user in the sudoers file [\#63](https://github.com/chef/bento/pull/63) ([juliandunn](https://github.com/juliandunn)) +- \[BENTO-54\] Fix Debian 7 definitions [\#62](https://github.com/chef/bento/pull/62) ([vaskas](https://github.com/vaskas)) +- \[BENTO-53\] Fixed paths for Debian 6.0.7 ISOs [\#61](https://github.com/chef/bento/pull/61) ([hectcastro](https://github.com/hectcastro)) +- \[BENTO-49\] Debian 6 definitions broken: missing sshd.sh [\#60](https://github.com/chef/bento/pull/60) ([zuazo](https://github.com/zuazo)) +- \[BENTO-48\] Add SLES11SP2 definitions [\#59](https://github.com/chef/bento/pull/59) ([juliandunn](https://github.com/juliandunn)) +- \[BENTO-47\] Regenerate Autounattend.xml for Windows 2012 to unbreak it. [\#57](https://github.com/chef/bento/pull/57) ([juliandunn](https://github.com/juliandunn)) +- Fix Gemfile and Gemfile.lock. [\#55](https://github.com/chef/bento/pull/55) ([juliandunn](https://github.com/juliandunn)) +- \[BENTO-46\] Update centos 6.4 definitions to use the common components. [\#54](https://github.com/chef/bento/pull/54) ([lewg](https://github.com/lewg)) +- \[BENTO-45\] Install vmware tools if on fusion provider. [\#53](https://github.com/chef/bento/pull/53) ([lewg](https://github.com/lewg)) +- Fix PR\#33 - CentOS 5.8 is in the vault now. [\#52](https://github.com/chef/bento/pull/52) ([juliandunn](https://github.com/juliandunn)) +- \[BENTO-41\] Check to see if you're on VirtualBox [\#51](https://github.com/chef/bento/pull/51) ([lewg](https://github.com/lewg)) +- \[BENTO-19\] Use the VirtualBox ISO that veewee attaches to the machine [\#50](https://github.com/chef/bento/pull/50) ([juliandunn](https://github.com/juliandunn)) +- Upgrade to veewee that has hooks \(we may use them\) [\#49](https://github.com/chef/bento/pull/49) ([juliandunn](https://github.com/juliandunn)) +- \[BENTO-37\] Added definitions for ubuntu 13.04. [\#48](https://github.com/chef/bento/pull/48) ([juliandunn](https://github.com/juliandunn)) +- Add Debian 7.0.0 definitions [\#47](https://github.com/chef/bento/pull/47) ([jtimberman](https://github.com/jtimberman)) +- \[BENTO-35\] Do not ship Chef with our baseboxes anymore. [\#46](https://github.com/chef/bento/pull/46) ([juliandunn](https://github.com/juliandunn)) +- \[BENTO-10\] Add "UseDNS no" to all sshd configs [\#45](https://github.com/chef/bento/pull/45) ([juliandunn](https://github.com/juliandunn)) +- Fix Windows 8 Enterprise box builds. [\#44](https://github.com/chef/bento/pull/44) ([juliandunn](https://github.com/juliandunn)) +- Windows 8 and 2012 fixes [\#43](https://github.com/chef/bento/pull/43) ([juliandunn](https://github.com/juliandunn)) +- Added ubuntu-12.10 definitions. [\#41](https://github.com/chef/bento/pull/41) ([johnbellone](https://github.com/johnbellone)) +- Update documentation for Chef 11.4.4. Update Gemfile for vagrant 1.2.2. [\#40](https://github.com/chef/bento/pull/40) ([juliandunn](https://github.com/juliandunn)) +- Add a task to update apt-get on boot in ubuntu. [\#39](https://github.com/chef/bento/pull/39) ([whilp](https://github.com/whilp)) +- update build directions, new links for Chef 11.4.0 baseboxes [\#38](https://github.com/chef/bento/pull/38) ([juliandunn](https://github.com/juliandunn)) +- fix Windows box builds for Vagrant 1.1 [\#37](https://github.com/chef/bento/pull/37) ([juliandunn](https://github.com/juliandunn)) +- Added defs for CentOS 5.9 and 6.4 boxes. Bugfix CentOS 5.8 x86\_64 box. [\#36](https://github.com/chef/bento/pull/36) ([juliandunn](https://github.com/juliandunn)) +- Repin gemset to Vagrant 1.1 versions and veewee head [\#35](https://github.com/chef/bento/pull/35) ([juliandunn](https://github.com/juliandunn)) +- \[BENTO-31\] debian 6.0.5 is no longer available, change to 6.0.7 [\#32](https://github.com/chef/bento/pull/32) ([ctdk](https://github.com/ctdk)) +- Vagrant11+2008 [\#30](https://github.com/chef/bento/pull/30) ([hh](https://github.com/hh)) +- Windows+2012+8 [\#29](https://github.com/chef/bento/pull/29) ([hh](https://github.com/hh)) +- \[BENTO-28\] Use Centos, not RedHat for os\_type\_id [\#27](https://github.com/chef/bento/pull/27) ([chulkilee](https://github.com/chulkilee)) +- \[BENTO-24\] "\#" is not a valid comment character for Windows batch files [\#22](https://github.com/chef/bento/pull/22) ([juliandunn](https://github.com/juliandunn)) +- Update to ubuntu 12.04.2 [\#20](https://github.com/chef/bento/pull/20) ([rnewson](https://github.com/rnewson)) +- \[BENTO-20\] add fedora 18 support [\#17](https://github.com/chef/bento/pull/17) ([josephholsten](https://github.com/josephholsten)) +- BENTO-17 passes validation for windows 7 and 2008R2 [\#15](https://github.com/chef/bento/pull/15) ([hh](https://github.com/hh)) +- \[BENTO-2\] Update Ubuntu iso filenames, md5sums. [\#6](https://github.com/chef/bento/pull/6) ([torandu](https://github.com/torandu)) +- \[BENTO-4\] Updated centos 6.2 iso urls to use the vault.centos.org url [\#4](https://github.com/chef/bento/pull/4) ([cburyta](https://github.com/cburyta)) + +\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)* diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..cd21578 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1 @@ +Please refer to diff --git a/LICENSE b/LICENSE index 0c97efd..11069ed 100644 --- a/LICENSE +++ b/LICENSE @@ -1,235 +1,201 @@ -GNU AFFERO GENERAL PUBLIC LICENSE -Version 3, 19 November 2007 - -Copyright (C) 2007 Free Software Foundation, Inc. - -Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - - Preamble - -The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software. - -The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. - -When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. - -Developers that use our General Public Licenses protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you legal permission to copy, distribute and/or modify the software. - -A secondary benefit of defending all users' freedom is that improvements made in alternate versions of the program, if they receive widespread use, become available for other developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation. However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License permits making a modified version and letting the public access it on a server without ever releasing its source code to the public. - -The GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified source code becomes available to the community. It requires the operator of a network server to provide the source code of the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly accessible server, gives the public access to the source code of the modified version. - -An older license, called the Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license, not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this license. - -The precise terms and conditions for copying, distribution and modification follow. - - TERMS AND CONDITIONS - -0. Definitions. - -"This License" refers to version 3 of the GNU Affero General Public License. - -"Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. - -"The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. - -To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. - -A "covered work" means either the unmodified Program or a work based on the Program. - -To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. - -To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. - -An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. - -1. Source Code. -The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. - -A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. - -The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. - -The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those -subprograms and other parts of the work. - -The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. - -The Corresponding Source for a work in source code form is that same work. - -2. Basic Permissions. -All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. - -You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. - -Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. - -3. Protecting Users' Legal Rights From Anti-Circumvention Law. -No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. - -When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. - -4. Conveying Verbatim Copies. -You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. - -You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. - -5. Conveying Modified Source Versions. -You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". - - c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. - -A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. - -6. Conveying Non-Source Forms. -You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: - - a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. - - d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. - -A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. - -A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. - -"Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. - -If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). - -The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. - -Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. - -7. Additional Terms. -"Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. - -When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. - -Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or authors of the material; or - - e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. - -All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. - -If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. - -Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. - -8. Termination. - -You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). - -However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. - -Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. - -Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. - -9. Acceptance Not Required for Having Copies. - -You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. - -10. Automatic Licensing of Downstream Recipients. - -Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. - -An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. - -You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. - -11. Patents. - -A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". - -A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. - -Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. - -In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. - -If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. - -If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. - -A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. - -Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. - -12. No Surrender of Others' Freedom. - -If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. - -13. Remote Network Interaction; Use with the GNU General Public License. - -Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. This Corresponding Source shall include the Corresponding Source for any work covered by version 3 of the GNU General Public License that is incorporated pursuant to the following paragraph. - -Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License. - -14. Revised Versions of this License. - -The Free Software Foundation may publish revised and/or new versions of the GNU Affero General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation. - -If the Program specifies that a proxy can decide which future versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. - -Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. - -15. Disclaimer of Warranty. - -THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - -16. Limitation of Liability. - -IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -17. Interpretation of Sections 15 and 16. - -If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS - How to Apply These Terms to Your New Programs - -If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. - -To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +APPENDIX: How to apply the Apache License to your work. - This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. - You should have received a copy of the GNU Affero General Public License along with this program. If not, see . +Copyright [yyyy] [name of copyright owner] -Also add information on how to contact you by electronic and paper mail. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at -If your software can interact with users remotely through a computer network, you should also make sure that it provides a way for users to get its source. For example, if your program is a web application, its interface could display a "Source" link that leads users to an archive of the code. There are many ways you could offer source, and different solutions will be better for different programs; see section 13 for the specific requirements. + http://www.apache.org/licenses/LICENSE-2.0 -You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU AGPL, see . +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/NOTICE.md b/NOTICE.md new file mode 100644 index 0000000..a2fcc43 --- /dev/null +++ b/NOTICE.md @@ -0,0 +1,11 @@ +# Bento NOTICE + +Chef Bento +Copyright 2019-2023, Progress Software Corporation +Copyright 2012-2019, Chef Software, Inc. + +The baseboxes in the "definitions" directory is from Tim Dysinger's +"basebox" project. + +Author: Tim Dysinger () +Copyright 2011-2012, Tim Dysinger () diff --git a/README.md b/README.md index ffd659f..b98fdb6 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,173 @@ -# create-iso -git clone +# Bento +Bento is a project that encapsulates [Packer](https://www.packer.io/) templates for building [Vagrant](https://www.vagrantup.com/) base boxes. A subset of templates are built and published to the [bento org](https://app.vagrantup.com/bento) on Vagrant Cloud. These published boxes serve as the default boxes for [kitchen-vagrant](https://github.com/test-kitchen/kitchen-vagrant/). + +***NOTE:** + +- Virutalbox 6.x requires disabling nat config that allows vbox 7.x guests to connect to the host. To use comment out lines #161 and #162 in bento/packer_templates/pkr-variables.pkr.hcl or add variable `vboxmanage = []` to os_pkrvars files. +- When running packer build command the output directory is relative to the working directory the command is currently running in. Suggest running packer build commands from bento root directory for build working files to be placed in bento/builds/(build_name) directory by default. If the output_directory variable isn't overwritten a directory called builds/(build_name) will be created in the current working directory that you are running the command from + +## Using Public Boxes + +Adding a bento box to Vagrant + +```bash +vagrant box add bento/ubuntu-18.04 +``` + +Using a bento box in a Vagrantfile + +```ruby +Vagrant.configure("2") do |config| + config.vm.box = "bento/ubuntu-18.04" +end +``` + +### Building Boxes + +#### Requirements + +- [Packer](https://www.packer.io/) >= 1.7.0 +- [Vagrant](https://www.vagrantup.com/) +- At least one of the following virtualization providers: + - [VirtualBox](https://www.virtualbox.org/) + - [VMware Fusion](https://www.vmware.com/products/fusion.html) + - [VMware Workstation](https://www.vmware.com/products/workstation-pro.html) + - [Parallels Desktop](https://www.parallels.com/products/desktop/) also requires [Parallels Virtualization SDK](https://www.parallels.com/products/desktop/download/) + - [qemu](https://www.qemu.org/) * + - [Hyper-V](https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/about/) * + +***NOTE:** support for these providers is considered experimental and corresponding Vagrant Cloud images may or may not exist. + +#### Using `packer` + +To build a Ubuntu 22.04 box for only the VirtualBox provider + +```bash +cd /bento +packer init -upgrade ./packer_templates +packer build -only=virtualbox-iso.vm -var-file=os_pkrvars/ubuntu/ubuntu-22.04-x86_64.pkrvars.hcl ./packer_templates +``` + +To build latest Debian 11 boxes for all possible providers (simultaneously) + +```bash +cd /bento +packer init -upgrade ./packer_templates +packer build -var-file=os_pkrvars/debian/debian-11-x86_64.pkrvars.hcl ./packer_templates +``` + +To build latest CentOS 7 boxes for all providers except VMware and Parallels + +```bash +cd /bento +packer init -upgrade ./packer_templates +packer build -except=parallels-iso.vm,vmware-iso.vm -var-file=os_pkrvars/centos/centos-7-x86_64.pkrvars.hcl ./packer_templates +``` + +To use an alternate url + +````bash +cd /bento +packer init -upgrade ./packer_templates +packer build -var 'iso_url=http://mirror.utexas.edu/fedora/linux' -var-file=os_pkrvars/fedora/fedor-37-x86_64.pkrvars.hcl ./packer_templates +```` + +To build a Windows 10 Enterprise Gen 2 box for the Hyper-V provider + +```bash +cd /bento +packer init -upgrade ./packer_templates +packer build -var-file=os_pkrvars/windows/windows-10gen2-x86_64.pkrvars.hcl ./packer_templates +``` + +If the build is successful, your box files will be in the `builds` directory at the root of the repository. + +#### KVM/qemu support for Windows + +You must download [the iso image with the Windows drivers for paravirtualized KVM/qemu hardware](https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso). You can do this from the command line: `wget -nv -nc https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso -O virtio-win.iso` and place it in the packer_templates/win_answer_files/ directory. + +You can use the following sample command to build a KVM/qemu Windows box: + +```bash +packer init -upgrade ./packer_templates +packer build --only=qemu.vm -var-file=os_pkrvars/windwos/windows-2022-x86_64.pkrvars.hcl ./packer_templates +``` + +### Proprietary Templates + +Templates for operating systems only available via license or subscription are also available in the repository, these include but are not limited to: Red Hat Enterprise Linux, and SUSE Linux Enterprise. As the ISOs are not publicly available the URL values will need to be overridden as appropriate. We rely on the efforts of those with access to licensed versions of the operating systems to keep these up-to-date. + +### Networking/Firewalls + +Most of the providers expect unrestricted access to networking in order to build as expected. We can't enumerate all possible firewall configurations but include some snippets below that might be useful to users. + +#### Windows + +```powershell +$VS = "Standardswitch" +$IF_ALIAS = (Get-NetAdapter -Name "vEthernet ($VS)").ifAlias +New-NetFirewallRule -Displayname "Allow incomming from $VS" -Direction Inbound -InterfaceAlias $IF_ALIAS -Action Allow +``` + +#### Hyper-V Generation 2 VM's + +Hyper-V Gen 2 VMs do not support floppy drives. If you previously provided resources using a floppy drive, you must add those files to your Gen 2 iso images, in particular: + +- `autounattend.xml`: The Gen 2 `autounattend.xml` file supports EFI partitions. Update the `autounattend.xml` with the correct Windows version for your systems and ensure that the partitions are correct for your situation. You also need to manage the driver disk that holds the hyper-v guest services drivers and adjust the `autounattend.xml` file as appropriate. +- `base_setup.ps1` + +### Testing the build with the test-kitchen + +If you have successfully built a vagrant box using the bento tool, you should have the vagrant box and a metadata file in the `builds` folder. You can use these files to test the build with a test-kitchen configuration. Place your `kitchen.yml` and `bootstrap.sh` files inside the `templates` directory and run the following command to test the build. + +```bash +kitchen test +``` + +## Bugs and Issues + +Please use GitHub issues to report bugs, features, or other problems. + +## Related projects + +A huge thank you to these related projects from which we've taken inspiration and often used as a source for workarounds in complex world of base box building. + +- +- +- +- +- + +## License & Authors + +These basebox templates were converted from [veewee](https://github.com/jedi4ever/veewee) definitions originally based on [work done by Tim Dysinger](https://github.com/dysinger) to make "Don't Repeat Yourself" (DRY) modular baseboxes. Thanks Tim! + +- Author: Chris McClimans ([chris@hippiehacker.org](mailto:chris@hippiehacker.org)) +- Author: Fletcher Nichol ([fnichol@nichol.ca](mailto:fnichol@nichol.ca)) +- Author: Joshua Timberman ([joshua@chef.io](mailto:joshua@chef.io)) +- Author: Julian Dunn ([jdunn@chef.io](mailto:jdunn@chef.io)) +- Author: Ross Timson ([ross@rosstimson.com](mailto:ross@rosstimson.com)) +- Author: Seth Chisamore ([schisamo@chef.io](mailto:schisamo@chef.io)) +- Author: Stephen Delano ([stephen@chef.io](mailto:stephen@chef.io)) +- Author: Tim Dysinger ([tim@dysinger.net](mailto:tim@dysinger.net)) +- Author: Tim Smith ([tsmith@chef.io](mailto:tsmith@chef.io)) +- Author: Tom Duffield ([tom@chef.io](mailto:tom@chef.io)) +- Author: Corey Hemminger ([corey.hemminger@progress.com](mailto:corey.hemminger@progress.com)) + +```text +Copyright 2012-2023, Progress Software, Inc. () +Copyright 2011-2012, Tim Dysinger () + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +``` diff --git a/TESTING.md b/TESTING.md new file mode 100644 index 0000000..359579c --- /dev/null +++ b/TESTING.md @@ -0,0 +1 @@ +Please refer to diff --git a/build-ubuntu-18.04-iso.sh b/build-ubuntu-18.04-iso.sh new file mode 100755 index 0000000..0944585 --- /dev/null +++ b/build-ubuntu-18.04-iso.sh @@ -0,0 +1,5 @@ + +#git clone https://github.com/chef/bento.git +#cd ./bento +packer init -upgrade ./packer_templates +packer build -only=virtualbox-iso.vm -var-file=os_pkrvars/ubuntu/ubuntu-22.04-x86_64.pkrvars.hcl ./packer_templates diff --git a/builds/.gitkeep b/builds/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/os_pkrvars/almalinux/almalinux-8-aarch64.pkrvars.hcl b/os_pkrvars/almalinux/almalinux-8-aarch64.pkrvars.hcl new file mode 100644 index 0000000..235f83d --- /dev/null +++ b/os_pkrvars/almalinux/almalinux-8-aarch64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "almalinux" +os_version = "8.7" +os_arch = "aarch64" +iso_url = "https://repo.almalinux.org/almalinux/8/isos/aarch64/AlmaLinux-8.7-update-1-aarch64-minimal.iso" +iso_checksum = "file:https://repo.almalinux.org/almalinux/8/isos/aarch64/CHECKSUM" +parallels_guest_os_type = "centos" +vbox_guest_os_type = "RedHat_64" +vmware_guest_os_type = "centos-64" +boot_command = ["e inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rhel/8ks.cfg x"] diff --git a/os_pkrvars/almalinux/almalinux-8-x86_64.pkrvars.hcl b/os_pkrvars/almalinux/almalinux-8-x86_64.pkrvars.hcl new file mode 100644 index 0000000..4063af0 --- /dev/null +++ b/os_pkrvars/almalinux/almalinux-8-x86_64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "almalinux" +os_version = "8.7" +os_arch = "x86_64" +iso_url = "https://repo.almalinux.org/almalinux/8/isos/x86_64/AlmaLinux-8.7-update-1-x86_64-minimal.iso" +iso_checksum = "file:https://repo.almalinux.org/almalinux/8/isos/x86_64/CHECKSUM" +parallels_guest_os_type = "centos" +vbox_guest_os_type = "RedHat_64" +vmware_guest_os_type = "centos-64" +boot_command = [" inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rhel/8ks.cfg"] diff --git a/os_pkrvars/almalinux/almalinux-9-aarch64.pkrvars.hcl b/os_pkrvars/almalinux/almalinux-9-aarch64.pkrvars.hcl new file mode 100644 index 0000000..9f15caa --- /dev/null +++ b/os_pkrvars/almalinux/almalinux-9-aarch64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "almalinux" +os_version = "9.1" +os_arch = "aarch64" +iso_url = "https://repo.almalinux.org/almalinux/9/isos/aarch64/AlmaLinux-9.1-aarch64-dvd.iso" +iso_checksum = "file:https://repo.almalinux.org/almalinux/9/isos/aarch64/CHECKSUM" +parallels_guest_os_type = "centos" +vbox_guest_os_type = "RedHat_64" +vmware_guest_os_type = "centos-64" +boot_command = ["e inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rhel/9ks.cfg x"] diff --git a/os_pkrvars/almalinux/almalinux-9-x86_64.pkrvars.hcl b/os_pkrvars/almalinux/almalinux-9-x86_64.pkrvars.hcl new file mode 100644 index 0000000..8430665 --- /dev/null +++ b/os_pkrvars/almalinux/almalinux-9-x86_64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "almalinux" +os_version = "9.1" +os_arch = "x86_64" +iso_url = "https://repo.almalinux.org/almalinux/9/isos/x86_64/AlmaLinux-9.1-x86_64-dvd.iso" +iso_checksum = "file:https://repo.almalinux.org/almalinux/9/isos/x86_64/CHECKSUM" +parallels_guest_os_type = "centos" +vbox_guest_os_type = "RedHat_64" +vmware_guest_os_type = "centos-64" +boot_command = [" inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rhel/9ks.cfg"] diff --git a/os_pkrvars/amazonlinux/amazonlinux-2-x86_64.pkrvars.hcl b/os_pkrvars/amazonlinux/amazonlinux-2-x86_64.pkrvars.hcl new file mode 100644 index 0000000..4707acc --- /dev/null +++ b/os_pkrvars/amazonlinux/amazonlinux-2-x86_64.pkrvars.hcl @@ -0,0 +1,21 @@ +os_name = "amazonlinux" +os_version = "2" +os_arch = "x86_64" +vbox_guest_os_type = "RedHat_64" +sources_enabled = [ + "source.virtualbox-ovf.amazonlinux" +] +vboxmanage = [ + [ + "modifyvm", + "{{ .Name }}", + "--memory", + "2048", + "--cpus", + "2", + "--audio", + "none", + "--nat-localhostreachable1", + "on", + ] +] diff --git a/os_pkrvars/centos/centos-7-aarch64.pkrvars.hcl b/os_pkrvars/centos/centos-7-aarch64.pkrvars.hcl new file mode 100644 index 0000000..44bbeec --- /dev/null +++ b/os_pkrvars/centos/centos-7-aarch64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "centos" +os_version = "7.9" +os_arch = "aarch64" +iso_url = "https://quantum-mirror.hu/mirrors/pub/centos-altarch/7.9.2009/isos/aarch64/CentOS-7-aarch64-Minimal-2009.iso" +iso_checksum = "1bef71329e51f9bed12349aa026b3fe0c4bb27db729399a3f9addae22848da9b" +parallels_guest_os_type = "centos" +vbox_guest_os_type = "RedHat_64" +vmware_guest_os_type = "centos-64" +boot_command = ["e text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rhel/7ks.cfg x"] diff --git a/os_pkrvars/centos/centos-7-x86_64.pkrvars.hcl b/os_pkrvars/centos/centos-7-x86_64.pkrvars.hcl new file mode 100644 index 0000000..867d24b --- /dev/null +++ b/os_pkrvars/centos/centos-7-x86_64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "centos" +os_version = "7.9" +os_arch = "x86_64" +iso_url = "http://mirrors.kernel.org/centos/7.9.2009/isos/x86_64/CentOS-7-x86_64-Minimal-2009.iso" +iso_checksum = "07b94e6b1a0b0260b94c83d6bb76b26bf7a310dc78d7a9c7432809fb9bc6194a" +parallels_guest_os_type = "centos" +vbox_guest_os_type = "RedHat_64" +vmware_guest_os_type = "centos-64" +boot_command = [" inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rhel/7ks.cfg"] diff --git a/os_pkrvars/centos/centos-stream-8-aarch64.pkrvars.hcl b/os_pkrvars/centos/centos-stream-8-aarch64.pkrvars.hcl new file mode 100644 index 0000000..6733e37 --- /dev/null +++ b/os_pkrvars/centos/centos-stream-8-aarch64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "centos-stream" +os_version = "8" +os_arch = "aarch64" +iso_url = "https://mirrors.edge.kernel.org/centos/8-stream/isos/aarch64/CentOS-Stream-8-aarch64-latest-boot.iso" +iso_checksum = "file:https://mirrors.edge.kernel.org/centos/8-stream/isos/aarch64/CHECKSUM" +parallels_guest_os_type = "centos" +vbox_guest_os_type = "RedHat_64" +vmware_guest_os_type = "centos-64" +boot_command = ["e inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rhel/8ks.cfg x"] diff --git a/os_pkrvars/centos/centos-stream-8-x86_64.pkrvars.hcl b/os_pkrvars/centos/centos-stream-8-x86_64.pkrvars.hcl new file mode 100644 index 0000000..c2bfab5 --- /dev/null +++ b/os_pkrvars/centos/centos-stream-8-x86_64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "centos-stream" +os_version = "8" +os_arch = "x86_64" +iso_url = "http://mirrors.kernel.org/centos/8-stream/isos/x86_64/CentOS-Stream-8-x86_64-latest-dvd1.iso" +iso_checksum = "file:https://mirrors.edge.kernel.org/centos/8-stream/isos/x86_64/CHECKSUM" +parallels_guest_os_type = "centos" +vbox_guest_os_type = "RedHat_64" +vmware_guest_os_type = "centos-64" +boot_command = [" inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rhel/8ks.cfg"] diff --git a/os_pkrvars/centos/centos-stream-9-aarch64.pkrvars.hcl b/os_pkrvars/centos/centos-stream-9-aarch64.pkrvars.hcl new file mode 100644 index 0000000..7e3ed35 --- /dev/null +++ b/os_pkrvars/centos/centos-stream-9-aarch64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "centos-stream" +os_version = "9" +os_arch = "aarch64" +iso_url = "https://mirror.stream.centos.org/9-stream/BaseOS/aarch64/iso/CentOS-Stream-9-latest-aarch64-dvd1.iso" +iso_checksum = "file:https://mirror.stream.centos.org/9-stream/BaseOS/aarch64/iso/CentOS-Stream-9-latest-aarch64-dvd1.iso.SHA256SUM" +parallels_guest_os_type = "centos" +vbox_guest_os_type = "RedHat_64" +vmware_guest_os_type = "centos-64" +boot_command = ["e inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rhel/9ks.cfg x"] diff --git a/os_pkrvars/centos/centos-stream-9-x86_64.pkrvars.hcl b/os_pkrvars/centos/centos-stream-9-x86_64.pkrvars.hcl new file mode 100644 index 0000000..6275223 --- /dev/null +++ b/os_pkrvars/centos/centos-stream-9-x86_64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "centos-stream" +os_version = "9" +os_arch = "x86_64" +iso_url = "https://mirror.stream.centos.org/9-stream/BaseOS/x86_64/iso/CentOS-Stream-9-latest-x86_64-dvd1.iso" +iso_checksum = "file:https://mirror.stream.centos.org/9-stream/BaseOS/x86_64/iso/CentOS-Stream-9-latest-x86_64-dvd1.iso.SHA256SUM" +parallels_guest_os_type = "centos" +vbox_guest_os_type = "RedHat_64" +vmware_guest_os_type = "centos-64" +boot_command = [" inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rhel/9ks.cfg"] diff --git a/os_pkrvars/debian/debian-10-aarch64.pkrvars.hcl b/os_pkrvars/debian/debian-10-aarch64.pkrvars.hcl new file mode 100644 index 0000000..860f434 --- /dev/null +++ b/os_pkrvars/debian/debian-10-aarch64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "debian" +os_version = "10.13" +os_arch = "aarch64" +iso_url = "https://cdimage.debian.org/cdimage/archive/10.13.0/arm64/iso-dvd/debian-10.13.0-arm64-DVD-1.iso" +iso_checksum = "5c6f6df5febf691e95c08b630db3b1c13b9c5b3d19ea4b1515207f09385e186d" +parallels_guest_os_type = "debian" +vbox_guest_os_type = "Debian_64" +vmware_guest_os_type = "debian-64" +boot_command = ["einstall preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/debian/preseed.cfg debian-installer=en_US.UTF-8 auto locale=en_US.UTF-8 kbd-chooser/method=us keyboard-configuration/xkb-keymap=us netcfg/get_hostname={{ .Name }} netcfg/get_domain=vagrantup.com fb=false debconf/frontend=noninteractive console-setup/ask_detect=false console-keymaps-at/keymap=us grub-installer/bootdev=/dev/sda "] diff --git a/os_pkrvars/debian/debian-10-x86_64.pkrvars.hcl b/os_pkrvars/debian/debian-10-x86_64.pkrvars.hcl new file mode 100644 index 0000000..fe00bae --- /dev/null +++ b/os_pkrvars/debian/debian-10-x86_64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "debian" +os_version = "10.13" +os_arch = "x86_64" +iso_url = "https://cdimage.debian.org/cdimage/archive/10.13.0/amd64/iso-dvd/debian-10.13.0-amd64-DVD-1.iso" +iso_checksum = "07d493c305aa5313e767181af5ef2c2b2758a4a3f57e78fb4a4fcba1dcefb198" +parallels_guest_os_type = "debian" +vbox_guest_os_type = "Debian_64" +vmware_guest_os_type = "debian-64" +boot_command = ["auto preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/debian/preseed.cfg netcfg/get_hostname={{ .Name }}"] diff --git a/os_pkrvars/debian/debian-11-aarch64.pkrvars.hcl b/os_pkrvars/debian/debian-11-aarch64.pkrvars.hcl new file mode 100644 index 0000000..8be5010 --- /dev/null +++ b/os_pkrvars/debian/debian-11-aarch64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "debian" +os_version = "11.6" +os_arch = "aarch64" +iso_url = "https://cdimage.debian.org/debian-cd/current/arm64/iso-dvd/debian-11.6.0-arm64-DVD-1.iso" +iso_checksum = "b27ff768c10808518790d72d670c5588cdc60cf8934ef92773a89274a193a65f" +parallels_guest_os_type = "debian" +vbox_guest_os_type = "Debian_64" +vmware_guest_os_type = "debian-64" +boot_command = ["einstall preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/debian/preseed.cfg debian-installer=en_US.UTF-8 auto locale=en_US.UTF-8 kbd-chooser/method=us keyboard-configuration/xkb-keymap=us netcfg/get_hostname={{ .Name }} netcfg/get_domain=vagrantup.com fb=false debconf/frontend=noninteractive console-setup/ask_detect=false console-keymaps-at/keymap=us grub-installer/bootdev=/dev/sda "] diff --git a/os_pkrvars/debian/debian-11-x86_64.pkrvars.hcl b/os_pkrvars/debian/debian-11-x86_64.pkrvars.hcl new file mode 100644 index 0000000..495ed88 --- /dev/null +++ b/os_pkrvars/debian/debian-11-x86_64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "debian" +os_version = "11.6" +os_arch = "x86_64" +iso_url = "https://cdimage.debian.org/debian-cd/current/amd64/iso-dvd/debian-11.6.0-amd64-DVD-1.iso" +iso_checksum = "55f6f49b32d3797621297a9481a6cc3e21b3142f57d8e1279412ff5a267868d8" +parallels_guest_os_type = "debian" +vbox_guest_os_type = "Debian_64" +vmware_guest_os_type = "debian-64" +boot_command = ["auto preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/debian/preseed.cfg netcfg/get_hostname={{ .Name }}"] diff --git a/os_pkrvars/fedora/fedora-36-aarch64.pkrvars.hcl b/os_pkrvars/fedora/fedora-36-aarch64.pkrvars.hcl new file mode 100644 index 0000000..86239ae --- /dev/null +++ b/os_pkrvars/fedora/fedora-36-aarch64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "fedora" +os_version = "36" +os_arch = "aarch64" +iso_url = "https://na.edge.kernel.org/fedora/releases/36/Server/aarch64/iso/Fedora-Server-dvd-aarch64-36-1.5.iso" +iso_checksum = "sha256:0ab4000575ff8b258576750ecf4ca39b266f0c88cab5fe3d8d2f88c9bea4830d" +parallels_guest_os_type = "fedora-core" +vbox_guest_os_type = "Fedora_64" +vmware_guest_os_type = "fedora-64" +boot_command = ["e inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/fedora/ks.cfg"] diff --git a/os_pkrvars/fedora/fedora-36-x86_64.pkrvars.hcl b/os_pkrvars/fedora/fedora-36-x86_64.pkrvars.hcl new file mode 100644 index 0000000..634f6a2 --- /dev/null +++ b/os_pkrvars/fedora/fedora-36-x86_64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "fedora" +os_version = "36" +os_arch = "x86_64" +iso_url = "https://ftp-nyc.osuosl.org/pub/fedora/linux/releases/36/Server/x86_64/iso/Fedora-Server-dvd-x86_64-36-1.5.iso" +iso_checksum = "sha256:5edaf708a52687b09f9810c2b6d2a3432edac1b18f4d8c908c0da6bde0379148" +parallels_guest_os_type = "fedora-core" +vbox_guest_os_type = "Fedora_64" +vmware_guest_os_type = "fedora-64" +boot_command = [" inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/fedora/ks.cfg"] diff --git a/os_pkrvars/fedora/fedora-37-aarch64.pkrvars.hcl b/os_pkrvars/fedora/fedora-37-aarch64.pkrvars.hcl new file mode 100644 index 0000000..86daf9c --- /dev/null +++ b/os_pkrvars/fedora/fedora-37-aarch64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "fedora" +os_version = "37" +os_arch = "aarch64" +iso_url = "https://download.fedoraproject.org/pub/fedora/linux/releases/37/Server/aarch64/iso/Fedora-Server-dvd-aarch64-37-1.7.iso" +iso_checksum = "sha256:1c2deba876bd2da3a429b1b0cd5e294508b8379b299913d97dd6dd6ebcd8b56f" +parallels_guest_os_type = "fedora-core" +vbox_guest_os_type = "Fedora_64" +vmware_guest_os_type = "fedora-64" +boot_command = ["e inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/fedora/ks.cfg"] diff --git a/os_pkrvars/fedora/fedora-37-x86_64.pkrvars.hcl b/os_pkrvars/fedora/fedora-37-x86_64.pkrvars.hcl new file mode 100644 index 0000000..a304f86 --- /dev/null +++ b/os_pkrvars/fedora/fedora-37-x86_64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "fedora" +os_version = "37" +os_arch = "x86_64" +iso_url = "https://download.fedoraproject.org/pub/fedora/linux/releases/37/Server/x86_64/iso/Fedora-Server-dvd-x86_64-37-1.7.iso" +iso_checksum = "sha256:0a4de5157af47b41a07a53726cd62ffabd04d5c1a4afece5ee7c7a84c1213e4f" +parallels_guest_os_type = "fedora-core" +vbox_guest_os_type = "Fedora_64" +vmware_guest_os_type = "fedora-64" +boot_command = ["e inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/fedora/ks.cfg"] diff --git a/os_pkrvars/freebsd/freebsd-12-x86_64.pkrvars.hcl b/os_pkrvars/freebsd/freebsd-12-x86_64.pkrvars.hcl new file mode 100644 index 0000000..4053f8b --- /dev/null +++ b/os_pkrvars/freebsd/freebsd-12-x86_64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "freebsd" +os_version = "12.4" +os_arch = "x86_64" +iso_url = "https://download.freebsd.org/releases/amd64/amd64/ISO-IMAGES/12.4/FreeBSD-12.4-RELEASE-amd64-disc1.iso" +iso_checksum = "606435637b76991f96df68f561badf03266f3d5452e9f72ed9b130d96b188800" +parallels_guest_os_type = "freebsd" +vbox_guest_os_type = "FreeBSD_64" +vmware_guest_os_type = "freedsd-64" +boot_command = ["boot -s/bin/shmdmfs -s 100m md1 /tmpmdmfs -s 100m md2 /mntdhclient -p /tmp/dhclient.em0.pid -l /tmp/dhclient.lease.em0 em0fetch -o /tmp/installerconfig http://{{ .HTTPIP }}:{{ .HTTPPort }}/freebsd/installerconfig \u0026\u0026 bsdinstall script /tmp/installerconfig"] diff --git a/os_pkrvars/freebsd/freebsd-13-x86_64.pkrvars.hcl b/os_pkrvars/freebsd/freebsd-13-x86_64.pkrvars.hcl new file mode 100644 index 0000000..e7fc620 --- /dev/null +++ b/os_pkrvars/freebsd/freebsd-13-x86_64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "freebsd" +os_version = "13.1" +os_arch = "x86_64" +iso_url = "https://download.freebsd.org/releases/amd64/amd64/ISO-IMAGES/13.1/FreeBSD-13.1-RELEASE-amd64-disc1.iso" +iso_checksum = "697d81653fa246b921ddfcf1d15562c55249cc727b11fa3e47f470e2cf2b6a40" +parallels_guest_os_type = "freebsd" +vbox_guest_os_type = "FreeBSD_64" +vmware_guest_os_type = "freedsd-64" +boot_command = ["boot -s/bin/shmdmfs -s 100m md1 /tmpmdmfs -s 100m md2 /mntdhclient -p /tmp/dhclient.em0.pid -l /tmp/dhclient.lease.em0 em0fetch -o /tmp/installerconfig http://{{ .HTTPIP }}:{{ .HTTPPort }}/freebsd/installerconfig && bsdinstall script /tmp/installerconfig"] diff --git a/os_pkrvars/opensuse/opensuse-leap-15-x86_64.pkrvars.hcl b/os_pkrvars/opensuse/opensuse-leap-15-x86_64.pkrvars.hcl new file mode 100644 index 0000000..eb5e316 --- /dev/null +++ b/os_pkrvars/opensuse/opensuse-leap-15-x86_64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "opensuse" +os_version = "15.4" +os_arch = "x86_64" +iso_url = "http://sfo-korg-mirror.kernel.org/opensuse/distribution/leap/15.4/iso/openSUSE-Leap-15.4-DVD-x86_64-Media.iso" +iso_checksum = "4683345f242397c7fd7d89a50731a120ffd60a24460e21d2634e783b3c169695" +parallels_guest_os_type = "opensuse" +vbox_guest_os_type = "OpenSUSE_64" +vmware_guest_os_type = "opensuse-64" +boot_command = ["linux biosdevname=0 net.ifnames=0 netdevice=eth0 netsetup=dhcp lang=en_US textmode=1 autoyast=http://{{ .HTTPIP }}:{{ .HTTPPort }}/opensuse/autoinst.xml"] diff --git a/os_pkrvars/oraclelinux/oraclelinux-7-aarch64.pkrvars.hcl b/os_pkrvars/oraclelinux/oraclelinux-7-aarch64.pkrvars.hcl new file mode 100644 index 0000000..bf32714 --- /dev/null +++ b/os_pkrvars/oraclelinux/oraclelinux-7-aarch64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "oraclelinux" +os_version = "7.9" +os_arch = "aarch64" +iso_url = "https://yum.oracle.com/ISOS/OracleLinux/OL7/u9/aarch64/OracleLinux-R7-U9-Server-aarch64-dvd.iso" +iso_checksum = "fd2c1b1e26858576534f6e6c4cf000a15cd81bec010dad5e827b204a14a1750e" +parallels_guest_os_type = "centos" +vbox_guest_os_type = "RedHat_64" +vmware_guest_os_type = "centos-64" +boot_command = ["e text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rhel/7ks.cfg x"] diff --git a/os_pkrvars/oraclelinux/oraclelinux-7-x86_64.pkrvars.hcl b/os_pkrvars/oraclelinux/oraclelinux-7-x86_64.pkrvars.hcl new file mode 100644 index 0000000..6bd8977 --- /dev/null +++ b/os_pkrvars/oraclelinux/oraclelinux-7-x86_64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "oraclelinux" +os_version = "7.9" +os_arch = "x86_64" +iso_url = "http://mirrors.dotsrc.org/oracle-linux/OL7/u9/x86_64/OracleLinux-R7-U9-Server-x86_64-dvd.iso" +iso_checksum = "dc2782bfd92b4c060cf8006fbc6e18036c27f599eebf3584a1a2ac54f008bf2f" +parallels_guest_os_type = "centos" +vbox_guest_os_type = "RedHat_64" +vmware_guest_os_type = "centos-64" +boot_command = [" inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rhel/7ks.cfg"] diff --git a/os_pkrvars/oraclelinux/oraclelinux-8-aarch64.pkrvars.hcl b/os_pkrvars/oraclelinux/oraclelinux-8-aarch64.pkrvars.hcl new file mode 100644 index 0000000..d908506 --- /dev/null +++ b/os_pkrvars/oraclelinux/oraclelinux-8-aarch64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "oraclelinux" +os_version = "8.7" +os_arch = "aarch64" +iso_url = "https://yum.oracle.com/ISOS/OracleLinux/OL8/u7/aarch64/OracleLinux-R8-U7-aarch64-dvd.iso" +iso_checksum = "420000aa561e833d8dc9576815d068fb5b15fd9fb826a0d9c127782004683741" +parallels_guest_os_type = "centos" +vbox_guest_os_type = "RedHat_64" +vmware_guest_os_type = "centos-64" +boot_command = ["e inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rhel/8ks.cfg x"] diff --git a/os_pkrvars/oraclelinux/oraclelinux-8-x86_64.pkrvars.hcl b/os_pkrvars/oraclelinux/oraclelinux-8-x86_64.pkrvars.hcl new file mode 100644 index 0000000..bbfea5f --- /dev/null +++ b/os_pkrvars/oraclelinux/oraclelinux-8-x86_64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "oraclelinux" +os_version = "8.7" +os_arch = "x86_64" +iso_url = "https://yum.oracle.com/ISOS/OracleLinux/OL8/u7/x86_64/OracleLinux-R8-U7-x86_64-dvd.iso" +iso_checksum = "dd6ede6c0597189b7dffb800b32835002bd95f19c254734aeb58f58651aa03fb" +parallels_guest_os_type = "centos" +vbox_guest_os_type = "RedHat_64" +vmware_guest_os_type = "centos-64" +boot_command = [" inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rhel/8ks.cfg"] diff --git a/os_pkrvars/oraclelinux/oraclelinux-9-aarch64.pkrvars.hcl b/os_pkrvars/oraclelinux/oraclelinux-9-aarch64.pkrvars.hcl new file mode 100644 index 0000000..256517d --- /dev/null +++ b/os_pkrvars/oraclelinux/oraclelinux-9-aarch64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "oraclelinux" +os_version = "9.1" +os_arch = "aarch64" +iso_url = "https://yum.oracle.com/ISOS/OracleLinux/OL9/u1/aarch64/OracleLinux-R9-U1-aarch64-dvd.iso" +iso_checksum = "3dc4578f53ceb1010f8236b3356f2441ec3f9e840fa60522e470d7f3cdb86cb1" +parallels_guest_os_type = "centos" +vbox_guest_os_type = "RedHat_64" +vmware_guest_os_type = "centos-64" +boot_command = ["e inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rhel/9ks.cfg x"] diff --git a/os_pkrvars/oraclelinux/oraclelinux-9-x86_64.pkrvars.hcl b/os_pkrvars/oraclelinux/oraclelinux-9-x86_64.pkrvars.hcl new file mode 100644 index 0000000..dd4cc14 --- /dev/null +++ b/os_pkrvars/oraclelinux/oraclelinux-9-x86_64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "oraclelinux" +os_version = "9.1" +os_arch = "x86_64" +iso_url = "https://yum.oracle.com/ISOS/OracleLinux/OL9/u1/x86_64/OracleLinux-R9-U1-x86_64-dvd.iso" +iso_checksum = "a46ac0b717881a2673c7dc981b3219f6dea747e3d6bd18908fcb8c1f42b82786" +parallels_guest_os_type = "centos" +vbox_guest_os_type = "RedHat_64" +vmware_guest_os_type = "centos-64" +boot_command = [" inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rhel/9ks.cfg"] diff --git a/os_pkrvars/rhel/rhel-7-aarch64.pkrvars.hcl b/os_pkrvars/rhel/rhel-7-aarch64.pkrvars.hcl new file mode 100644 index 0000000..8e6b400 --- /dev/null +++ b/os_pkrvars/rhel/rhel-7-aarch64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "rhel" +os_version = "7.9" +os_arch = "aarch64" +iso_url = "https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux" +iso_checksum = "1b8004961150b60f6c5ec3f25139d3217eee55707cf9fa19e826919fc58e328b" +parallels_guest_os_type = "rhel" +vbox_guest_os_type = "RedHat_64" +vmware_guest_os_type = "centos-64" +boot_command = [" inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rhel/7ks.cfg"] diff --git a/os_pkrvars/rhel/rhel-7-x86_64.pkrvars.hcl b/os_pkrvars/rhel/rhel-7-x86_64.pkrvars.hcl new file mode 100644 index 0000000..d3f3d53 --- /dev/null +++ b/os_pkrvars/rhel/rhel-7-x86_64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "rhel" +os_version = "7.9" +os_arch = "x86_64" +iso_url = "https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux" +iso_checksum = "1b8004961150b60f6c5ec3f25139d3217eee55707cf9fa19e826919fc58e328b" +parallels_guest_os_type = "rhel" +vbox_guest_os_type = "RedHat_64" +vmware_guest_os_type = "centos-64" +boot_command = [" inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rhel/7ks.cfg"] diff --git a/os_pkrvars/rhel/rhel-8-aarch64.pkrvars.hcl b/os_pkrvars/rhel/rhel-8-aarch64.pkrvars.hcl new file mode 100644 index 0000000..ffb0f9c --- /dev/null +++ b/os_pkrvars/rhel/rhel-8-aarch64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "rhel" +os_version = "8.7" +os_arch = "aarch64" +iso_url = "https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux" +iso_checksum = "1b8004961150b60f6c5ec3f25139d3217eee55707cf9fa19e826919fc58e328b" +parallels_guest_os_type = "rhel" +vbox_guest_os_type = "RedHat_64" +vmware_guest_os_type = "centos-64" +boot_command = [" inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rhel/8ks.cfg"] diff --git a/os_pkrvars/rhel/rhel-8-x86_64.pkrvars.hcl b/os_pkrvars/rhel/rhel-8-x86_64.pkrvars.hcl new file mode 100644 index 0000000..54368f6 --- /dev/null +++ b/os_pkrvars/rhel/rhel-8-x86_64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "rhel" +os_version = "8.7" +os_arch = "x86_64" +iso_url = "https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux" +iso_checksum = "1b8004961150b60f6c5ec3f25139d3217eee55707cf9fa19e826919fc58e328b" +parallels_guest_os_type = "rhel" +vbox_guest_os_type = "RedHat_64" +vmware_guest_os_type = "centos-64" +boot_command = [" inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rhel/8ks.cfg"] diff --git a/os_pkrvars/rhel/rhel-9-aarch64.pkrvars.hcl b/os_pkrvars/rhel/rhel-9-aarch64.pkrvars.hcl new file mode 100644 index 0000000..83c8224 --- /dev/null +++ b/os_pkrvars/rhel/rhel-9-aarch64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "rhel" +os_version = "9.1" +os_arch = "aarch64" +iso_url = "https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux" +iso_checksum = "1b8004961150b60f6c5ec3f25139d3217eee55707cf9fa19e826919fc58e328b" +parallels_guest_os_type = "rhel" +vbox_guest_os_type = "RedHat_64" +vmware_guest_os_type = "centos-64" +boot_command = [" inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rhel/9ks.cfg"] diff --git a/os_pkrvars/rhel/rhel-9-x86_64.pkrvars.hcl b/os_pkrvars/rhel/rhel-9-x86_64.pkrvars.hcl new file mode 100644 index 0000000..efda205 --- /dev/null +++ b/os_pkrvars/rhel/rhel-9-x86_64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "rhel" +os_version = "9.1" +os_arch = "x86_64" +iso_url = "https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux" +iso_checksum = "1b8004961150b60f6c5ec3f25139d3217eee55707cf9fa19e826919fc58e328b" +parallels_guest_os_type = "rhel" +vbox_guest_os_type = "RedHat_64" +vmware_guest_os_type = "centos-64" +boot_command = [" inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rhel/9ks.cfg"] diff --git a/os_pkrvars/rockylinux/rockylinux-8-aarch64.pkrvars.hcl b/os_pkrvars/rockylinux/rockylinux-8-aarch64.pkrvars.hcl new file mode 100644 index 0000000..1220b87 --- /dev/null +++ b/os_pkrvars/rockylinux/rockylinux-8-aarch64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "rockylinux" +os_version = "8.7" +os_arch = "aarch64" +iso_url = "https://download.rockylinux.org/pub/rocky/8/isos/aarch64/Rocky-aarch64-minimal.iso" +iso_checksum = "file:https://download.rockylinux.org/pub/rocky/8/isos/aarch64/CHECKSUM" +parallels_guest_os_type = "centos" +vbox_guest_os_type = "RedHat_64" +vmware_guest_os_type = "centos-64" +boot_command = ["e inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rhel/8ks.cfg x"] diff --git a/os_pkrvars/rockylinux/rockylinux-8-x86_64.pkrvars.hcl b/os_pkrvars/rockylinux/rockylinux-8-x86_64.pkrvars.hcl new file mode 100644 index 0000000..5aee7c3 --- /dev/null +++ b/os_pkrvars/rockylinux/rockylinux-8-x86_64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "rockylinux" +os_version = "8.7" +os_arch = "x86_64" +iso_url = "https://download.rockylinux.org/pub/rocky/8/isos/x86_64/Rocky-x86_64-minimal.iso" +iso_checksum = "file:https://download.rockylinux.org/pub/rocky/8.7/isos/x86_64/CHECKSUM" +parallels_guest_os_type = "centos" +vbox_guest_os_type = "RedHat_64" +vmware_guest_os_type = "centos-64" +boot_command = [" inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rhel/8ks.cfg"] diff --git a/os_pkrvars/rockylinux/rockylinux-9-aarch64.pkrvars.hcl b/os_pkrvars/rockylinux/rockylinux-9-aarch64.pkrvars.hcl new file mode 100644 index 0000000..4e80892 --- /dev/null +++ b/os_pkrvars/rockylinux/rockylinux-9-aarch64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "rockylinux" +os_version = "9.1" +os_arch = "aarch64" +iso_url = "https://download.rockylinux.org/pub/rocky/9/isos/aarch64/Rocky-aarch64-minimal.iso" +iso_checksum = "file:https://download.rockylinux.org/pub/rocky/9/isos/aarch64/CHECKSUM" +parallels_guest_os_type = "centos" +vbox_guest_os_type = "RedHat_64" +vmware_guest_os_type = "centos-64" +boot_command = ["e inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rhel/9ks.cfg x"] diff --git a/os_pkrvars/rockylinux/rockylinux-9-x86_64.pkrvars.hcl b/os_pkrvars/rockylinux/rockylinux-9-x86_64.pkrvars.hcl new file mode 100644 index 0000000..2644ead --- /dev/null +++ b/os_pkrvars/rockylinux/rockylinux-9-x86_64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "rockylinux" +os_version = "9.1" +os_arch = "x86_64" +iso_url = "https://download.rockylinux.org/pub/rocky/9.1/isos/x86_64/Rocky-9.1-x86_64-dvd.iso" +iso_checksum = "file:https://download.rockylinux.org/pub/rocky/9.1/isos/x86_64/CHECKSUM" +parallels_guest_os_type = "centos" +vbox_guest_os_type = "RedHat_64" +vmware_guest_os_type = "centos-64" +boot_command = [" inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rhel/9ks.cfg"] diff --git a/os_pkrvars/scientificlinux/scientificlinux-7-x86_64.pkrvars.hcl b/os_pkrvars/scientificlinux/scientificlinux-7-x86_64.pkrvars.hcl new file mode 100644 index 0000000..90f2d7d --- /dev/null +++ b/os_pkrvars/scientificlinux/scientificlinux-7-x86_64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "scientificlinux" +os_version = "7.9" +os_arch = "x86_64" +iso_url = "http://www.gtlib.gatech.edu/pub/scientific/7.9/x86_64/iso/SL-7-DVD-x86_64.iso" +iso_checksum = "7ac643e164c4a0da0b9f33411c68368cf908e0c34254904044957a3ca7793934" +parallels_guest_os_type = "centos" +vbox_guest_os_type = "RedHat_64" +vmware_guest_os_type = "centos-64" +boot_command = [" inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/rhel/7ks.cfg"] diff --git a/os_pkrvars/sles/sles-12-x86_64.pkrvars.hcl b/os_pkrvars/sles/sles-12-x86_64.pkrvars.hcl new file mode 100644 index 0000000..a1e7e72 --- /dev/null +++ b/os_pkrvars/sles/sles-12-x86_64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "suse" +os_version = "12.5" +os_arch = "x86_64" +iso_url = "https://updates.suse.com/SUSE/Products/SLE-SERVER/12-SP5/x86_64/iso/SLE-12-SP5-Server-DVD-x86_64-GM-DVD1.iso" +iso_checksum = "5a12561f8c2869bca4f820787971f3b92f44dce77442906115cd21c359327b9f" +parallels_guest_os_type = "suse" +vbox_guest_os_type = "SUSE_LE_64" +vmware_guest_os_type = "sles12-64" +boot_command = ["linux netdevice=eth0 netsetup=dhcp install=cd:/ lang=en_US autoyast=http://{{ .HTTPIP }}:{{ .HTTPPort }}/sles/12-autoinst.xml textmode=1"] diff --git a/os_pkrvars/sles/sles-15-x86_64.pkrvars.hcl b/os_pkrvars/sles/sles-15-x86_64.pkrvars.hcl new file mode 100644 index 0000000..4cb327e --- /dev/null +++ b/os_pkrvars/sles/sles-15-x86_64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "suse" +os_version = "15.4" +os_arch = "x86_64" +iso_url = "https://updates.suse.com/SUSE/Products/SLE-Product-SLES/15-SP4/x86_64/iso/SLE-15-SP4-Online-x86_64-GM-Media1.iso" +iso_checksum = "c0ceebe14d23c6c9484a1594fc5159225292f0847f7f15046f45a83319536d0e" +parallels_guest_os_type = "suse" +vbox_guest_os_type = "SUSE_LE_64" +vmware_guest_os_type = "sles15-64" +boot_command = ["linux netdevice=eth0 netsetup=dhcp install=cd:/ lang=en_US autoyast=http://{{ .HTTPIP }}:{{ .HTTPPort }}/sles/15-autoinst.xml textmode=1"] diff --git a/os_pkrvars/solaris/solaris-11-x86_64.pkrvars.hcl b/os_pkrvars/solaris/solaris-11-x86_64.pkrvars.hcl new file mode 100644 index 0000000..19dec5c --- /dev/null +++ b/os_pkrvars/solaris/solaris-11-x86_64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "solaris" +os_version = "11.4" +os_arch = "x86_64" +iso_url = "./packer_cache/sol-11_4-ai-x86.iso" +iso_checksum = "sha256:e3a29507e583acbc0b912f371c8f328fea7cb6257d587cbc0a651477a52b0a29" +parallels_guest_os_type = "solaris" +vbox_guest_os_type = "Solaris11_64" +vmware_guest_os_type = "solaris11-64" +boot_command = ["efalserootsolariswhile (true); do sleep 5; test -f /a/etc/sudoers && grep -v \"vagrant\" \"/a/etc/sudoers\" 2> /dev/null && echo \"vagrant ALL=(ALL) NOPASSWD: ALL\" >> /a/etc/sudoers && break ; done &while (true); do grep \"You may wish to reboot\" \"/var/svc/log/application-auto-installer:default.log\" 2> /dev/null && reboot; sleep 10; done &sleep 5; curl http://{{ .HTTPIP }}:{{ .HTTPPort }}/solaris/default.xml -o default.xml;curl http://{{ .HTTPIP }}:{{ .HTTPPort }}/solaris/profile.xml -o profile.xml;cp default.xml /system/volatile/ai.xml;mkdir /system/volatile/profile;cp profile.xml /system/volatile/profile/profile.xml;svcadm enable svc:/application/auto-installer:default;tail -f /var/svc/log/application-auto-installer\\:default.log"] diff --git a/os_pkrvars/springdalelinux/springdalelinux-7-x86_64.pkrvars.hcl b/os_pkrvars/springdalelinux/springdalelinux-7-x86_64.pkrvars.hcl new file mode 100644 index 0000000..3c35a32 --- /dev/null +++ b/os_pkrvars/springdalelinux/springdalelinux-7-x86_64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "springdalelinux" +os_version = "7.9" +os_arch = "x86_64" +iso_url = "http://springdale.princeton.edu/data/springdale/7/x86_64/iso/Springdale%20Linux-7.9-x86_64-netinst.iso" +iso_checksum = "ad47807e17f796bdca35bb3ec5b65f1340d43b698ee04dcf60faecc8c6818c67" +parallels_guest_os_type = "centos" +vbox_guest_os_type = "RedHat_64" +vmware_guest_os_type = "centos-64" +boot_command = [" inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/springdalelinux/7ks.cfg"] diff --git a/os_pkrvars/springdalelinux/springdalelinux-8-x86_64.pkrvars.hcl b/os_pkrvars/springdalelinux/springdalelinux-8-x86_64.pkrvars.hcl new file mode 100644 index 0000000..779e07f --- /dev/null +++ b/os_pkrvars/springdalelinux/springdalelinux-8-x86_64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "springdalelinux" +os_version = "8.7" +os_arch = "x86_64" +iso_url = "http://springdale.princeton.edu/data/springdale/8/x86_64/iso/Springdale%20Linux-8.7-x86_64-netinst.iso" +iso_checksum = "7535d3eadf5d60d12a026ccaf5f1235c660cc985bc1e8b7502a99fd0389407f8" +parallels_guest_os_type = "centos" +vbox_guest_os_type = "RedHat_64" +vmware_guest_os_type = "centos-64" +boot_command = [" inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/springdalelinux/8ks.cfg"] diff --git a/os_pkrvars/springdalelinux/springdalelinux-9-x86_64.pkrvars.hcl b/os_pkrvars/springdalelinux/springdalelinux-9-x86_64.pkrvars.hcl new file mode 100644 index 0000000..16fe6ce --- /dev/null +++ b/os_pkrvars/springdalelinux/springdalelinux-9-x86_64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "springdalelinux" +os_version = "9.1" +os_arch = "x86_64" +iso_url = "http://springdale.princeton.edu/data/springdale/9/x86_64/iso/Springdale%20Linux-9.1-x86_64-netinst.iso" +iso_checksum = "a282a61dfd9ac587aa635688ec3eae8ac95524094dac0355543c3c0f6df84253" +parallels_guest_os_type = "centos" +vbox_guest_os_type = "RedHat_64" +vmware_guest_os_type = "centos-64" +boot_command = [" inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/springdalelinux/9ks.cfg"] diff --git a/os_pkrvars/ubuntu/ubuntu-18.04-aarch64.pkrvars.hcl b/os_pkrvars/ubuntu/ubuntu-18.04-aarch64.pkrvars.hcl new file mode 100644 index 0000000..a56af4d --- /dev/null +++ b/os_pkrvars/ubuntu/ubuntu-18.04-aarch64.pkrvars.hcl @@ -0,0 +1,10 @@ +os_name = "ubuntu" +os_version = "18.04" +os_arch = "aarch64" +iso_url = "https://cdimage.ubuntu.com/releases/18.04.6/release/ubuntu-18.04.6-server-arm64.iso" +iso_checksum = "0a20ef21181a36588f8fb670cc63e8d326fa6e715b526543d300a68de389055f" +hyperv_generation = 2 +parallels_guest_os_type = "ubuntu" +vbox_guest_os_type = "Ubuntu_64" +vmware_guest_os_type = "ubuntu-64" +boot_command = ["e", "", "", "", "", "auto console-setup/ask_detect=false", " console-setup/layoutcode=us", " console-setup/modelcode=pc105", " debconf/frontend=noninteractive", " debian-installer=en_US.UTF-8", " fb=false", " initrd=/install/initrd.gz", " kbd-chooser/method=us", " keyboard-configuration/layout=USA", " keyboard-configuration/variant=USA", " locale=en_US.UTF-8", " netcfg/get_hostname=vagrant", " grub-installer/bootdev=/dev/sda", " noapic", " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ubuntu/preseed.cfg", " ---", ""] diff --git a/os_pkrvars/ubuntu/ubuntu-18.04-x86_64.pkrvars.hcl b/os_pkrvars/ubuntu/ubuntu-18.04-x86_64.pkrvars.hcl new file mode 100644 index 0000000..192ee7b --- /dev/null +++ b/os_pkrvars/ubuntu/ubuntu-18.04-x86_64.pkrvars.hcl @@ -0,0 +1,10 @@ +os_name = "ubuntu" +os_version = "18.04" +os_arch = "x86_64" +iso_url = "http://cdimage.ubuntu.com/ubuntu/releases/18.04.6/release/ubuntu-18.04.6-server-amd64.iso" +iso_checksum = "f5cbb8104348f0097a8e513b10173a07dbc6684595e331cb06f93f385d0aecf6" +hyperv_generation = 2 +parallels_guest_os_type = "ubuntu" +vbox_guest_os_type = "Ubuntu_64" +vmware_guest_os_type = "ubuntu-64" +boot_command = ["", "", "", "/install/vmlinuz auto console-setup/ask_detect=false", " console-setup/layoutcode=us", " console-setup/modelcode=pc105", " debconf/frontend=noninteractive", " debian-installer=en_US.UTF-8", " fb=false", " initrd=/install/initrd.gz", " kbd-chooser/method=us", " keyboard-configuration/layout=USA", " keyboard-configuration/variant=USA", " locale=en_US.UTF-8", " netcfg/get_hostname=vagrant", " grub-installer/bootdev=/dev/sda", " noapic", " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ubuntu/preseed.cfg", " ---", ""] diff --git a/os_pkrvars/ubuntu/ubuntu-20.04-aarch64.pkrvars.hcl b/os_pkrvars/ubuntu/ubuntu-20.04-aarch64.pkrvars.hcl new file mode 100644 index 0000000..3a32db5 --- /dev/null +++ b/os_pkrvars/ubuntu/ubuntu-20.04-aarch64.pkrvars.hcl @@ -0,0 +1,10 @@ +os_name = "ubuntu" +os_version = "20.04" +os_arch = "aarch64" +iso_url = "http://cdimage.ubuntu.com/releases/20.04/release/ubuntu-20.04.5-live-server-arm64.iso" +iso_checksum = "sha256:e42d6373dd39173094af5c26cbf2497770426f42049f8b9ea3e60ce35bebdedf" +hyperv_generation = 2 +parallels_guest_os_type = "ubuntu" +vbox_guest_os_type = "Ubuntu_64" +vmware_guest_os_type = "ubuntu-64" +boot_command = ["linux /casper/vmlinuz quiet autoinstall ds='nocloud-net;s=http://{{.HTTPIP}}:{{.HTTPPort}}/ubuntu/'initrd /casper/initrdboot"] diff --git a/os_pkrvars/ubuntu/ubuntu-20.04-x86_64.pkrvars.hcl b/os_pkrvars/ubuntu/ubuntu-20.04-x86_64.pkrvars.hcl new file mode 100644 index 0000000..3d4f087 --- /dev/null +++ b/os_pkrvars/ubuntu/ubuntu-20.04-x86_64.pkrvars.hcl @@ -0,0 +1,11 @@ +os_name = "ubuntu" +os_version = "20.04" +os_arch = "x86_64" +iso_url = "https://releases.ubuntu.com/focal/ubuntu-20.04.5-live-server-amd64.iso" +iso_checksum = "sha256:5035be37a7e9abbdc09f0d257f3e33416c1a0fb322ba860d42d74aa75c3468d4" +hyperv_generation = 2 +parallels_guest_os_type = "ubuntu" +vbox_guest_os_type = "Ubuntu_64" +vmware_guest_os_type = "ubuntu-64" +boot_wait = "2s" +boot_command = ["/casper/vmlinuz initrd=/casper/initrd quiet autoinstall ds=nocloud-net;s=http://{{.HTTPIP}}:{{.HTTPPort}}/ubuntu/"] diff --git a/os_pkrvars/ubuntu/ubuntu-22.04-aarch64.pkrvars.hcl b/os_pkrvars/ubuntu/ubuntu-22.04-aarch64.pkrvars.hcl new file mode 100644 index 0000000..f540f17 --- /dev/null +++ b/os_pkrvars/ubuntu/ubuntu-22.04-aarch64.pkrvars.hcl @@ -0,0 +1,10 @@ +os_name = "ubuntu" +os_version = "22.04" +os_arch = "aarch64" +iso_url = "https://cdimage.ubuntu.com/releases/22.04/release/ubuntu-22.04.2-live-server-arm64.iso" +iso_checksum = "file:https://cdimage.ubuntu.com/releases/22.04/release/SHA256SUMS" +hyperv_generation = 2 +parallels_guest_os_type = "ubuntu" +vbox_guest_os_type = "Ubuntu_64" +vmware_guest_os_type = "ubuntu-64" +boot_command = ["e autoinstall ds=nocloud-net\\;s=http://{{.HTTPIP}}:{{.HTTPPort}}/ubuntu/"] diff --git a/os_pkrvars/ubuntu/ubuntu-22.04-x86_64.pkrvars.hcl b/os_pkrvars/ubuntu/ubuntu-22.04-x86_64.pkrvars.hcl new file mode 100644 index 0000000..da713f2 --- /dev/null +++ b/os_pkrvars/ubuntu/ubuntu-22.04-x86_64.pkrvars.hcl @@ -0,0 +1,10 @@ +os_name = "ubuntu" +os_version = "22.04" +os_arch = "x86_64" +iso_url = "https://releases.ubuntu.com/jammy/ubuntu-22.04.2-live-server-amd64.iso" +iso_checksum = "file:https://releases.ubuntu.com/jammy/SHA256SUMS" +hyperv_generation = 2 +parallels_guest_os_type = "ubuntu" +vbox_guest_os_type = "Ubuntu_64" +vmware_guest_os_type = "ubuntu-64" +boot_command = ["cset gfxpayload=keeplinux /casper/vmlinuz quiet autoinstall ds=nocloud-net\\;s=http://{{.HTTPIP}}:{{.HTTPPort}}/ubuntu/ ---initrd /casper/initrdboot"] diff --git a/os_pkrvars/ubuntu/ubuntu-22.10-aarch64.pkrvars.hcl b/os_pkrvars/ubuntu/ubuntu-22.10-aarch64.pkrvars.hcl new file mode 100644 index 0000000..c594dd1 --- /dev/null +++ b/os_pkrvars/ubuntu/ubuntu-22.10-aarch64.pkrvars.hcl @@ -0,0 +1,10 @@ +os_name = "ubuntu" +os_version = "22.10" +os_arch = "aarch64" +iso_url = "https://cdimage.ubuntu.com/releases/22.10/release/ubuntu-22.10-live-server-arm64.iso" +iso_checksum = "a19d956e993a16fc6496c371e36dcc0eb85d2bdf6a8e86028b92ce62e9f585cd" +hyperv_generation = 2 +parallels_guest_os_type = "ubuntu" +vbox_guest_os_type = "Ubuntu_64" +vmware_guest_os_type = "ubuntu-64" +boot_command = ["e autoinstall ds=nocloud-net\\;s=http://{{.HTTPIP}}:{{.HTTPPort}}/ubuntu/"] diff --git a/os_pkrvars/ubuntu/ubuntu-22.10-x86_64.pkrvars.hcl b/os_pkrvars/ubuntu/ubuntu-22.10-x86_64.pkrvars.hcl new file mode 100644 index 0000000..22f4168 --- /dev/null +++ b/os_pkrvars/ubuntu/ubuntu-22.10-x86_64.pkrvars.hcl @@ -0,0 +1,10 @@ +os_name = "ubuntu" +os_version = "22.10" +os_arch = "x86_64" +iso_url = "http://releases.ubuntu.com/kinetic/ubuntu-22.10-live-server-amd64.iso" +iso_checksum = "874452797430a94ca240c95d8503035aa145bd03ef7d84f9b23b78f3c5099aed" +hyperv_generation = 2 +parallels_guest_os_type = "ubuntu" +vbox_guest_os_type = "Ubuntu_64" +vmware_guest_os_type = "ubuntu-64" +boot_command = ["e autoinstall ds=nocloud-net\\;s=http://{{.HTTPIP}}:{{.HTTPPort}}/ubuntu/"] diff --git a/os_pkrvars/windows/windows-10-x86_64.pkrvars.hcl b/os_pkrvars/windows/windows-10-x86_64.pkrvars.hcl new file mode 100644 index 0000000..0036e7c --- /dev/null +++ b/os_pkrvars/windows/windows-10-x86_64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "windows" +os_version = "10" +os_arch = "x86_64" +is_windows = true +iso_url = "https://software-static.download.prss.microsoft.com/dbazure/988969d5-f34g-4e03-ac9d-1f9786c66750/19045.2006.220908-0225.22h2_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso" +iso_checksum = "ef7312733a9f5d7d51cfa04ac497671995674ca5e1058d5164d6028f0938d668" +parallels_guest_os_type = "win-10" +vbox_guest_os_type = "Windows10_64" +vmware_guest_os_type = "windows9srv-64" diff --git a/os_pkrvars/windows/windows-10gen2-x86_64.pkrvars.hcl b/os_pkrvars/windows/windows-10gen2-x86_64.pkrvars.hcl new file mode 100644 index 0000000..a7ea6ea --- /dev/null +++ b/os_pkrvars/windows/windows-10gen2-x86_64.pkrvars.hcl @@ -0,0 +1,12 @@ +os_name = "windows" +os_version = "10gen2" +os_arch = "x86_64" +is_windows = true +iso_url = "https://software-static.download.prss.microsoft.com/dbazure/988969d5-f34g-4e03-ac9d-1f9786c66750/19045.2006.220908-0225.22h2_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso" +iso_checksum = "ef7312733a9f5d7d51cfa04ac497671995674ca5e1058d5164d6028f0938d668" +parallels_guest_os_type = "win-10" +vbox_guest_os_type = "Windows10_64" +vmware_guest_os_type = "windows9srv-64" +boot_command = ["aaaaaaa"] +hyperv_generation = 2 +sources_enabled = ["source.hyperv-iso.vm", "source.qemu.vm"] diff --git a/os_pkrvars/windows/windows-11-x86_64.pkrvars.hcl b/os_pkrvars/windows/windows-11-x86_64.pkrvars.hcl new file mode 100644 index 0000000..42d7a34 --- /dev/null +++ b/os_pkrvars/windows/windows-11-x86_64.pkrvars.hcl @@ -0,0 +1,11 @@ +os_name = "windows" +os_version = "11" +os_arch = "x86_64" +is_windows = true +# Windows 11 source requires a prompt to select OS to install. This allows the system time to add reg keys to ignore TPM Check before the install begins. +iso_url = "https://software-download.microsoft.com/download/sg/22000.194.210913-1444.co_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso" +iso_checksum = "sha256:e8b1d2a1a85a09b4bf6154084a8be8e3c814894a15a7bcf3e8e63fcfa9a528cb" +parallels_guest_os_type = "win-11" +vbox_guest_os_type = "Windows11_64" +vmware_guest_os_type = "windows9srv-64" +boot_command = ["reg add HKLM\\SYSTEM\\Setup\\LabConfig /t REG_DWORD /v BypassTPMCheck /d 1reg add HKLM\\SYSTEM\\Setup\\LabConfig /t REG_DWORD /v BypassSecureBootCheck /d 1exit"] diff --git a/os_pkrvars/windows/windows-11gen2-x86_64.pkrvars.hcl b/os_pkrvars/windows/windows-11gen2-x86_64.pkrvars.hcl new file mode 100644 index 0000000..37c72aa --- /dev/null +++ b/os_pkrvars/windows/windows-11gen2-x86_64.pkrvars.hcl @@ -0,0 +1,13 @@ +os_name = "windows" +os_version = "11gen2" +os_arch = "x86_64" +is_windows = true +# Windows 11 source requires a prompt to select OS to install. This allows the system time to add reg keys to ignore TPM Check before the install begins. +iso_url = "https://software-download.microsoft.com/download/sg/22000.194.210913-1444.co_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso" +iso_checksum = "sha256:e8b1d2a1a85a09b4bf6154084a8be8e3c814894a15a7bcf3e8e63fcfa9a528cb" +parallels_guest_os_type = "win-11" +vbox_guest_os_type = "Windows11_64" +vmware_guest_os_type = "windows9srv-64" +hyperv_generation = 2 +boot_command = ["aaaaaaa"] +sources_enabled = ["source.hyperv-iso.vm", "source.qemu.vm"] diff --git a/os_pkrvars/windows/windows-2012r2-x86_64.pkrvars.hcl b/os_pkrvars/windows/windows-2012r2-x86_64.pkrvars.hcl new file mode 100644 index 0000000..2fab256 --- /dev/null +++ b/os_pkrvars/windows/windows-2012r2-x86_64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "windows" +os_version = "2012r2" +os_arch = "x86_64" +is_windows = true +iso_url = "https://download.microsoft.com/download/6/2/A/62A76ABB-9990-4EFC-A4FE-C7D698DAEB96/9600.17050.WINBLUE_REFRESH.140317-1640_X64FRE_SERVER_EVAL_EN-US-IR3_SSS_X64FREE_EN-US_DV9.ISO" +iso_checksum = "6612b5b1f53e845aacdf96e974bb119a3d9b4dcb5b82e65804ab7e534dc7b4d5" +parallels_guest_os_type = "win-2012" +vbox_guest_os_type = "Windows2012_64" +vmware_guest_os_type = "windows9srv-64" diff --git a/os_pkrvars/windows/windows-2016-x86_64.pkrvars.hcl b/os_pkrvars/windows/windows-2016-x86_64.pkrvars.hcl new file mode 100644 index 0000000..0346a55 --- /dev/null +++ b/os_pkrvars/windows/windows-2016-x86_64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "windows" +os_version = "2016" +os_arch = "x86_64" +is_windows = true +iso_url = "https://software-static.download.prss.microsoft.com/pr/download/Windows_Server_2016_Datacenter_EVAL_en-us_14393_refresh.ISO" +iso_checksum = "1ce702a578a3cb1ac3d14873980838590f06d5b7101c5daaccbac9d73f1fb50f" +parallels_guest_os_type = "win-2016" +vbox_guest_os_type = "Windows2016_64" +vmware_guest_os_type = "windows9srv-64" diff --git a/os_pkrvars/windows/windows-2019-x86_64.pkrvars.hcl b/os_pkrvars/windows/windows-2019-x86_64.pkrvars.hcl new file mode 100644 index 0000000..04c9e3f --- /dev/null +++ b/os_pkrvars/windows/windows-2019-x86_64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "windows" +os_version = "2019" +os_arch = "x86_64" +is_windows = true +iso_url = "https://software-static.download.prss.microsoft.com/pr/download/17763.737.190906-2324.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us_1.iso" +iso_checksum = "549bca46c055157291be6c22a3aaaed8330e78ef4382c99ee82c896426a1cee1" +parallels_guest_os_type = "win-2019" +vbox_guest_os_type = "Windows2019_64" +vmware_guest_os_type = "windows9srv-64" diff --git a/os_pkrvars/windows/windows-2022-x86_64.pkrvars.hcl b/os_pkrvars/windows/windows-2022-x86_64.pkrvars.hcl new file mode 100644 index 0000000..6c45a4b --- /dev/null +++ b/os_pkrvars/windows/windows-2022-x86_64.pkrvars.hcl @@ -0,0 +1,9 @@ +os_name = "windows" +os_version = "2022" +os_arch = "x86_64" +is_windows = true +iso_url = "https://software-static.download.prss.microsoft.com/sg/download/888969d5-f34g-4e03-ac9d-1f9786c66749/SERVER_EVAL_x64FRE_en-us.iso" +iso_checksum = "sha256:3e4fa6d8507b554856fc9ca6079cc402df11a8b79344871669f0251535255325" +parallels_guest_os_type = "win-2022" +vbox_guest_os_type = "Windows2022_64" +vmware_guest_os_type = "windows9srv-64" diff --git a/packer_templates/amz_seed_iso/README.md b/packer_templates/amz_seed_iso/README.md new file mode 100644 index 0000000..8ffadfe --- /dev/null +++ b/packer_templates/amz_seed_iso/README.md @@ -0,0 +1 @@ +# Used by Amazon Linux script to convert vdi to packer/vagrant ready ovf diff --git a/packer_templates/amz_seed_iso/meta-data b/packer_templates/amz_seed_iso/meta-data new file mode 100644 index 0000000..d84db15 --- /dev/null +++ b/packer_templates/amz_seed_iso/meta-data @@ -0,0 +1 @@ +local-hostname: vagrant diff --git a/packer_templates/amz_seed_iso/user-data b/packer_templates/amz_seed_iso/user-data new file mode 100644 index 0000000..222eb4e --- /dev/null +++ b/packer_templates/amz_seed_iso/user-data @@ -0,0 +1,29 @@ +#cloud-config +#vim:syntax=yaml +user: vagrant +password: vagrant + +# install packages for vbox guest additions to complete +packages: + - gcc + - kernel-devel + - kernel-headers + - dkms + - make + - bzip2 + - perl + +# make sure we don't setup the network on every boot +write_files: + - path: /etc/cloud/cloud.cfg.d/80_disable_network_after_firstboot.cfg + content: | + # Disable network configuration after first boot + network: + config: disabled + + - path: /etc/cloud/cloud.cfg.d/90_enable_ssh_pwauth.cfg + content: | + runcmd: + - sed -i "s/^PasswordAuthentication.*/PasswordAuthentication yes/" /etc/ssh/sshd_config + - sed -i "/^HWADDR/d" /etc/sysconfig/network-scripts/ifcfg-eth0 + - systemctl restart network sshd diff --git a/packer_templates/amz_working_files/README.md b/packer_templates/amz_working_files/README.md new file mode 100644 index 0000000..5142457 --- /dev/null +++ b/packer_templates/amz_working_files/README.md @@ -0,0 +1 @@ +# Used to store temp Amazon Linux files for packer build diff --git a/packer_templates/cookbooks/packer/Berksfile b/packer_templates/cookbooks/packer/Berksfile new file mode 100644 index 0000000..34fea21 --- /dev/null +++ b/packer_templates/cookbooks/packer/Berksfile @@ -0,0 +1,3 @@ +source 'https://supermarket.chef.io' + +metadata diff --git a/packer_templates/cookbooks/packer/chefignore b/packer_templates/cookbooks/packer/chefignore new file mode 100644 index 0000000..cc170ea --- /dev/null +++ b/packer_templates/cookbooks/packer/chefignore @@ -0,0 +1,115 @@ +# Put files/directories that should be ignored in this file when uploading +# to a Chef Infra Server or Supermarket. +# Lines that start with '# ' are comments. + +# OS generated files # +###################### +.DS_Store +ehthumbs.db +Icon? +nohup.out +Thumbs.db +.envrc + +# EDITORS # +########### +.#* +.project +.settings +*_flymake +*_flymake.* +*.bak +*.sw[a-z] +*.tmproj +*~ +\#* +REVISION +TAGS* +tmtags +.vscode +.editorconfig + +## COMPILED ## +############## +*.class +*.com +*.dll +*.exe +*.o +*.pyc +*.so +*/rdoc/ +a.out +mkmf.log + +# Testing # +########### +.circleci/* +.codeclimate.yml +.delivery/* +.foodcritic +.kitchen* +.mdlrc +.overcommit.yml +.rspec +.rubocop.yml +.travis.yml +.watchr +.yamllint +azure-pipelines.yml +Dangerfile +examples/* +features/* +Guardfile +kitchen.yml* +mlc_config.json +Procfile +Rakefile +spec/* +test/* + +# SCM # +####### +.git +.gitattributes +.gitconfig +.github/* +.gitignore +.gitkeep +.gitmodules +.svn +*/.bzr/* +*/.git +*/.hg/* +*/.svn/* + +# Berkshelf # +############# +Berksfile +Berksfile.lock +cookbooks/* +tmp + +# Bundler # +########### +vendor/* +Gemfile +Gemfile.lock + +# Policyfile # +############## +Policyfile.rb +Policyfile.lock.json + +# Documentation # +############# +CODE_OF_CONDUCT* +CONTRIBUTING* +documentation/* +TESTING* +UPGRADING* + +# Vagrant # +########### +.vagrant +Vagrantfile diff --git a/packer_templates/cookbooks/packer/kitchen.yml b/packer_templates/cookbooks/packer/kitchen.yml new file mode 100644 index 0000000..4e4a4a2 --- /dev/null +++ b/packer_templates/cookbooks/packer/kitchen.yml @@ -0,0 +1,41 @@ +driver: + name: vagrant + customize: + cpus: 2 + memory: 4096 + +transport: + name: winrm + elevated: true + +provisioner: + name: chef_zero + deprecations_as_errors: true + +platforms: + - name: windows-2019 + driver_config: + box: tas50/windows_2019 + - name: windows-2016 + driver_config: + box: tas50/windows_2016 + - name: windows-2012r2 + driver_config: + box: tas50/windows_2012r2 + +suites: + - name: default + run_list: + - recipe[packer::disable_uac] + - recipe[packer::disable_restore] + - recipe[packer::disable_windows_update] + - recipe[packer::remove_defender] + - recipe[packer::configure_power] + - recipe[packer::disable_screensaver] + - recipe[packer::vm_tools] + - recipe[packer::features] + - recipe[packer::enable_file_sharing] + - recipe[packer::enable_remote_desktop] + - recipe[packer::ui_tweaks] + - recipe[packer::cleanup] + - recipe[packer::defrag] diff --git a/packer_templates/cookbooks/packer/metadata.rb b/packer_templates/cookbooks/packer/metadata.rb new file mode 100644 index 0000000..c15884e --- /dev/null +++ b/packer_templates/cookbooks/packer/metadata.rb @@ -0,0 +1,7 @@ +name 'packer' +maintainer 'Tim Smith' +maintainer_email 'tsmith@chef.io' +license 'Apache-2.0' +description 'Resources run during packer builds' +version '1.0.0' +chef_version '>= 15.0' diff --git a/packer_templates/cookbooks/packer/recipes/cleanup.rb b/packer_templates/cookbooks/packer/recipes/cleanup.rb new file mode 100644 index 0000000..b2e47e1 --- /dev/null +++ b/packer_templates/cookbooks/packer/recipes/cleanup.rb @@ -0,0 +1,79 @@ +# OneDrive takes up 150 megs and isn't needed for testing +windows_package 'Microsoft OneDrive' do + action :remove +end + +# Skype takes up 26 megs +windows_package 'Skype' do + action :remove +end + +if windows_workstation? && !node['platform_version'].to_i == 10 # cleanmgr isn't on servers + # registry key locations pulled from https://github.com/spjeff/spadmin/blob/master/Cleanmgr.ps1 + # thanks @spjeff! + registry_key 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Update Cleanup' do + values [{ + name: 'StateFlags0001', + type: :dword, + data: 2, + }] + end + + registry_key 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Temporary Files' do + values [{ + name: 'StateFlags0001', + type: :dword, + data: 2, + }] + end + + execute 'run cleanmgr' do + command 'C:\Windows\System32\cleanmgr.exe /sagerun:1' + ignore_failure true + live_stream true + end +end + +execute 'clean SxS' do + command 'Dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase' + ignore_failure true + live_stream true +end + +powershell_script 'remove unnecesary directories' do + code <<-EOH + @( + "C:\\Recovery", + "$env:localappdata\\temp\\*", + "$env:windir\\logs", + "$env:windir\\temp", + "$env:windir\\winsxs\\manifestcache", + "C:\\Users\\vagrant\Favorites\\*" + ) | % { + if(Test-Path $_) { + Write-Host "Removing $_" + try { + Takeown /d Y /R /f $_ + Icacls $_ /GRANT:r administrators:F /T /c /q 2>&1 | Out-Null + Remove-Item $_ -Recurse -Force | Out-Null + } catch { $global:error.RemoveAt(0) } + } + } + EOH +end + +# clean all of the event logs +%w(Application Security Setup System).each do |log| + execute "Cleaning the #{log} event log" do + command "wevtutil clear-log #{log}" + end +end + +# remove pagefile. it will get created on boot next time +registry_key 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management' do + values [{ + name: 'PagingFiles', + type: :string, + data: '', + }] +end diff --git a/packer_templates/cookbooks/packer/recipes/configure_power.rb b/packer_templates/cookbooks/packer/recipes/configure_power.rb new file mode 100644 index 0000000..15279ba --- /dev/null +++ b/packer_templates/cookbooks/packer/recipes/configure_power.rb @@ -0,0 +1,16 @@ +execute 'Set high performance power profile' do + command 'powercfg -setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c' +end + +execute 'Turn off Hibernation' do + command 'powercfg.exe /hibernate off' + ignore_failure :quiet # if unsupported on the hardware it errors +end + +execute 'Turn off monitor timeout on AC power' do + command 'powercfg -Change -monitor-timeout-ac 0' +end + +execute 'Turn off monitor timeout on DC power' do + command 'powercfg -Change -monitor-timeout-dc 0' +end diff --git a/packer_templates/cookbooks/packer/recipes/defrag.rb b/packer_templates/cookbooks/packer/recipes/defrag.rb new file mode 100644 index 0000000..fcd4c17 --- /dev/null +++ b/packer_templates/cookbooks/packer/recipes/defrag.rb @@ -0,0 +1,20 @@ +remote_file ::File.join(Chef::Config[:file_cache_path], 'ultradefrag.zip') do + source 'http://downloads.sourceforge.net/ultradefrag/ultradefrag-portable-7.1.4.bin.amd64.zip' + action :create +end + +archive_file 'Decompress ultradefrag' do + path ::File.join(Chef::Config[:file_cache_path], 'ultradefrag.zip') + destination ::File.join(Chef::Config[:file_cache_path], 'temp_defrag') + action :extract +end + +execute 'Rename ultradefrag' do + command "move #{::File.join(Chef::Config[:file_cache_path])}\\temp_defrag\\ultradefrag-* #{::File.join(Chef::Config[:file_cache_path], 'ultradefrag')}" + not_if { ::File.exist?(::File.join(Chef::Config[:file_cache_path], 'ultradefrag')) } +end + +execute 'Run ultradefrag' do + command "#{::File.join(Chef::Config[:file_cache_path], 'ultradefrag', 'udefrag.exe')} --optimize --repeat %SystemDrive%" + action :run +end diff --git a/packer_templates/cookbooks/packer/recipes/disable_restore.rb b/packer_templates/cookbooks/packer/recipes/disable_restore.rb new file mode 100644 index 0000000..1e0ece6 --- /dev/null +++ b/packer_templates/cookbooks/packer/recipes/disable_restore.rb @@ -0,0 +1,5 @@ +# don't bother saving data for a system restore +registry_key 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\SystemRestore' do + values [{ name: 'DisableSR', type: :dword, data: 0 }] # disable + action :create +end diff --git a/packer_templates/cookbooks/packer/recipes/disable_screensaver.rb b/packer_templates/cookbooks/packer/recipes/disable_screensaver.rb new file mode 100644 index 0000000..8318ac7 --- /dev/null +++ b/packer_templates/cookbooks/packer/recipes/disable_screensaver.rb @@ -0,0 +1,5 @@ +# Disable the screensaver +registry_key 'HKEY_CURRENT_USER\Control Panel\Desktop' do + values [{ name: 'ScreenSaveActive', type: :dword, data: 0 }] # disable + action :create +end diff --git a/packer_templates/cookbooks/packer/recipes/disable_uac.rb b/packer_templates/cookbooks/packer/recipes/disable_uac.rb new file mode 100644 index 0000000..7bdda07 --- /dev/null +++ b/packer_templates/cookbooks/packer/recipes/disable_uac.rb @@ -0,0 +1,5 @@ +windows_uac 'Configure UAC' do + consent_behavior_admins :no_prompt + prompt_on_secure_desktop false + enable_uac false +end diff --git a/packer_templates/cookbooks/packer/recipes/disable_windows_update.rb b/packer_templates/cookbooks/packer/recipes/disable_windows_update.rb new file mode 100644 index 0000000..dbd70fd --- /dev/null +++ b/packer_templates/cookbooks/packer/recipes/disable_windows_update.rb @@ -0,0 +1,4 @@ +# don't waste CPU / network bandwidth checking for updates +windows_update_settings 'disable windows update' do + disable_automatic_updates true +end diff --git a/packer_templates/cookbooks/packer/recipes/enable_file_sharing.rb b/packer_templates/cookbooks/packer/recipes/enable_file_sharing.rb new file mode 100644 index 0000000..072797a --- /dev/null +++ b/packer_templates/cookbooks/packer/recipes/enable_file_sharing.rb @@ -0,0 +1,3 @@ +execute 'enable filesharing' do + command 'netsh advfirewall firewall set rule group="File and Printer Sharing" new enable=Yes' +end diff --git a/packer_templates/cookbooks/packer/recipes/enable_remote_desktop.rb b/packer_templates/cookbooks/packer/recipes/enable_remote_desktop.rb new file mode 100644 index 0000000..293c729 --- /dev/null +++ b/packer_templates/cookbooks/packer/recipes/enable_remote_desktop.rb @@ -0,0 +1,10 @@ +registry_key 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server' do + values [{ + name: 'fDenyTSConnections', + type: :dword, + data: 0 }] +end + +execute 'Enable RDP firewall rule' do + command 'netsh advfirewall firewall set rule group="Remote Desktop" new enable=Yes' +end diff --git a/packer_templates/cookbooks/packer/recipes/features.rb b/packer_templates/cookbooks/packer/recipes/features.rb new file mode 100644 index 0000000..8fb9548 --- /dev/null +++ b/packer_templates/cookbooks/packer/recipes/features.rb @@ -0,0 +1,3 @@ +windows_feature 'MicrosoftWindowsPowerShellISE' do + action :remove +end diff --git a/packer_templates/cookbooks/packer/recipes/remove_defender.rb b/packer_templates/cookbooks/packer/recipes/remove_defender.rb new file mode 100644 index 0000000..ec72c2e --- /dev/null +++ b/packer_templates/cookbooks/packer/recipes/remove_defender.rb @@ -0,0 +1,3 @@ +windows_defender 'disable windows defender' do + action :disable +end diff --git a/packer_templates/cookbooks/packer/recipes/set_local_account_token_filter_policy.rb b/packer_templates/cookbooks/packer/recipes/set_local_account_token_filter_policy.rb new file mode 100644 index 0000000..63dbfa2 --- /dev/null +++ b/packer_templates/cookbooks/packer/recipes/set_local_account_token_filter_policy.rb @@ -0,0 +1,7 @@ +registry_key 'HKEY_LOCAL_MACHINE\software\Microsoft\Windows\CurrentVersion\Policies\system' do + values [{ + name: 'LocalAccountTokenFilterPolicy', + type: :dword, + data: 1, + }] +end diff --git a/packer_templates/cookbooks/packer/recipes/ui_tweaks.rb b/packer_templates/cookbooks/packer/recipes/ui_tweaks.rb new file mode 100644 index 0000000000000000000000000000000000000000..bf17b3330a5bd025d554f1363b3211143843e78b GIT binary patch literal 3851 zcmc&%O>-JK5ZyDsqN{x1;)9*ju5SbnwOeZviVr(mJ1JMss0UPNq$x?mN4E0c)6zf^ zumiT^uqPNssNZY#d)+z%H#18pq#~e|C+(!su4QQ|oww`zIjy1n=il8)Ix>Y{qNTJi zb88$wrFT*bvvg^yDq8SAB<{)k8N&wY0?947C^ z_mfdFJfzo+ZXt;~54Su2c1Wk!M*9(4#pJIeNAUv|l{IA*@fXYnS-!Pr^UzETozV~K z{-&Rf-uK3Lonev=jFPz|_t1La-8dbRl9)*){rV7r(I((9#(RHEy?Zo9Ldl7zP+V2MaQ1A__B7Q39bi3vzRBsuLd14NqMQKA%wp_L5Ty+z>L%=TmEH z)~_sCbdez;&mT?6K^U_B2VQsRiLKJkUqa0(o)x2bGPJMbOV1ir$1Gcp+|iuUQ1;L4 z=Z%Um{+qs9>~hBQYbp6x`6+bwV7Vo(Hjj@TQI|WhH3|l(Nu}3Kjc#V~K6xv1cgSM< zQa23t9G1s@j(=d_{>}xO{s62PzA(p)mnUK! zmBx4;xy3ZJwE|pjDclwq_M@KrXl4(A?1iBy26@nZp9s-45E+?K3KYv9GP5Gb7o1JL zW6_(6adY>`c;?u7T_8(>-K)_?NxBY=g-4U%BHuO%cf76Hu_=&+(gdfd3@_$e$2QvT zcHS7}d2W4V$7W&eA%q0!sdRt^Zv{EeYV%M9+dX67*b5$TzDk))_|7!2R1jZ4b8>x_ g=x(WGQlnjeU)JqEF3vCCoL^j?|9%nIZtj#{051;)R{#J2 literal 0 HcmV?d00001 diff --git a/packer_templates/cookbooks/packer/recipes/updates.rb b/packer_templates/cookbooks/packer/recipes/updates.rb new file mode 100644 index 0000000..f602be4 --- /dev/null +++ b/packer_templates/cookbooks/packer/recipes/updates.rb @@ -0,0 +1,13 @@ +if windows_nt_version == '10.0.17763' # 2019 + # This is basically a service pack and we should install it to fix a giant pile of bugs + msu_package '2020-04 monthly rollup' do + source 'http://download.windowsupdate.com/d/msdownload/update/software/updt/2020/04/windows10.0-kb4550969-x64_7d0a6efbe9e4d44253babdc161873513f88fc1e4.msu' + action :install + end +elsif windows_nt_version == '10.0.14393' # 2016 + # This is basically a service pack and we should install it to fix a giant pile of bugs + msu_package '2020-04 monthly rollup' do + source 'http://download.windowsupdate.com/d/msdownload/update/software/updt/2020/04/windows10.0-kb4550947-x64_f2ec932f8fb2be82d2f430b5dcd1ec4b92a7611c.msu' + action :install + end +end diff --git a/packer_templates/cookbooks/packer/recipes/vm_tools.rb b/packer_templates/cookbooks/packer/recipes/vm_tools.rb new file mode 100644 index 0000000..d5b87c2 --- /dev/null +++ b/packer_templates/cookbooks/packer/recipes/vm_tools.rb @@ -0,0 +1,37 @@ +# install virtualbox guest additions on vbox guests +if vbox? + directory 'C:/Windows/Temp/virtualbox' do + recursive true + end + + powershell_script 'install vbox guest additions' do + code <<-EOH + Get-ChildItem E:/cert/ -Filter vbox*.cer | ForEach-Object { + E:/cert/VBoxCertUtil.exe add-trusted-publisher $_.FullName --root $_.FullName + } + + Start-Process -FilePath "e:/VBoxWindowsAdditions.exe" -ArgumentList "/S" -WorkingDirectory "C:/Windows/Temp/virtualbox" -Wait + EOH + ignore_failure true + end + + directory 'C:/Windows/Temp/virtualbox' do + action :delete + end +end + +# install vmware tools on vmware guests +# This is from https://github.com/luciusbono/Packer-Windows10/blob/master/install-guest-tools.ps1 +if vmware? + powershell_script 'install vmware tools' do + code <<-'EOH' + $isopath = 'C:\Windows\Temp\vmware.iso' + Mount-DiskImage -ImagePath $isopath + $exe = ((Get-DiskImage -ImagePath $isopath | Get-Volume).Driveletter + ':\setup.exe') + $parameters = '/S /v "/qn REBOOT=R"' + Start-Process -FilePath $exe -ArgumentList $parameters -Wait + Dismount-DiskImage -ImagePath $isopath + Remove-Item $isopath + EOH + end +end diff --git a/packer_templates/http/debian/preseed.cfg b/packer_templates/http/debian/preseed.cfg new file mode 100644 index 0000000..4d065bc --- /dev/null +++ b/packer_templates/http/debian/preseed.cfg @@ -0,0 +1,104 @@ +#_preseed_V1 +# Automatic installation +d-i auto-install/enable boolean true + +# Preseeding only locale sets language, country and locale. +d-i debian-installer/language string en +d-i debian-installer/country string US +d-i debian-installer/locale string en_US.UTF-8 + +d-i console-setup/ask_detect boolean false +d-i debconf/frontend select noninteractive + +# Keyboard selection. +d-i keyboard-configuration/xkb-keymap select us +d-i keymap select us + +choose-mirror-bin mirror/http/proxy string +d-i apt-setup/use_mirror boolean true +d-i base-installer/kernel/override-image string linux-server + +### Clock and time zone setup +d-i clock-setup/utc boolean true +d-i clock-setup/utc-auto boolean true +d-i time/zone string UTC + +# Avoid that last message about the install being complete. +d-i finish-install/reboot_in_progress note + +# This is fairly safe to set, it makes grub install automatically to the MBR +# if no other operating system is detected on the machine. +d-i grub-installer/only_debian boolean true + +# This one makes grub-installer install to the MBR if it also finds some other +# OS, which is less safe as it might not be able to boot that other OS. +d-i grub-installer/with_other_os boolean true + +# Set dev for grub boot +d-i grub-installer/bootdev string /dev/sda + +### Mirror settings +# If you select ftp, the mirror/country string does not need to be set. +d-i mirror/country string manual +d-i mirror/http/directory string /debian/ +d-i mirror/http/hostname string httpredir.debian.org +d-i mirror/http/proxy string + +# This makes partman automatically partition without confirmation. +d-i partman-efi/non_efi_system boolean true +d-i partman-auto-lvm/guided_size string max +d-i partman-auto/choose_recipe select atomic +d-i partman-auto/method string lvm +d-i partman-lvm/confirm boolean true +d-i partman-lvm/confirm_nooverwrite boolean true +d-i partman-lvm/device_remove_lvm boolean true +d-i partman/choose_partition select finish +d-i partman/confirm boolean true +d-i partman/confirm_nooverwrite boolean true +d-i partman/confirm_write_new_label boolean true + +### Account setup +d-i passwd/root-login boolean false +d-i passwd/user-fullname string vagrant +d-i passwd/user-uid string 1000 +d-i passwd/user-password password vagrant +d-i passwd/user-password-again password vagrant +d-i passwd/username string vagrant + +# The installer will warn about weak passwords. If you are sure you know +# what you're doing and want to override it, uncomment this. +d-i user-setup/allow-password-weak boolean true +d-i user-setup/encrypt-home boolean false + +### Package selection +tasksel tasksel/first multiselect standard, ssh-server +d-i pkgsel/include string openssh-server sudo bzip2 acpid cryptsetup zlib1g-dev wget curl dkms fuse make nfs-common net-tools cifs-utils rsync +d-i pkgsel/install-language-support boolean false + +# Prevent packaged version of VirtualBox Guest Additions being installed: +d-i preseed/early_command string sed -i \ +'/in-target/idiscover(){/sbin/discover|grep -v VirtualBox;}' \ +/usr/lib/pre-pkgsel.d/20install-hwpackages + +# Do not scan additional CDs +apt-cdrom-setup apt-setup/cdrom/set-first boolean false + +# Use network mirror +apt-mirror-setup apt-setup/use_mirror boolean true + +# disable automatic package updates +d-i pkgsel/update-policy select none +d-i pkgsel/upgrade select full-upgrade + +# Disable polularity contest +popularity-contest popularity-contest/participate boolean false + +# Select base install +tasksel tasksel/first multiselect standard, ssh-server + +# Setup passwordless sudo for packer user +d-i preseed/late_command string \ +echo "vagrant ALL=(ALL:ALL) NOPASSWD:ALL" > /target/etc/sudoers.d/vagrant && chmod 0440 /target/etc/sudoers.d/vagrant + +# remove cdrom from apt sources +d-i preseed/late_command string sed -i '/^deb cdrom:/s/^/#/' /target/etc/apt/sources.list diff --git a/packer_templates/http/fedora/ks.cfg b/packer_templates/http/fedora/ks.cfg new file mode 100644 index 0000000..f31e533 --- /dev/null +++ b/packer_templates/http/fedora/ks.cfg @@ -0,0 +1,47 @@ +lang en_US.UTF-8 +keyboard --xlayouts='us' +network --bootproto=dhcp --noipv6 --onboot=on --device=eth0 +rootpw --plaintext vagrant +firewall --disabled +selinux --permissive +timezone UTC +bootloader --timeout=1 --location=mbr --append="net.ifnames=0 biosdevname=0" +text +skipx +zerombr +clearpart --all --initlabel +autopart --nohome --nolvm --noboot +firstboot --disabled +reboot --eject +user --name=vagrant --plaintext --password vagrant + +%packages --ignoremissing --excludedocs +bzip2 +tar +wget +nfs-utils +net-tools +rsync +dkms +-plymouth +-plymouth-core-libs +-fedora-release-notes +-mcelog +-smartmontools +-usbutils +-microcode_ctl +%end + +%post +# sudo +echo 'Defaults:vagrant !requiretty' > /etc/sudoers.d/vagrant +echo '%vagrant ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers.d/vagrant +chmod 440 /etc/sudoers.d/vagrant + +# Enable hyper-v daemons only if using hyper-v virtualization +if [ $(virt-what) == "hyperv" ]; then +dnf -y install hyperv-daemons cifs-utils +systemctl enable hypervvssd +systemctl enable hypervkvpd +fi +%end diff --git a/packer_templates/http/freebsd/installerconfig b/packer_templates/http/freebsd/installerconfig new file mode 100644 index 0000000..0204566 --- /dev/null +++ b/packer_templates/http/freebsd/installerconfig @@ -0,0 +1,55 @@ +DISTRIBUTIONS="base.txz kernel.txz" +if [ `uname -m` = "amd64" ]; then + DISTRIBUTIONS="${DISTRIBUTIONS} lib32.txz" +fi + +# for variations in the root disk device name between VMware and Virtualbox +if [ -e /dev/ada0 ]; then + DISKSLICE=ada0 +elif [ -e /dev/da0 ]; then + DISKSLICE=da0 +elif [ -e /dev/vtbd0 ]; then + DISKSLICE=vtbd0 +else + echo "Unknown disk for install.sh to work with!" + exit -1 +fi + +# Workaround for https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=203777 +export nonInteractive="YES" + +export ZFSBOOT_DISKS="$DISKSLICE" +export ZFSBOOT_CONFIRM_LAYOUT=0 + +HOSTNAME=freebsd + +#!/bin/sh -x + +ifdev=$(ifconfig | grep '^[a-z]' | cut -d: -f1 | head -n 1) +# Enable required services +cat >> /etc/rc.conf << EOT +ifconfig_${ifdev}="dhcp" +sshd_enable="YES" +EOT + +# Tune and boot from zfs +cat >> /boot/loader.conf << EOT +vm.kmem_size="200M" +vm.kmem_size_max="200M" +vfs.zfs.arc_max="40M" +vfs.zfs.vdev.cache.size="5M" +autoboot_delay=3 +EOT + +# zfs doesn't use an fstab, but some rc scripts expect one +touch /etc/fstab + +# Set up user accounts +echo "vagrant" | pw -V /etc useradd vagrant -h 0 -s /bin/sh -G wheel -d /usr/home/vagrant -c "Vagrant User" +echo "vagrant" | pw -V /etc usermod root + +mkdir -p /usr/home/vagrant +chown 1001:1001 /usr/home/vagrant +ln -s /usr/home /home + +reboot diff --git a/packer_templates/http/opensuse/autoinst.xml b/packer_templates/http/opensuse/autoinst.xml new file mode 100644 index 0000000..4b1a823 --- /dev/null +++ b/packer_templates/http/opensuse/autoinst.xml @@ -0,0 +1,235 @@ + + + + + + + false + true + false + + + + + false + 10 + true + + + false + 10 + true + + + false + 10 + true + + + + english-us + + + en_US + en_US + + + UTC + Etc/UTC + + + + false + true + + + true + false + swap + true + defaults + false + swap + device + 130 + 1 + + false + 512M + + + true + false + btrfs + true + false + / + device + 131 + 2 + + false + max + + boot/grub2/i386-pc + boot/grub2/x86_64-efi + home + opt + srv + tmp + usr/local + var/crash + var/lib/mailman + var/lib/named + var/lib/pgsql + var/log + var/opt + var/spool + var/tmp + + + + + CT_DISK + all + + + + grub2 + + true + 1 + true + + + + false + true + + false + localdomain + opensuse15.localdomain + + + + dhcp + enp0s3 + hotplug + + + dhcp + ens33 + hotplug + + + dhcp + eth0 + hotplug + + + + + false + false + + + + + grub2 + glibc-locale + iputils + kernel-default + sudo + yast2 + yast2-firstboot + zypper + yast2-trans-en_US + wget + curl + less + openssh + openssh-server + + + sw_management + yast2_install_wf + minimal_base + + + bash-completion + telnet + virtualbox-guest-kmp-default + virtualbox-guest-tools + snapper + snapper-zypp-plugin + + + + multi-user + + + + sshd + + + + + + 100 + users + + + + + + 100 + + /home + -1 + true + /bin/bash + /etc/skel + 022 + + + + vagrant + root + + + vagrant + 100 + /home/vagrant + + + + -1 + 99999 + 0 + 7 + + /bin/bash + 1000 + vagrant + vagrant + + + + false + + + + + + + + diff --git a/packer_templates/http/rhel/7ks.cfg b/packer_templates/http/rhel/7ks.cfg new file mode 100644 index 0000000..ce5b2d9 --- /dev/null +++ b/packer_templates/http/rhel/7ks.cfg @@ -0,0 +1,77 @@ +install +cdrom +lang en_US.UTF-8 +keyboard us +network --bootproto=dhcp --noipv6 --onboot=on --device=eth0 +rootpw --plaintext vagrant +firewall --disabled +selinux --permissive +timezone UTC +unsupported_hardware +bootloader --timeout=1 --location=mbr --append="net.ifnames=0 biosdevname=0" +text +skipx +zerombr +clearpart --all --initlabel +autopart --nohome --nolvm +auth --enableshadow --passalgo=sha512 --kickstart +firstboot --disabled +reboot --eject +user --name=vagrant --plaintext --password vagrant + +%packages --nobase --ignoremissing --excludedocs --instLangs=en_US.utf8 +# vagrant needs this to copy initial files via scp +openssh-clients +sudo +selinux-policy-devel +wget +nfs-utils +net-tools +tar +bzip2 +deltarpm +rsync +-fprintd-pam +-intltool + +# unnecessary firmware +-*firmware +-microcode_ctl +%end + +%post +# sudo +echo 'Defaults:vagrant !requiretty' > /etc/sudoers.d/vagrant +echo '%vagrant ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers.d/vagrant +chmod 440 /etc/sudoers.d/vagrant + +# Enable hyper-v daemons only if using hyper-v virtualization +if [ $(virt-what) == "hyperv" ]; then + yum -y install hyperv-daemons cifs-utils + systemctl enable hypervvssd + systemctl enable hypervkvpd +fi + +# Since we disable consistent network naming, we need to make sure the eth0 +# configuration file is in place so it will come up. +# Delete other network configuration first because RHEL/C7 networking will not +# restart successfully if there are configuration files for devices that do not +# exist. +rm -f /etc/sysconfig/network-scripts/ifcfg-e* +cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << _EOF_ +TYPE=Ethernet +PROXY_METHOD=none +BROWSER_ONLY=no +BOOTPROTO=dhcp +DEFROUTE=yes +IPV4_FAILURE_FATAL=no +IPV6INIT=yes +IPV6_AUTOCONF=yes +IPV6_DEFROUTE=yes +IPV6_FAILURE_FATAL=no +IPV6_ADDR_GEN_MODE=stable-privacy +NAME=eth0 +DEVICE=eth0 +ONBOOT=yes +_EOF_ +%end diff --git a/packer_templates/http/rhel/8ks.cfg b/packer_templates/http/rhel/8ks.cfg new file mode 100644 index 0000000..595f495 --- /dev/null +++ b/packer_templates/http/rhel/8ks.cfg @@ -0,0 +1,77 @@ +install +cdrom +lang en_US.UTF-8 +keyboard us +network --bootproto=dhcp --noipv6 --onboot=on --device=eth0 +rootpw --plaintext vagrant +firewall --disabled +selinux --permissive +timezone UTC +bootloader --timeout=1 --location=mbr --append="net.ifnames=0 biosdevname=0" +text +skipx +zerombr +clearpart --all --initlabel +autopart --nohome --nolvm --noboot +firstboot --disabled +reboot --eject +user --name=vagrant --plaintext --password vagrant + +%packages --ignoremissing --excludedocs --instLangs=en_US.utf8 +# vagrant needs this to copy initial files via scp +openssh-clients +sudo +selinux-policy-devel +wget +nfs-utils +net-tools +tar +bzip2 +deltarpm +rsync +dnf-utils +redhat-lsb-core +elfutils-libelf-devel +network-scripts +-fprintd-pam +-intltool +-iwl*-firmware +-microcode_ctl +%end + +%post +# sudo +echo 'Defaults:vagrant !requiretty' > /etc/sudoers.d/vagrant +echo '%vagrant ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers.d/vagrant +chmod 440 /etc/sudoers.d/vagrant + +# Enable hyper-v daemons only if using hyper-v virtualization +if [ $(virt-what) == "hyperv" ]; then + dnf -y install hyperv-daemons cifs-utils + systemctl enable hypervvssd + systemctl enable hypervkvpd +fi + +# Since we disable consistent network naming, we need to make sure the eth0 +# configuration file is in place so it will come up. +# Delete other network configuration first because RHEL/C7 networking will not +# restart successfully if there are configuration files for devices that do not +# exist. +rm -f /etc/sysconfig/network-scripts/ifcfg-e* +cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << _EOF_ +TYPE=Ethernet +PROXY_METHOD=none +BROWSER_ONLY=no +BOOTPROTO=dhcp +DEFROUTE=yes +IPV4_FAILURE_FATAL=no +IPV6INIT=yes +IPV6_AUTOCONF=yes +IPV6_DEFROUTE=yes +IPV6_FAILURE_FATAL=no +IPV6_ADDR_GEN_MODE=stable-privacy +NAME=eth0 +DEVICE=eth0 +ONBOOT=yes +_EOF_ +%end diff --git a/packer_templates/http/rhel/9ks.cfg b/packer_templates/http/rhel/9ks.cfg new file mode 100644 index 0000000..0ea7d91 --- /dev/null +++ b/packer_templates/http/rhel/9ks.cfg @@ -0,0 +1,76 @@ +cdrom +lang en_US.UTF-8 +keyboard us +network --bootproto=dhcp --noipv6 --onboot=on --device=eth0 +rootpw --plaintext vagrant +firewall --disabled +selinux --permissive +timezone UTC +bootloader --timeout=1 --location=mbr --append="net.ifnames=0 biosdevname=0" +text +skipx +zerombr +clearpart --all --initlabel +autopart --nohome --nolvm --noboot +firstboot --disabled +reboot --eject +user --name=vagrant --plaintext --password vagrant + +%packages --ignoremissing --excludedocs +# vagrant needs this to copy initial files via scp +openssh-clients +sudo +selinux-policy-devel +wget +nfs-utils +net-tools +tar +bzip2 +deltarpm +rsync +dnf-utils +redhat-lsb-core +elfutils-libelf-devel +network-scripts +-fprintd-pam +-intltool +-iwl*-firmware +-microcode_ctl +%end + +%post +# sudo +echo 'Defaults:vagrant !requiretty' > /etc/sudoers.d/vagrant +echo '%vagrant ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers.d/vagrant +chmod 440 /etc/sudoers.d/vagrant + +# Enable hyper-v daemons only if using hyper-v virtualization +if [ $(virt-what) == "hyperv" ]; then +dnf -y install hyperv-daemons cifs-utils +systemctl enable hypervvssd +systemctl enable hypervkvpd +fi + +# Since we disable consistent network naming, we need to make sure the eth0 +# configuration file is in place so it will come up. +# Delete other network configuration first because RHEL/C7 networking will not +# restart successfully if there are configuration files for devices that do not +# exist. +rm -f /etc/sysconfig/network-scripts/ifcfg-e* +cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << _EOF_ +TYPE=Ethernet +PROXY_METHOD=none + BROWSER_ONLY=no + BOOTPROTO=dhcp + DEFROUTE=yes +IPV4_FAILURE_FATAL=no +IPV6INIT=yes +IPV6_AUTOCONF=yes +IPV6_DEFROUTE=yes + IPV6_FAILURE_FATAL=no + IPV6_ADDR_GEN_MODE=stable-privacy + NAME=eth0 +DEVICE=eth0 +ONBOOT=yes +_EOF_ +%end diff --git a/packer_templates/http/sles/12-autoinst.xml b/packer_templates/http/sles/12-autoinst.xml new file mode 100644 index 0000000..40126e7 --- /dev/null +++ b/packer_templates/http/sles/12-autoinst.xml @@ -0,0 +1,283 @@ + + + + + + + + + true + splash=silent quiet showopts + showopts apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe + false + false + false + true + 0 + SLES12 + true + auto + false + 8 + + + + ahci + + + ata_piix + + + ata_generic + + + jbd + + + mbcache + + + grub2 + + + + false + + + false + false + + + + + false + + + none + + + + true + true + true + true + false + true + + + + + + + + AUTO + + + false + vagrantup.com + vagrant-sles-12-x64 + auto + + vagrantup.com + + true + + + + dhcp + eth0 + yes + auto + no + + + true + false + + false + false + + + + + + + + false + true + + + true + false + swap + true + defaults + false + swap + device + 130 + 1 + + false + 1561492992 + + + true + false + btrfs + true + false + / + device + 131 + 2 + + false + max + + boot/grub2/i386-pc + boot/grub2/x86_64-efi + home + opt + srv + tmp + usr/local + var/crash + var/lib/mailman + var/lib/named + var/lib/pgsql + var/log + var/opt + var/spool + var/tmp + + + + + CT_DISK + all + + + + + true + true + 0 + + + true + true + 0 + + + true + true + 0 + + + true + true + 0 + + + + graphical + + + + sshd + + + + + + glibc + openssh + snapper + SuSEfirewall2 + kexec-tools + perl-Bootloader-YAML + kernel-default-devel + sudo + gcc + wget + perl + make + + + Minimal + apparmor + + + adaptec-firmware + atmel-firmware + bash-completion + bash-doc + cifs-utils + cups-libs + ipw-firmware + mpt-firmware + postfix + samba-libs + ucode-intel + snapper + snapper-zypp-plugin + + + + UTC + UTC + + + + 100 + video,dialout + /home + -1 + /bin/bash + /etc/skel + 022 + + + + true + vagrant + 100 + /home/vagrant + + + + + 99999 + 0 + 7 + + /bin/bash + 1000 + $2y$05$NA1Li9ZKJOLRW5mMTXm6/e5r8dltWS5RpDZpvHrI82aLE00V51tdi + vagrant + + + true + root + 0 + /root + + + + + + + + + /bin/bash + 0 + $6$UgKtUD0AUMIA$VWLyc2Uvl0Lk6xxfTuoRb0/jrhZ9IJG/Gtx/DkZUEWZm.JYO1Q1fvPo6gDxQAHp38kQ1DG1vNGRgu2T/z/vih. + root + + + diff --git a/packer_templates/http/sles/15-autoinst.xml b/packer_templates/http/sles/15-autoinst.xml new file mode 100644 index 0000000..2c47c22 --- /dev/null +++ b/packer_templates/http/sles/15-autoinst.xml @@ -0,0 +1,293 @@ + + + + + + + + sle-module-basesystem-release + /Module-Basesystem + + + + + + true + splash=silent quiet showopts + showopts apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe + false + false + false + true + 0 + SLES15 + true + auto + false + 8 + + + + ahci + + + ata_piix + + + ata_generic + + + jbd + + + mbcache + + + grub2 + + + + false + + + false + false + + + + + false + + + none + + + + true + true + true + true + false + true + + + + + + + + AUTO + + + false + vagrantup.com + vagrant-sles-15-x64 + auto + + vagrantup.com + + true + + + + dhcp + eth0 + yes + auto + no + + + true + false + + false + false + + + + + + + + false + true + + + true + false + swap + true + defaults + false + swap + device + 130 + 1 + + false + 1561492992 + + + true + false + btrfs + true + false + / + device + 131 + 2 + + false + max + + boot/grub2/i386-pc + boot/grub2/x86_64-efi + home + opt + srv + tmp + usr/local + var/crash + var/lib/mailman + var/lib/named + var/lib/pgsql + var/log + var/opt + var/spool + var/tmp + + + + + CT_DISK + all + + + + + true + true + 0 + + + true + true + 0 + + + true + true + 0 + + + true + true + 0 + + + + graphical + + + + sshd + + + + + + SLES + + + glibc + openssh + kexec-tools + kernel-default-devel + sudo + gcc + wget + perl + make + bzip2 + tar + + + base + + + adaptec-firmware + atmel-firmware + bash-completion + bash-doc + cifs-utils + cups-libs + ipw-firmware + mpt-firmware + postfix + samba-libs + ucode-intel + snapper + snapper-zypp-plugin + + + + UTC + UTC + + + + 100 + video,dialout + /home + -1 + /bin/bash + /etc/skel + 022 + + + + true + vagrant + 100 + /home/vagrant + + + + + 99999 + 0 + 7 + + /bin/bash + 1000 + $2y$05$NA1Li9ZKJOLRW5mMTXm6/e5r8dltWS5RpDZpvHrI82aLE00V51tdi + vagrant + + + true + root + 0 + /root + + + + + + + + + /bin/bash + 0 + $6$UgKtUD0AUMIA$VWLyc2Uvl0Lk6xxfTuoRb0/jrhZ9IJG/Gtx/DkZUEWZm.JYO1Q1fvPo6gDxQAHp38kQ1DG1vNGRgu2T/z/vih. + root + + + + false + + diff --git a/packer_templates/http/solaris/default.xml b/packer_templates/http/solaris/default.xml new file mode 100644 index 0000000..09f5087 --- /dev/null +++ b/packer_templates/http/solaris/default.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + pkg:/server_install + pkg:/library/python/six + pkg:/library/python/cryptography + + + + pkg:/server_install + + + + + diff --git a/packer_templates/http/solaris/profile.xml b/packer_templates/http/solaris/profile.xml new file mode 100644 index 0000000..51af5b9 --- /dev/null +++ b/packer_templates/http/solaris/profile.xml @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packer_templates/http/springdalelinux/7ks.cfg b/packer_templates/http/springdalelinux/7ks.cfg new file mode 100644 index 0000000..bef5e9b --- /dev/null +++ b/packer_templates/http/springdalelinux/7ks.cfg @@ -0,0 +1,81 @@ +install +eula --agreed +url --url="http://springdale.princeton.edu/data/Springdale/7/x86_64/os" +repo --name="Addons" --baseurl=http://springdale.princeton.edu/data/Springdale/7/x86_64/os/Addons +repo --name="Computational" --baseurl=http://springdale.princeton.edu/data/Springdale/7/x86_64/os/Computational +repo --name="Updates" --baseurl=http://springdale.princeton.edu/data/Springdale/7/x86_64/os/Updates +lang en_US.UTF-8 +keyboard us +network --bootproto=dhcp --noipv6 --onboot=on --device=eth0 +rootpw --plaintext vagrant +firewall --disabled +selinux --permissive +timezone UTC +bootloader --timeout=1 --location=mbr --append="net.ifnames=0 biosdevname=0" +text +skipx +zerombr +clearpart --all --initlabel +autopart --type=plain +firstboot --disabled +reboot --eject +user --name=vagrant --plaintext --password vagrant + +%packages --ignoremissing --excludedocs +@core +openssh-clients +sudo +selinux-policy-devel +wget +nfs-utils +net-tools +tar +bzip2 +deltarpm +rsync +dnf-utils +redhat-lsb-core +elfutils-libelf-devel +network-scripts +-fprintd-pam +-intltool +-iwl*-firmware +-microcode_ctl +%end + +%post +# sudo +echo 'Defaults:vagrant !requiretty' > /etc/sudoers.d/vagrant +echo '%vagrant ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers.d/vagrant +chmod 440 /etc/sudoers.d/vagrant + +# Enable hyper-v daemons only if using hyper-v virtualization +if [ $(virt-what) == "hyperv" ]; then +dnf -y install hyperv-daemons cifs-utils +systemctl enable hypervvssd +systemctl enable hypervkvpd +fi + +# Since we disable consistent network naming, we need to make sure the eth0 +# configuration file is in place so it will come up. +# Delete other network configuration first because RHEL/C7 networking will not +# restart successfully if there are configuration files for devices that do not +# exist. +rm -f /etc/sysconfig/network-scripts/ifcfg-e* +cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << _EOF_ +TYPE=Ethernet +PROXY_METHOD=none + BROWSER_ONLY=no + BOOTPROTO=dhcp + DEFROUTE=yes +IPV4_FAILURE_FATAL=no +IPV6INIT=yes +IPV6_AUTOCONF=yes +IPV6_DEFROUTE=yes + IPV6_FAILURE_FATAL=no + IPV6_ADDR_GEN_MODE=stable-privacy + NAME=eth0 +DEVICE=eth0 +ONBOOT=yes +_EOF_ +%end diff --git a/packer_templates/http/springdalelinux/8ks.cfg b/packer_templates/http/springdalelinux/8ks.cfg new file mode 100644 index 0000000..9209acb --- /dev/null +++ b/packer_templates/http/springdalelinux/8ks.cfg @@ -0,0 +1,84 @@ +install +url --url="http://springdale.princeton.edu/data/Springdale/8/x86_64/os" +lang en_US.UTF-8 +keyboard us +network --bootproto=dhcp --noipv6 --onboot=on --device=eth0 +rootpw --plaintext vagrant +firewall --disabled +selinux --permissive +timezone UTC +bootloader --timeout=1 --location=mbr --append="net.ifnames=0 biosdevname=0" +text +skipx +zerombr +clearpart --all --initlabel +autopart --nohome --nolvm --noboot +firstboot --disabled +reboot --eject +user --name=vagrant --plaintext --password vagrant + +%packages --ignoremissing --excludedocs --instLangs=en_US.utf8 +# maybe prb needed for vbos guest additions? https://github.com/chef/bento/issues/1345 +# kernel-devel +# gcc +# make +# perl +# elfutils-libelf-devel +# end vbox +# vagrant needs this to copy initial files via scp +openssh-clients +sudo +selinux-policy-devel +wget +nfs-utils +net-tools +tar +bzip2 +deltarpm +rsync +dnf-utils +redhat-lsb-core +elfutils-libelf-devel +network-scripts +-fprintd-pam +-intltool +-iwl*-firmware +-microcode_ctl +%end + +%post +# sudo +echo 'Defaults:vagrant !requiretty' > /etc/sudoers.d/vagrant +echo '%vagrant ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers.d/vagrant +chmod 440 /etc/sudoers.d/vagrant + +# Enable hyper-v daemons only if using hyper-v virtualization +if [ $(virt-what) == "hyperv" ]; then +dnf -y install hyperv-daemons cifs-utils +systemctl enable hypervvssd +systemctl enable hypervkvpd +fi + +# Since we disable consistent network naming, we need to make sure the eth0 +# configuration file is in place so it will come up. +# Delete other network configuration first because RHEL/C7 networking will not +# restart successfully if there are configuration files for devices that do not +# exist. +rm -f /etc/sysconfig/network-scripts/ifcfg-e* +cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << _EOF_ +TYPE=Ethernet +PROXY_METHOD=none + BROWSER_ONLY=no + BOOTPROTO=dhcp + DEFROUTE=yes +IPV4_FAILURE_FATAL=no +IPV6INIT=yes +IPV6_AUTOCONF=yes +IPV6_DEFROUTE=yes + IPV6_FAILURE_FATAL=no + IPV6_ADDR_GEN_MODE=stable-privacy + NAME=eth0 +DEVICE=eth0 +ONBOOT=yes +_EOF_ +%end diff --git a/packer_templates/http/springdalelinux/9ks.cfg b/packer_templates/http/springdalelinux/9ks.cfg new file mode 100644 index 0000000..8f2523d --- /dev/null +++ b/packer_templates/http/springdalelinux/9ks.cfg @@ -0,0 +1,82 @@ +# Kickstart file for springdalelinux 9 +lang en_US.UTF-8 +keyboard us +network --bootproto=dhcp --noipv6 --onboot=on --device=eth0 +rootpw --plaintext vagrant +firewall --disabled +selinux --permissive +timezone UTC +bootloader --timeout=1 --location=mbr --append="net.ifnames=0 biosdevname=0" +text +skipx +zerombr +clearpart --all --initlabel +autopart --nohome --nolvm --noboot +firstboot --disabled +reboot --eject +user --name=vagrant --plaintext --password vagrant + +url --url="http://springdale.princeton.edu/data/springdale/9/x86_64/os" +repo --name="BaseOS" --baseurl=http://springdale.princeton.edu/data/springdale/9/x86_64/os/BaseOS +repo --name="Updates_BaseOS" --baseurl=http://springdale.princeton.edu/data/springdale/9/x86_64/os/Updates_BaseOS +repo --name="AppStream" --baseurl=http://springdale.princeton.edu/data/springdale/9/x86_64/os/AppStream +repo --name="Updates_AppStream" --baseurl=http://springdale.princeton.edu/data/springdale/9/x86_64/os/Updates_AppStream + +%packages --ignoremissing --excludedocs +@^server-product-environment +openssh-clients +sudo +selinux-policy-devel +wget +nfs-utils +net-tools +tar +bzip2 +deltarpm +rsync +dnf-utils +redhat-lsb-core +elfutils-libelf-devel +network-scripts +-fprintd-pam +-intltool +-iwl*-firmware +-microcode_ctl +%end + +%post +# sudo +echo 'Defaults:vagrant !requiretty' > /etc/sudoers.d/vagrant +echo '%vagrant ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers.d/vagrant +chmod 440 /etc/sudoers.d/vagrant + +# Enable hyper-v daemons only if using hyper-v virtualization +if [ $(virt-what) == "hyperv" ]; then +dnf -y install hyperv-daemons cifs-utils +systemctl enable hypervvssd +systemctl enable hypervkvpd +fi + +# Since we disable consistent network naming, we need to make sure the eth0 +# configuration file is in place so it will come up. +# Delete other network configuration first because RHEL/C7 networking will not +# restart successfully if there are configuration files for devices that do not +# exist. +rm -f /etc/sysconfig/network-scripts/ifcfg-e* +cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << _EOF_ +TYPE=Ethernet +PROXY_METHOD=none + BROWSER_ONLY=no + BOOTPROTO=dhcp + DEFROUTE=yes +IPV4_FAILURE_FATAL=no +IPV6INIT=yes +IPV6_AUTOCONF=yes +IPV6_DEFROUTE=yes + IPV6_FAILURE_FATAL=no + IPV6_ADDR_GEN_MODE=stable-privacy + NAME=eth0 +DEVICE=eth0 +ONBOOT=yes +_EOF_ +%end diff --git a/packer_templates/http/ubuntu/meta-data b/packer_templates/http/ubuntu/meta-data new file mode 100644 index 0000000..e69de29 diff --git a/packer_templates/http/ubuntu/preseed-hyperv.cfg b/packer_templates/http/ubuntu/preseed-hyperv.cfg new file mode 100755 index 0000000..6b40fbd --- /dev/null +++ b/packer_templates/http/ubuntu/preseed-hyperv.cfg @@ -0,0 +1,37 @@ +choose-mirror-bin mirror/http/proxy string +d-i base-installer/kernel/override-image string linux-server +d-i clock-setup/utc boolean true +d-i clock-setup/utc-auto boolean true +d-i finish-install/reboot_in_progress note +d-i grub-installer/only_debian boolean true +d-i grub-installer/with_other_os boolean true +d-i mirror/country string manual +d-i mirror/http/directory string /ubuntu/ +d-i mirror/http/hostname string archive.ubuntu.com +d-i mirror/http/proxy string +d-i partman-auto-lvm/guided_size string max +d-i partman-auto/choose_recipe select atomic +d-i partman-auto/method string lvm +d-i partman-lvm/confirm boolean true +d-i partman-lvm/confirm_nooverwrite boolean true +d-i partman-lvm/device_remove_lvm boolean true +d-i partman/choose_partition select finish +d-i partman/confirm boolean true +d-i partman/confirm_nooverwrite boolean true +d-i partman/confirm_write_new_label boolean true +d-i partman-partitioning/no_bootable_gpt_biosgrub boolean false +d-i partman-partitioning/no_bootable_gpt_efi boolean false +d-i partman-efi/non_efi_system boolean true +d-i passwd/user-fullname string vagrant +d-i passwd/user-uid string 1000 +d-i passwd/user-password password vagrant +d-i passwd/user-password-again password vagrant +d-i passwd/username string vagrant +d-i pkgsel/include string openssh-server ntp dkms linux-tools-$(uname -r) linux-cloud-tools-$(uname -r) linux-cloud-tools-common cifs-utils software-properties-common ifupdown +d-i pkgsel/install-language-support boolean false +d-i pkgsel/update-policy select none +d-i pkgsel/upgrade select full-upgrade +d-i time/zone string UTC +d-i user-setup/allow-password-weak boolean true +d-i user-setup/encrypt-home boolean false +tasksel tasksel/first multiselect standard, server diff --git a/packer_templates/http/ubuntu/preseed.cfg b/packer_templates/http/ubuntu/preseed.cfg new file mode 100644 index 0000000..63dbda0 --- /dev/null +++ b/packer_templates/http/ubuntu/preseed.cfg @@ -0,0 +1,90 @@ +#_preseed_V1 +# Automatic installation +d-i auto-install/enable boolean true + +# Preseeding only locale sets language, country and locale. +d-i debian-installer/language string en +d-i debian-installer/country string US +d-i debian-installer/locale string en_US.UTF-8 + +d-i console-setup/ask_detect boolean false +d-i debconf/frontend select noninteractive + +# Keyboard selection. +d-i keyboard-configuration/xkb-keymap select us +d-i keymap select us + +choose-mirror-bin mirror/http/proxy string +d-i apt-setup/use_mirror boolean true +d-i base-installer/kernel/override-image string linux-server + +### Clock and time zone setup +d-i clock-setup/utc boolean true +d-i clock-setup/utc-auto boolean true +d-i time/zone string UTC + +# Avoid that last message about the install being complete. +d-i finish-install/reboot_in_progress note + +# This is fairly safe to set, it makes grub install automatically to the MBR +# if no other operating system is detected on the machine. +d-i grub-installer/only_debian boolean true + +# This one makes grub-installer install to the MBR if it also finds some other +# OS, which is less safe as it might not be able to boot that other OS. +d-i grub-installer/with_other_os boolean true + +# Set dev for grub boot +d-i grub-installer/bootdev string /dev/sda + +### Mirror settings +# If you select ftp, the mirror/country string does not need to be set. +d-i mirror/country string manual +d-i mirror/http/directory string /ubuntu/ +d-i mirror/http/hostname string archive.ubuntu.com +d-i mirror/http/proxy string + +# This makes partman automatically partition without confirmation. +d-i partman-efi/non_efi_system boolean true +d-i partman-auto-lvm/guided_size string max +d-i partman-auto/choose_recipe select atomic +d-i partman-auto/method string lvm +d-i partman-lvm/confirm boolean true +d-i partman-lvm/confirm_nooverwrite boolean true +d-i partman-lvm/device_remove_lvm boolean true +d-i partman/choose_partition select finish +d-i partman/confirm boolean true +d-i partman/confirm_nooverwrite boolean true +d-i partman/confirm_write_new_label boolean true + +### Account setup +d-i passwd/root-login boolean false +d-i passwd/user-fullname string vagrant +d-i passwd/user-uid string 1000 +d-i passwd/user-password password vagrant +d-i passwd/user-password-again password vagrant +d-i passwd/username string vagrant + +# The installer will warn about weak passwords. If you are sure you know +# what you're doing and want to override it, uncomment this. +d-i user-setup/allow-password-weak boolean true +d-i user-setup/encrypt-home boolean false + +### Package selection +tasksel tasksel/first multiselect standard, server +d-i pkgsel/include string openssh-server sudo cryptsetup libssl-dev libreadline-dev zlib1g-dev linux-source dkms nfs-common linux-headers-$(uname -r) perl cifs-utils software-properties-common rsync ifupdown +d-i pkgsel/install-language-support boolean false + +# disable automatic package updates +d-i pkgsel/update-policy select none +d-i pkgsel/upgrade select full-upgrade + +# Disable polularity contest +popularity-contest popularity-contest/participate boolean false + +# Select base install +tasksel tasksel/first multiselect standard, ssh-server + +# Setup passwordless sudo for packer user +d-i preseed/late_command string \ +echo "vagrant ALL=(ALL:ALL) NOPASSWD:ALL" > /target/etc/sudoers.d/vagrant && chmod 0440 /target/etc/sudoers.d/vagrant diff --git a/packer_templates/http/ubuntu/user-data b/packer_templates/http/ubuntu/user-data new file mode 100644 index 0000000..df9c1b0 --- /dev/null +++ b/packer_templates/http/ubuntu/user-data @@ -0,0 +1,19 @@ +#cloud-config +autoinstall: + version: 1 + identity: + hostname: vagrant + username: vagrant + password: '$6$rounds=4096$5CU3LEj/MQvbkfPb$LmKEF9pCfU8R.dA.GemgE/8GT6r9blge3grJvdsVTMFKyLEQwzEF3SGWqAzjawY/XHRpWj4fOiLBrRyxJhIRJ1' + early-commands: + # otherwise packer tries to connect and exceed max attempts: + - systemctl stop ssh.service + - systemctl stop ssh.socket + ssh: + install-server: yes + allow-pw: yes + late-commands: + - 'sed -i "s/dhcp4: true/&\n dhcp-identifier: mac/" /target/etc/netplan/00-installer-config.yaml' + - echo 'vagrant ALL=(ALL) NOPASSWD:ALL' > /target/etc/sudoers.d/vagrant + # Enable hyper-v daemons only if using hyper-v virtualization + - if [ $(virt-what) == "hyperv" ]; then apt-get update && apt-get install -y hyperv-daemons linux-tools-$(uname -r) linux-cloud-tools-$(uname -r) linux-cloud-tools-common cifs-utils && systemctl enable hypervvssd && systemctl enable hypervkvpd && systemctl start hypervvssd && systemctl start hypervkvpd; fi diff --git a/packer_templates/pkr-builder.pkr.hcl b/packer_templates/pkr-builder.pkr.hcl new file mode 100644 index 0000000..c586f3a --- /dev/null +++ b/packer_templates/pkr-builder.pkr.hcl @@ -0,0 +1,254 @@ +packer { + required_version = ">= 1.7.0" + required_plugins { + hyperv = { + version = ">= 1.0.0" + source = "github.com/hashicorp/hyperv" + } + parallels = { + version = ">= 1.0.1" + source = "github.com/hashicorp/parallels" + } + qemu = { + version = ">= 1.0.8" + source = "github.com/hashicorp/qemu" + } + vagrant = { + version = ">= 1.0.2" + source = "github.com/hashicorp/vagrant" + } + virtualbox = { + version = ">= 0.0.1" + source = "github.com/hashicorp/virtualbox" + } + vmware = { + version = ">= 0.0.1" + source = "github.com/stromweld/vmware" # TODO: switching to stromweld repo for fix to vmware tools for fusion 13 till official fix is in place https://github.com/hashicorp/packer-plugin-vmware/issues/109 + } + windows-update = { + version = ">= 0.14.1" + source = "github.com/rgl/windows-update" + } + } +} + +locals { + scripts = var.is_windows ? ( + substr(var.os_version, 0, 2) == "10" || + substr(var.os_version, 0, 2) == "11" ? [ + # "${path.root}/scripts/windows/base_setup.ps1", + "${path.root}/scripts/windows/provision.ps1", + "${path.root}/scripts/windows/disable-windows-updates.ps1", + "${path.root}/scripts/windows/disable-windows-defender.ps1", + "${path.root}/scripts/windows/remove-one-drive.ps1", + "${path.root}/scripts/windows/remove-apps.ps1", + "${path.root}/scripts/windows/virtualbox-prevent-vboxsrv-resolution-delay.ps1", + "${path.root}/scripts/windows/provision-winrm.ps1", + "${path.root}/scripts/windows/enable-remote-desktop.ps1", + "${path.root}/scripts/windows/eject-media.ps1" + ] : [ + # "${path.root}/scripts/windows/base_setup.ps1", + "${path.root}/scripts/windows/provision.ps1", + "${path.root}/scripts/windows/disable-windows-updates.ps1", + "${path.root}/scripts/windows/disable-windows-defender.ps1", + "${path.root}/scripts/windows/remove-one-drive.ps1", + # "${path.root}/scripts/windows/remove-apps.ps1", + "${path.root}/scripts/windows/virtualbox-prevent-vboxsrv-resolution-delay.ps1", + "${path.root}/scripts/windows/provision-winrm.ps1", + "${path.root}/scripts/windows/enable-remote-desktop.ps1", + "${path.root}/scripts/windows/eject-media.ps1" + ] + ) : ( + var.os_name == "solaris" ? [ + "${path.root}/scripts/solaris/update_solaris.sh", + "${path.root}/scripts/_common/vagrant.sh", + "${path.root}/scripts/solaris/vmtools_solaris.sh", + "${path.root}/scripts/solaris/minimize_solaris.sh" + ] : ( + var.os_name == "freebsd" ? [ + "${path.root}/scripts/freebsd/update_freebsd.sh", + "${path.root}/scripts/freebsd/postinstall_freebsd.sh", + "${path.root}/scripts/freebsd/sudoers_freebsd.sh", + "${path.root}/scripts/_common/vagrant.sh", + "${path.root}/scripts/freebsd/vmtools_freebsd.sh", + "${path.root}/scripts/freebsd/cleanup_freebsd.sh", + "${path.root}/scripts/freebsd/minimize_freebsd.sh" + ] : ( + var.os_name == "opensuse" || + var.os_name == "sles" ? [ + "${path.root}/scripts/suse/repositories_suse.sh", + "${path.root}/scripts/suse/update_suse.sh", + "${path.root}/scripts/_common/motd.sh", + "${path.root}/scripts/_common/sshd.sh", + "${path.root}/scripts/_common/vagrant.sh", + "${path.root}/scripts/suse/unsupported-modules_suse.sh", + "${path.root}/scripts/_common/virtualbox.sh", + "${path.root}/scripts/_common/vmware_suse.sh", + "${path.root}/scripts/_common/parallels.sh", + "${path.root}/scripts/suse/vagrant_group_suse.sh", + "${path.root}/scripts/suse/sudoers_suse.sh", + "${path.root}/scripts/suse/zypper-locks_suse.sh", + "${path.root}/scripts/suse/remove-dvd-source_suse.sh", + "${path.root}/scripts/suse/cleanup_suse.sh", + "${path.root}/scripts/_common/minimize.sh" + ] : ( + var.os_name == "ubuntu" || + var.os_name == "debian" ? [ + "${path.root}/scripts/${var.os_name}/update_${var.os_name}.sh", + "${path.root}/scripts/_common/motd.sh", + "${path.root}/scripts/_common/sshd.sh", + "${path.root}/scripts/${var.os_name}/networking_${var.os_name}.sh", + "${path.root}/scripts/${var.os_name}/sudoers_${var.os_name}.sh", + "${path.root}/scripts/_common/vagrant.sh", + "${path.root}/scripts/${var.os_name}/systemd_${var.os_name}.sh", + "${path.root}/scripts/_common/virtualbox.sh", + "${path.root}/scripts/_common/vmware_debian_ubuntu.sh", + "${path.root}/scripts/_common/parallels.sh", + "${path.root}/scripts/${var.os_name}/hyperv_${var.os_name}.sh", + "${path.root}/scripts/${var.os_name}/cleanup_${var.os_name}.sh", + "${path.root}/scripts/_common/minimize.sh" + ] : ( + var.os_name == "fedora" ? [ + "${path.root}/scripts/fedora/networking_fedora.sh", + "${path.root}/scripts/fedora/update_dnf.sh", + "${path.root}/scripts/fedora/build-tools_fedora.sh", + "${path.root}/scripts/fedora/install-supporting-packages_fedora.sh", + "${path.root}/scripts/_common/motd.sh", + "${path.root}/scripts/_common/sshd.sh", + "${path.root}/scripts/_common/virtualbox.sh", + "${path.root}/scripts/_common/vmware_fedora.sh", + "${path.root}/scripts/_common/parallels-rhel.sh", + "${path.root}/scripts/_common/vagrant.sh", + "${path.root}/scripts/fedora/real-tmp_fedora.sh", + "${path.root}/scripts/fedora/cleanup_dnf.sh", + "${path.root}/scripts/_common/minimize.sh" + ] : ( + "${var.os_name}-${substr(var.os_version, 0, 1)}" == "amazonlinux-2" || + "${var.os_name}-${substr(var.os_version, 0, 1)}" == "centos-7" || + "${var.os_name}-${substr(var.os_version, 0, 1)}" == "oraclelinux-7" || + "${var.os_name}-${substr(var.os_version, 0, 1)}" == "rhel-7" || + "${var.os_name}-${substr(var.os_version, 0, 1)}" == "scientificlinux-7" || + "${var.os_name}-${substr(var.os_version, 0, 1)}" == "springdalelinux-7" ? [ + "${path.root}/scripts/rhel/update_yum.sh", + "${path.root}/scripts/_common/motd.sh", + "${path.root}/scripts/_common/sshd.sh", + "${path.root}/scripts/rhel/networking_rhel7.sh", + "${path.root}/scripts/_common/vagrant.sh", + "${path.root}/scripts/_common/virtualbox.sh", + "${path.root}/scripts/_common/vmware_rhel.sh", + "${path.root}/scripts/_common/parallels-rhel.sh", + "${path.root}/scripts/rhel/cleanup_yum.sh", + "${path.root}/scripts/_common/minimize.sh" + ] : [ + "${path.root}/scripts/rhel/update_dnf.sh", + "${path.root}/scripts/_common/motd.sh", + "${path.root}/scripts/_common/sshd.sh", + "${path.root}/scripts/_common/vagrant.sh", + "${path.root}/scripts/_common/virtualbox.sh", + "${path.root}/scripts/_common/vmware_rhel.sh", + "${path.root}/scripts/_common/parallels-rhel.sh", + "${path.root}/scripts/rhel/cleanup_dnf.sh", + "${path.root}/scripts/_common/minimize.sh" + ] + ) + ) + ) + ) + ) + ) + source_names = [for source in var.sources_enabled : trimprefix(source, "source.")] +} + +# https://www.packer.io/docs/templates/hcl_templates/blocks/build +build { + sources = var.sources_enabled + + # Linux Shell scipts + provisioner "shell" { + environment_vars = var.os_name == "freebsd" ? [ + "HOME_DIR=/home/vagrant", + "http_proxy=${var.http_proxy}", + "https_proxy=${var.https_proxy}", + "no_proxy=${var.no_proxy}", + "pkg_branch=quarterly" + ] : ( + var.os_name == "solaris" ? [] : [ + "HOME_DIR=/home/vagrant", + "http_proxy=${var.http_proxy}", + "https_proxy=${var.https_proxy}", + "no_proxy=${var.no_proxy}" + ] + ) + execute_command = var.os_name == "freebsd" ? "echo 'vagrant' | {{.Vars}} su -m root -c 'sh -eux {{.Path}}'" : ( + var.os_name == "solaris" ? "echo 'vagrant'|sudo -S bash {{.Path}}" : "echo 'vagrant' | {{ .Vars }} sudo -S -E sh -eux '{{ .Path }}'" + ) + expect_disconnect = true + scripts = local.scripts + except = var.is_windows ? local.source_names : null + } + + # Windows Updates and scripts + provisioner "powershell" { + elevated_password = "vagrant" + elevated_user = "vagrant" + scripts = local.scripts + except = var.is_windows ? null : local.source_names + } + provisioner "windows-restart" { + except = var.is_windows ? null : local.source_names + } + provisioner "windows-update" { + search_criteria = "IsInstalled=0" + except = var.is_windows ? null : local.source_names + } + provisioner "chef-solo" { + chef_license = "accept-no-persist" + version = "17" + cookbook_paths = [ + "${path.root}/cookbooks" + ] + guest_os_type = "windows" + run_list = [ + "packer::disable_uac", + "packer::configure_power", + "packer::disable_screensaver", + "packer::features", + "packer::enable_file_sharing", + "packer::ui_tweaks" + ] + except = var.is_windows ? null : local.source_names + } + provisioner "windows-restart" { + except = var.is_windows ? null : local.source_names + } + provisioner "chef-solo" { + chef_license = "accept-no-persist" + version = "17" + cookbook_paths = [ + "${path.root}/cookbooks" + ] + guest_os_type = "windows" + run_list = [ + "packer::cleanup", + "packer::defrag" + ] + except = var.is_windows ? null : local.source_names + } + provisioner "powershell" { + elevated_password = "vagrant" + elevated_user = "vagrant" + scripts = [ + "${path.root}/scripts/windows/cleanup.ps1", + "${path.root}/scripts/windows/optimize.ps1" + ] + except = var.is_windows ? null : local.source_names + } + + # Convert machines to vagrant boxes + post-processor "vagrant" { + compression_level = 9 + keep_input_artifact = var.is_windows + output = "${path.root}/../builds/${var.os_name}-${var.os_version}-${var.os_arch}.{{ .Provider }}.box" + vagrantfile_template = var.is_windows ? (var.hyperv_generation == 1 ? "${path.root}/vagrantfile-windows.template" : "${path.root}/vagrantfile-windows-gen2.template") : null + } +} diff --git a/packer_templates/pkr-sources.pkr.hcl b/packer_templates/pkr-sources.pkr.hcl new file mode 100644 index 0000000..d36be65 --- /dev/null +++ b/packer_templates/pkr-sources.pkr.hcl @@ -0,0 +1,277 @@ +locals { + # Source block provider specific + # hyperv-iso + hyperv_enable_dynamic_memory = var.hyperv_enable_dynamic_memory == null ? ( + var.hyperv_generation == 2 && var.is_windows ? "true" : null + ) : var.hyperv_enable_dynamic_memory + hyperv_enable_secure_boot = var.hyperv_enable_secure_boot == null ? ( + var.hyperv_generation == 2 && var.is_windows ? false : null + ) : var.hyperv_enable_secure_boot + + # parallels-iso + parallels_tools_flavor = var.parallels_tools_flavor == null ? ( + var.is_windows ? ( + var.os_arch == "x86_64" ? "win" : "win-arm" + ) : ( + var.os_arch == "x86_64" ? "lin" : "lin-arm" + ) + ) : var.parallels_tools_flavor + parallels_tools_mode = var.parallels_tools_mode == null ? ( + var.is_windows ? "attach" : "upload" + ) : var.parallels_tools_mode + parallels_prlctl = var.parallels_prlctl == null ? ( + var.is_windows ? [ + ["set", "{{ .Name }}", "--efi-boot", "off"] + ] : [ + ["set", "{{ .Name }}", "--3d-accelerate", "off"], + ["set", "{{ .Name }}", "--videosize", "16"] + ] + ) : var.parallels_prlctl + + # qemu + qemu_binary = var.qemu_binary == null ? "qemu-system-${var.os_arch}" : var.qemu_binary + qemu_machine_type = var.qemu_machine_type == null ? ( + var.os_arch == "aarch64" ? "virt" : "q35" + ) : var.qemu_machine_type + qemuargs = var.qemuargs == null ? ( + var.hyperv_generation == 2 && var.is_windows ? [ + ["-bios", "/usr/share/OVMF/OVMF_CODE.fd"], + ] : ( + var.is_windows ? [ + ["-drive", "file=${path.root}/win_answer_files/virtio-win.iso,media=cdrom,index=3"], + ["-drive", "file=${path.root}/../builds/packer-${var.os_name}-${var.os_version}-${var.os_arch}-qemu/{{ .Name }},if=virtio,cache=writeback,discard=ignore,format=qcow2,index=1"], + ] : ( + var.os_arch == "aarch64" ? [ + ["-boot", "strict=off"] + ] : null + ) + ) + ) : var.qemuargs + + # virtualbox-iso + vbox_gfx_controller = var.vbox_gfx_controller == null ? ( + var.is_windows ? "vboxsvga" : "vmsvga" + ) : var.vbox_gfx_controller + vbox_gfx_vram_size = var.vbox_gfx_controller == null ? ( + var.is_windows ? 128 : 33 + ) : var.vbox_gfx_vram_size + vbox_guest_additions_mode = var.vbox_guest_additions_mode == null ? ( + var.is_windows && var.hyperv_generation == 1 ? "attach" : "upload" + ) : var.vbox_guest_additions_mode + + # virtualbox-ovf + vbox_source = var.vbox_source == null ? ( + var.os_name == "amazonlinux" ? "${path.root}/amz_working_files/amazon2.ovf" : null + ) : var.vbox_source + + # vmware-iso + vmware_disk_adapter_type = var.vmware_disk_adapter_type == null ? ( + var.is_windows ? "lsisas1068" : null + ) : var.vmware_disk_adapter_type + + # Source block common + boot_wait = var.boot_wait == null ? ( + var.is_windows ? "60s" : "10s" + ) : var.boot_wait + cd_files = var.cd_files == null ? ( + var.hyperv_generation == 2 && var.is_windows ? [ + "${path.root}/win_answer_files/${substr(var.os_version, 0, 2)}/gen2_Autounattend.xml" + ] : null + ) : var.cd_files + communicator = var.communicator == null ? ( + var.is_windows ? "winrm" : "ssh" + ) : var.communicator + floppy_files = var.floppy_files == null ? ( + var.hyperv_generation == 2 ? null : ( + var.is_windows ? [ + "${path.root}/win_answer_files/${var.os_version}/Autounattend.xml", + "${path.root}/scripts/windows/base_setup.ps1" + ] : ( + var.os_name == "springdalelinux" ? [ + "${path.root}/http/rhel/${substr(var.os_version, 0, 1)}ks.cfg" + ] : null + ) + ) + ) : var.floppy_files + http_directory = var.http_directory == null ? "${path.root}/http" : var.http_directory + memory = var.memory == null ? (var.is_windows ? 4096 : 2048) : var.memory + output_directory = var.output_directory == null ? "builds/packer-${var.os_name}-${var.os_version}-${var.os_arch}" : var.output_directory + shutdown_command = var.shutdown_command == null ? ( + var.is_windows ? "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"" : ( + var.os_name == "freebsd" ? "echo 'vagrant' | su -m root -c 'shutdown -p now'" : "echo 'vagrant' | sudo -S /sbin/halt -h -p" + ) + ) : var.shutdown_command + vm_name = var.vm_name == null ? ( + var.os_arch == "x86_64" ? "${var.os_name}-${var.os_version}-amd64" : "${var.os_name}-${var.os_version}-${var.os_arch}" + ) : var.vm_name +} + +# https://www.packer.io/docs/templates/hcl_templates/blocks/source +source "hyperv-iso" "vm" { + enable_dynamic_memory = local.hyperv_enable_dynamic_memory + enable_secure_boot = local.hyperv_enable_secure_boot + generation = var.hyperv_generation + guest_additions_mode = var.hyperv_guest_additions_mode + switch_name = var.hyperv_switch_name + boot_command = var.boot_command + boot_wait = local.boot_wait + cpus = var.cpus + communicator = local.communicator + disk_size = var.disk_size + floppy_files = local.floppy_files + headless = var.headless + http_directory = local.http_directory + iso_checksum = var.iso_checksum + iso_url = var.iso_url + memory = local.memory + output_directory = "${local.output_directory}-hyperv" + shutdown_command = local.shutdown_command + shutdown_timeout = var.shutdown_timeout + ssh_password = var.ssh_password + ssh_port = var.ssh_port + ssh_timeout = var.ssh_timeout + ssh_username = var.ssh_username + winrm_password = var.winrm_password + winrm_timeout = var.winrm_timeout + winrm_username = var.winrm_username + vm_name = local.vm_name +} +source "parallels-iso" "vm" { + guest_os_type = var.parallels_guest_os_type + parallels_tools_flavor = local.parallels_tools_flavor + parallels_tools_mode = local.parallels_tools_mode + prlctl = local.parallels_prlctl + prlctl_version_file = var.parallels_prlctl_version_file + boot_command = var.boot_command + boot_wait = local.boot_wait + cpus = var.cpus + communicator = local.communicator + disk_size = var.disk_size + floppy_files = local.floppy_files + http_directory = local.http_directory + iso_checksum = var.iso_checksum + iso_url = var.iso_url + memory = local.memory + output_directory = "${local.output_directory}-parallels" + shutdown_command = local.shutdown_command + shutdown_timeout = var.shutdown_timeout + ssh_password = var.ssh_password + ssh_port = var.ssh_port + ssh_timeout = var.ssh_timeout + ssh_username = var.ssh_username + winrm_password = var.winrm_password + winrm_timeout = var.winrm_timeout + winrm_username = var.winrm_username + vm_name = local.vm_name +} +source "qemu" "vm" { + accelerator = var.qemu_accelerator + display = var.headless ? "none" : var.qemu_display + machine_type = local.qemu_machine_type + qemu_binary = local.qemu_binary + qemuargs = local.qemuargs + boot_command = var.boot_command + boot_wait = local.boot_wait + cd_files = local.cd_files + cpus = var.cpus + communicator = local.communicator + disk_size = var.disk_size + floppy_files = local.floppy_files + headless = var.headless + http_directory = local.http_directory + iso_checksum = var.iso_checksum + iso_url = var.iso_url + memory = local.memory + output_directory = "${local.output_directory}-qemu" + shutdown_command = local.shutdown_command + shutdown_timeout = var.shutdown_timeout + ssh_password = var.ssh_password + ssh_port = var.ssh_port + ssh_timeout = var.ssh_timeout + ssh_username = var.ssh_username + winrm_password = var.winrm_password + winrm_timeout = var.winrm_timeout + winrm_username = var.winrm_username + vm_name = local.vm_name +} +source "virtualbox-iso" "vm" { + gfx_controller = local.vbox_gfx_controller + gfx_vram_size = local.vbox_gfx_vram_size + guest_additions_path = var.vbox_guest_additions_path + guest_additions_mode = local.vbox_guest_additions_mode + guest_additions_interface = var.vbox_guest_additions_interface + guest_os_type = var.vbox_guest_os_type + hard_drive_interface = var.vbox_hard_drive_interface + iso_interface = var.vbox_iso_interface + vboxmanage = var.vboxmanage + virtualbox_version_file = var.virtualbox_version_file + boot_command = var.boot_command + boot_wait = local.boot_wait + cpus = var.cpus + communicator = local.communicator + disk_size = var.disk_size + floppy_files = local.floppy_files + headless = var.headless + http_directory = local.http_directory + iso_checksum = var.iso_checksum + iso_url = var.iso_url + memory = local.memory + output_directory = "${local.output_directory}-virtualbox" + shutdown_command = local.shutdown_command + shutdown_timeout = var.shutdown_timeout + ssh_password = var.ssh_password + ssh_port = var.ssh_port + ssh_timeout = var.ssh_timeout + ssh_username = var.ssh_username + winrm_password = var.winrm_password + winrm_timeout = var.winrm_timeout + winrm_username = var.winrm_username + vm_name = local.vm_name +} +source "virtualbox-ovf" "amazonlinux" { + guest_additions_path = var.vbox_guest_additions_path + source_path = local.vbox_source + vboxmanage = var.vboxmanage + virtualbox_version_file = var.virtualbox_version_file + communicator = local.communicator + headless = var.headless + output_directory = "${local.output_directory}-virtualbox-ovf" + shutdown_command = local.shutdown_command + shutdown_timeout = var.shutdown_timeout + ssh_password = var.ssh_password + ssh_port = var.ssh_port + ssh_timeout = var.ssh_timeout + ssh_username = var.ssh_username + vm_name = local.vm_name +} +source "vmware-iso" "vm" { + guest_os_type = var.vmware_guest_os_type + disk_adapter_type = local.vmware_disk_adapter_type + tools_upload_flavor = var.vmware_tools_upload_flavor + tools_upload_path = var.vmware_tools_upload_path + version = var.vmware_version + vmx_data = var.vmware_vmx_data + vmx_remove_ethernet_interfaces = var.vmware_vmx_remove_ethernet_interfaces + boot_command = var.boot_command + boot_wait = local.boot_wait + cpus = var.cpus + communicator = local.communicator + disk_size = var.disk_size + floppy_files = local.floppy_files + headless = var.headless + http_directory = local.http_directory + iso_checksum = var.iso_checksum + iso_url = var.iso_url + memory = local.memory + output_directory = "${local.output_directory}-vmware" + shutdown_command = local.shutdown_command + shutdown_timeout = var.shutdown_timeout + ssh_password = var.ssh_password + ssh_port = var.ssh_port + ssh_timeout = var.ssh_timeout + ssh_username = var.ssh_username + winrm_password = var.winrm_password + winrm_timeout = var.winrm_timeout + winrm_username = var.winrm_username + vm_name = local.vm_name +} diff --git a/packer_templates/pkr-variables.pkr.hcl b/packer_templates/pkr-variables.pkr.hcl new file mode 100644 index 0000000..b219925 --- /dev/null +++ b/packer_templates/pkr-variables.pkr.hcl @@ -0,0 +1,307 @@ +# General variables +variable "os_name" { + type = string + description = "OS Brand Name" +} +variable "os_version" { + type = string + description = "OS version number" +} +variable "os_arch" { + type = string + validation { + condition = var.os_arch == "x86_64" || var.os_arch == "aarch64" + error_message = "The OS architecture type should be either x86_64 or aarch64." + } + description = "OS architecture type, x86_64 or aarch64" +} +variable "is_windows" { + type = bool + default = false + description = "Determines to set setting for Windows or Linux" +} +variable "http_proxy" { + type = string + default = env("http_proxy") + description = "Http proxy url to connect to the internet" +} +variable "https_proxy" { + type = string + default = env("https_proxy") + description = "Https proxy url to connect to the internet" +} +variable "no_proxy" { + type = string + default = env("no_proxy") + description = "No Proxy" +} +variable "sources_enabled" { + type = list(string) + default = [ + "source.hyperv-iso.vm", + "source.parallels-iso.vm", + "source.qemu.vm", + "source.virtualbox-iso.vm", + "source.vmware-iso.vm", + ] + description = "Build Sources to use for building vagrant boxes" +} + +# Source block provider specific variables +# hyperv-iso +variable "hyperv_enable_dynamic_memory" { + type = bool + default = null +} +variable "hyperv_enable_secure_boot" { + type = bool + default = null +} +variable "hyperv_generation" { + type = number + default = 1 + description = "Hyper-v generation version" +} +variable "hyperv_guest_additions_mode" { + type = string + default = "disable" +} +variable "hyperv_switch_name" { + type = string + default = "bento" +} + +# parallels-iso +variable "parallels_guest_os_type" { + type = string + default = null + description = "OS type for virtualization optimization" +} +variable "parallels_tools_flavor" { + type = string + default = null +} +variable "parallels_tools_mode" { + type = string + default = null +} +variable "parallels_prlctl" { + type = list(list(string)) + default = null +} +variable "parallels_prlctl_version_file" { + type = string + default = ".prlctl_version" +} + +# qemu +variable "qemu_accelerator" { + type = string + default = null +} +variable "qemu_binary" { + type = string + default = null +} +variable "qemu_display" { + type = string + default = "none" +} +variable "qemu_machine_type" { + type = string + default = null +} +variable "qemuargs" { + type = list(list(string)) + default = null +} + +# virtualbox-iso +variable "vbox_gfx_controller" { + type = string + default = null +} +variable "vbox_gfx_vram_size" { + type = number + default = null +} +variable "vbox_guest_additions_interface" { + type = string + default = "sata" +} +variable "vbox_guest_additions_mode" { + type = string + default = null +} +variable "vbox_guest_additions_path" { + type = string + default = "VBoxGuestAdditions_{{ .Version }}.iso" +} +variable "vbox_guest_os_type" { + type = string + default = null + description = "OS type for virtualization optimization" +} +variable "vbox_hard_drive_interface" { + type = string + default = "sata" +} +variable "vbox_iso_interface" { + type = string + default = "sata" +} +variable "vboxmanage" { + type = list(list(string)) + default = [ + [ + "modifyvm", + "{{.Name}}", + "--audio", + "none", + "--nat-localhostreachable1", + "on", + ] + ] +} +variable "virtualbox_version_file" { + type = string + default = ".vbox_version" +} + +# virtualbox-ovf +variable "vbox_source" { + type = string + default = null +} + +# vmware-iso +variable "vmware_disk_adapter_type" { + type = string + default = null +} +variable "vmware_guest_os_type" { + type = string + default = null + description = "OS type for virtualization optimization" +} +variable "vmware_tools_upload_flavor" { + type = string + default = null +} +variable "vmware_tools_upload_path" { + type = string + default = null +} +variable "vmware_version" { + type = number + default = 20 +} +variable "vmware_vmx_data" { + type = map(string) + default = { + "cpuid.coresPerSocket" = "1" + "ethernet0.pciSlotNumber" = "32" + } +} +variable "vmware_vmx_remove_ethernet_interfaces" { + type = bool + default = true +} + +# Source block common variables +variable "boot_command" { + type = list(string) + default = null + description = "Commands to pass to gui session to initiate automated install" +} +variable "boot_wait" { + type = string + default = null +} +variable "cd_files" { + type = list(string) + default = null +} +variable "cpus" { + type = number + default = 2 +} +variable "communicator" { + type = string + default = null +} +variable "disk_size" { + type = number + default = 65536 +} +variable "floppy_files" { + type = list(string) + default = null +} +variable "headless" { + type = bool + default = true + description = "Start GUI window to interact with VM" +} +variable "http_directory" { + type = string + default = null +} +variable "iso_checksum" { + type = string + default = null + description = "ISO download checksum" +} +variable "iso_url" { + type = string + default = null + description = "ISO download url" +} +variable "memory" { + type = number + default = null +} +variable "output_directory" { + type = string + default = null +} +variable "shutdown_command" { + type = string + default = null +} +variable "shutdown_timeout" { + type = string + default = "15m" +} +variable "ssh_password" { + type = string + default = "vagrant" +} +variable "ssh_port" { + type = number + default = 22 +} +variable "ssh_timeout" { + type = string + default = "60m" +} +variable "ssh_username" { + type = string + default = "vagrant" +} +variable "winrm_password" { + type = string + default = "vagrant" +} +variable "winrm_timeout" { + type = string + default = "60m" +} +variable "winrm_username" { + type = string + default = "vagrant" +} +variable "vm_name" { + type = string + default = null +} diff --git a/packer_templates/scripts/_common/metadata.sh b/packer_templates/scripts/_common/metadata.sh new file mode 100755 index 0000000..42386ac --- /dev/null +++ b/packer_templates/scripts/_common/metadata.sh @@ -0,0 +1,6 @@ +#!/bin/sh -eux + +mkdir -p /etc; +cp /tmp/bento-metadata.json /etc/bento-metadata.json; +chmod 0444 /etc/bento-metadata.json; +rm -f /tmp/bento-metadata.json; diff --git a/packer_templates/scripts/_common/minimize.sh b/packer_templates/scripts/_common/minimize.sh new file mode 100644 index 0000000..c516675 --- /dev/null +++ b/packer_templates/scripts/_common/minimize.sh @@ -0,0 +1,36 @@ +#!/bin/sh -eux + +case "$PACKER_BUILDER_TYPE" in + qemu) exit 0 ;; +esac + +# Whiteout root +count=$(df --sync -kP / | tail -n1 | awk -F ' ' '{print $4}') +count=$((count - 1)) +dd if=/dev/zero of=/tmp/whitespace bs=1M count=$count || echo "dd exit code $? is suppressed"; +rm /tmp/whitespace + +# Whiteout /boot +count=$(df --sync -kP /boot | tail -n1 | awk -F ' ' '{print $4}') +count=$((count - 1)) +dd if=/dev/zero of=/boot/whitespace bs=1M count=$count || echo "dd exit code $? is suppressed"; +rm /boot/whitespace + +set +e +swapuuid="$(/sbin/blkid -o value -l -s UUID -t TYPE=swap)"; +case "$?" in + 2|0) ;; + *) exit 1 ;; +esac +set -e + +if [ "x${swapuuid}" != "x" ]; then + # Whiteout the swap partition to reduce box size + # Swap is disabled till reboot + swappart="$(readlink -f /dev/disk/by-uuid/"$swapuuid")"; + /sbin/swapoff "$swappart" || true; + dd if=/dev/zero of="$swappart" bs=1M || echo "dd exit code $? is suppressed"; + /sbin/mkswap -U "$swapuuid" "$swappart"; +fi + +sync; diff --git a/packer_templates/scripts/_common/motd.sh b/packer_templates/scripts/_common/motd.sh new file mode 100644 index 0000000..2a82b9b --- /dev/null +++ b/packer_templates/scripts/_common/motd.sh @@ -0,0 +1,21 @@ +#!/bin/sh -eux + +bento=' +This system is built by the Bento project by Chef Software +More information can be found at https://github.com/chef/bento' + +if [ -d /etc/update-motd.d ]; then + MOTD_CONFIG='/etc/update-motd.d/99-bento' + + cat >> "$MOTD_CONFIG" <> /etc/motd +fi diff --git a/packer_templates/scripts/_common/parallels-rhel.sh b/packer_templates/scripts/_common/parallels-rhel.sh new file mode 100644 index 0000000..fde6f59 --- /dev/null +++ b/packer_templates/scripts/_common/parallels-rhel.sh @@ -0,0 +1,47 @@ +#!/bin/sh -eux + +# set a default HOME_DIR environment variable if not set +HOME_DIR="${HOME_DIR:-/home/vagrant}"; + +case "$PACKER_BUILDER_TYPE" in +parallels-iso|parallels-pvm) + major_version="$(sed 's/^.\+ release \([.0-9]\+\).*/\1/' /etc/redhat-release | awk -F. '{print $1}')" + # make sure we use dnf on EL 8+ + if [ "$major_version" -ge 8 ]; then + dnf -y install checkpolicy selinux-policy-devel gcc kernel-devel kernel-headers make + else + yum -y install checkpolicy selinux-policy-devel gcc kernel-devel kernel-headers make + fi + + mkdir -p /tmp/parallels; + if [ "$(uname -m)" = "aarch64" ] ; then + mount -o loop "$HOME_DIR"/prl-tools-lin-arm.iso /tmp/parallels; + else + mount -o loop "$HOME_DIR"/prl-tools-lin.iso /tmp/parallels; + fi + VER="$(cat /tmp/parallels/version)"; + + echo "Parallels Tools Version: $VER"; + + /tmp/parallels/install --install-unattended-with-deps \ + || (code="$?"; \ + echo "Parallels tools installation exited $code, attempting" \ + "to output /var/log/parallels-tools-install.log"; \ + cat /var/log/parallels-tools-install.log; \ + exit $code); + umount /tmp/parallels; + rm -rf /tmp/parallels; + rm -f "$HOME_DIR"/*.iso; + + # Parallels Tools for Linux includes native auto-mount script, + # which causes losing some of Vagrant-relative shared folders. + # So, we should disable this behavior. + # https://github.com/Parallels/vagrant-parallels/issues/325#issuecomment-418727113 + # TODO: verify this is fixed in latest version of parallels + # auto_mount_script='/usr/bin/prlfsmountd' + # if [ -f "${auto_mount_script}" ]; then + # printf '#!/bin/sh\n # Shared folders auto-mount is disabled by Vagrant' > "${auto_mount_script}" + # fi + + ;; +esac diff --git a/packer_templates/scripts/_common/parallels.sh b/packer_templates/scripts/_common/parallels.sh new file mode 100644 index 0000000..def4f01 --- /dev/null +++ b/packer_templates/scripts/_common/parallels.sh @@ -0,0 +1,39 @@ +#!/bin/sh -eux + +# set a default HOME_DIR environment variable if not set +HOME_DIR="${HOME_DIR:-/home/vagrant}"; + +case "$PACKER_BUILDER_TYPE" in +parallels-iso|parallels-pvm) + mkdir -p /tmp/parallels; + if [ "$(uname -m)" = "aarch64" ] ; then + mount -o loop "$HOME_DIR"/prl-tools-lin-arm.iso /tmp/parallels; + else + mount -o loop "$HOME_DIR"/prl-tools-lin.iso /tmp/parallels; + fi + VER="$(cat /tmp/parallels/version)"; + + echo "Parallels Tools Version: $VER"; + + /tmp/parallels/install --install-unattended-with-deps \ + || (code="$?"; \ + echo "Parallels tools installation exited $code, attempting" \ + "to output /var/log/parallels-tools-install.log"; \ + cat /var/log/parallels-tools-install.log; \ + exit $code); + umount /tmp/parallels; + rm -rf /tmp/parallels; + rm -f "$HOME_DIR"/*.iso; + + # Parallels Tools for Linux includes native auto-mount script, + # which causes losing some of Vagrant-relative shared folders. + # So, we should disable this behavior. + # https://github.com/Parallels/vagrant-parallels/issues/325#issuecomment-418727113 + # TODO: verify this is fixed in latest version of parallels + # auto_mount_script='/usr/bin/prlfsmountd' + # if [ -f "${auto_mount_script}" ]; then + # printf '#!/bin/sh\n # Shared folders auto-mount is disabled by Vagrant' > "${auto_mount_script}" + # fi + + ;; +esac diff --git a/packer_templates/scripts/_common/sshd.sh b/packer_templates/scripts/_common/sshd.sh new file mode 100644 index 0000000..835193f --- /dev/null +++ b/packer_templates/scripts/_common/sshd.sh @@ -0,0 +1,21 @@ +#!/bin/sh -eux + +SSHD_CONFIG="/etc/ssh/sshd_config" + +# ensure that there is a trailing newline before attempting to concatenate +# shellcheck disable=SC1003 +sed -i -e '$a\' "$SSHD_CONFIG" + +USEDNS="UseDNS no" +if grep -q -E "^[[:space:]]*UseDNS" "$SSHD_CONFIG"; then + sed -i "s/^\s*UseDNS.*/${USEDNS}/" "$SSHD_CONFIG" +else + echo "$USEDNS" >>"$SSHD_CONFIG" +fi + +GSSAPI="GSSAPIAuthentication no" +if grep -q -E "^[[:space:]]*GSSAPIAuthentication" "$SSHD_CONFIG"; then + sed -i "s/^\s*GSSAPIAuthentication.*/${GSSAPI}/" "$SSHD_CONFIG" +else + echo "$GSSAPI" >>"$SSHD_CONFIG" +fi diff --git a/packer_templates/scripts/_common/vagrant.sh b/packer_templates/scripts/_common/vagrant.sh new file mode 100644 index 0000000..9dfbc09 --- /dev/null +++ b/packer_templates/scripts/_common/vagrant.sh @@ -0,0 +1,19 @@ +#!/bin/sh -eux + +# set a default HOME_DIR environment variable if not set +HOME_DIR="${HOME_DIR:-/home/vagrant}"; + +pubkey_url="https://raw.githubusercontent.com/hashicorp/vagrant/main/keys/vagrant.pub"; +mkdir -p "$HOME_DIR"/.ssh; +if command -v wget >/dev/null 2>&1; then + wget --no-check-certificate "$pubkey_url" -O "$HOME_DIR"/.ssh/authorized_keys; +elif command -v curl >/dev/null 2>&1; then + curl --insecure --location "$pubkey_url" > "$HOME_DIR"/.ssh/authorized_keys; +elif command -v fetch >/dev/null 2>&1; then + fetch -am -o "$HOME_DIR"/.ssh/authorized_keys "$pubkey_url"; +else + echo "Cannot download vagrant public key"; + exit 1; +fi +chown -R vagrant "$HOME_DIR"/.ssh; +chmod -R go-rwsx "$HOME_DIR"/.ssh; diff --git a/packer_templates/scripts/_common/virtualbox.sh b/packer_templates/scripts/_common/virtualbox.sh new file mode 100644 index 0000000..f6e66b7 --- /dev/null +++ b/packer_templates/scripts/_common/virtualbox.sh @@ -0,0 +1,55 @@ +#!/bin/sh -eux + +# set a default HOME_DIR environment variable if not set +HOME_DIR="${HOME_DIR:-/home/vagrant}"; + +case "$PACKER_BUILDER_TYPE" in +virtualbox-iso|virtualbox-ovf) + VER="$(cat "$HOME_DIR"/.vbox_version)"; + ISO="VBoxGuestAdditions_$VER.iso"; + + # mount the ISO to /tmp/vbox + mkdir -p /tmp/vbox; + mount -o loop "$HOME_DIR"/"$ISO" /tmp/vbox; + + echo "installing deps necessary to compile kernel modules" + # We install things like kernel-headers here vs. kickstart files so we make sure we install them for the updated kernel not the stock kernel + if [ -f "/bin/dnf" ]; then + dnf install -y --skip-broken perl cpp gcc make bzip2 tar kernel-headers kernel-devel kernel-uek-devel || true # not all these packages are on every system + elif [ -f "/bin/yum" ] || [ -f "/usr/bin/yum" ]; then + yum install -y --skip-broken perl cpp gcc make bzip2 tar kernel-headers kernel-devel kernel-uek-devel || true # not all these packages are on every system + elif [ -f "/usr/bin/apt-get" ]; then + apt-get install -y build-essential dkms bzip2 tar linux-headers-"$(uname -r)" + elif [ -f "/usr/bin/zypper" ]; then + zypper install -y perl cpp gcc make bzip2 tar kernel-default-devel + fi + + echo "installing the vbox additions" + # this install script fails with non-zero exit codes for no apparent reason so we need better ways to know if it worked + /tmp/vbox/VBoxLinuxAdditions.run --nox11 || true + + if ! modinfo vboxsf >/dev/null 2>&1; then + echo "Cannot find vbox kernel module. Installation of guest additions unsuccessful!" + exit 1 + fi + + echo "unmounting and removing the vbox ISO" + umount /tmp/vbox; + rm -rf /tmp/vbox; + rm -f "$HOME_DIR"/*.iso; + + echo "removing kernel dev packages and compilers we no longer need" + if [ -f "/bin/dnf" ]; then + dnf remove -y gcc cpp kernel-headers kernel-devel kernel-uek-devel + elif [ -f "/bin/yum" ] || [ -f "/usr/bin/yum" ]; then + yum remove -y gcc cpp kernel-headers kernel-devel kernel-uek-devel + elif [ -f "/usr/bin/apt-get" ]; then + apt-get remove -y build-essential gcc g++ make libc6-dev dkms linux-headers-"$(uname -r)" + elif [ -f "/usr/bin/zypper" ]; then + zypper -n rm -u kernel-default-devel gcc make + fi + + echo "removing leftover logs" + rm -rf /var/log/vboxadd* + ;; +esac diff --git a/packer_templates/scripts/_common/vmware_debian_ubuntu.sh b/packer_templates/scripts/_common/vmware_debian_ubuntu.sh new file mode 100644 index 0000000..1409a8b --- /dev/null +++ b/packer_templates/scripts/_common/vmware_debian_ubuntu.sh @@ -0,0 +1,11 @@ +#!/bin/sh -eux + +case "$PACKER_BUILDER_TYPE" in +vmware-iso|vmware-vmx) + echo "install open-vm-tools" + apt-get install -y open-vm-tools; + mkdir /mnt/hgfs; + systemctl enable open-vm-tools + systemctl start open-vm-tools + echo "platform specific vmware.sh executed"; +esac diff --git a/packer_templates/scripts/_common/vmware_fedora.sh b/packer_templates/scripts/_common/vmware_fedora.sh new file mode 100644 index 0000000..8e02760 --- /dev/null +++ b/packer_templates/scripts/_common/vmware_fedora.sh @@ -0,0 +1,9 @@ +#!/bin/bash -eux + +# the proprietary vm tools don't work on Fedora 30 so we'll install the open-vm-tools +case "$PACKER_BUILDER_TYPE" in +vmware-iso|vmware-vmx) + dnf install -y open-vm-tools + systemctl enable vmtoolsd + systemctl start vmtoolsd +esac diff --git a/packer_templates/scripts/_common/vmware_rhel.sh b/packer_templates/scripts/_common/vmware_rhel.sh new file mode 100644 index 0000000..835230d --- /dev/null +++ b/packer_templates/scripts/_common/vmware_rhel.sh @@ -0,0 +1,18 @@ +#!/bin/sh -eux + +# set a default HOME_DIR environment variable if not set +HOME_DIR="${HOME_DIR:-/home/vagrant}"; + +case "$PACKER_BUILDER_TYPE" in +vmware-iso|vmware-vmx) + # determine the major EL version we're runninng + major_version="$(sed 's/^.\+ release \([.0-9]\+\).*/\1/' /etc/redhat-release | awk -F. '{print $1}')"; + + # make sure we use dnf on EL 8+ + if [ "$major_version" -ge 8 ]; then + dnf -y install open-vm-tools + else + yum -y install open-vm-tools + fi + ;; +esac diff --git a/packer_templates/scripts/_common/vmware_suse.sh b/packer_templates/scripts/_common/vmware_suse.sh new file mode 100644 index 0000000..1905bbd --- /dev/null +++ b/packer_templates/scripts/_common/vmware_suse.sh @@ -0,0 +1,10 @@ +#!/bin/sh -eux + +case "$PACKER_BUILDER_TYPE" in +vmware-iso|vmware-vmx) + zypper install -y open-vm-tools insserv-compat + mkdir /mnt/hgfs + systemctl enable vmtoolsd + systemctl start vmtoolsd + echo "platform specific vmware.sh executed" +esac diff --git a/packer_templates/scripts/debian/cleanup_debian.sh b/packer_templates/scripts/debian/cleanup_debian.sh new file mode 100644 index 0000000..c99bf44 --- /dev/null +++ b/packer_templates/scripts/debian/cleanup_debian.sh @@ -0,0 +1,65 @@ +#!/bin/sh -eux + +echo "remove linux-headers" +dpkg --list \ + | awk '{ print $2 }' \ + | grep 'linux-headers' \ + | xargs apt-get -y purge; + +echo "remove specific Linux kernels, such as linux-image-4.9.0-13-amd64 but keeps the current kernel and does not touch the virtual packages" +dpkg --list \ + | awk '{ print $2 }' \ + | grep 'linux-image-[234].*' \ + | grep -v "$(uname -r)" \ + | xargs apt-get -y purge; + +echo "remove linux-source package" +dpkg --list \ + | awk '{ print $2 }' \ + | grep linux-source \ + | xargs apt-get -y purge; + +echo "remove all development packages" +dpkg --list \ + | awk '{ print $2 }' \ + | grep -- '-dev\(:[a-z0-9]\+\)\?$' \ + | xargs apt-get -y purge; + +echo "remove X11 libraries" +apt-get -y purge libx11-data xauth libxmuu1 libxcb1 libx11-6 libxext6; + +echo "remove obsolete networking packages" +apt-get -y purge ppp pppconfig pppoeconf; + +echo "remove popularity-contest package" +apt-get -y purge popularity-contest; + +echo "remove installation-report package" +apt-get -y purge installation-report; + +echo "autoremoving packages and cleaning apt data" +apt-get -y autoremove; +apt-get -y clean; + +echo "remove /var/cache" +find /var/cache -type f -exec rm -rf {} \; + +echo "truncate any logs that have built up during the install" +find /var/log -type f -exec truncate --size=0 {} \; + +echo "blank netplan machine-id (DUID) so machines get unique ID generated on boot" +truncate -s 0 /etc/machine-id +if test -f /var/lib/dbus/machine-id +then + truncate -s 0 /var/lib/dbus/machine-id # if not symlinked to "/etc/machine-id" +fi + +echo "remove the contents of /tmp and /var/tmp" +rm -rf /tmp/* /var/tmp/* + +echo "force a new random seed to be generated" +rm -f /var/lib/systemd/random-seed + +echo "clear the history so our install isn't there" +rm -f /root/.wget-hsts +export HISTSIZE=0 diff --git a/packer_templates/scripts/debian/hyperv_debian.sh b/packer_templates/scripts/debian/hyperv_debian.sh new file mode 100755 index 0000000..1c3dc61 --- /dev/null +++ b/packer_templates/scripts/debian/hyperv_debian.sh @@ -0,0 +1,7 @@ +#!/bin/sh -eux + +case "$PACKER_BUILDER_TYPE" in +hyperv-iso) + echo "installing packaging for hyper-v" + apt-get -y install linux-image-virtual linux-tools-virtual linux-cloud-tools-virtual; +esac diff --git a/packer_templates/scripts/debian/networking_debian.sh b/packer_templates/scripts/debian/networking_debian.sh new file mode 100644 index 0000000..a574c69 --- /dev/null +++ b/packer_templates/scripts/debian/networking_debian.sh @@ -0,0 +1,9 @@ +#!/bin/sh -eux + +# Disable Predictable Network Interface names and use eth0 +sed -i 's/en[[:alnum:]]*/eth0/g' /etc/network/interfaces; +sed -i 's/GRUB_CMDLINE_LINUX="\(.*\)"/GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0 \1"/g' /etc/default/grub; +update-grub; + +# Adding a 2 sec delay to the interface up, to make the dhclient happy +echo "pre-up sleep 2" >> /etc/network/interfaces diff --git a/packer_templates/scripts/debian/sudoers_debian.sh b/packer_templates/scripts/debian/sudoers_debian.sh new file mode 100644 index 0000000..00aa3b9 --- /dev/null +++ b/packer_templates/scripts/debian/sudoers_debian.sh @@ -0,0 +1,9 @@ +#!/bin/sh -eux + +# Only add the secure path line if it is not already present +grep -q 'secure_path' /etc/sudoers \ + || sed -i -e '/Defaults\s\+env_reset/a Defaults\tsecure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"' /etc/sudoers; + +# Set up password-less sudo for the vagrant user +echo 'vagrant ALL=(ALL) NOPASSWD:ALL' >/etc/sudoers.d/99_vagrant; +chmod 440 /etc/sudoers.d/99_vagrant; diff --git a/packer_templates/scripts/debian/systemd_debian.sh b/packer_templates/scripts/debian/systemd_debian.sh new file mode 100644 index 0000000..2d1b5a7 --- /dev/null +++ b/packer_templates/scripts/debian/systemd_debian.sh @@ -0,0 +1,4 @@ +#!/bin/sh -eux + +# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=751636 +apt-get install libpam-systemd diff --git a/packer_templates/scripts/debian/update_debian.sh b/packer_templates/scripts/debian/update_debian.sh new file mode 100644 index 0000000..ee07e8e --- /dev/null +++ b/packer_templates/scripts/debian/update_debian.sh @@ -0,0 +1,26 @@ +#!/bin/sh -eux + +arch="$(uname -r | sed 's/^.*[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}\(-[0-9]\{1,2\}\)-//')" + +# Disable systemd apt timers/services +systemctl stop apt-daily.timer; +systemctl stop apt-daily-upgrade.timer; +systemctl disable apt-daily.timer; +systemctl disable apt-daily-upgrade.timer; +systemctl mask apt-daily.service; +systemctl mask apt-daily-upgrade.service; +systemctl daemon-reload; + +# Disable periodic activities of apt +cat </etc/apt/apt.conf.d/10periodic; +APT::Periodic::Enable "0"; +APT::Periodic::Update-Package-Lists "0"; +APT::Periodic::Download-Upgradeable-Packages "0"; +APT::Periodic::AutocleanInterval "0"; +APT::Periodic::Unattended-Upgrade "0"; +EOF + +apt-get update; + +apt-get -y upgrade linux-image-"$arch"; +apt-get -y install linux-headers-"$(uname -r)"; diff --git a/packer_templates/scripts/fedora/build-tools_fedora.sh b/packer_templates/scripts/fedora/build-tools_fedora.sh new file mode 100644 index 0000000..e00cd1e --- /dev/null +++ b/packer_templates/scripts/fedora/build-tools_fedora.sh @@ -0,0 +1,3 @@ +#!/bin/bash -eux +# Installing build tools here because Fedora 22+ will not do so during kickstart +dnf -y install kernel-headers kernel-devel-"$(uname -r)" elfutils-libelf-devel gcc make perl diff --git a/packer_templates/scripts/fedora/cleanup_dnf.sh b/packer_templates/scripts/fedora/cleanup_dnf.sh new file mode 100644 index 0000000..8757ced --- /dev/null +++ b/packer_templates/scripts/fedora/cleanup_dnf.sh @@ -0,0 +1,48 @@ +#!/bin/bash -eux + +echo "reduce the grub menu time to 1 second" +sed -i -e 's/^GRUB_TIMEOUT=[0-9]\+$/GRUB_TIMEOUT=1/' /etc/default/grub +grub2-mkconfig -o /boot/grub2/grub.cfg + +echo "Remove development and kernel source packages" +dnf -y remove gcc cpp gc kernel-devel kernel-headers glibc-devel elfutils-libelf-devel glibc-headers kernel-devel kernel-headers + +echo "remove orphaned packages" +dnf -y autoremove + +echo "Remove previous kernels that preserved for rollbacks" +dnf -y remove "$(dnf repoquery --installonly --latest-limit=-1 -q)" + +# Avoid ~200 meg firmware package we don't need +# this cannot be done in the KS file so we do it here +echo "Removing extra firmware packages" +dnf -y remove linux-firmware + +echo "clean all package cache information" +dnf -y clean all --enablerepo=\* + +echo "truncate any logs that have built up during the install" +find /var/log -type f -exec truncate --size=0 {} \; + +echo "Remove any non-loopback network configs" +find /etc/sysconfig/network-scripts -name "ifcfg-*" -not -name "ifcfg-lo" -exec rm -f {} \; + +echo "remove the install log" +rm -f /root/anaconda-ks.cfg /root/original-ks.cfg + +echo "remove the contents of /tmp and /var/tmp" +rm -rf /tmp/* /var/tmp/* + +echo "Force a new random seed to be generated" +rm -f /var/lib/systemd/random-seed + +echo "Wipe netplan machine-id (DUID) so machines get unique ID generated on boot" +truncate -s 0 /etc/machine-id +if test -f /var/lib/dbus/machine-id +then + truncate -s 0 /var/lib/dbus/machine-id # if not symlinked to "/etc/machine-id" +fi + +echo "Clear the history so our install commands aren't there" +rm -f /root/.wget-hsts +export HISTSIZE=0 diff --git a/packer_templates/scripts/fedora/install-supporting-packages_fedora.sh b/packer_templates/scripts/fedora/install-supporting-packages_fedora.sh new file mode 100644 index 0000000..0cc2a51 --- /dev/null +++ b/packer_templates/scripts/fedora/install-supporting-packages_fedora.sh @@ -0,0 +1,3 @@ +#!/bin/bash -eux +# Chef with Fedora >= 30 requires libxcrypt-compat to be installed +dnf -y install libxcrypt-compat diff --git a/packer_templates/scripts/fedora/networking_fedora.sh b/packer_templates/scripts/fedora/networking_fedora.sh new file mode 100644 index 0000000..384632d --- /dev/null +++ b/packer_templates/scripts/fedora/networking_fedora.sh @@ -0,0 +1,16 @@ +#!/bin/bash -eux + +if [[ "$PACKER_BUILDER_TYPE" == virtualbox* ]]; then + + ## https://access.redhat.com/site/solutions/58625 (subscription required) + # add 'single-request-reopen' so it is included when /etc/resolv.conf is generated + cat >> /etc/NetworkManager/dispatcher.d/fix-slow-dns <> /etc/resolv.conf +EOF + chmod +x /etc/NetworkManager/dispatcher.d/fix-slow-dns + systemctl restart NetworkManager.service + echo 'Slow DNS fix applied (single-request-reopen)' +else + echo 'Slow DNS fix not required for this platform, skipping' +fi diff --git a/packer_templates/scripts/fedora/real-tmp_fedora.sh b/packer_templates/scripts/fedora/real-tmp_fedora.sh new file mode 100644 index 0000000..09613d9 --- /dev/null +++ b/packer_templates/scripts/fedora/real-tmp_fedora.sh @@ -0,0 +1,3 @@ +#!/bin/bash -eux +echo "Don't use the tmpfs based /tmp dir that is limited to 50% of RAM" +systemctl mask tmp.mount diff --git a/packer_templates/scripts/fedora/update_dnf.sh b/packer_templates/scripts/fedora/update_dnf.sh new file mode 100644 index 0000000..856c12b --- /dev/null +++ b/packer_templates/scripts/fedora/update_dnf.sh @@ -0,0 +1,7 @@ +#!/bin/sh -eux + +# update all packages +dnf -y upgrade + +reboot; +sleep 60; diff --git a/packer_templates/scripts/freebsd/cleanup_freebsd.sh b/packer_templates/scripts/freebsd/cleanup_freebsd.sh new file mode 100644 index 0000000..fe6e0a5 --- /dev/null +++ b/packer_templates/scripts/freebsd/cleanup_freebsd.sh @@ -0,0 +1,17 @@ +#!/bin/sh -eux + +# cleanup orphaned packages and cache +pkg autoremove --yes +pkg clean --yes --all +rm -f /var/db/pkg/repo-FreeBSD.sqlite + +# Purge files we don't need any longer +rm -rf /var/db/freebsd-update/files; +mkdir -p /var/db/freebsd-update/files; +rm -f /var/db/freebsd-update/*-rollback; +rm -rf /var/db/freebsd-update/install.*; +rm -rf /boot/kernel.old; +rm -f /boot/kernel*/*.symbols; +rm -f /*.core; +rm -rf /var/cache/pkg; +rm -f /usr/home/vagrant/*.iso; diff --git a/packer_templates/scripts/freebsd/minimize_freebsd.sh b/packer_templates/scripts/freebsd/minimize_freebsd.sh new file mode 100644 index 0000000..92cfaf4 --- /dev/null +++ b/packer_templates/scripts/freebsd/minimize_freebsd.sh @@ -0,0 +1,16 @@ +#!/bin/sh -eux + +case "$PACKER_BUILDER_TYPE" in + qemu) exit 0 ;; +esac + +ZROOT="zroot/ROOT/default" + +zfs set compression=off $ZROOT; +dd if=/dev/zero of=/EMPTY bs=1m || echo "dd(1) exits after taking over all the space" +sync +rm -f /EMPTY; +# Block until the empty file has been removed, otherwise, Packer +# will try to kill the box while the disk is still full and that's bad +sync; +zfs set compression=lz4 $ZROOT; diff --git a/packer_templates/scripts/freebsd/postinstall_freebsd.sh b/packer_templates/scripts/freebsd/postinstall_freebsd.sh new file mode 100644 index 0000000..a0e2513 --- /dev/null +++ b/packer_templates/scripts/freebsd/postinstall_freebsd.sh @@ -0,0 +1,39 @@ +#!/bin/sh -eux + +# Set the time correctly +#ntpdate -v -b 0.pool.ntp.org + +# Install curl and ca_root_nss +pkg install -y curl ca_root_nss dmidecode; + +# Emulate the ETCSYMLINK behavior of ca_root_nss; this is for FreeBSD 10, +# where fetch(1) was massively refactored and doesn't come with +# SSL CAcerts anymore +ln -sf /usr/local/share/certs/ca-root-nss.crt /etc/ssl/cert.pem; + +# Avoid pausing at the boot screen +cat >>/etc/loader.conf << LOADER_CONF +autoboot_delay="-1" +beastie_disable="YES" +loader_logo="none" +hw.memtest.tests="0" +LOADER_CONF + +# disable crash dumps +sysrc dumpdev="NO" + +# As sharedfolders are not in defaults ports tree, we will use NFS sharing +cat >>/etc/rc.conf << RC_CONF +rpcbind_enable="YES" +nfs_server_enable="YES" +mountd_flags="-r" +RC_CONF + +echo 'Disable X11 in make.conf because Vagrants VMs are (usually) headless' +cat >>/etc/make.conf << MAKE_CONF +WITHOUT_X11="YES" +WITHOUT_GUI="YES" +MAKE_CONF + +echo 'Update the locate DB' +/etc/periodic/weekly/310.locate diff --git a/packer_templates/scripts/freebsd/sudoers_freebsd.sh b/packer_templates/scripts/freebsd/sudoers_freebsd.sh new file mode 100644 index 0000000..d8c2032 --- /dev/null +++ b/packer_templates/scripts/freebsd/sudoers_freebsd.sh @@ -0,0 +1,4 @@ +#!/bin/sh -eux + +pkg install -y sudo; +echo "vagrant ALL=(ALL) NOPASSWD: ALL" >>/usr/local/etc/sudoers; diff --git a/packer_templates/scripts/freebsd/update_freebsd.sh b/packer_templates/scripts/freebsd/update_freebsd.sh new file mode 100644 index 0000000..5ab0880 --- /dev/null +++ b/packer_templates/scripts/freebsd/update_freebsd.sh @@ -0,0 +1,16 @@ +#!/bin/sh -eux + +freebsd_update="/usr/sbin/freebsd-update --not-running-from-cron"; + +# Update FreeBSD +# NOTE: the install action fails if there are no updates so || true it +env PAGER=/bin/cat "$freebsd_update" fetch || true; +env PAGER=/bin/cat "$freebsd_update" install || true; + +# shellcheck disable=SC2154 +if [ "$pkg_branch" != "quarterly" ]; then + sed -i.bak -e "s,pkg+http://pkg.FreeBSD.org/\${ABI}/quarterly,pkg+http://pkg.FreeBSD.org/\${ABI}/${pkg_branch}," /etc/pkg/FreeBSD.conf + rm -f /etc/pkg/FreeBSD.conf.bak +fi + +env ASSUME_ALWAYS_YES=true pkg update; diff --git a/packer_templates/scripts/freebsd/vmtools_freebsd.sh b/packer_templates/scripts/freebsd/vmtools_freebsd.sh new file mode 100644 index 0000000..dfaadf5 --- /dev/null +++ b/packer_templates/scripts/freebsd/vmtools_freebsd.sh @@ -0,0 +1,48 @@ +#!/bin/sh -eux + +case "$PACKER_BUILDER_TYPE" in + +virtualbox-iso|virtualbox-ovf) + # Disable X11 because vagrants are (usually) headless + echo 'WITHOUT_X11="YES"' >> /etc/make.conf; + + pkg install -y virtualbox-ose-additions-nox11; + + echo 'vboxdrv_load="YES"' >>/boot/loader.conf; + echo 'vboxnet_enable="YES"' >>/etc/rc.conf; + echo 'vboxguest_enable="YES"' >>/etc/rc.conf; + echo 'vboxservice_enable="YES"' >>/etc/rc.conf; + + echo 'virtio_blk_load="YES"' >>/boot/loader.conf; + echo 'virtio_scsi_load="YES"' >>/boot/loader.conf; + echo 'virtio_balloon_load="YES"' >>/boot/loader.conf; + echo 'if_vtnet_load="YES"' >>/boot/loader.conf; + + echo 'ifconfig_vtnet0_name="em0"' >>/etc/rc.conf; + echo 'ifconfig_vtnet1_name="em1"' >>/etc/rc.conf; + echo 'ifconfig_vtnet2_name="em2"' >>/etc/rc.conf; + echo 'ifconfig_vtnet3_name="em3"' >>/etc/rc.conf; + + pw groupadd vboxusers; + pw groupmod vboxusers -m vagrant; + ;; + +vmware-iso|vmware-vmx) + pkg install -y open-vm-tools-nox11; + + # for shared folder + echo 'fuse_load="YES"' >>/boot/loader.conf; + + echo 'ifconfig_vmx0="dhcp"' >>/etc/rc.conf; + ;; + +parallels-iso|parallels-pvm) + pkg install -y parallels-tools + ;; + +*) + echo "Unknown Packer Builder Type >>$PACKER_BUILDER_TYPE<< selected."; + echo "Known are virtualbox-iso|virtualbox-ovf|vmware-iso|vmware-vmx|parallels-iso|parallels-pvm."; + ;; + +esac diff --git a/packer_templates/scripts/rhel/cleanup_dnf.sh b/packer_templates/scripts/rhel/cleanup_dnf.sh new file mode 100644 index 0000000..2fa9737 --- /dev/null +++ b/packer_templates/scripts/rhel/cleanup_dnf.sh @@ -0,0 +1,62 @@ +#!/bin/sh -eux + +echo "reduce the grub menu time to 1 second" +sed -i -e 's/^GRUB_TIMEOUT=[0-9]\+$/GRUB_TIMEOUT=1/' /etc/default/grub +grub2-mkconfig -o /boot/grub2/grub.cfg + +echo "Remove development and kernel source packages" +dnf -y remove gcc cpp gc kernel-devel kernel-headers glibc-devel elfutils-libelf-devel glibc-headers kernel-devel kernel-headers + +echo "remove orphaned packages" +dnf -y autoremove + +echo "Remove previous kernels that preserved for rollbacks" +dnf -y remove "$(dnf repoquery --installonly --latest-limit=-1 -q)" + +# Avoid ~200 meg firmware package we don't need +# this cannot be done in the KS file so we do it here +# Skip Oracle linux because it causes errors by removing kernel-uek-core +distro="$(rpm -qf --queryformat '%{NAME}' /etc/redhat-release | cut -f 1 -d '-')" +if [ "$distro" != 'oraclelinux' ]; then + echo "Removing extra firmware packages" + dnf -y remove linux-firmware +fi + +echo "clean all package cache information" +dnf -y clean all --enablerepo=\* + +# Clean up network interface persistence +rm -f /etc/udev/rules.d/70-persistent-net.rules; +mkdir -p /etc/udev/rules.d/70-persistent-net.rules; +rm -f /lib/udev/rules.d/75-persistent-net-generator.rules; +rm -rf /dev/.udev/; + +for ndev in /etc/sysconfig/network-scripts/ifcfg-*; do + if [ "$(basename "$ndev")" != "ifcfg-lo" ]; then + sed -i '/^HWADDR/d' "$ndev"; + sed -i '/^UUID/d' "$ndev"; + fi +done + +echo "truncate any logs that have built up during the install" +find /var/log -type f -exec truncate --size=0 {} \; + +echo "remove the install log" +rm -f /root/anaconda-ks.cfg /root/original-ks.cfg + +echo "remove the contents of /tmp and /var/tmp" +rm -rf /tmp/* /var/tmp/* + +echo "Force a new random seed to be generated" +rm -f /var/lib/systemd/random-seed + +echo "Wipe netplan machine-id (DUID) so machines get unique ID generated on boot" +truncate -s 0 /etc/machine-id +if test -f /var/lib/dbus/machine-id +then + truncate -s 0 /var/lib/dbus/machine-id # if not symlinked to "/etc/machine-id" +fi + +echo "Clear the history so our install commands aren't there" +rm -f /root/.wget-hsts +export HISTSIZE=0 diff --git a/packer_templates/scripts/rhel/cleanup_yum.sh b/packer_templates/scripts/rhel/cleanup_yum.sh new file mode 100644 index 0000000..6dd7cf3 --- /dev/null +++ b/packer_templates/scripts/rhel/cleanup_yum.sh @@ -0,0 +1,62 @@ +#!/bin/sh -eux + +echo "reduce the grub menu time to 1 second" +sed -i -e 's/^GRUB_TIMEOUT=[0-9]\+$/GRUB_TIMEOUT=1/' /etc/default/grub +grub2-mkconfig -o /boot/grub2/grub.cfg + +echo "Remove development and kernel source packages" +yum -y remove gcc cpp gc kernel-devel kernel-headers glibc-devel elfutils-libelf-devel glibc-headers kernel-devel kernel-headers + +echo "remove orphaned packages" +yum -y autoremove + +echo "Remove previous kernels that preserved for rollbacks" +if ! command -v package-cleanup >/dev/null 2>&1; then + yum -y install yum-utils +fi + +package-cleanup --oldkernels --count=1 -y + +# Avoid ~200 meg firmware package we don't need +# this cannot be done in the KS file so we do it here +echo "Removing extra firmware packages" +yum -y remove linux-firmware + +echo "clean all package cache information" +yum -y clean all --enablerepo=\*; + +# Clean up network interface persistence +rm -f /etc/udev/rules.d/70-persistent-net.rules; +mkdir -p /etc/udev/rules.d/70-persistent-net.rules; +rm -f /lib/udev/rules.d/75-persistent-net-generator.rules; +rm -rf /dev/.udev/; + +for ndev in /etc/sysconfig/network-scripts/ifcfg-*; do + if [ "$(basename "$ndev")" != "ifcfg-lo" ]; then + sed -i '/^HWADDR/d' "$ndev"; + sed -i '/^UUID/d' "$ndev"; + fi +done + +echo "truncate any logs that have built up during the install" +find /var/log -type f -exec truncate --size=0 {} \; + +echo "remove the install log" +rm -f /root/anaconda-ks.cfg /root/original-ks.cfg + +echo "remove the contents of /tmp and /var/tmp" +rm -rf /tmp/* /var/tmp/* + +echo "Force a new random seed to be generated" +rm -f /var/lib/systemd/random-seed + +echo "Wipe netplan machine-id (DUID) so machines get unique ID generated on boot" +truncate -s 0 /etc/machine-id +if test -f /var/lib/dbus/machine-id +then + truncate -s 0 /var/lib/dbus/machine-id # if not symlinked to "/etc/machine-id" +fi + +echo "Clear the history so our install commands aren't there" +rm -f /root/.wget-hsts +export HISTSIZE=0 diff --git a/packer_templates/scripts/rhel/networking_rhel7.sh b/packer_templates/scripts/rhel/networking_rhel7.sh new file mode 100644 index 0000000..285079c --- /dev/null +++ b/packer_templates/scripts/rhel/networking_rhel7.sh @@ -0,0 +1,15 @@ +#!/bin/sh -eux + +case "$PACKER_BUILDER_TYPE" in + +virtualbox-iso|virtualbox-ovf) + # Fix slow DNS: + # Add 'single-request-reopen' so it is included when /etc/resolv.conf is + # generated + # https://access.redhat.com/site/solutions/58625 (subscription required) + echo 'RES_OPTIONS="single-request-reopen"' >>/etc/sysconfig/network; + service network restart; + echo 'Slow DNS fix applied (single-request-reopen)'; + ;; + +esac diff --git a/packer_templates/scripts/rhel/update_dnf.sh b/packer_templates/scripts/rhel/update_dnf.sh new file mode 100644 index 0000000..62c95df --- /dev/null +++ b/packer_templates/scripts/rhel/update_dnf.sh @@ -0,0 +1,7 @@ +#!/bin/sh -eux + +# update all packages +dnf -y upgrade --skip-broken + +reboot; +sleep 60; diff --git a/packer_templates/scripts/rhel/update_yum.sh b/packer_templates/scripts/rhel/update_yum.sh new file mode 100644 index 0000000..d3ef300 --- /dev/null +++ b/packer_templates/scripts/rhel/update_yum.sh @@ -0,0 +1,5 @@ +#!/bin/sh -eux + +yum -y upgrade --skip-broken; +reboot; +sleep 60; diff --git a/packer_templates/scripts/solaris/minimize_solaris.sh b/packer_templates/scripts/solaris/minimize_solaris.sh new file mode 100644 index 0000000..01cb693 --- /dev/null +++ b/packer_templates/scripts/solaris/minimize_solaris.sh @@ -0,0 +1,7 @@ +#!/bin/sh -ux + +dd if=/dev/zero of=/EMPTY bs=1048576 +rm -f /EMPTY +# Block until the empty file has been removed, otherwise, Packer +# will try to kill the box while the disk is still full and that's bad +sync diff --git a/packer_templates/scripts/solaris/update_solaris.sh b/packer_templates/scripts/solaris/update_solaris.sh new file mode 100644 index 0000000..c70aff8 --- /dev/null +++ b/packer_templates/scripts/solaris/update_solaris.sh @@ -0,0 +1,4 @@ +#!/bin/bash -eux + +pkg update pkg:/package/pkg || true +pkg update --accept || true diff --git a/packer_templates/scripts/solaris/vmtools_solaris.sh b/packer_templates/scripts/solaris/vmtools_solaris.sh new file mode 100644 index 0000000..7395341 --- /dev/null +++ b/packer_templates/scripts/solaris/vmtools_solaris.sh @@ -0,0 +1,24 @@ +#!/bin/bash -eux + +# Add pkgadd auto-answer file +sudo mkdir -p /tmp +sudo chmod 777 /tmp +{ + echo "mail=" + echo "instance=overwrite" + echo "partial=nocheck" + echo "runlevel=nocheck" + echo "idepend=nocheck" + echo "rdepend=nocheck" + echo "space=nocheck" + echo "setuid=nocheck" + echo "conflict=nocheck" + echo "action=nocheck" + echo "basedir=default" +} > /tmp/nocheck + +if [ -f /home/vagrant/.vbox_version ]; then + mkdir /tmp/vbox + ls + echo "all" | sudo -i pkgadd -a /tmp/nocheck -d /media/VBOXADDITIONS_*/VBoxSolarisAdditions.pkg +fi diff --git a/packer_templates/scripts/suse/cleanup_suse.sh b/packer_templates/scripts/suse/cleanup_suse.sh new file mode 100644 index 0000000..9100c3e --- /dev/null +++ b/packer_templates/scripts/suse/cleanup_suse.sh @@ -0,0 +1,32 @@ +#!/bin/bash -eux + +echo "remove some bogus packages we don't need" +zypper -n rm -u --clean-deps gcc kernel-default-devel wallpaper-branding release-notes sound-theme-freedesktop || true # don't fail if zypper fails (because it does sometimes) + +echo "cleanup all the downloaded RPMs" +zypper clean --all + +echo "clean up network interface persistence" +rm -f /etc/udev/rules.d/70-persistent-net.rules; +touch /etc/udev/rules.d/75-persistent-net-generator.rules; + +echo "truncate any logs that have built up during the install" +find /var/log/ -type f -name "*.log.*" -exec rm -rf {} \; +find /var/log -type f -exec truncate --size=0 {} \; + +echo "remove the contents of /tmp and /var/tmp" +rm -rf /tmp/* /var/tmp/* + +echo "blank netplan machine-id (DUID) so machines get unique ID generated on boot" +truncate -s 0 /etc/machine-id +if test -f /var/lib/dbus/machine-id +then + truncate -s 0 /var/lib/dbus/machine-id # if not symlinked to "/etc/machine-id" +fi + +echo "force a new random seed to be generated" +rm -f /var/lib/systemd/random-seed + +echo "clear the history so our install isn't there" +rm -f /root/.wget-hsts +export HISTSIZE=0 diff --git a/packer_templates/scripts/suse/remove-dvd-source_suse.sh b/packer_templates/scripts/suse/remove-dvd-source_suse.sh new file mode 100644 index 0000000..925a451 --- /dev/null +++ b/packer_templates/scripts/suse/remove-dvd-source_suse.sh @@ -0,0 +1,4 @@ +#!/bin/sh -eux + +zypper removerepo "$(zypper repos | grep 'SLES' | awk '{ print $3 }' | grep "^SLES")"; +exit 0 diff --git a/packer_templates/scripts/suse/repositories_suse.sh b/packer_templates/scripts/suse/repositories_suse.sh new file mode 100644 index 0000000..1e03ba3 --- /dev/null +++ b/packer_templates/scripts/suse/repositories_suse.sh @@ -0,0 +1,12 @@ +#!/bin/sh -eux + +version=$(grep VERSION= /etc/os-release | cut -f2 -d\" | cut -f1 -d\ ) + +zypper removerepo "openSUSE-${version}-0" + +zypper ar http://download.opensuse.org/distribution/leap/"${version}"/repo/oss/ openSUSE-Leap-"${version}"-Oss +zypper ar http://download.opensuse.org/distribution/leap/"${version}"/repo/non-oss/ openSUSE-Leap-"${version}"-Non-Oss +zypper ar http://download.opensuse.org/update/leap/"${version}"/oss/ openSUSE-Leap-"${version}"-Update +zypper ar http://download.opensuse.org/update/leap/"${version}"/non-oss/ openSUSE-Leap-"${version}"-Update-Non-Oss + +zypper refresh diff --git a/packer_templates/scripts/suse/sudoers_suse.sh b/packer_templates/scripts/suse/sudoers_suse.sh new file mode 100644 index 0000000..22e66fd --- /dev/null +++ b/packer_templates/scripts/suse/sudoers_suse.sh @@ -0,0 +1,5 @@ +#!/bin/sh -eux + +# update sudoers - can't do this in autoinst.xml +printf "\nupdate sudoers ..." +printf "vagrant ALL=(ALL) NOPASSWD: ALL\n" >> /etc/sudoers diff --git a/packer_templates/scripts/suse/unsupported-modules_suse.sh b/packer_templates/scripts/suse/unsupported-modules_suse.sh new file mode 100644 index 0000000..e62773e --- /dev/null +++ b/packer_templates/scripts/suse/unsupported-modules_suse.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +# Enable unsupported kernel modules, so vboxguest can install +echo 'allow_unsupported_modules 1' > /etc/modprobe.d/10-unsupported-modules.conf diff --git a/packer_templates/scripts/suse/update_suse.sh b/packer_templates/scripts/suse/update_suse.sh new file mode 100644 index 0000000..4da63d3 --- /dev/null +++ b/packer_templates/scripts/suse/update_suse.sh @@ -0,0 +1,6 @@ +#!/bin/sh -eux + +echo "updating all packages" +zypper update -y + +reboot diff --git a/packer_templates/scripts/suse/vagrant_group_suse.sh b/packer_templates/scripts/suse/vagrant_group_suse.sh new file mode 100644 index 0000000..ad82963 --- /dev/null +++ b/packer_templates/scripts/suse/vagrant_group_suse.sh @@ -0,0 +1,7 @@ +#!/bin/sh -eux + +# User 'vagrant' belogs to the 'users' group by default so we need to +# create a new group 'vagrant' and put our user there. + +groupadd -f vagrant +gpasswd -a vagrant vagrant diff --git a/packer_templates/scripts/suse/zypper-locks_suse.sh b/packer_templates/scripts/suse/zypper-locks_suse.sh new file mode 100644 index 0000000..a9e4e4f --- /dev/null +++ b/packer_templates/scripts/suse/zypper-locks_suse.sh @@ -0,0 +1,4 @@ +#!/bin/sh -eux + +# remove zypper locks on removed packages to avoid later dependency problems +zypper --non-interactive rl \* diff --git a/packer_templates/scripts/ubuntu/cleanup_ubuntu.sh b/packer_templates/scripts/ubuntu/cleanup_ubuntu.sh new file mode 100644 index 0000000..91f0565 --- /dev/null +++ b/packer_templates/scripts/ubuntu/cleanup_ubuntu.sh @@ -0,0 +1,106 @@ +#!/bin/sh -eux + +echo "remove linux-headers" +dpkg --list \ + | awk '{ print $2 }' \ + | grep 'linux-headers' \ + | xargs apt-get -y purge; + +echo "remove specific Linux kernels, such as linux-image-3.11.0-15-generic but keeps the current kernel and does not touch the virtual packages" +dpkg --list \ + | awk '{ print $2 }' \ + | grep 'linux-image-.*-generic' \ + | grep -v "$(uname -r)" \ + | xargs apt-get -y purge; + +echo "remove old kernel modules packages" +dpkg --list \ + | awk '{ print $2 }' \ + | grep 'linux-modules-.*-generic' \ + | grep -v "$(uname -r)" \ + | xargs apt-get -y purge; + +echo "remove linux-source package" +dpkg --list \ + | awk '{ print $2 }' \ + | grep linux-source \ + | xargs apt-get -y purge; + +echo "remove all development packages" +dpkg --list \ + | awk '{ print $2 }' \ + | grep -- '-dev\(:[a-z0-9]\+\)\?$' \ + | xargs apt-get -y purge; + +echo "remove docs packages" +dpkg --list \ + | awk '{ print $2 }' \ + | grep -- '-doc$' \ + | xargs apt-get -y purge; + +echo "remove X11 libraries" +apt-get -y purge libx11-data xauth libxmuu1 libxcb1 libx11-6 libxext6; + +echo "remove obsolete networking packages" +apt-get -y purge ppp pppconfig pppoeconf; + +echo "remove packages we don't need" +apt-get -y purge popularity-contest command-not-found friendly-recovery bash-completion laptop-detect motd-news-config usbutils grub-legacy-ec2 + +# 22.04+ don't have this +echo "remove the fonts-ubuntu-font-family-console" +apt-get -y purge fonts-ubuntu-font-family-console || true; + +# 21.04+ don't have this +echo "remove the installation-report" +apt-get -y purge popularity-contest installation-report || true; + +echo "remove the console font" +apt-get -y purge fonts-ubuntu-console || true; + +echo "removing command-not-found-data" +# 19.10+ don't have this package so fail gracefully +apt-get -y purge command-not-found-data || true; + +# Exclude the files we don't need w/o uninstalling linux-firmware +echo "Setup dpkg excludes for linux-firmware" +cat <<_EOF_ | cat >> /etc/dpkg/dpkg.cfg.d/excludes +#BENTO-BEGIN +path-exclude=/lib/firmware/* +path-exclude=/usr/share/doc/linux-firmware/* +#BENTO-END +_EOF_ + +echo "delete the massive firmware files" +rm -rf /lib/firmware/* +rm -rf /usr/share/doc/linux-firmware/* + +echo "autoremoving packages and cleaning apt data" +apt-get -y autoremove; +apt-get -y clean; + +echo "remove /usr/share/doc/" +rm -rf /usr/share/doc/* + +echo "remove /var/cache" +find /var/cache -type f -exec rm -rf {} \; + +echo "truncate any logs that have built up during the install" +find /var/log -type f -exec truncate --size=0 {} \; + +echo "blank netplan machine-id (DUID) so machines get unique ID generated on boot" +truncate -s 0 /etc/machine-id +if test -f /var/lib/dbus/machine-id +then + truncate -s 0 /var/lib/dbus/machine-id # if not symlinked to "/etc/machine-id" +fi + +echo "remove the contents of /tmp and /var/tmp" +rm -rf /tmp/* /var/tmp/* + +echo "force a new random seed to be generated" +rm -f /var/lib/systemd/random-seed + +echo "clear the history so our install isn't there" +rm -f /root/.wget-hsts +export HISTSIZE=0 diff --git a/packer_templates/scripts/ubuntu/hyperv_ubuntu.sh b/packer_templates/scripts/ubuntu/hyperv_ubuntu.sh new file mode 100755 index 0000000..1c3dc61 --- /dev/null +++ b/packer_templates/scripts/ubuntu/hyperv_ubuntu.sh @@ -0,0 +1,7 @@ +#!/bin/sh -eux + +case "$PACKER_BUILDER_TYPE" in +hyperv-iso) + echo "installing packaging for hyper-v" + apt-get -y install linux-image-virtual linux-tools-virtual linux-cloud-tools-virtual; +esac diff --git a/packer_templates/scripts/ubuntu/networking_ubuntu.sh b/packer_templates/scripts/ubuntu/networking_ubuntu.sh new file mode 100644 index 0000000..26aed00 --- /dev/null +++ b/packer_templates/scripts/ubuntu/networking_ubuntu.sh @@ -0,0 +1,23 @@ +#!/bin/sh -eux + +ubuntu_version="$(lsb_release -r | awk '{print $2}')"; +major_version="$(echo "$ubuntu_version" | awk -F. '{print $1}')"; + +if [ "$major_version" -ge "18" ]; then +echo "Create netplan config for eth0" +cat </etc/netplan/01-netcfg.yaml; +network: + version: 2 + ethernets: + eth0: + dhcp4: true +EOF +else + # Adding a 2 sec delay to the interface up, to make the dhclient happy + echo "pre-up sleep 2" >> /etc/network/interfaces; +fi + +# Disable Predictable Network Interface names and use eth0 +[ -e /etc/network/interfaces ] && sed -i 's/en[[:alnum:]]*/eth0/g' /etc/network/interfaces; +sed -i 's/GRUB_CMDLINE_LINUX="\(.*\)"/GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0 \1"/g' /etc/default/grub; +update-grub; diff --git a/packer_templates/scripts/ubuntu/sudoers_ubuntu.sh b/packer_templates/scripts/ubuntu/sudoers_ubuntu.sh new file mode 100644 index 0000000..e56537f --- /dev/null +++ b/packer_templates/scripts/ubuntu/sudoers_ubuntu.sh @@ -0,0 +1,7 @@ +#!/bin/sh -eux + +sed -i -e '/Defaults\s\+env_reset/a Defaults\texempt_group=sudo' /etc/sudoers; + +# Set up password-less sudo for the vagrant user +echo 'vagrant ALL=(ALL) NOPASSWD:ALL' >/etc/sudoers.d/99_vagrant; +chmod 440 /etc/sudoers.d/99_vagrant; diff --git a/packer_templates/scripts/ubuntu/systemd_ubuntu.sh b/packer_templates/scripts/ubuntu/systemd_ubuntu.sh new file mode 100644 index 0000000..2d1b5a7 --- /dev/null +++ b/packer_templates/scripts/ubuntu/systemd_ubuntu.sh @@ -0,0 +1,4 @@ +#!/bin/sh -eux + +# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=751636 +apt-get install libpam-systemd diff --git a/packer_templates/scripts/ubuntu/update_ubuntu.sh b/packer_templates/scripts/ubuntu/update_ubuntu.sh new file mode 100644 index 0000000..79ca01b --- /dev/null +++ b/packer_templates/scripts/ubuntu/update_ubuntu.sh @@ -0,0 +1,35 @@ +#!/bin/sh -eux +export DEBIAN_FRONTEND=noninteractive + +echo "disable release-upgrades" +sed -i.bak 's/^Prompt=.*$/Prompt=never/' /etc/update-manager/release-upgrades; + +echo "disable systemd apt timers/services" +systemctl stop apt-daily.timer; +systemctl stop apt-daily-upgrade.timer; +systemctl disable apt-daily.timer; +systemctl disable apt-daily-upgrade.timer; +systemctl mask apt-daily.service; +systemctl mask apt-daily-upgrade.service; +systemctl daemon-reload; + +# Disable periodic activities of apt to be safe +cat </etc/apt/apt.conf.d/10periodic; +APT::Periodic::Enable "0"; +APT::Periodic::Update-Package-Lists "0"; +APT::Periodic::Download-Upgradeable-Packages "0"; +APT::Periodic::AutocleanInterval "0"; +APT::Periodic::Unattended-Upgrade "0"; +EOF + +echo "remove the unattended-upgrades and ubuntu-release-upgrader-core packages" +rm -rf /var/log/unattended-upgrades; +apt-get -y purge unattended-upgrades ubuntu-release-upgrader-core; + +echo "update the package list" +apt-get -y update; + +echo "upgrade all installed packages incl. kernel and kernel headers" +apt-get -y dist-upgrade -o Dpkg::Options::="--force-confnew"; + +reboot diff --git a/packer_templates/scripts/windows/base_setup.ps1 b/packer_templates/scripts/windows/base_setup.ps1 new file mode 100644 index 0000000..c448e0f --- /dev/null +++ b/packer_templates/scripts/windows/base_setup.ps1 @@ -0,0 +1,54 @@ +Write-Host "Performing the WinRM setup necessary to get the host ready for packer to run Chef..." + +# Make 100% sure we prevent Packer from connecting to WinRM while we +# attempt to configure everything +Disable-NetFirewallRule -DisplayGroup 'Windows Remote Management' + +# Disable UAC +Set-ItemProperty -Path "registry::HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System" -Name "EnableLUA" -Value 0 + +# parts of this are from https://github.com/luciusbono/Packer-Windows10/blob/master/configure-winrm.ps1 +# and https://github.com/rgl/windows-2016-vagrant/blob/master/winrm.ps1 + +# Supress network location Prompt +New-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Network\NewNetworkWindowOff" -Force + +# The above suppresses the prompt but defaults to "Public" which prevents WinRM from being enabled even with the SkipNetworkProfileCheck arg +# This command sets any network connections detected to Private to allow WinRM to be configured and started +Get-NetConnectionProfile | Set-NetConnectionProfile -NetworkCategory "Private" + +# Does a lot: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/enable-psremoting?view=powershell-6 +Enable-PSRemoting -SkipNetworkProfileCheck -Force +# May not be necessary since we set the profile to Private above +Set-NetFirewallRule -Name "WINRM-HTTP-In-TCP" -RemoteAddress Any # allow winrm over public profile interfaces + +Write-Host '* Deleting any pre-existing listeners' +winrm delete winrm/config/listener?Address=*+Transport=HTTP 2>$Null +winrm delete winrm/config/listener?Address=*+Transport=HTTPS 2>$Null +Write-Host '* Creating an HTTP listener' +winrm create winrm/config/listener?Address=*+Transport=HTTP | Out-Null +winrm create winrm/config/listener?Address=*+Transport=HTTPS | Out-Null + +winrm set winrm/config '@{MaxTimeoutms="1800000"}' +winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="2048"}' +winrm set winrm/config/service '@{AllowUnencrypted="true"}' +winrm set winrm/config/service/auth '@{Basic="true"}' +winrm set winrm/config/client/auth '@{Basic="true"}' + +# Restart WinRM service +Stop-Service -Name "winrm" +Set-Service -Name "winrm" -StartupType "Automatic" +Start-Service -Name "winrm" + +# Enable WinRM in Firewall for any remote address +Get-NetFirewallRule -DisplayGroup "Windows Remote Management" | Get-NetFirewallAddressFilter | Set-NetFirewallAddressFilter -RemoteAddress Any +Enable-NetFirewallRule -DisplayGroup "Windows Remote Management" + +# Reset auto logon count +# https://docs.microsoft.com/en-us/windows-hardware/customize/desktop/unattend/microsoft-windows-shell-setup-autologon-logoncount#logoncount-known-issue +Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' -Name AutoLogonCount -Value 0 + +# Allow time to view output before window is closed +Start-Sleep -Seconds 2 + +exit 0 diff --git a/packer_templates/scripts/windows/cleanup.ps1 b/packer_templates/scripts/windows/cleanup.ps1 new file mode 100644 index 0000000..23b3e07 --- /dev/null +++ b/packer_templates/scripts/windows/cleanup.ps1 @@ -0,0 +1,43 @@ +Write-Host "Uninstalling Chef..." +$app = Get-WmiObject -Class Win32_Product | Where-Object { + $_.Name -match "Chef" +} +$app.Uninstall() + +Write-Host "Removing leftover Chef files..." +Remove-Item "C:\Opscode\" -Recurse -Force -ErrorAction SilentlyContinue +Remove-Item "C:\Chef\" -Recurse -Force -ErrorAction SilentlyContinue + +Write-Host "Cleaning Temp Files..." +try { + Takeown /d Y /R /f "C:\Windows\Temp\*" + Icacls "C:\Windows\Temp\*" /GRANT:r administrators:F /T /c /q 2>&1 + Remove-Item "C:\Windows\Temp\*" -Recurse -Force -ErrorAction SilentlyContinue +} catch { } + +Write-Host "Optimizing Drive" +Optimize-Volume -DriveLetter C + +Write-Host "Wiping empty space on disk..." +$FilePath="c:\zero.tmp" +$Volume = Get-WmiObject win32_logicaldisk -filter "DeviceID='C:'" +$ArraySize= 64kb +$SpaceToLeave= $Volume.Size * 0.05 +$FileSize= $Volume.FreeSpace - $SpacetoLeave +$ZeroArray= new-object byte[]($ArraySize) + +$Stream= [io.File]::OpenWrite($FilePath) +try { + $CurFileSize = 0 + while($CurFileSize -lt $FileSize) { + $Stream.Write($ZeroArray,0, $ZeroArray.Length) + $CurFileSize +=$ZeroArray.Length + } +} +finally { + if($Stream) { + $Stream.Close() + } +} + +Remove-Item $FilePath diff --git a/packer_templates/scripts/windows/disable-windows-defender.ps1 b/packer_templates/scripts/windows/disable-windows-defender.ps1 new file mode 100644 index 0000000..7a69552 --- /dev/null +++ b/packer_templates/scripts/windows/disable-windows-defender.ps1 @@ -0,0 +1,49 @@ +#MIT License +# +#Copyright (c) 2017 Rui Lopes +# +#Permission is hereby granted, free of charge, to any person obtaining a copy +#of this software and associated documentation files (the "Software"), to deal +#in the Software without restriction, including without limitation the rights +#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +#copies of the Software, and to permit persons to whom the Software is +#furnished to do so, subject to the following conditions: +# +#The above copyright notice and this permission notice shall be included in all +#copies or substantial portions of the Software. +# +#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +#SOFTWARE. + +Set-StrictMode -Version Latest +$ProgressPreference = 'SilentlyContinue' +$ErrorActionPreference = 'Stop' +trap { + Write-Host + Write-Host "ERROR: $_" + ($_.ScriptStackTrace -split '\r?\n') -replace '^(.*)$','ERROR: $1' | Write-Host + ($_.Exception.ToString() -split '\r?\n') -replace '^(.*)$','ERROR EXCEPTION: $1' | Write-Host + Write-Host + Write-Host 'Sleeping for 60m to give you time to look around the virtual machine before self-destruction...' + Start-Sleep -Seconds (60*60) + Exit 1 +} + +if (Get-Command -ErrorAction SilentlyContinue Uninstall-WindowsFeature) { + # for Windows Server. + Get-WindowsFeature 'Windows-Defender*' | Uninstall-WindowsFeature +} else { + # for Windows Client. + Set-MpPreference ` + -DisableRealtimeMonitoring $true ` + -ExclusionPath @('C:\', 'D:\') + Set-ItemProperty ` + -Path 'HKLM:/SOFTWARE/Policies/Microsoft/Windows Defender' ` + -Name DisableAntiSpyware ` + -Value 1 +} diff --git a/packer_templates/scripts/windows/disable-windows-updates.ps1 b/packer_templates/scripts/windows/disable-windows-updates.ps1 new file mode 100644 index 0000000..ec3aee7 --- /dev/null +++ b/packer_templates/scripts/windows/disable-windows-updates.ps1 @@ -0,0 +1,90 @@ +#MIT License +# +#Copyright (c) 2017 Rui Lopes +# +#Permission is hereby granted, free of charge, to any person obtaining a copy +#of this software and associated documentation files (the "Software"), to deal +#in the Software without restriction, including without limitation the rights +#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +#copies of the Software, and to permit persons to whom the Software is +#furnished to do so, subject to the following conditions: +# +#The above copyright notice and this permission notice shall be included in all +#copies or substantial portions of the Software. +# +#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +#SOFTWARE. + +Set-StrictMode -Version Latest +$ProgressPreference = 'SilentlyContinue' +$ErrorActionPreference = 'Stop' +trap { + Write-Host + Write-Host "ERROR: $_" + ($_.ScriptStackTrace -split '\r?\n') -replace '^(.*)$','ERROR: $1' | Write-Host + ($_.Exception.ToString() -split '\r?\n') -replace '^(.*)$','ERROR EXCEPTION: $1' | Write-Host + Write-Host + Write-Host 'Sleeping for 60m to give you time to look around the virtual machine before self-destruction...' + Start-Sleep -Seconds (60*60) + Exit 1 +} + +# disable automatic updates. +# XXX this does not seem to work anymore. +# see How to configure automatic updates by using Group Policy or registry settings +# at https://support.microsoft.com/en-us/help/328010 +function New-Directory($path) { + $p, $components = $path -split '[\\/]' + $components | ForEach-Object { + $p = "$p\$_" + if (!(Test-Path $p)) { + New-Item -ItemType Directory $p | Out-Null + } + } + $null +} +$auPath = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU' +New-Directory $auPath +# set NoAutoUpdate. +# 0: Automatic Updates is enabled (default). +# 1: Automatic Updates is disabled. +New-ItemProperty ` + -Path $auPath ` + -Name NoAutoUpdate ` + -Value 1 ` + -PropertyType DWORD ` + -Force ` + | Out-Null +# set AUOptions. +# 1: Keep my computer up to date has been disabled in Automatic Updates. +# 2: Notify of download and installation. +# 3: Automatically download and notify of installation. +# 4: Automatically download and scheduled installation. +New-ItemProperty ` + -Path $auPath ` + -Name AUOptions ` + -Value 2 ` + -PropertyType DWORD ` + -Force ` + | Out-Null + +# disable Windows Update Delivery Optimization. +# NB this applies to Windows 10. +# 0: Disabled +# 1: PCs on my local network +# 3: PCs on my local network, and PCs on the Internet +$deliveryOptimizationPath = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config' +if (Test-Path $deliveryOptimizationPath) { + New-ItemProperty ` + -Path $deliveryOptimizationPath ` + -Name DODownloadMode ` + -Value 0 ` + -PropertyType DWORD ` + -Force ` + | Out-Null +} diff --git a/packer_templates/scripts/windows/eject-media.ps1 b/packer_templates/scripts/windows/eject-media.ps1 new file mode 100644 index 0000000..9bea3a0 --- /dev/null +++ b/packer_templates/scripts/windows/eject-media.ps1 @@ -0,0 +1,60 @@ +#MIT License +# +#Copyright (c) 2017 Rui Lopes +# +#Permission is hereby granted, free of charge, to any person obtaining a copy +#of this software and associated documentation files (the "Software"), to deal +#in the Software without restriction, including without limitation the rights +#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +#copies of the Software, and to permit persons to whom the Software is +#furnished to do so, subject to the following conditions: +# +#The above copyright notice and this permission notice shall be included in all +#copies or substantial portions of the Software. +# +#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +#SOFTWARE. + +Set-StrictMode -Version Latest +$ProgressPreference = 'SilentlyContinue' +$ErrorActionPreference = 'Stop' +trap { + Write-Host + Write-Host "ERROR: $_" + ($_.ScriptStackTrace -split '\r?\n') -replace '^(.*)$','ERROR: $1' | Write-Host + ($_.Exception.ToString() -split '\r?\n') -replace '^(.*)$','ERROR EXCEPTION: $1' | Write-Host + Write-Host + Write-Host 'Sleeping for 60m to give you time to look around the virtual machine before self-destruction...' + Start-Sleep -Seconds (60*60) + Exit 1 +} + + +# +# enable TLS 1.2. + +[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol ` + -bor [Net.SecurityProtocolType]::Tls12 + + +# +# eject removable volume media. + +Write-Host 'Downloaing EjectVolumeMedia...' +$ejectVolumeMediaExeUrl = 'https://github.com/rgl/EjectVolumeMedia/releases/download/v1.0.0/EjectVolumeMedia.exe' +$ejectVolumeMediaExeHash = 'f7863394085e1b3c5aa999808b012fba577b4a027804ea292abf7962e5467ba0' +$ejectVolumeMediaExe = "$env:TEMP\EjectVolumeMedia.exe" +Invoke-WebRequest $ejectVolumeMediaExeUrl -OutFile $ejectVolumeMediaExe +$ejectVolumeMediaExeActualHash = (Get-FileHash $ejectVolumeMediaExe -Algorithm SHA256).Hash +if ($ejectVolumeMediaExeActualHash -ne $ejectVolumeMediaExeHash) { + throw "the $ejectVolumeMediaExeUrl file hash $ejectVolumeMediaExeActualHash does not match the expected $ejectVolumeMediaExeHash" +} + +Get-Volume | Where-Object {$_.DriveType -ne 'Fixed' -and $_.DriveLetter} | ForEach-Object { + &$ejectVolumeMediaExe $_.DriveLetter +} diff --git a/packer_templates/scripts/windows/enable-remote-desktop.ps1 b/packer_templates/scripts/windows/enable-remote-desktop.ps1 new file mode 100644 index 0000000..1eed756 --- /dev/null +++ b/packer_templates/scripts/windows/enable-remote-desktop.ps1 @@ -0,0 +1,43 @@ +#MIT License +# +#Copyright (c) 2017 Rui Lopes +# +#Permission is hereby granted, free of charge, to any person obtaining a copy +#of this software and associated documentation files (the "Software"), to deal +#in the Software without restriction, including without limitation the rights +#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +#copies of the Software, and to permit persons to whom the Software is +#furnished to do so, subject to the following conditions: +# +#The above copyright notice and this permission notice shall be included in all +#copies or substantial portions of the Software. +# +#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +#SOFTWARE. + +Set-StrictMode -Version Latest +$ProgressPreference = 'SilentlyContinue' +$ErrorActionPreference = 'Stop' +trap { + Write-Host + Write-Host "ERROR: $_" + ($_.ScriptStackTrace -split '\r?\n') -replace '^(.*)$','ERROR: $1' | Write-Host + ($_.Exception.ToString() -split '\r?\n') -replace '^(.*)$','ERROR EXCEPTION: $1' | Write-Host + Write-Host + Write-Host 'Sleeping for 60m to give you time to look around the virtual machine before self-destruction...' + Start-Sleep -Seconds (60*60) + Exit 1 +} + +Write-Host 'Enabling Remote Desktop...' +Set-ItemProperty ` + -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' ` + -Name fDenyTSConnections ` + -Value 0 +Enable-NetFirewallRule ` + -DisplayGroup 'Remote Desktop' diff --git a/packer_templates/scripts/windows/optimize.ps1 b/packer_templates/scripts/windows/optimize.ps1 new file mode 100644 index 0000000..86877e6 --- /dev/null +++ b/packer_templates/scripts/windows/optimize.ps1 @@ -0,0 +1,216 @@ +#MIT License +# +#Copyright (c) 2017 Rui Lopes +# +#Permission is hereby granted, free of charge, to any person obtaining a copy +#of this software and associated documentation files (the "Software"), to deal +#in the Software without restriction, including without limitation the rights +#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +#copies of the Software, and to permit persons to whom the Software is +#furnished to do so, subject to the following conditions: +# +#The above copyright notice and this permission notice shall be included in all +#copies or substantial portions of the Software. +# +#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +#SOFTWARE. + +Set-StrictMode -Version Latest +$ProgressPreference = 'SilentlyContinue' +$ErrorActionPreference = 'Stop' +trap { + Write-Host + Write-Host "ERROR: $_" + ($_.ScriptStackTrace -split '\r?\n') -replace '^(.*)$','ERROR: $1' | Write-Host + ($_.Exception.ToString() -split '\r?\n') -replace '^(.*)$','ERROR EXCEPTION: $1' | Write-Host + Write-Host + Write-Host 'Sleeping for 60m to give you time to look around the virtual machine before self-destruction...' + Start-Sleep -Seconds (60*60) + Exit 1 +} + + +# +# enable TLS 1.2. + +[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol ` + -bor [Net.SecurityProtocolType]::Tls12 + + +# +# run automatic maintenance. + +Add-Type @' +using System; +using System.Runtime.InteropServices; + +public static class Windows +{ + [DllImport("kernel32", SetLastError=true)] + public static extern UInt64 GetTickCount64(); + + public static TimeSpan GetUptime() + { + return TimeSpan.FromMilliseconds(GetTickCount64()); + } +} +'@ + +function Wait-Condition { + param( + [scriptblock]$Condition, + [int]$DebounceSeconds=15 + ) + process { + $begin = [Windows]::GetUptime() + do { + Start-Sleep -Seconds 3 + try { + $result = &$Condition + } catch { + $result = $false + } + if (-not $result) { + $begin = [Windows]::GetUptime() + continue + } + } while ((([Windows]::GetUptime()) - $begin).TotalSeconds -lt $DebounceSeconds) + } +} + +function Get-ScheduledTasks() { + $s = New-Object -ComObject 'Schedule.Service' + try { + $s.Connect() + Get-ScheduledTasksInternal $s.GetFolder('\') + } finally { + [System.Runtime.Interopservices.Marshal]::ReleaseComObject($s) | Out-Null + } +} + +function Get-ScheduledTasksInternal($Folder) { + $Folder.GetTasks(0) + $Folder.GetFolders(0) | ForEach-Object { + Get-ScheduledTasksInternal $_ + } +} + +function Test-IsMaintenanceTask([xml]$definition) { + # see MaintenanceSettings (maintenanceSettingsType) Element at https://msdn.microsoft.com/en-us/library/windows/desktop/hh832151(v=vs.85).aspx + $ns = New-Object System.Xml.XmlNamespaceManager($definition.NameTable) + $ns.AddNamespace('t', $definition.DocumentElement.NamespaceURI) + $null -ne $definition.SelectSingleNode("/t:Task/t:Settings/t:MaintenanceSettings", $ns) +} + +Write-Host 'Running Automatic Maintenance...' +MSchedExe.exe Start +Wait-Condition {@(Get-ScheduledTasks | Where-Object {($_.State -ge 4) -and (Test-IsMaintenanceTask $_.XML)}).Count -eq 0} -DebounceSeconds 60 + + +# +# generate the .net frameworks native images. +# NB this is normally done in the Automatic Maintenance step, but for +# some reason, sometimes its not. +# see https://docs.microsoft.com/en-us/dotnet/framework/tools/ngen-exe-native-image-generator + +Get-ChildItem "$env:windir\Microsoft.NET\*\*\ngen.exe" | ForEach-Object { + Write-Host "Generating the .NET Framework native images with $_..." + &$_ executeQueuedItems /nologo /silent +} + + +# +# remove temporary files. +# NB we ignore the packer generated files so it won't complain in the output. + +Write-Host 'Stopping services that might interfere with temporary file removal...' +function Stop-ServiceForReal($name) { + while ($true) { + Stop-Service -ErrorAction SilentlyContinue $name + if ((Get-Service $name).Status -eq 'Stopped') { + break + } + } +} +Stop-ServiceForReal TrustedInstaller # Windows Modules Installer +Stop-ServiceForReal wuauserv # Windows Update +Stop-ServiceForReal BITS # Background Intelligent Transfer Service +@( + "$env:LOCALAPPDATA\Temp\*" + "$env:windir\Temp\*" + "$env:windir\Logs\*" + "$env:windir\Panther\*" + "$env:windir\WinSxS\ManifestCache\*" + "$env:windir\SoftwareDistribution\Download" +) | Where-Object {Test-Path $_} | ForEach-Object { + Write-Host "Removing temporary files $_..." + try { + takeown.exe /D Y /R /F $_ | Out-Null + icacls.exe $_ /grant:r Administrators:F /T /C /Q 2>&1 | Out-Null + } catch { + Write-Host "Ignoring taking ownership of temporary files error: $_" + } + try { + Remove-Item $_ -Exclude 'packer-*' -Recurse -Force -ErrorAction SilentlyContinue | Out-Null + } catch { + Write-Host "Ignoring failure to remove files error: $_" + } +} + + +# +# cleanup the WinSxS folder. + +# NB even thou the automatic maintenance includes a component cleanup task, +# it will not clean everything, as such, dism will clean the rest. +# NB to analyse the used space use: dism.exe /Online /Cleanup-Image /AnalyzeComponentStore +# see https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/clean-up-the-winsxs-folder +Write-Host 'Cleaning up the WinSxS folder...' +dism.exe /Online /Quiet /Cleanup-Image /StartComponentCleanup /ResetBase +if ($LASTEXITCODE) { + throw "Failed with Exit Code $LASTEXITCODE" +} + +# NB even after cleaning up the WinSxS folder the "Backups and Disabled Features" +# field of the analysis report will display a non-zero number because the +# disabled features packages are still on disk. you can remove them with: +# Get-WindowsOptionalFeature -Online ` +# | Where-Object {$_.State -eq 'Disabled'} ` +# | ForEach-Object { +# Write-Host "Removing feature $($_.FeatureName)..." +# dism.exe /Online /Quiet /Disable-Feature "/FeatureName:$($_.FeatureName)" /Remove +# } +# NB a removed feature can still be installed from other sources (e.g. windows update). +Write-Host 'Analyzing the WinSxS folder...' +dism.exe /Online /Cleanup-Image /AnalyzeComponentStore + + +# +# reclaim the free disk space. + +Write-Host 'Reclaiming the free disk space...' +$results = defrag.exe C: /H /L +if ($results -eq 'The operation completed successfully.') +{ + $results +} +else +{ + if ((Get-CimInstance Win32_OperatingSystem).version -eq "6.3.9600") + { + return + } + else + { + Write-Host 'Zero filling the free disk space...' + (New-Object System.Net.WebClient).DownloadFile('https://download.sysinternals.com/files/SDelete.zip', "$env:TEMP\SDelete.zip") + Expand-Archive "$env:TEMP\SDelete.zip" $env:TEMP + Remove-Item "$env:TEMP\SDelete.zip" + &"$env:TEMP\sdelete64.exe" -accepteula -z C: + } +} diff --git a/packer_templates/scripts/windows/provision-winrm.ps1 b/packer_templates/scripts/windows/provision-winrm.ps1 new file mode 100644 index 0000000..a664053 --- /dev/null +++ b/packer_templates/scripts/windows/provision-winrm.ps1 @@ -0,0 +1,100 @@ +#MIT License +# +#Copyright (c) 2017 Rui Lopes +# +#Permission is hereby granted, free of charge, to any person obtaining a copy +#of this software and associated documentation files (the "Software"), to deal +#in the Software without restriction, including without limitation the rights +#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +#copies of the Software, and to permit persons to whom the Software is +#furnished to do so, subject to the following conditions: +# +#The above copyright notice and this permission notice shall be included in all +#copies or substantial portions of the Software. +# +#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +#SOFTWARE. + +Set-StrictMode -Version Latest +$ProgressPreference = 'SilentlyContinue' +$ErrorActionPreference = 'Stop' +trap { + Write-Host + Write-Host "ERROR: $_" + ($_.ScriptStackTrace -split '\r?\n') -replace '^(.*)$','ERROR: $1' | Write-Host + ($_.Exception.ToString() -split '\r?\n') -replace '^(.*)$','ERROR EXCEPTION: $1' | Write-Host + Write-Host + Write-Host 'Sleeping for 60m to give you time to look around the virtual machine before self-destruction...' + Start-Sleep -Seconds (60*60) + Exit 1 +} + +## for troubleshoot purposes, save this script output to a file. +#Start-Transcript C:\winrm-autounattend.txt + +## for troubleshoot purposes, save the current user details. this will be later displayed by provision.ps1. +#whoami /all >C:\whoami-autounattend.txt + +if (![Environment]::Is64BitProcess) { + throw 'this must run in a 64-bit PowerShell session' +} + +if (!(New-Object System.Security.Principal.WindowsPrincipal( + [Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole( + [Security.Principal.WindowsBuiltInRole]::Administrator)) { + throw 'this must run with Administrator privileges (e.g. in a elevated shell session)' +} + +# move all (non-domain) network interfaces into the private profile to make winrm happy (it needs at +# least one private interface; for vagrant its enough to configure the first network interface). +# NB in windows server it would be enough to call winrm -force argument, but +# in windows client 10, we must set the network interface profile. +Get-NetConnectionProfile ` + | Where-Object {$_.NetworkCategory -ne 'DomainAuthenticated'} ` + | Set-NetConnectionProfile -NetworkCategory Private + +# configure WinRM. +Write-Output 'Configuring WinRM...' +winrm quickconfig -quiet +winrm set winrm/config/service '@{AllowUnencrypted="true"}' +winrm set winrm/config/service/auth '@{Basic="true"}' +winrm set winrm/config/service/auth '@{CredSSP="true"}' +# make sure the WinRM service startup type is delayed-auto +# even when the default config is auto (e.g. Windows 2019 +# changed that default). +# WARN do not be tempted to change the default WinRM service startup type from +# delayed-auto to auto, as the later proved to be unreliable. +$result = sc.exe config WinRM start= delayed-auto +if ($result -ne '[SC] ChangeServiceConfig SUCCESS') { + throw "sc.exe config failed with $result" +} + +# dump the WinRM configuration. +Write-Output 'WinRM Configuration:' +winrm enumerate winrm/config/listener +winrm get winrm/config +winrm id + +# disable UAC remote restrictions. +# see https://support.microsoft.com/en-us/help/951016/description-of-user-account-control-and-remote-restrictions-in-windows +# see https://docs.microsoft.com/en-us/windows/desktop/wmisdk/user-account-control-and-wmi#handling-remote-connections-under-uac +New-ItemProperty ` + -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System' ` + -Name LocalAccountTokenFilterPolicy ` + -Value 1 ` + -Force ` + | Out-Null + +# make sure winrm can be accessed from any network location. +New-NetFirewallRule ` + -DisplayName WINRM-HTTP-In-TCP-VAGRANT ` + -Direction Inbound ` + -Action Allow ` + -Protocol TCP ` + -LocalPort 5985 ` + | Out-Null diff --git a/packer_templates/scripts/windows/provision.ps1 b/packer_templates/scripts/windows/provision.ps1 new file mode 100644 index 0000000..1fd0979 --- /dev/null +++ b/packer_templates/scripts/windows/provision.ps1 @@ -0,0 +1,135 @@ +#MIT License +# +#Copyright (c) 2017 Rui Lopes +# +#Permission is hereby granted, free of charge, to any person obtaining a copy +#of this software and associated documentation files (the "Software"), to deal +#in the Software without restriction, including without limitation the rights +#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +#copies of the Software, and to permit persons to whom the Software is +#furnished to do so, subject to the following conditions: +# +#The above copyright notice and this permission notice shall be included in all +#copies or substantial portions of the Software. +# +#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +#SOFTWARE. + +Set-StrictMode -Version Latest +$ProgressPreference = 'SilentlyContinue' +$ErrorActionPreference = 'Stop' +trap { + #Write-Host + #Write-Host 'whoami from autounattend:' + #Get-Content C:\whoami-autounattend.txt | ForEach-Object { Write-Host "whoami from autounattend: $_" } + #Write-Host 'whoami from current WinRM session:' + #whoami /all >C:\whoami-winrm.txt + #Get-Content C:\whoami-winrm.txt | ForEach-Object { Write-Host "whoami from winrm: $_" } + Write-Host + Write-Host "ERROR: $_" + ($_.ScriptStackTrace -split '\r?\n') -replace '^(.*)$','ERROR: $1' | Write-Host + ($_.Exception.ToString() -split '\r?\n') -replace '^(.*)$','ERROR EXCEPTION: $1' | Write-Host + Write-Host + Write-Host 'Sleeping for 60m to give you time to look around the virtual machine before self-destruction...' + Start-Sleep -Seconds (60*60) + Exit 1 +} + +# enable TLS 1.2. +[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol ` + -bor [Net.SecurityProtocolType]::Tls12 + +if (![Environment]::Is64BitProcess) { + throw 'this must run in a 64-bit PowerShell session' +} + +if (!(New-Object System.Security.Principal.WindowsPrincipal( + [Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole( + [Security.Principal.WindowsBuiltInRole]::Administrator)) { + throw 'this must run with Administrator privileges (e.g. in a elevated shell session)' +} + +Add-Type -A System.IO.Compression.FileSystem + +# install Guest Additions. +$systemVendor = (Get-CimInstance -ClassName Win32_ComputerSystemProduct -Property Vendor).Vendor +if ($systemVendor -eq 'QEMU') { + $guestToolsPath = "e:\drivers\virtio-win-guest-tools.exe" + $guestTools = "$env:TEMP\$(Split-Path -Leaf $guestToolsPath)" + $guestToolsLog = "$guestTools.log" + Write-Host 'Installing the guest tools...' + &$guestTools /install /norestart /quiet /log $guestToolsLog | Out-String -Stream + if ($LASTEXITCODE) { + throw "failed to install guest tools with exit code $LASTEXITCODE" + } + Write-Host "Done installing the guest tools." +} elseif ($systemVendor -eq 'innotek GmbH') { + Write-Host 'Importing the Oracle (for VirtualBox) certificate as a Trusted Publisher...' + E:\cert\VBoxCertUtil.exe add-trusted-publisher E:\cert\vbox-sha1.cer + if ($LASTEXITCODE) { + throw "failed to import certificate with exit code $LASTEXITCODE" + } + + Write-Host 'Installing the VirtualBox Guest Additions...' + E:\VBoxWindowsAdditions-amd64.exe /S | Out-String -Stream + if ($LASTEXITCODE) { + throw "failed to install with exit code $LASTEXITCODE. Check the logs at C:\Program Files\Oracle\VirtualBox Guest Additions\install.log." + } +} elseif ($systemVendor -eq 'Microsoft Corporation') { + # do nothing. Hyper-V enlightments are already bundled with Windows. +} elseif ($systemVendor -eq 'VMware, Inc.') { + Write-Output 'Installing VMware Tools...' + # silent install without rebooting. + E:\setup64.exe /s /v '/qn reboot=r'| Out-String -Stream +} elseif ($systemVendor -eq 'Parallels Software International Inc.') { + Write-Host 'Installing the Parallels Tools for Guest VM...' + E:\PTAgent.exe /install_silent | Out-String -Stream + if ($LASTEXITCODE) { + throw "failed to install with exit code $LASTEXITCODE. Check the logs at C:\Program Files\Oracle\VirtualBox Guest Additions\install.log." + } +} else { + Write-Host "Cannot install Guest Additions: Unsupported system ($systemVendor)." +} + +Write-Host 'Setting the vagrant account properties...' +# see the ADS_USER_FLAG_ENUM enumeration at https://msdn.microsoft.com/en-us/library/aa772300(v=vs.85).aspx +$AdsScript = 0x00001 +$AdsAccountDisable = 0x00002 +$AdsNormalAccount = 0x00200 +$AdsDontExpirePassword = 0x10000 +$account = [ADSI]'WinNT://./vagrant' +$account.Userflags = $AdsNormalAccount -bor $AdsDontExpirePassword +$account.SetInfo() + +Write-Host 'Setting the Administrator account properties...' +$account = [ADSI]'WinNT://./Administrator' +$account.Userflags = $AdsNormalAccount -bor $AdsDontExpirePassword -bor $AdsAccountDisable +$account.SetInfo() + +Write-Host 'Disabling Automatic Private IP Addressing (APIPA)...' +Set-ItemProperty ` + -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters' ` + -Name IPAutoconfigurationEnabled ` + -Value 0 + +Write-Host 'Disabling IPv6...' +Set-ItemProperty ` + -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters' ` + -Name DisabledComponents ` + -Value 0xff + +Write-Host 'Disabling hibernation...' +powercfg /hibernate off + +Write-Host 'Setting the power plan to high performance...' +powercfg /setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c + +Write-Host 'Disabling the Windows Boot Manager menu...' +# NB to have the menu show with a lower timeout, run this instead: bcdedit /timeout 2 +# NB with a timeout of 2 you can still press F8 to show the boot manager menu. +bcdedit /set '{bootmgr}' displaybootmenu no diff --git a/packer_templates/scripts/windows/remove-apps.ps1 b/packer_templates/scripts/windows/remove-apps.ps1 new file mode 100644 index 0000000..3209a66 --- /dev/null +++ b/packer_templates/scripts/windows/remove-apps.ps1 @@ -0,0 +1,110 @@ +#MIT License +# +#Copyright (c) 2017 Rui Lopes +# +#Permission is hereby granted, free of charge, to any person obtaining a copy +#of this software and associated documentation files (the "Software"), to deal +#in the Software without restriction, including without limitation the rights +#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +#copies of the Software, and to permit persons to whom the Software is +#furnished to do so, subject to the following conditions: +# +#The above copyright notice and this permission notice shall be included in all +#copies or substantial portions of the Software. +# +#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +#SOFTWARE. + +Set-StrictMode -Version Latest +$ProgressPreference = 'SilentlyContinue' +$ErrorActionPreference = 'Stop' +trap { + Write-Host + Write-Host "ERROR: $_" + ($_.ScriptStackTrace -split '\r?\n') -replace '^(.*)$','ERROR: $1' | Write-Host + ($_.Exception.ToString() -split '\r?\n') -replace '^(.*)$','ERROR EXCEPTION: $1' | Write-Host + Write-Host + Write-Host 'Sleeping for 60m to give you time to look around the virtual machine before self-destruction...' + Start-Sleep -Seconds (60*60) + Exit 1 +} + +Write-Host 'Disabling the Microsoft Consumer Experience...' +mkdir -Force 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent' | Set-ItemProperty ` + -Name DisableWindowsConsumerFeatures ` + -Value 1 + +# when running on pwsh and windows 10, explicitly import the appx module. +# see https://github.com/PowerShell/PowerShell/issues/13138 +$currentVersionKey = Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' +$build = [int]$currentVersionKey.CurrentBuildNumber +if (($PSVersionTable.PSEdition -ne 'Desktop') -and ($build -lt 22000)) { + Import-Module Appx -UseWindowsPowerShell +} + +# remove all the provisioned appx packages. +# NB some packages fail to be removed and thats OK. +Get-AppXProvisionedPackage -Online | ForEach-Object { + Write-Host "Removing the $($_.PackageName) provisioned appx package..." + try { + $_ | Remove-AppxProvisionedPackage -Online | Out-Null + } catch { + Write-Output "WARN Failed to remove appx: $_" + } +} + +# remove appx packages. +# NB some packages fail to be removed and thats OK. +# see https://docs.microsoft.com/en-us/windows/application-management/apps-in-windows-10 +@( + 'Microsoft.BingWeather' + 'Microsoft.GetHelp' + 'Microsoft.Getstarted' + 'Microsoft.Microsoft3DViewer' + 'Microsoft.MicrosoftOfficeHub' + 'Microsoft.MicrosoftSolitaireCollection' + 'Microsoft.MicrosoftStickyNotes' + 'Microsoft.MixedReality.Portal' + 'Microsoft.MSPaint' + 'Microsoft.Office.OneNote' + 'Microsoft.People' + 'Microsoft.ScreenSketch' + 'Microsoft.Services.Store.Engagement' + 'Microsoft.SkypeApp' + 'Microsoft.StorePurchaseApp' + 'Microsoft.Wallet' + 'Microsoft.Windows.Photos' + 'Microsoft.WindowsAlarms' + 'Microsoft.WindowsCalculator' + 'Microsoft.WindowsCamera' + 'microsoft.windowscommunicationsapps' + 'Microsoft.WindowsFeedbackHub' + 'Microsoft.WindowsMaps' + 'Microsoft.WindowsSoundRecorder' + 'Microsoft.WindowsStore' + 'Microsoft.Xbox.TCUI' + 'Microsoft.XboxApp' + 'Microsoft.XboxGameOverlay' + 'Microsoft.XboxGamingOverlay' + 'Microsoft.XboxIdentityProvider' + 'Microsoft.XboxSpeechToTextOverlay' + 'Microsoft.YourPhone' + 'Microsoft.ZuneMusic' + 'Microsoft.ZuneVideo' + #'Microsoft.BioEnrollment' # NB this fails to remove. +) | ForEach-Object { + $appx = Get-AppxPackage -AllUsers $_ + if ($appx) { + Write-Host "Removing the $($appx.Name) appx package..." + try { + $appx | Remove-AppxPackage -AllUsers + } catch { + Write-Output "WARN Failed to remove appx: $_" + } + } +} diff --git a/packer_templates/scripts/windows/remove-one-drive.ps1 b/packer_templates/scripts/windows/remove-one-drive.ps1 new file mode 100644 index 0000000..30d869c --- /dev/null +++ b/packer_templates/scripts/windows/remove-one-drive.ps1 @@ -0,0 +1,69 @@ +#MIT License +# +#Copyright (c) 2017 Rui Lopes +# +#Permission is hereby granted, free of charge, to any person obtaining a copy +#of this software and associated documentation files (the "Software"), to deal +#in the Software without restriction, including without limitation the rights +#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +#copies of the Software, and to permit persons to whom the Software is +#furnished to do so, subject to the following conditions: +# +#The above copyright notice and this permission notice shall be included in all +#copies or substantial portions of the Software. +# +#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +#SOFTWARE. + +Set-StrictMode -Version Latest +$ProgressPreference = 'SilentlyContinue' +$ErrorActionPreference = 'Stop' +trap { + Write-Host + Write-Host "ERROR: $_" + ($_.ScriptStackTrace -split '\r?\n') -replace '^(.*)$','ERROR: $1' | Write-Host + ($_.Exception.ToString() -split '\r?\n') -replace '^(.*)$','ERROR EXCEPTION: $1' | Write-Host + Write-Host + Write-Host 'Sleeping for 60m to give you time to look around the virtual machine before self-destruction...' + Start-Sleep -Seconds (60*60) + Exit 1 +} + +$oneDriveSetup = 'C:\Windows\SysWOW64\OneDriveSetup.exe' + +# bail when OneDrive is not installed. +if (!(Test-Path $oneDriveSetup)) { + Exit 0 +} + +# disable OneDrive. +New-Item ` + -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows' ` + -Name OneDrive ` + -Force ` + | Out-Null +New-ItemProperty ` + -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive' ` + -Name DisableFileSyncNGSC ` + -Value 1 ` + -Force ` + | Out-Null + +# uninstall OneDrive. +# NB one drive setup will still be WinSxS and it does not seem possible to +# remove with Remove-WindowsPackage. +Get-Process OneDrive -ErrorAction SilentlyContinue | Stop-Process -Force +&$oneDriveSetup /uninstall | Out-String -Stream + +# ignore uninstall error. +# NB because it fails in windows 20H2, and not having OneDrive is just a +# nice to have. +if ($LASTEXITCODE) { + Write-Output "WARN Failed to uninstall OneDrive with exit code $LASTEXITCODE." + Exit 0 +} diff --git a/packer_templates/scripts/windows/virtualbox-prevent-vboxsrv-resolution-delay.ps1 b/packer_templates/scripts/windows/virtualbox-prevent-vboxsrv-resolution-delay.ps1 new file mode 100644 index 0000000..be52670 --- /dev/null +++ b/packer_templates/scripts/windows/virtualbox-prevent-vboxsrv-resolution-delay.ps1 @@ -0,0 +1,34 @@ +#MIT License +# +#Copyright (c) 2017 Rui Lopes +# +#Permission is hereby granted, free of charge, to any person obtaining a copy +#of this software and associated documentation files (the "Software"), to deal +#in the Software without restriction, including without limitation the rights +#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +#copies of the Software, and to permit persons to whom the Software is +#furnished to do so, subject to the following conditions: +# +#The above copyright notice and this permission notice shall be included in all +#copies or substantial portions of the Software. +# +#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +#SOFTWARE. + +if ('VirtualBox' -ne (Get-CimInstance -ClassName WIN32_BIOS -Property SMBIOSBIOSVersion).SMBIOSBIOSVersion) { + Exit 0 +} + +# to prevent long delays while resolving the vboxsrv (used by c:\vagrant) +# NetBIOS name, hard-code its address in the lmhosts file. +# see 12.3.9. Long delays when accessing shared folders +# at https://www.virtualbox.org/manual/ch12.html#idm10219 +Write-Output @' +255.255.255.255 VBOXSVR #PRE +255.255.255.255 VBOXSRV #PRE +'@ | Out-File -Encoding ASCII -Append 'c:\windows\system32\drivers\etc\lmhosts' diff --git a/packer_templates/vagrantfile-freebsd.template b/packer_templates/vagrantfile-freebsd.template new file mode 100644 index 0000000..be0e5eb --- /dev/null +++ b/packer_templates/vagrantfile-freebsd.template @@ -0,0 +1,16 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +Vagrant.configure(2) do |config| + config.ssh.shell = "sh" + + # Disable the base shared folder, Guest Tools supporting this feature are + # unavailable for all providers. + config.vm.synced_folder ".", "/vagrant", disabled: true + + config.vm.provider :parallels do |prl, override| + # Guest Tools are unavailable. + prl.check_guest_tools = false + prl.functional_psf = false + end +end diff --git a/packer_templates/vagrantfile-windows-gen2.template b/packer_templates/vagrantfile-windows-gen2.template new file mode 100644 index 0000000..8a0a1eb --- /dev/null +++ b/packer_templates/vagrantfile-windows-gen2.template @@ -0,0 +1,22 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +Vagrant.require_version ">= 1.6.2" + +Vagrant.configure("2") do |config| + config.vm.box = "hyperv_win_10" + config.vm.communicator = "winrm" + config.vm.synced_folder ".", "/vagrant", SharedFoldersEnableSymlinksCreate: false + + config.vm.guest = :windows + + config.vm.network :forwarded_port, guest: 3389, host: 3399, id: "rdp", auto_correct: true + config.vm.network :forwarded_port, guest: 5985, host: 5985, id: "winrm", auto_correct: true + + config.vm.provider "hyperv" do |hv| + hv.ip_address_timeout = 240 + hv.memory = 2048 + hv.cpus = 2 + hv.enable_virtualization_extensions = true + end +end diff --git a/packer_templates/vagrantfile-windows.template b/packer_templates/vagrantfile-windows.template new file mode 100644 index 0000000..de22af3 --- /dev/null +++ b/packer_templates/vagrantfile-windows.template @@ -0,0 +1,24 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +Vagrant.configure(2) do |config| + config.vm.guest = :windows + config.vm.communicator = "winrm" + config.vm.boot_timeout = 300 + config.vm.network :forwarded_port, guest: 3389, host: 3389, id: 'rdp', auto_correct: true + + config.vm.provider "virtualbox" do |vb| + vb.gui = true + vb.memory = 2048 + end + + config.vm.provider 'hyperv' do |hv| + hv.ip_address_timeout = 240 + hv.memory = 2048 + end + + config.vm.provider :libvirt do |domain| + domain.memory = 2028 + domain.cpus = 2 + end +end diff --git a/packer_templates/win_answer_files/10/Autounattend.xml b/packer_templates/win_answer_files/10/Autounattend.xml new file mode 100644 index 0000000..e5ddb41 --- /dev/null +++ b/packer_templates/win_answer_files/10/Autounattend.xml @@ -0,0 +1,217 @@ + + + + + + + + E:\viostor\w10\amd64 + + + + E:\NetKVM\w10\amd64 + + + + E:\Balloon\w10\amd64 + + + + E:\pvpanic\w10\amd64 + + + + E:\qemupciserial\w10\amd64 + + + + E:\qxldod\w10\amd64 + + + + E:\vioinput\w10\amd64 + + + + E:\viorng\w10\amd64 + + + + E:\vioscsi\w10\amd64 + + + + E:\vioserial\w10\amd64 + + + + + + en-US + + en-US + en-US + en-US + en-US + en-US + + + + + + + Primary + 1 + 100 + + + 2 + Primary + true + + + + + true + NTFS + + 1 + 1 + + + NTFS + + C + 2 + 2 + + + 0 + true + + + + + + + /IMAGE/NAME + Windows 10 Enterprise Evaluation + + + + 0 + 2 + + + + + + OnError + + true + Vagrant + Bento by Chef Software, Inc. + + + + + + 1 + + + false + false + + + + + en-US + en-US + en-US + en-US + + + + true + true + true + true + true + Work + 3 + true + true + + UTC + + + vagrant + true</PlainText> + </AdministratorPassword> + <LocalAccounts> + <LocalAccount wcm:action="add"> + <Password> + <Value>vagrant</Value> + <PlainText>true</PlainText> + </Password> + <Description>Vagrant User</Description> + <DisplayName>vagrant</DisplayName> + <Group>administrators</Group> + <Name>vagrant</Name> + </LocalAccount> + </LocalAccounts> + </UserAccounts> + <AutoLogon> + <Password> + <Value>vagrant</Value> + <PlainText>true</PlainText> + </Password> + <Username>vagrant</Username> + <Enabled>true</Enabled> + </AutoLogon> + <FirstLogonCommands> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine> + <Description>Set Execution Policy 64 Bit</Description> + <Order>1</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>C:\Windows\SysWOW64\cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine> + <Description>Set Execution Policy 32 Bit</Description> + <Order>2</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>powershell -NoLogo -ExecutionPolicy RemoteSigned -File a:\base_setup.ps1</CommandLine> + <Description>Configure WinRM so packer can connect to run Chef</Description> + <Order>3</Order> + <RequiresUserInput>false</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c wmic useraccount where "name='vagrant'" set PasswordExpires=FALSE</CommandLine> + <Order>4</Order> + <Description>Disable password expiration for vagrant user</Description> + </SynchronousCommand> + </FirstLogonCommands> + </component> + </settings> + <settings pass="specialize"> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-ServerManager-SvrMgrNc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <DoNotOpenServerManagerAtLogon>true</DoNotOpenServerManagerAtLogon> + </component> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-IE-ESC" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <!-- Disable IE ESC. --> + <IEHardenAdmin>false</IEHardenAdmin> + <IEHardenUser>false</IEHardenUser> + </component> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-OutOfBoxExperience" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <DoNotOpenInitialConfigurationTasksAtLogon>true</DoNotOpenInitialConfigurationTasksAtLogon> + </component> + </settings> +</unattend> diff --git a/packer_templates/win_answer_files/10/gen2_Autounattend.xml b/packer_templates/win_answer_files/10/gen2_Autounattend.xml new file mode 100644 index 0000000..d64883c --- /dev/null +++ b/packer_templates/win_answer_files/10/gen2_Autounattend.xml @@ -0,0 +1,253 @@ +<?xml version="1.0" encoding="utf-8"?> +<unattend xmlns="urn:schemas-microsoft-com:unattend"> + <settings pass="windowsPE"> + <component name="Microsoft-Windows-PnpCustomizationsWinPE" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" processorArchitecture="amd64" + xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"> + <!-- + This makes the VirtIO drivers available to Windows, assuming that + the VirtIO driver disk at https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso + (see https://docs.fedoraproject.org/en-US/quick-docs/creating-windows-virtual-machines-using-virtio-drivers/index.html#virtio-win-direct-downloads) + is available as drive E: + --> + <DriverPaths> + <PathAndCredentials wcm:action="add" wcm:keyValue="2"> + <Path>F:\viostor\w10\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="3"> + <Path>F:\NetKVM\w10\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="4"> + <Path>F:\Balloon\w10\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="5"> + <Path>F:\pvpanic\w10\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="6"> + <Path>F:\qemupciserial\w10\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="7"> + <Path>F:\qxldod\w10\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="8"> + <Path>F:\vioinput\w10\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="9"> + <Path>F:\viorng\w10\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="10"> + <Path>F:\vioscsi\w10\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="11"> + <Path>F:\vioserial\w10\amd64</Path> + </PathAndCredentials> + </DriverPaths> + </component> + <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" + xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <SetupUILanguage> + <UILanguage>en-US</UILanguage> + </SetupUILanguage> + <InputLocale>en-US</InputLocale> + <SystemLocale>en-US</SystemLocale> + <UILanguage>en-US</UILanguage> + <UILanguageFallback>en-US</UILanguageFallback> + <UserLocale>en-US</UserLocale> + </component> + <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" + xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <DiskConfiguration> + <Disk wcm:action="add"> + <CreatePartitions> + <CreatePartition wcm:action="add"> + <Order>1</Order> + <Size>350</Size> + <Type>Primary</Type> + </CreatePartition> + <CreatePartition wcm:action="add"> + <Order>2</Order> + <Size>100</Size> + <Type>EFI</Type> + </CreatePartition> + <CreatePartition wcm:action="add"> + <Order>3</Order> + <Size>128</Size> + <Type>MSR</Type> + </CreatePartition> + <CreatePartition wcm:action="add"> + <Order>4</Order> + <Extend>true</Extend> + <Type>Primary</Type> + </CreatePartition> + </CreatePartitions> + <ModifyPartitions> + <ModifyPartition wcm:action="add"> + <Order>1</Order> + <PartitionID>1</PartitionID> + <Label>WINRE</Label> + <Format>NTFS</Format> + <TypeID>de94bba4-06d1-4d40-a16a-bfd50179d6ac</TypeID> + </ModifyPartition> + <ModifyPartition wcm:action="add"> + <Order>2</Order> + <PartitionID>2</PartitionID> + <Label>System</Label> + <Format>FAT32</Format> + </ModifyPartition> + <ModifyPartition wcm:action="add"> + <Order>3</Order> + <PartitionID>3</PartitionID> + </ModifyPartition> + <ModifyPartition wcm:action="add"> + <Order>4</Order> + <PartitionID>4</PartitionID> + <Label>Windows</Label> + <Format>NTFS</Format> + </ModifyPartition> + </ModifyPartitions> + <DiskID>0</DiskID> + <WillWipeDisk>true</WillWipeDisk> + </Disk> + <WillShowUI>OnError</WillShowUI> + </DiskConfiguration> + <ImageInstall> + <OSImage> + <InstallFrom> + <MetaData wcm:action="add"> + <Key>/IMAGE/NAME</Key> + <Value>Windows 10 Enterprise Evaluation</Value> + </MetaData> + </InstallFrom> + <InstallTo> + <DiskID>0</DiskID> + <PartitionID>4</PartitionID> + </InstallTo> + </OSImage> + </ImageInstall> + <UserData> + <ProductKey> + <WillShowUI>OnError</WillShowUI> + </ProductKey> + <AcceptEula>true</AcceptEula> + <FullName>Vagrant</FullName> + <Organization>Bento by Chef Software, Inc.</Organization> + </UserData> + </component> + </settings> + <settings pass="generalize"> + <component name="Microsoft-Windows-Security-SPP" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" + xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <SkipRearm>1</SkipRearm> + </component> + <component name="Microsoft-Windows-PnpSysprep" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" + xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <PersistAllDeviceInstalls>false</PersistAllDeviceInstalls> + <DoNotCleanUpNonPresentDevices>false</DoNotCleanUpNonPresentDevices> + </component> + </settings> + <settings pass="oobeSystem"> + <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" + xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <InputLocale>en-US</InputLocale> + <SystemLocale>en-US</SystemLocale> + <UILanguage>en-US</UILanguage> + <UserLocale>en-US</UserLocale> + </component> + <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" + xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <OOBE> + <HideEULAPage>true</HideEULAPage> + <HideLocalAccountScreen>true</HideLocalAccountScreen> + <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen> + <HideOnlineAccountScreens>true</HideOnlineAccountScreens> + <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE> + <NetworkLocation>Work</NetworkLocation> + <ProtectYourPC>3</ProtectYourPC> + <SkipMachineOOBE>true</SkipMachineOOBE> + <SkipUserOOBE>true</SkipUserOOBE> + </OOBE> + <TimeZone>UTC</TimeZone> + <UserAccounts> + <AdministratorPassword> + <Value>vagrant</Value> + <PlainText>true</PlainText> + </AdministratorPassword> + <LocalAccounts> + <LocalAccount wcm:action="add"> + <Password> + <Value>vagrant</Value> + <PlainText>true</PlainText> + </Password> + <Description>Vagrant User</Description> + <DisplayName>vagrant</DisplayName> + <Group>administrators</Group> + <Name>vagrant</Name> + </LocalAccount> + </LocalAccounts> + </UserAccounts> + <AutoLogon> + <Password> + <Value>vagrant</Value> + <PlainText>true</PlainText> + </Password> + <Username>vagrant</Username> + <Enabled>true</Enabled> + </AutoLogon> + <FirstLogonCommands> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine> + <Description>Set Execution Policy 64 Bit</Description> + <Order>1</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>C:\Windows\SysWOW64\cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine> + <Description>Set Execution Policy 32 Bit</Description> + <Order>2</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>powershell -NoLogo -ExecutionPolicy RemoteSigned -File e:\base_setup.ps1</CommandLine> + <Description>Configure WinRM so packer can connect to run Chef</Description> + <Order>3</Order> + <RequiresUserInput>false</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c wmic useraccount where "name='vagrant'" set PasswordExpires=FALSE</CommandLine> + <Order>4</Order> + <Description>Disable password expiration for vagrant user</Description> + </SynchronousCommand> + </FirstLogonCommands> + </component> + </settings> + <settings pass="specialize"> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-ServerManager-SvrMgrNc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <DoNotOpenServerManagerAtLogon>true</DoNotOpenServerManagerAtLogon> + </component> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-IE-ESC" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <!-- Disable IE ESC. --> + <IEHardenAdmin>false</IEHardenAdmin> + <IEHardenUser>false</IEHardenUser> + </component> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-OutOfBoxExperience" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <DoNotOpenInitialConfigurationTasksAtLogon>true</DoNotOpenInitialConfigurationTasksAtLogon> + </component> + </settings> +</unattend> diff --git a/packer_templates/win_answer_files/11/Autounattend.xml b/packer_templates/win_answer_files/11/Autounattend.xml new file mode 100644 index 0000000..d7b3586 --- /dev/null +++ b/packer_templates/win_answer_files/11/Autounattend.xml @@ -0,0 +1,221 @@ +<?xml version="1.0" encoding="utf-8"?> +<unattend xmlns="urn:schemas-microsoft-com:unattend"> + <settings pass="windowsPE"> + <component name="Microsoft-Windows-PnpCustomizationsWinPE" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" processorArchitecture="amd64" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"> + <!-- + This makes the VirtIO drivers available to Windows, assuming that + the VirtIO driver disk at https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso + (see https://docs.fedoraproject.org/en-US/quick-docs/creating-windows-virtual-machines-using-virtio-drivers/index.html#virtio-win-direct-downloads) + is available as drive E: + --> + <DriverPaths> + <PathAndCredentials wcm:action="add" wcm:keyValue="2"> + <Path>E:\viostor\w11\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="3"> + <Path>E:\NetKVM\w11\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="4"> + <Path>E:\Balloon\w11\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="5"> + <Path>E:\pvpanic\w11\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="6"> + <Path>E:\qemupciserial\w11\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="7"> + <Path>E:\qxldod\w11\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="8"> + <Path>E:\vioinput\w11\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="9"> + <Path>E:\viorng\w11\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="10"> + <Path>E:\vioscsi\w11\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="11"> + <Path>E:\vioserial\w11\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="12"> + <Path>E:\vioserial\w11\amd64</Path> + </PathAndCredentials> + </DriverPaths> + </component> + <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <SetupUILanguage> + <UILanguage>en-US</UILanguage> + </SetupUILanguage> + <InputLocale>en-US</InputLocale> + <SystemLocale>en-US</SystemLocale> + <UILanguage>en-US</UILanguage> + <UILanguageFallback>en-US</UILanguageFallback> + <UserLocale>en-US</UserLocale> + </component> + <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <DiskConfiguration> + <Disk wcm:action="add"> + <CreatePartitions> + <CreatePartition wcm:action="add"> + <Type>Primary</Type> + <Order>1</Order> + <Size>100</Size> + </CreatePartition> + <CreatePartition wcm:action="add"> + <Order>2</Order> + <Type>Primary</Type> + <Extend>true</Extend> + </CreatePartition> + </CreatePartitions> + <ModifyPartitions> + <ModifyPartition wcm:action="add"> + <Active>true</Active> + <Format>NTFS</Format> + <Label>boot</Label> + <Order>1</Order> + <PartitionID>1</PartitionID> + </ModifyPartition> + <ModifyPartition wcm:action="add"> + <Format>NTFS</Format> + <Label>Windows 11</Label> + <Letter>C</Letter> + <Order>2</Order> + <PartitionID>2</PartitionID> + </ModifyPartition> + </ModifyPartitions> + <DiskID>0</DiskID> + <WillWipeDisk>true</WillWipeDisk> + </Disk> + </DiskConfiguration> + <ImageInstall> + <OSImage> + <InstallFrom> + <MetaData wcm:action="add"> + <Key>/IMAGE/NAME</Key> + <Value>Windows 11 Enterprise Evaluation</Value> + </MetaData> + </InstallFrom> + <InstallTo> + <DiskID>0</DiskID> + <PartitionID>2</PartitionID> + </InstallTo> + </OSImage> + </ImageInstall> + <UserData> + <ProductKey> + <WillShowUI>OnError</WillShowUI> + </ProductKey> + <AcceptEula>true</AcceptEula> + <FullName>Vagrant</FullName> + <Organization>Bento by Chef Software, Inc.</Organization> + </UserData> + </component> + </settings> + <settings pass="generalize"> + <component name="Microsoft-Windows-Security-SPP" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <SkipRearm>1</SkipRearm> + </component> + <component name="Microsoft-Windows-PnpSysprep" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <PersistAllDeviceInstalls>false</PersistAllDeviceInstalls> + <DoNotCleanUpNonPresentDevices>false</DoNotCleanUpNonPresentDevices> + </component> + </settings> + <settings pass="oobeSystem"> + <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <InputLocale>en-US</InputLocale> + <SystemLocale>en-US</SystemLocale> + <UILanguage>en-US</UILanguage> + <UserLocale>en-US</UserLocale> + </component> + <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <OOBE> + <HideEULAPage>true</HideEULAPage> + <HideLocalAccountScreen>true</HideLocalAccountScreen> + <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen> + <HideOnlineAccountScreens>true</HideOnlineAccountScreens> + <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE> + <NetworkLocation>Work</NetworkLocation> + <ProtectYourPC>3</ProtectYourPC> + <SkipMachineOOBE>true</SkipMachineOOBE> + <SkipUserOOBE>true</SkipUserOOBE> + </OOBE> + <TimeZone>UTC</TimeZone> + <UserAccounts> + <AdministratorPassword> + <Value>vagrant</Value> + <PlainText>true</PlainText> + </AdministratorPassword> + <LocalAccounts> + <LocalAccount wcm:action="add"> + <Password> + <Value>vagrant</Value> + <PlainText>true</PlainText> + </Password> + <Description>Vagrant User</Description> + <DisplayName>vagrant</DisplayName> + <Group>administrators</Group> + <Name>vagrant</Name> + </LocalAccount> + </LocalAccounts> + </UserAccounts> + <AutoLogon> + <Password> + <Value>vagrant</Value> + <PlainText>true</PlainText> + </Password> + <Username>vagrant</Username> + <Enabled>true</Enabled> + </AutoLogon> + <FirstLogonCommands> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine> + <Description>Set Execution Policy 64 Bit</Description> + <Order>1</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>C:\Windows\SysWOW64\cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine> + <Description>Set Execution Policy 32 Bit</Description> + <Order>2</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>powershell -NoLogo -ExecutionPolicy RemoteSigned -File a:\base_setup.ps1</CommandLine> + <Description>Configure WinRM so packer can connect to run Chef</Description> + <Order>3</Order> + <RequiresUserInput>false</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c wmic useraccount where "name='vagrant'" set PasswordExpires=FALSE</CommandLine> + <Order>4</Order> + <Description>Disable password expiration for vagrant user</Description> + </SynchronousCommand> + </FirstLogonCommands> + </component> + </settings> + <settings pass="specialize"> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-ServerManager-SvrMgrNc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <DoNotOpenServerManagerAtLogon>true</DoNotOpenServerManagerAtLogon> + </component> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-IE-ESC" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <!-- Disable IE ESC. --> + <IEHardenAdmin>false</IEHardenAdmin> + <IEHardenUser>false</IEHardenUser> + </component> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-OutOfBoxExperience" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <DoNotOpenInitialConfigurationTasksAtLogon>true</DoNotOpenInitialConfigurationTasksAtLogon> + </component> + </settings> +</unattend> diff --git a/packer_templates/win_answer_files/11/gen2_Autounattend.xml b/packer_templates/win_answer_files/11/gen2_Autounattend.xml new file mode 100644 index 0000000..89e9c26 --- /dev/null +++ b/packer_templates/win_answer_files/11/gen2_Autounattend.xml @@ -0,0 +1,257 @@ +<?xml version="1.0" encoding="utf-8"?> +<unattend xmlns="urn:schemas-microsoft-com:unattend"> + <settings pass="windowsPE"> + <component name="Microsoft-Windows-PnpCustomizationsWinPE" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" processorArchitecture="amd64" + xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"> + <!-- + This makes the VirtIO drivers available to Windows, assuming that + the VirtIO driver disk at https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso + (see https://docs.fedoraproject.org/en-US/quick-docs/creating-windows-virtual-machines-using-virtio-drivers/index.html#virtio-win-direct-downloads) + is available as drive E: + --> + <DriverPaths> + <PathAndCredentials wcm:action="add" wcm:keyValue="2"> + <Path>F:\viostor\w11\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="3"> + <Path>F:\NetKVM\w11\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="4"> + <Path>F:\Balloon\w11\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="5"> + <Path>F:\pvpanic\w11\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="6"> + <Path>F:\qemupciserial\w11\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="7"> + <Path>F:\qxldod\w11\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="8"> + <Path>F:\vioinput\w11\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="9"> + <Path>F:\viorng\w11\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="10"> + <Path>F:\vioscsi\w11\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="11"> + <Path>F:\vioserial\w11\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="12"> + <Path>F:\vioserial\w11\amd64</Path> + </PathAndCredentials> + </DriverPaths> + </component> + <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" + xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <SetupUILanguage> + <UILanguage>en-US</UILanguage> + </SetupUILanguage> + <InputLocale>en-US</InputLocale> + <SystemLocale>en-US</SystemLocale> + <UILanguage>en-US</UILanguage> + <UILanguageFallback>en-US</UILanguageFallback> + <UserLocale>en-US</UserLocale> + </component> + <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" + xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <DiskConfiguration> + <Disk wcm:action="add"> + <CreatePartitions> + <CreatePartition wcm:action="add"> + <Order>1</Order> + <Size>350</Size> + <Type>Primary</Type> + </CreatePartition> + <CreatePartition wcm:action="add"> + <Order>2</Order> + <Size>100</Size> + <Type>EFI</Type> + </CreatePartition> + <CreatePartition wcm:action="add"> + <Order>3</Order> + <Size>128</Size> + <Type>MSR</Type> + </CreatePartition> + <CreatePartition wcm:action="add"> + <Order>4</Order> + <Extend>true</Extend> + <Type>Primary</Type> + </CreatePartition> + </CreatePartitions> + <ModifyPartitions> + <ModifyPartition wcm:action="add"> + <Order>1</Order> + <PartitionID>1</PartitionID> + <Label>WINRE</Label> + <Format>NTFS</Format> + <TypeID>de94bba4-06d1-4d40-a16a-bfd50179d6ac</TypeID> + </ModifyPartition> + <ModifyPartition wcm:action="add"> + <Order>2</Order> + <PartitionID>2</PartitionID> + <Label>System</Label> + <Format>FAT32</Format> + </ModifyPartition> + <ModifyPartition wcm:action="add"> + <Order>3</Order> + <PartitionID>3</PartitionID> + </ModifyPartition> + <ModifyPartition wcm:action="add"> + <Order>4</Order> + <PartitionID>4</PartitionID> + <Label>Windows</Label> + <Format>NTFS</Format> + </ModifyPartition> + </ModifyPartitions> + <DiskID>0</DiskID> + <WillWipeDisk>true</WillWipeDisk> + </Disk> + <WillShowUI>OnError</WillShowUI> + </DiskConfiguration> + <ImageInstall> + <OSImage> + <InstallFrom> + <MetaData wcm:action="add"> + <Key>/IMAGE/NAME</Key> + <Value>Windows 11 Enterprise Evaluation</Value> + </MetaData> + </InstallFrom> + <InstallTo> + <DiskID>0</DiskID> + <PartitionID>4</PartitionID> + </InstallTo> + </OSImage> + </ImageInstall> + <UserData> + <ProductKey> + <WillShowUI>OnError</WillShowUI> + </ProductKey> + <AcceptEula>true</AcceptEula> + <FullName>Vagrant</FullName> + <Organization>Bento by Chef Software, Inc.</Organization> + </UserData> + </component> + </settings> + <settings pass="generalize"> + <component name="Microsoft-Windows-Security-SPP" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" + xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <SkipRearm>1</SkipRearm> + </component> + <component name="Microsoft-Windows-PnpSysprep" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" + xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <PersistAllDeviceInstalls>false</PersistAllDeviceInstalls> + <DoNotCleanUpNonPresentDevices>false</DoNotCleanUpNonPresentDevices> + </component> + </settings> + <settings pass="oobeSystem"> + <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" + xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <InputLocale>en-US</InputLocale> + <SystemLocale>en-US</SystemLocale> + <UILanguage>en-US</UILanguage> + <UserLocale>en-US</UserLocale> + </component> + <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" + xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <OOBE> + <HideEULAPage>true</HideEULAPage> + <HideLocalAccountScreen>true</HideLocalAccountScreen> + <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen> + <HideOnlineAccountScreens>true</HideOnlineAccountScreens> + <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE> + <NetworkLocation>Work</NetworkLocation> + <ProtectYourPC>3</ProtectYourPC> + <SkipMachineOOBE>true</SkipMachineOOBE> + <SkipUserOOBE>true</SkipUserOOBE> + </OOBE> + <TimeZone>UTC</TimeZone> + <UserAccounts> + <AdministratorPassword> + <Value>vagrant</Value> + <PlainText>true</PlainText> + </AdministratorPassword> + <LocalAccounts> + <LocalAccount wcm:action="add"> + <Password> + <Value>vagrant</Value> + <PlainText>true</PlainText> + </Password> + <Description>Vagrant User</Description> + <DisplayName>vagrant</DisplayName> + <Group>administrators</Group> + <Name>vagrant</Name> + </LocalAccount> + </LocalAccounts> + </UserAccounts> + <AutoLogon> + <Password> + <Value>vagrant</Value> + <PlainText>true</PlainText> + </Password> + <Username>vagrant</Username> + <Enabled>true</Enabled> + </AutoLogon> + <FirstLogonCommands> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine> + <Description>Set Execution Policy 64 Bit</Description> + <Order>1</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>C:\Windows\SysWOW64\cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine> + <Description>Set Execution Policy 32 Bit</Description> + <Order>2</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>powershell -NoLogo -ExecutionPolicy RemoteSigned -File e:\base_setup.ps1</CommandLine> + <Description>Configure WinRM so packer can connect to run Chef</Description> + <Order>3</Order> + <RequiresUserInput>false</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c wmic useraccount where "name='vagrant'" set PasswordExpires=FALSE</CommandLine> + <Order>4</Order> + <Description>Disable password expiration for vagrant user</Description> + </SynchronousCommand> + </FirstLogonCommands> + </component> + </settings> + <settings pass="specialize"> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-ServerManager-SvrMgrNc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <DoNotOpenServerManagerAtLogon>true</DoNotOpenServerManagerAtLogon> + </component> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-IE-ESC" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <!-- Disable IE ESC. --> + <IEHardenAdmin>false</IEHardenAdmin> + <IEHardenUser>false</IEHardenUser> + </component> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-OutOfBoxExperience" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <DoNotOpenInitialConfigurationTasksAtLogon>true</DoNotOpenInitialConfigurationTasksAtLogon> + </component> + </settings> +</unattend> diff --git a/packer_templates/win_answer_files/2012/Autounattend.xml b/packer_templates/win_answer_files/2012/Autounattend.xml new file mode 100644 index 0000000..a7274bc --- /dev/null +++ b/packer_templates/win_answer_files/2012/Autounattend.xml @@ -0,0 +1,289 @@ +<?xml version="1.0" encoding="utf-8"?> +<unattend xmlns="urn:schemas-microsoft-com:unattend"> + <settings pass="windowsPE"> + <component name="Microsoft-Windows-PnpCustomizationsWinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <!-- + This makes the VirtIO drivers available to Windows, assuming that + the VirtIO driver disk at https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso + (see https://docs.fedoraproject.org/en-US/quick-docs/creating-windows-virtual-machines-using-virtio-drivers/index.html#virtio-win-direct-downloads) + is available as drive E: + --> + <DriverPaths> + <PathAndCredentials wcm:action="add" wcm:keyValue="2"> + <Path>E:\viostor\2k12\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="3"> + <Path>E:\NetKVM\2k12\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="4"> + <Path>E:\Balloon\2k12\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="5"> + <Path>E:\pvpanic\2k12\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="6"> + <Path>E:\qemupciserial\2k12\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="7"> + <Path>E:\qxldod\2k12\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="8"> + <Path>E:\vioinput\2k12\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="9"> + <Path>E:\viorng\2k12\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="10"> + <Path>E:\vioscsi\2k12\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="11"> + <Path>E:\vioserial\2k12\amd64</Path> + </PathAndCredentials> + </DriverPaths> + </component> + <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <SetupUILanguage> + <UILanguage>en-US</UILanguage> + </SetupUILanguage> + <InputLocale>en-US</InputLocale> + <SystemLocale>en-US</SystemLocale> + <UILanguage>en-US</UILanguage> + <UILanguageFallback>en-US</UILanguageFallback> + <UserLocale>en-US</UserLocale> + </component> + <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <DiskConfiguration> + <Disk wcm:action="add"> + <CreatePartitions> + <CreatePartition wcm:action="add"> + <Type>Primary</Type> + <Order>1</Order> + <Size>350</Size> + </CreatePartition> + <CreatePartition wcm:action="add"> + <Order>2</Order> + <Type>Primary</Type> + <Extend>true</Extend> + </CreatePartition> + </CreatePartitions> + <ModifyPartitions> + <ModifyPartition wcm:action="add"> + <Active>true</Active> + <Format>NTFS</Format> + <Label>boot</Label> + <Order>1</Order> + <PartitionID>1</PartitionID> + </ModifyPartition> + <ModifyPartition wcm:action="add"> + <Format>NTFS</Format> + <Label>Windows 2012</Label> + <Letter>C</Letter> + <Order>2</Order> + <PartitionID>2</PartitionID> + </ModifyPartition> + </ModifyPartitions> + <DiskID>0</DiskID> + <WillWipeDisk>true</WillWipeDisk> + </Disk> + </DiskConfiguration> + <ImageInstall> + <OSImage> + <InstallFrom> + <MetaData wcm:action="add"> + <Key>/IMAGE/NAME</Key> + <Value>Windows Server 2012 SERVERSTANDARD</Value> + </MetaData> + </InstallFrom> + <InstallTo> + <DiskID>0</DiskID> + <PartitionID>2</PartitionID> + </InstallTo> + </OSImage> + </ImageInstall> + <UserData> + <ProductKey> + <WillShowUI>OnError</WillShowUI> + </ProductKey> + <AcceptEula>true</AcceptEula> + <FullName>Vagrant</FullName> + <Organization>Bento by Chef Software, Inc.</Organization> + </UserData> + </component> + </settings> + <settings pass="generalize"> + <component name="Microsoft-Windows-Security-SPP" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <SkipRearm>1</SkipRearm> + </component> + <component name="Microsoft-Windows-PnpSysprep" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <PersistAllDeviceInstalls>false</PersistAllDeviceInstalls> + <DoNotCleanUpNonPresentDevices>false</DoNotCleanUpNonPresentDevices> + </component> + </settings> + <settings pass="oobeSystem"> + <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <InputLocale>en-US</InputLocale> + <SystemLocale>en-US</SystemLocale> + <UILanguage>en-US</UILanguage> + <UserLocale>en-US</UserLocale> + </component> + <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <OOBE> + <HideEULAPage>true</HideEULAPage> + <HideLocalAccountScreen>true</HideLocalAccountScreen> + <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen> + <HideOnlineAccountScreens>true</HideOnlineAccountScreens> + <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE> + <NetworkLocation>Home</NetworkLocation> + <ProtectYourPC>3</ProtectYourPC> + <SkipMachineOOBE>true</SkipMachineOOBE> + <SkipUserOOBE>true</SkipUserOOBE> + </OOBE> + <TimeZone>UTC</TimeZone> + <UserAccounts> + <AdministratorPassword> + <Value>vagrant</Value> + <PlainText>true</PlainText> + </AdministratorPassword> + <LocalAccounts> + <LocalAccount wcm:action="add"> + <Password> + <Value>vagrant</Value> + <PlainText>true</PlainText> + </Password> + <Description>Vagrant User</Description> + <DisplayName>vagrant</DisplayName> + <Group>administrators</Group> + <Name>vagrant</Name> + </LocalAccount> + </LocalAccounts> + </UserAccounts> + <AutoLogon> + <Password> + <Value>vagrant</Value> + <PlainText>true</PlainText> + </Password> + <Username>vagrant</Username> + <Enabled>true</Enabled> + </AutoLogon> + <FirstLogonCommands> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine> + <Description>Set Execution Policy 64 Bit</Description> + <Order>1</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>C:\Windows\SysWOW64\cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine> + <Description>Set Execution Policy 32 Bit</Description> + <Order>2</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c winrm quickconfig -q</CommandLine> + <Description>winrm quickconfig -q</Description> + <Order>3</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c winrm quickconfig -transport:http</CommandLine> + <Description>winrm quickconfig -transport:http</Description> + <Order>4</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c winrm set winrm/config @{MaxTimeoutms="1800000"}</CommandLine> + <Description>Win RM MaxTimoutms</Description> + <Order>5</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c winrm set winrm/config/winrs @{MaxMemoryPerShellMB="800"}</CommandLine> + <Description>Win RM MaxMemoryPerShellMB</Description> + <Order>6</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c winrm set winrm/config/service @{AllowUnencrypted="true"}</CommandLine> + <Description>Win RM AllowUnencrypted</Description> + <Order>7</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c winrm set winrm/config/service/auth @{Basic="true"}</CommandLine> + <Description>Win RM auth Basic</Description> + <Order>8</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c winrm set winrm/config/client/auth @{Basic="true"}</CommandLine> + <Description>Win RM client auth Basic</Description> + <Order>9</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c winrm set winrm/config/listener?Address=*+Transport=HTTP @{Port="5985"} </CommandLine> + <Description>Win RM listener Address/Port</Description> + <Order>10</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c netsh advfirewall firewall set rule group="remote administration" new enable=yes </CommandLine> + <Description>Win RM adv firewall enable</Description> + <Order>11</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c netsh firewall add portopening TCP 5985 "Port 5985" </CommandLine> + <Description>Win RM port open</Description> + <Order>12</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c net stop winrm </CommandLine> + <Description>Stop Win RM Service </Description> + <Order>13</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c sc config winrm start= auto</CommandLine> + <Description>Win RM Autostart</Description> + <Order>14</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c net start winrm</CommandLine> + <Description>Start Win RM Service</Description> + <Order>15</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c wmic useraccount where "name='vagrant'" set PasswordExpires=FALSE</CommandLine> + <Order>16</Order> + <Description>Disable password expiration for vagrant user</Description> + </SynchronousCommand> + </FirstLogonCommands> + </component> + </settings> + <settings pass="specialize"> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-ServerManager-SvrMgrNc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <DoNotOpenServerManagerAtLogon>true</DoNotOpenServerManagerAtLogon> + </component> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-IE-ESC" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <!-- Disable IE ESC. --> + <IEHardenAdmin>false</IEHardenAdmin> + <IEHardenUser>false</IEHardenUser> + </component> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-OutOfBoxExperience" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <DoNotOpenInitialConfigurationTasksAtLogon>true</DoNotOpenInitialConfigurationTasksAtLogon> + </component> + </settings> +</unattend> diff --git a/packer_templates/win_answer_files/2012r2/Autounattend.xml b/packer_templates/win_answer_files/2012r2/Autounattend.xml new file mode 100644 index 0000000..aeddff9 --- /dev/null +++ b/packer_templates/win_answer_files/2012r2/Autounattend.xml @@ -0,0 +1,289 @@ +<?xml version="1.0" encoding="utf-8"?> +<unattend xmlns="urn:schemas-microsoft-com:unattend"> + <settings pass="windowsPE"> + <component name="Microsoft-Windows-PnpCustomizationsWinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <!-- + This makes the VirtIO drivers available to Windows, assuming that + the VirtIO driver disk at https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso + (see https://docs.fedoraproject.org/en-US/quick-docs/creating-windows-virtual-machines-using-virtio-drivers/index.html#virtio-win-direct-downloads) + is available as drive E: + --> + <DriverPaths> + <PathAndCredentials wcm:action="add" wcm:keyValue="2"> + <Path>E:\viostor\2k12R2\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="3"> + <Path>E:\NetKVM\2k12R2\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="4"> + <Path>E:\Balloon\2k12R2\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="5"> + <Path>E:\pvpanic\2k12R2\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="6"> + <Path>E:\qemupciserial\2k12R2\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="7"> + <Path>E:\qxldod\2k12R2\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="8"> + <Path>E:\vioinput\2k12R2\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="9"> + <Path>E:\viorng\2k12R2\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="10"> + <Path>E:\vioscsi\2k12R2\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="11"> + <Path>E:\vioserial\2k12R2\amd64</Path> + </PathAndCredentials> + </DriverPaths> + </component> + <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <SetupUILanguage> + <UILanguage>en-US</UILanguage> + </SetupUILanguage> + <InputLocale>en-US</InputLocale> + <SystemLocale>en-US</SystemLocale> + <UILanguage>en-US</UILanguage> + <UILanguageFallback>en-US</UILanguageFallback> + <UserLocale>en-US</UserLocale> + </component> + <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <DiskConfiguration> + <Disk wcm:action="add"> + <CreatePartitions> + <CreatePartition wcm:action="add"> + <Type>Primary</Type> + <Order>1</Order> + <Size>350</Size> + </CreatePartition> + <CreatePartition wcm:action="add"> + <Order>2</Order> + <Type>Primary</Type> + <Extend>true</Extend> + </CreatePartition> + </CreatePartitions> + <ModifyPartitions> + <ModifyPartition wcm:action="add"> + <Active>true</Active> + <Format>NTFS</Format> + <Label>boot</Label> + <Order>1</Order> + <PartitionID>1</PartitionID> + </ModifyPartition> + <ModifyPartition wcm:action="add"> + <Format>NTFS</Format> + <Label>Windows 2012 R2</Label> + <Letter>C</Letter> + <Order>2</Order> + <PartitionID>2</PartitionID> + </ModifyPartition> + </ModifyPartitions> + <DiskID>0</DiskID> + <WillWipeDisk>true</WillWipeDisk> + </Disk> + </DiskConfiguration> + <ImageInstall> + <OSImage> + <InstallFrom> + <MetaData wcm:action="add"> + <Key>/IMAGE/NAME</Key> + <Value>Windows Server 2012 R2 SERVERSTANDARD</Value> + </MetaData> + </InstallFrom> + <InstallTo> + <DiskID>0</DiskID> + <PartitionID>2</PartitionID> + </InstallTo> + </OSImage> + </ImageInstall> + <UserData> + <ProductKey> + <WillShowUI>OnError</WillShowUI> + </ProductKey> + <AcceptEula>true</AcceptEula> + <FullName>Vagrant</FullName> + <Organization>Bento by Chef Software, Inc.</Organization> + </UserData> + </component> + </settings> + <settings pass="generalize"> + <component name="Microsoft-Windows-Security-SPP" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <SkipRearm>1</SkipRearm> + </component> + <component name="Microsoft-Windows-PnpSysprep" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <PersistAllDeviceInstalls>false</PersistAllDeviceInstalls> + <DoNotCleanUpNonPresentDevices>false</DoNotCleanUpNonPresentDevices> + </component> + </settings> + <settings pass="oobeSystem"> + <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <InputLocale>en-US</InputLocale> + <SystemLocale>en-US</SystemLocale> + <UILanguage>en-US</UILanguage> + <UserLocale>en-US</UserLocale> + </component> + <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <OOBE> + <HideEULAPage>true</HideEULAPage> + <HideLocalAccountScreen>true</HideLocalAccountScreen> + <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen> + <HideOnlineAccountScreens>true</HideOnlineAccountScreens> + <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE> + <NetworkLocation>Home</NetworkLocation> + <ProtectYourPC>3</ProtectYourPC> + <SkipMachineOOBE>true</SkipMachineOOBE> + <SkipUserOOBE>true</SkipUserOOBE> + </OOBE> + <TimeZone>UTC</TimeZone> + <UserAccounts> + <AdministratorPassword> + <Value>vagrant</Value> + <PlainText>true</PlainText> + </AdministratorPassword> + <LocalAccounts> + <LocalAccount wcm:action="add"> + <Password> + <Value>vagrant</Value> + <PlainText>true</PlainText> + </Password> + <Description>Vagrant User</Description> + <DisplayName>vagrant</DisplayName> + <Group>administrators</Group> + <Name>vagrant</Name> + </LocalAccount> + </LocalAccounts> + </UserAccounts> + <AutoLogon> + <Password> + <Value>vagrant</Value> + <PlainText>true</PlainText> + </Password> + <Username>vagrant</Username> + <Enabled>true</Enabled> + </AutoLogon> + <FirstLogonCommands> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine> + <Description>Set Execution Policy 64 Bit</Description> + <Order>1</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>C:\Windows\SysWOW64\cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine> + <Description>Set Execution Policy 32 Bit</Description> + <Order>2</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c winrm quickconfig -q</CommandLine> + <Description>winrm quickconfig -q</Description> + <Order>3</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c winrm quickconfig -transport:http</CommandLine> + <Description>winrm quickconfig -transport:http</Description> + <Order>4</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c winrm set winrm/config @{MaxTimeoutms="1800000"}</CommandLine> + <Description>Win RM MaxTimoutms</Description> + <Order>5</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c winrm set winrm/config/winrs @{MaxMemoryPerShellMB="800"}</CommandLine> + <Description>Win RM MaxMemoryPerShellMB</Description> + <Order>6</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c winrm set winrm/config/service @{AllowUnencrypted="true"}</CommandLine> + <Description>Win RM AllowUnencrypted</Description> + <Order>7</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c winrm set winrm/config/service/auth @{Basic="true"}</CommandLine> + <Description>Win RM auth Basic</Description> + <Order>8</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c winrm set winrm/config/client/auth @{Basic="true"}</CommandLine> + <Description>Win RM client auth Basic</Description> + <Order>9</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c winrm set winrm/config/listener?Address=*+Transport=HTTP @{Port="5985"} </CommandLine> + <Description>Win RM listener Address/Port</Description> + <Order>10</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c netsh advfirewall firewall set rule group="remote administration" new enable=yes </CommandLine> + <Description>Win RM adv firewall enable</Description> + <Order>11</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c netsh firewall add portopening TCP 5985 "Port 5985" </CommandLine> + <Description>Win RM port open</Description> + <Order>12</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c net stop winrm </CommandLine> + <Description>Stop Win RM Service </Description> + <Order>13</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c sc config winrm start= auto</CommandLine> + <Description>Win RM Autostart</Description> + <Order>14</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c net start winrm</CommandLine> + <Description>Start Win RM Service</Description> + <Order>15</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c wmic useraccount where "name='vagrant'" set PasswordExpires=FALSE</CommandLine> + <Order>16</Order> + <Description>Disable password expiration for vagrant user</Description> + </SynchronousCommand> + </FirstLogonCommands> + </component> + </settings> + <settings pass="specialize"> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-ServerManager-SvrMgrNc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <DoNotOpenServerManagerAtLogon>true</DoNotOpenServerManagerAtLogon> + </component> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-IE-ESC" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <!-- Disable IE ESC. --> + <IEHardenAdmin>false</IEHardenAdmin> + <IEHardenUser>false</IEHardenUser> + </component> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-OutOfBoxExperience" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <DoNotOpenInitialConfigurationTasksAtLogon>true</DoNotOpenInitialConfigurationTasksAtLogon> + </component> + </settings> +</unattend> diff --git a/packer_templates/win_answer_files/2016/Autounattend.xml b/packer_templates/win_answer_files/2016/Autounattend.xml new file mode 100644 index 0000000..6dda24e --- /dev/null +++ b/packer_templates/win_answer_files/2016/Autounattend.xml @@ -0,0 +1,289 @@ +<?xml version="1.0" encoding="utf-8"?> +<unattend xmlns="urn:schemas-microsoft-com:unattend"> + <settings pass="windowsPE"> + <component name="Microsoft-Windows-PnpCustomizationsWinPE" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" processorArchitecture="amd64" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"> + <!-- + This makes the VirtIO drivers available to Windows, assuming that + the VirtIO driver disk at https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso + (see https://docs.fedoraproject.org/en-US/quick-docs/creating-windows-virtual-machines-using-virtio-drivers/index.html#virtio-win-direct-downloads) + is available as drive E: + --> + <DriverPaths> + <PathAndCredentials wcm:action="add" wcm:keyValue="2"> + <Path>E:\viostor\2k16\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="3"> + <Path>E:\NetKVM\2k16\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="4"> + <Path>E:\Balloon\2k16\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="5"> + <Path>E:\pvpanic\2k16\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="6"> + <Path>E:\qemupciserial\2k16\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="7"> + <Path>E:\qxldod\2k16\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="8"> + <Path>E:\vioinput\2k16\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="9"> + <Path>E:\viorng\2k16\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="10"> + <Path>E:\vioscsi\2k16\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="11"> + <Path>E:\vioserial\2k16\amd64</Path> + </PathAndCredentials> + </DriverPaths> + </component> + <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <SetupUILanguage> + <UILanguage>en-US</UILanguage> + </SetupUILanguage> + <InputLocale>en-US</InputLocale> + <SystemLocale>en-US</SystemLocale> + <UILanguage>en-US</UILanguage> + <UILanguageFallback>en-US</UILanguageFallback> + <UserLocale>en-US</UserLocale> + </component> + <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <DiskConfiguration> + <Disk wcm:action="add"> + <CreatePartitions> + <CreatePartition wcm:action="add"> + <Type>Primary</Type> + <Order>1</Order> + <Size>350</Size> + </CreatePartition> + <CreatePartition wcm:action="add"> + <Order>2</Order> + <Type>Primary</Type> + <Extend>true</Extend> + </CreatePartition> + </CreatePartitions> + <ModifyPartitions> + <ModifyPartition wcm:action="add"> + <Active>true</Active> + <Format>NTFS</Format> + <Label>boot</Label> + <Order>1</Order> + <PartitionID>1</PartitionID> + </ModifyPartition> + <ModifyPartition wcm:action="add"> + <Format>NTFS</Format> + <Label>Windows 2016</Label> + <Letter>C</Letter> + <Order>2</Order> + <PartitionID>2</PartitionID> + </ModifyPartition> + </ModifyPartitions> + <DiskID>0</DiskID> + <WillWipeDisk>true</WillWipeDisk> + </Disk> + </DiskConfiguration> + <ImageInstall> + <OSImage> + <InstallFrom> + <MetaData wcm:action="add"> + <Key>/IMAGE/NAME</Key> + <Value>Windows Server 2016 SERVERDATACENTER</Value> + </MetaData> + </InstallFrom> + <InstallTo> + <DiskID>0</DiskID> + <PartitionID>2</PartitionID> + </InstallTo> + </OSImage> + </ImageInstall> + <UserData> + <ProductKey> + <WillShowUI>OnError</WillShowUI> + </ProductKey> + <AcceptEula>true</AcceptEula> + <FullName>Vagrant</FullName> + <Organization>Bento by Chef Software, Inc.</Organization> + </UserData> + </component> + </settings> + <settings pass="generalize"> + <component name="Microsoft-Windows-Security-SPP" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <SkipRearm>1</SkipRearm> + </component> + <component name="Microsoft-Windows-PnpSysprep" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <PersistAllDeviceInstalls>false</PersistAllDeviceInstalls> + <DoNotCleanUpNonPresentDevices>false</DoNotCleanUpNonPresentDevices> + </component> + </settings> + <settings pass="oobeSystem"> + <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <InputLocale>en-US</InputLocale> + <SystemLocale>en-US</SystemLocale> + <UILanguage>en-US</UILanguage> + <UserLocale>en-US</UserLocale> + </component> + <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <OOBE> + <HideEULAPage>true</HideEULAPage> + <HideLocalAccountScreen>true</HideLocalAccountScreen> + <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen> + <HideOnlineAccountScreens>true</HideOnlineAccountScreens> + <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE> + <NetworkLocation>Home</NetworkLocation> + <ProtectYourPC>3</ProtectYourPC> + <SkipMachineOOBE>true</SkipMachineOOBE> + <SkipUserOOBE>true</SkipUserOOBE> + </OOBE> + <TimeZone>UTC</TimeZone> + <UserAccounts> + <AdministratorPassword> + <Value>vagrant</Value> + <PlainText>true</PlainText> + </AdministratorPassword> + <LocalAccounts> + <LocalAccount wcm:action="add"> + <Password> + <Value>vagrant</Value> + <PlainText>true</PlainText> + </Password> + <Description>Vagrant User</Description> + <DisplayName>vagrant</DisplayName> + <Group>administrators</Group> + <Name>vagrant</Name> + </LocalAccount> + </LocalAccounts> + </UserAccounts> + <AutoLogon> + <Password> + <Value>vagrant</Value> + <PlainText>true</PlainText> + </Password> + <Username>vagrant</Username> + <Enabled>true</Enabled> + </AutoLogon> + <FirstLogonCommands> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine> + <Description>Set Execution Policy 64 Bit</Description> + <Order>1</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>C:\Windows\SysWOW64\cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine> + <Description>Set Execution Policy 32 Bit</Description> + <Order>2</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c winrm quickconfig -q</CommandLine> + <Description>winrm quickconfig -q</Description> + <Order>3</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c winrm quickconfig -transport:http</CommandLine> + <Description>winrm quickconfig -transport:http</Description> + <Order>4</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c winrm set winrm/config @{MaxTimeoutms="1800000"}</CommandLine> + <Description>Win RM MaxTimoutms</Description> + <Order>5</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c winrm set winrm/config/winrs @{MaxMemoryPerShellMB="800"}</CommandLine> + <Description>Win RM MaxMemoryPerShellMB</Description> + <Order>6</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c winrm set winrm/config/service @{AllowUnencrypted="true"}</CommandLine> + <Description>Win RM AllowUnencrypted</Description> + <Order>7</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c winrm set winrm/config/service/auth @{Basic="true"}</CommandLine> + <Description>Win RM auth Basic</Description> + <Order>8</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c winrm set winrm/config/client/auth @{Basic="true"}</CommandLine> + <Description>Win RM client auth Basic</Description> + <Order>9</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c winrm set winrm/config/listener?Address=*+Transport=HTTP @{Port="5985"} </CommandLine> + <Description>Win RM listener Address/Port</Description> + <Order>10</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c netsh advfirewall firewall set rule group="remote administration" new enable=yes </CommandLine> + <Description>Win RM adv firewall enable</Description> + <Order>11</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c netsh firewall add portopening TCP 5985 "Port 5985" </CommandLine> + <Description>Win RM port open</Description> + <Order>12</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c net stop winrm </CommandLine> + <Description>Stop Win RM Service </Description> + <Order>13</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c sc config winrm start= auto</CommandLine> + <Description>Win RM Autostart</Description> + <Order>14</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c net start winrm</CommandLine> + <Description>Start Win RM Service</Description> + <Order>15</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c wmic useraccount where "name='vagrant'" set PasswordExpires=FALSE</CommandLine> + <Order>16</Order> + <Description>Disable password expiration for vagrant user</Description> + </SynchronousCommand> + </FirstLogonCommands> + </component> + </settings> + <settings pass="specialize"> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-ServerManager-SvrMgrNc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <DoNotOpenServerManagerAtLogon>true</DoNotOpenServerManagerAtLogon> + </component> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-IE-ESC" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <!-- Disable IE ESC. --> + <IEHardenAdmin>false</IEHardenAdmin> + <IEHardenUser>false</IEHardenUser> + </component> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-OutOfBoxExperience" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <DoNotOpenInitialConfigurationTasksAtLogon>true</DoNotOpenInitialConfigurationTasksAtLogon> + </component> + </settings> +</unattend> diff --git a/packer_templates/win_answer_files/2019/Autounattend.xml b/packer_templates/win_answer_files/2019/Autounattend.xml new file mode 100644 index 0000000..f752de7 --- /dev/null +++ b/packer_templates/win_answer_files/2019/Autounattend.xml @@ -0,0 +1,289 @@ +<?xml version="1.0" encoding="utf-8"?> +<unattend xmlns="urn:schemas-microsoft-com:unattend"> + <settings pass="windowsPE"> + <component name="Microsoft-Windows-PnpCustomizationsWinPE" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" processorArchitecture="amd64" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"> + <!-- + This makes the VirtIO drivers available to Windows, assuming that + the VirtIO driver disk at https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso + (see https://docs.fedoraproject.org/en-US/quick-docs/creating-windows-virtual-machines-using-virtio-drivers/index.html#virtio-win-direct-downloads) + is available as drive E: + --> + <DriverPaths> + <PathAndCredentials wcm:action="add" wcm:keyValue="2"> + <Path>E:\viostor\2k19\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="3"> + <Path>E:\NetKVM\2k19\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="4"> + <Path>E:\Balloon\2k19\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="5"> + <Path>E:\pvpanic\2k19\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="6"> + <Path>E:\qemupciserial\2k19\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="7"> + <Path>E:\qxldod\2k19\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="8"> + <Path>E:\vioinput\2k19\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="9"> + <Path>E:\viorng\2k19\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="10"> + <Path>E:\vioscsi\2k19\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="11"> + <Path>E:\vioserial\2k19\amd64</Path> + </PathAndCredentials> + </DriverPaths> + </component> + <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <SetupUILanguage> + <UILanguage>en-US</UILanguage> + </SetupUILanguage> + <InputLocale>en-US</InputLocale> + <SystemLocale>en-US</SystemLocale> + <UILanguage>en-US</UILanguage> + <UILanguageFallback>en-US</UILanguageFallback> + <UserLocale>en-US</UserLocale> + </component> + <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <DiskConfiguration> + <Disk wcm:action="add"> + <CreatePartitions> + <CreatePartition wcm:action="add"> + <Type>Primary</Type> + <Order>1</Order> + <Size>350</Size> + </CreatePartition> + <CreatePartition wcm:action="add"> + <Order>2</Order> + <Type>Primary</Type> + <Extend>true</Extend> + </CreatePartition> + </CreatePartitions> + <ModifyPartitions> + <ModifyPartition wcm:action="add"> + <Active>true</Active> + <Format>NTFS</Format> + <Label>boot</Label> + <Order>1</Order> + <PartitionID>1</PartitionID> + </ModifyPartition> + <ModifyPartition wcm:action="add"> + <Format>NTFS</Format> + <Label>Windows 2019</Label> + <Letter>C</Letter> + <Order>2</Order> + <PartitionID>2</PartitionID> + </ModifyPartition> + </ModifyPartitions> + <DiskID>0</DiskID> + <WillWipeDisk>true</WillWipeDisk> + </Disk> + </DiskConfiguration> + <ImageInstall> + <OSImage> + <InstallFrom> + <MetaData wcm:action="add"> + <Key>/IMAGE/NAME</Key> + <Value>Windows Server 2019 SERVERDATACENTER</Value> + </MetaData> + </InstallFrom> + <InstallTo> + <DiskID>0</DiskID> + <PartitionID>2</PartitionID> + </InstallTo> + </OSImage> + </ImageInstall> + <UserData> + <ProductKey> + <WillShowUI>OnError</WillShowUI> + </ProductKey> + <AcceptEula>true</AcceptEula> + <FullName>Vagrant</FullName> + <Organization>Bento by Chef Software, Inc.</Organization> + </UserData> + </component> + </settings> + <settings pass="generalize"> + <component name="Microsoft-Windows-Security-SPP" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <SkipRearm>1</SkipRearm> + </component> + <component name="Microsoft-Windows-PnpSysprep" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <PersistAllDeviceInstalls>false</PersistAllDeviceInstalls> + <DoNotCleanUpNonPresentDevices>false</DoNotCleanUpNonPresentDevices> + </component> + </settings> + <settings pass="oobeSystem"> + <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <InputLocale>en-US</InputLocale> + <SystemLocale>en-US</SystemLocale> + <UILanguage>en-US</UILanguage> + <UserLocale>en-US</UserLocale> + </component> + <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <OOBE> + <HideEULAPage>true</HideEULAPage> + <HideLocalAccountScreen>true</HideLocalAccountScreen> + <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen> + <HideOnlineAccountScreens>true</HideOnlineAccountScreens> + <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE> + <NetworkLocation>Home</NetworkLocation> + <ProtectYourPC>3</ProtectYourPC> + <SkipMachineOOBE>true</SkipMachineOOBE> + <SkipUserOOBE>true</SkipUserOOBE> + </OOBE> + <TimeZone>UTC</TimeZone> + <UserAccounts> + <AdministratorPassword> + <Value>vagrant</Value> + <PlainText>true</PlainText> + </AdministratorPassword> + <LocalAccounts> + <LocalAccount wcm:action="add"> + <Password> + <Value>vagrant</Value> + <PlainText>true</PlainText> + </Password> + <Description>Vagrant User</Description> + <DisplayName>vagrant</DisplayName> + <Group>administrators</Group> + <Name>vagrant</Name> + </LocalAccount> + </LocalAccounts> + </UserAccounts> + <AutoLogon> + <Password> + <Value>vagrant</Value> + <PlainText>true</PlainText> + </Password> + <Username>vagrant</Username> + <Enabled>true</Enabled> + </AutoLogon> + <FirstLogonCommands> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine> + <Description>Set Execution Policy 64 Bit</Description> + <Order>1</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>C:\Windows\SysWOW64\cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine> + <Description>Set Execution Policy 32 Bit</Description> + <Order>2</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c winrm quickconfig -q</CommandLine> + <Description>winrm quickconfig -q</Description> + <Order>3</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c winrm quickconfig -transport:http</CommandLine> + <Description>winrm quickconfig -transport:http</Description> + <Order>4</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c winrm set winrm/config @{MaxTimeoutms="1800000"}</CommandLine> + <Description>Win RM MaxTimoutms</Description> + <Order>5</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c winrm set winrm/config/winrs @{MaxMemoryPerShellMB="800"}</CommandLine> + <Description>Win RM MaxMemoryPerShellMB</Description> + <Order>6</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c winrm set winrm/config/service @{AllowUnencrypted="true"}</CommandLine> + <Description>Win RM AllowUnencrypted</Description> + <Order>7</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c winrm set winrm/config/service/auth @{Basic="true"}</CommandLine> + <Description>Win RM auth Basic</Description> + <Order>8</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c winrm set winrm/config/client/auth @{Basic="true"}</CommandLine> + <Description>Win RM client auth Basic</Description> + <Order>9</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c winrm set winrm/config/listener?Address=*+Transport=HTTP @{Port="5985"} </CommandLine> + <Description>Win RM listener Address/Port</Description> + <Order>10</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c netsh advfirewall firewall set rule group="remote administration" new enable=yes </CommandLine> + <Description>Win RM adv firewall enable</Description> + <Order>11</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c netsh firewall add portopening TCP 5985 "Port 5985" </CommandLine> + <Description>Win RM port open</Description> + <Order>12</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c net stop winrm </CommandLine> + <Description>Stop Win RM Service </Description> + <Order>13</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c sc config winrm start= auto</CommandLine> + <Description>Win RM Autostart</Description> + <Order>14</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c net start winrm</CommandLine> + <Description>Start Win RM Service</Description> + <Order>15</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c wmic useraccount where "name='vagrant'" set PasswordExpires=FALSE</CommandLine> + <Order>16</Order> + <Description>Disable password expiration for vagrant user</Description> + </SynchronousCommand> + </FirstLogonCommands> + </component> + </settings> + <settings pass="specialize"> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-ServerManager-SvrMgrNc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <DoNotOpenServerManagerAtLogon>true</DoNotOpenServerManagerAtLogon> + </component> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-IE-ESC" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <!-- Disable IE ESC. --> + <IEHardenAdmin>false</IEHardenAdmin> + <IEHardenUser>false</IEHardenUser> + </component> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-OutOfBoxExperience" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <DoNotOpenInitialConfigurationTasksAtLogon>true</DoNotOpenInitialConfigurationTasksAtLogon> + </component> + </settings> +</unattend> diff --git a/packer_templates/win_answer_files/2022/Autounattend.xml b/packer_templates/win_answer_files/2022/Autounattend.xml new file mode 100644 index 0000000..8d4b3d2 --- /dev/null +++ b/packer_templates/win_answer_files/2022/Autounattend.xml @@ -0,0 +1,289 @@ +<?xml version="1.0" encoding="utf-8"?> +<unattend xmlns="urn:schemas-microsoft-com:unattend"> + <settings pass="windowsPE"> + <component name="Microsoft-Windows-PnpCustomizationsWinPE" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" processorArchitecture="amd64" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"> + <!-- + This makes the VirtIO drivers available to Windows, assuming that + the VirtIO driver disk at https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso + (see https://docs.fedoraproject.org/en-US/quick-docs/creating-windows-virtual-machines-using-virtio-drivers/index.html#virtio-win-direct-downloads) + is available as drive E: + --> + <DriverPaths> + <PathAndCredentials wcm:action="add" wcm:keyValue="2"> + <Path>E:\viostor\2k22\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="3"> + <Path>E:\NetKVM\2k22\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="4"> + <Path>E:\Balloon\2k22\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="5"> + <Path>E:\pvpanic\2k22\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="6"> + <Path>E:\qemupciserial\2k22\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="7"> + <Path>E:\qxldod\2k22\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="8"> + <Path>E:\vioinput\2k22\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="9"> + <Path>E:\viorng\2k22\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="10"> + <Path>E:\vioscsi\2k22\amd64</Path> + </PathAndCredentials> + + <PathAndCredentials wcm:action="add" wcm:keyValue="11"> + <Path>E:\vioserial\2k22\amd64</Path> + </PathAndCredentials> + </DriverPaths> + </component> + <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <SetupUILanguage> + <UILanguage>en-US</UILanguage> + </SetupUILanguage> + <InputLocale>en-US</InputLocale> + <SystemLocale>en-US</SystemLocale> + <UILanguage>en-US</UILanguage> + <UILanguageFallback>en-US</UILanguageFallback> + <UserLocale>en-US</UserLocale> + </component> + <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <DiskConfiguration> + <Disk wcm:action="add"> + <CreatePartitions> + <CreatePartition wcm:action="add"> + <Type>Primary</Type> + <Order>1</Order> + <Size>350</Size> + </CreatePartition> + <CreatePartition wcm:action="add"> + <Order>2</Order> + <Type>Primary</Type> + <Extend>true</Extend> + </CreatePartition> + </CreatePartitions> + <ModifyPartitions> + <ModifyPartition wcm:action="add"> + <Active>true</Active> + <Format>NTFS</Format> + <Label>boot</Label> + <Order>1</Order> + <PartitionID>1</PartitionID> + </ModifyPartition> + <ModifyPartition wcm:action="add"> + <Format>NTFS</Format> + <Label>Windows 2022</Label> + <Letter>C</Letter> + <Order>2</Order> + <PartitionID>2</PartitionID> + </ModifyPartition> + </ModifyPartitions> + <DiskID>0</DiskID> + <WillWipeDisk>true</WillWipeDisk> + </Disk> + </DiskConfiguration> + <ImageInstall> + <OSImage> + <InstallFrom> + <MetaData wcm:action="add"> + <Key>/IMAGE/NAME</Key> + <Value>Windows Server 2022 SERVERDATACENTER</Value> + </MetaData> + </InstallFrom> + <InstallTo> + <DiskID>0</DiskID> + <PartitionID>2</PartitionID> + </InstallTo> + </OSImage> + </ImageInstall> + <UserData> + <ProductKey> + <WillShowUI>OnError</WillShowUI> + </ProductKey> + <AcceptEula>true</AcceptEula> + <FullName>Vagrant</FullName> + <Organization>Bento by Chef Software, Inc.</Organization> + </UserData> + </component> + </settings> + <settings pass="generalize"> + <component name="Microsoft-Windows-Security-SPP" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <SkipRearm>1</SkipRearm> + </component> + <component name="Microsoft-Windows-PnpSysprep" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <PersistAllDeviceInstalls>false</PersistAllDeviceInstalls> + <DoNotCleanUpNonPresentDevices>false</DoNotCleanUpNonPresentDevices> + </component> + </settings> + <settings pass="oobeSystem"> + <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <InputLocale>en-US</InputLocale> + <SystemLocale>en-US</SystemLocale> + <UILanguage>en-US</UILanguage> + <UserLocale>en-US</UserLocale> + </component> + <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <OOBE> + <HideEULAPage>true</HideEULAPage> + <HideLocalAccountScreen>true</HideLocalAccountScreen> + <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen> + <HideOnlineAccountScreens>true</HideOnlineAccountScreens> + <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE> + <NetworkLocation>Home</NetworkLocation> + <ProtectYourPC>3</ProtectYourPC> + <SkipMachineOOBE>true</SkipMachineOOBE> + <SkipUserOOBE>true</SkipUserOOBE> + </OOBE> + <TimeZone>UTC</TimeZone> + <UserAccounts> + <AdministratorPassword> + <Value>vagrant</Value> + <PlainText>true</PlainText> + </AdministratorPassword> + <LocalAccounts> + <LocalAccount wcm:action="add"> + <Password> + <Value>vagrant</Value> + <PlainText>true</PlainText> + </Password> + <Description>Vagrant User</Description> + <DisplayName>vagrant</DisplayName> + <Group>administrators</Group> + <Name>vagrant</Name> + </LocalAccount> + </LocalAccounts> + </UserAccounts> + <AutoLogon> + <Password> + <Value>vagrant</Value> + <PlainText>true</PlainText> + </Password> + <Username>vagrant</Username> + <Enabled>true</Enabled> + </AutoLogon> + <FirstLogonCommands> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine> + <Description>Set Execution Policy 64 Bit</Description> + <Order>1</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>C:\Windows\SysWOW64\cmd.exe /c powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine> + <Description>Set Execution Policy 32 Bit</Description> + <Order>2</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c winrm quickconfig -q</CommandLine> + <Description>winrm quickconfig -q</Description> + <Order>3</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c winrm quickconfig -transport:http</CommandLine> + <Description>winrm quickconfig -transport:http</Description> + <Order>4</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c winrm set winrm/config @{MaxTimeoutms="1800000"}</CommandLine> + <Description>Win RM MaxTimoutms</Description> + <Order>5</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c winrm set winrm/config/winrs @{MaxMemoryPerShellMB="800"}</CommandLine> + <Description>Win RM MaxMemoryPerShellMB</Description> + <Order>6</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c winrm set winrm/config/service @{AllowUnencrypted="true"}</CommandLine> + <Description>Win RM AllowUnencrypted</Description> + <Order>7</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c winrm set winrm/config/service/auth @{Basic="true"}</CommandLine> + <Description>Win RM auth Basic</Description> + <Order>8</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c winrm set winrm/config/client/auth @{Basic="true"}</CommandLine> + <Description>Win RM client auth Basic</Description> + <Order>9</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c winrm set winrm/config/listener?Address=*+Transport=HTTP @{Port="5985"} </CommandLine> + <Description>Win RM listener Address/Port</Description> + <Order>10</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c netsh advfirewall firewall set rule group="remote administration" new enable=yes </CommandLine> + <Description>Win RM adv firewall enable</Description> + <Order>11</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c netsh firewall add portopening TCP 5985 "Port 5985" </CommandLine> + <Description>Win RM port open</Description> + <Order>12</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c net stop winrm </CommandLine> + <Description>Stop Win RM Service </Description> + <Order>13</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c sc config winrm start= auto</CommandLine> + <Description>Win RM Autostart</Description> + <Order>14</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c net start winrm</CommandLine> + <Description>Start Win RM Service</Description> + <Order>15</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>cmd.exe /c wmic useraccount where "name='vagrant'" set PasswordExpires=FALSE</CommandLine> + <Order>16</Order> + <Description>Disable password expiration for vagrant user</Description> + </SynchronousCommand> + </FirstLogonCommands> + </component> + </settings> + <settings pass="specialize"> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-ServerManager-SvrMgrNc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <DoNotOpenServerManagerAtLogon>true</DoNotOpenServerManagerAtLogon> + </component> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-IE-ESC" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <!-- Disable IE ESC. --> + <IEHardenAdmin>false</IEHardenAdmin> + <IEHardenUser>false</IEHardenUser> + </component> + <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-OutOfBoxExperience" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> + <DoNotOpenInitialConfigurationTasksAtLogon>true</DoNotOpenInitialConfigurationTasksAtLogon> + </component> + </settings> +</unattend>