├── .azure-pipelines ├── development-ubuntu │ ├── 2204 │ │ ├── hyperv.yml │ │ ├── virtualbox.yml │ │ └── vmware.yml │ └── 2404 │ │ ├── hyperv.yml │ │ ├── virtualbox.yml │ │ └── vmware.yml ├── docker-linux │ └── community-ubuntu-server │ │ ├── hyperv.yml │ │ ├── virtualbox.yml │ │ └── vmware.yml ├── docker-windows │ ├── community-windows-server-core │ │ ├── hyperv.yml │ │ ├── virtualbox.yml │ │ └── vmware.yml │ └── community-windows-server │ │ ├── hyperv.yml │ │ ├── virtualbox.yml │ │ └── vmware.yml ├── iis │ ├── windows-server-core │ │ ├── hyperv.yml │ │ ├── virtualbox.yml │ │ └── vmware.yml │ └── windows-server │ │ ├── hyperv.yml │ │ ├── virtualbox.yml │ │ └── vmware.yml ├── jobs.yml ├── kitchen-ubuntu │ ├── 2204 │ │ ├── hyperv.yml │ │ ├── virtualbox.yml │ │ └── vmware.yml │ └── 2404 │ │ ├── hyperv.yml │ │ ├── virtualbox.yml │ │ └── vmware.yml ├── kitchen-windows │ ├── 2022 │ │ ├── hyperv.yml │ │ ├── virtualbox.yml │ │ └── vmware.yml │ └── 2025 │ │ ├── hyperv.yml │ │ ├── virtualbox.yml │ │ └── vmware.yml ├── sql-server │ ├── 2019-developer-windows-server-core │ │ ├── hyperv.yml │ │ ├── virtualbox.yml │ │ └── vmware.yml │ └── 2019-developer-windows-server │ │ ├── hyperv.yml │ │ ├── virtualbox.yml │ │ └── vmware.yml ├── stages.yml ├── ubuntu-desktop │ ├── 2004-lts-ubuntu │ │ ├── hyperv.yml │ │ ├── virtualbox.yml │ │ └── vmware.yml │ ├── 2004-lts-xubuntu │ │ ├── hyperv.yml │ │ ├── virtualbox.yml │ │ └── vmware.yml │ ├── 2204-lts-ubuntu │ │ ├── hyperv.yml │ │ ├── virtualbox.yml │ │ └── vmware.yml │ ├── 2204-lts-xubuntu │ │ ├── hyperv.yml │ │ ├── virtualbox.yml │ │ └── vmware.yml │ ├── 2404-lts-ubuntu │ │ ├── hyperv.yml │ │ ├── virtualbox.yml │ │ └── vmware.yml │ └── 2404-lts-xubuntu │ │ ├── hyperv.yml │ │ ├── virtualbox.yml │ │ └── vmware.yml ├── ubuntu-server │ ├── 2004-lts │ │ ├── hyperv.yml │ │ ├── virtualbox.yml │ │ └── vmware.yml │ ├── 2204-lts │ │ ├── hyperv.yml │ │ ├── virtualbox.yml │ │ └── vmware.yml │ └── 2404-lts │ │ ├── hyperv.yml │ │ ├── virtualbox.yml │ │ └── vmware.yml ├── visual-studio │ ├── 2022-community-windows-10 │ │ ├── hyperv.yml │ │ ├── virtualbox.yml │ │ └── vmware.yml │ └── 2022-community-windows-11 │ │ ├── hyperv.yml │ │ ├── virtualbox.yml │ │ └── vmware.yml ├── windows-10 │ ├── 21h2-enterprise-ltsc │ │ ├── hyperv.yml │ │ ├── virtualbox.yml │ │ └── vmware.yml │ └── 22h2-enterprise │ │ ├── hyperv.yml │ │ ├── virtualbox.yml │ │ └── vmware.yml ├── windows-11 │ ├── 21h2-enterprise │ │ ├── hyperv.yml │ │ ├── virtualbox.yml │ │ └── vmware.yml │ ├── 22h2-enterprise │ │ ├── hyperv.yml │ │ ├── virtualbox.yml │ │ └── vmware.yml │ ├── 23h2-enterprise │ │ ├── hyperv.yml │ │ ├── virtualbox.yml │ │ └── vmware.yml │ ├── 24h2-enterprise-ltsc │ │ ├── hyperv.yml │ │ ├── virtualbox.yml │ │ └── vmware.yml │ ├── 24h2-enterprise │ │ ├── hyperv.yml │ │ ├── virtualbox.yml │ │ └── vmware.yml │ └── insider-preview-enterprise │ │ ├── hyperv.yml │ │ ├── virtualbox.yml │ │ └── vmware.yml └── windows-server │ ├── 2022-standard-core │ ├── hyperv.yml │ ├── virtualbox.yml │ └── vmware.yml │ ├── 2022-standard │ ├── hyperv.yml │ ├── virtualbox.yml │ └── vmware.yml │ ├── 2025-standard-core │ ├── hyperv.yml │ ├── virtualbox.yml │ └── vmware.yml │ ├── 2025-standard │ ├── hyperv.yml │ ├── virtualbox.yml │ └── vmware.yml │ ├── insider-preview-standard-core │ ├── hyperv.yml │ ├── virtualbox.yml │ └── vmware.yml │ └── insider-preview-standard │ ├── hyperv.yml │ ├── virtualbox.yml │ └── vmware.yml ├── .config └── dotnet-tools.json ├── .gitattributes ├── .gitignore ├── .gitmodules ├── .rubocop.yml ├── LICENSE.md ├── README.md ├── build.cake ├── samples ├── README.md ├── core.Vagrantfile ├── development-ubuntu │ ├── Policyfile.rb │ ├── Policyfile.yml │ ├── README.md │ ├── Vagrantfile │ └── images.pkrvars.hcl ├── docker-linux │ ├── Policyfile.rb │ ├── Policyfile.yml │ ├── README.md │ ├── Vagrantfile │ └── images.pkrvars.hcl ├── docker-windows │ ├── Policyfile.rb │ ├── Policyfile.yml │ ├── README.md │ ├── Vagrantfile │ └── images.pkrvars.hcl ├── iis │ ├── Policyfile.rb │ ├── Policyfile.yml │ ├── README.md │ ├── Vagrantfile │ └── images.pkrvars.hcl ├── kitchen-ubuntu │ ├── Policyfile.rb │ ├── README.md │ ├── Vagrantfile │ └── images.pkrvars.hcl ├── kitchen-windows │ ├── Policyfile.rb │ ├── README.md │ ├── Vagrantfile │ └── images.pkrvars.hcl ├── sql-server │ ├── Policyfile.rb │ ├── Policyfile.yml │ ├── README.md │ ├── Vagrantfile │ ├── attributes.management-studio.json │ └── images.pkrvars.hcl ├── ubuntu-desktop │ ├── Policyfile.rb │ ├── README.md │ ├── Vagrantfile │ ├── attributes.ubuntu.json │ ├── attributes.xubuntu.json │ └── images.pkrvars.hcl ├── ubuntu-server │ ├── Policyfile.rb │ ├── README.md │ ├── Vagrantfile │ └── images.pkrvars.hcl ├── visual-studio │ ├── Policyfile.rb │ ├── README.md │ ├── Vagrantfile │ ├── attributes.2022-community.json │ └── images.pkrvars.hcl ├── windows-10 │ ├── Policyfile.rb │ ├── README.md │ ├── Vagrantfile │ └── images.pkrvars.hcl ├── windows-11 │ ├── Policyfile.rb │ ├── README.md │ ├── Vagrantfile │ ├── images.pkrvars.hcl │ └── setup.cmd └── windows-server │ ├── Policyfile.rb │ ├── README.md │ ├── Vagrantfile │ └── images.pkrvars.hcl └── src ├── ubuntu ├── boot │ ├── hyperv │ │ ├── meta-data │ │ └── user-data │ ├── virtualbox │ │ ├── meta-data │ │ └── user-data │ └── vmware │ │ ├── meta-data │ │ └── user-data ├── build.native.pkr.hcl ├── build.vagrant.pkr.hcl ├── chef │ ├── Policyfile.rb │ ├── apply.sh │ ├── cleanup.sh │ ├── cookbooks │ │ └── gusztavvargadr_packer_ubuntu │ │ │ ├── metadata.rb │ │ │ └── recipes │ │ │ ├── apply.rb │ │ │ ├── cleanup.rb │ │ │ ├── default.rb │ │ │ └── initialize.rb │ └── initialize.sh ├── core.pkr.hcl ├── source.amazon-ebs.pkr.hcl ├── source.core.pkr.hcl ├── source.hyperv.pkr.hcl ├── source.virtualbox.pkr.hcl ├── source.vmware.pkr.hcl └── vagrant │ ├── template.Vagrantfile │ └── vagrant.sh └── windows ├── boot ├── autounattend-first-logon.ps1 └── autounattend.xml ├── build.native.pkr.hcl ├── build.vagrant.pkr.hcl ├── chef ├── Policyfile.rb ├── apply.ps1 ├── cleanup.ps1 ├── cookbooks │ └── gusztavvargadr_packer_windows │ │ ├── metadata.rb │ │ └── recipes │ │ ├── apply.rb │ │ ├── cleanup.rb │ │ ├── default.rb │ │ └── initialize.rb └── initialize.ps1 ├── core.pkr.hcl ├── source.amazon-ebs.pkr.hcl ├── source.core.pkr.hcl ├── source.hyperv.pkr.hcl ├── source.virtualbox.pkr.hcl ├── source.vmware.pkr.hcl └── vagrant ├── Autounattend.ps1 ├── Autounattend.xml ├── cleanup.ps1 ├── shutdown.cmd ├── template.Vagrantfile └── vagrant.pub /.azure-pipelines/development-ubuntu/2204/hyperv.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: ubuntu-server.2204-lts.hyperv 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: development-ubuntu 13 | image: "2204" 14 | provider: hyperv 15 | -------------------------------------------------------------------------------- /.azure-pipelines/development-ubuntu/2204/virtualbox.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: ubuntu-server.2204-lts.virtualbox 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: development-ubuntu 13 | image: "2204" 14 | provider: virtualbox 15 | -------------------------------------------------------------------------------- /.azure-pipelines/development-ubuntu/2204/vmware.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: ubuntu-server.2204-lts.vmware 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: development-ubuntu 13 | image: "2204" 14 | provider: vmware 15 | -------------------------------------------------------------------------------- /.azure-pipelines/development-ubuntu/2404/hyperv.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: ubuntu-server.2404-lts.hyperv 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: development-ubuntu 13 | image: "2404" 14 | provider: hyperv 15 | -------------------------------------------------------------------------------- /.azure-pipelines/development-ubuntu/2404/virtualbox.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: ubuntu-server.2404-lts.virtualbox 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: development-ubuntu 13 | image: "2404" 14 | provider: virtualbox 15 | -------------------------------------------------------------------------------- /.azure-pipelines/development-ubuntu/2404/vmware.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: ubuntu-server.2404-lts.vmware 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: development-ubuntu 13 | image: "2404" 14 | provider: vmware 15 | -------------------------------------------------------------------------------- /.azure-pipelines/docker-linux/community-ubuntu-server/hyperv.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: ubuntu-server.2404-lts.hyperv 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: docker-linux 13 | image: community-ubuntu-server 14 | provider: hyperv 15 | -------------------------------------------------------------------------------- /.azure-pipelines/docker-linux/community-ubuntu-server/virtualbox.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: ubuntu-server.2404-lts.virtualbox 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: docker-linux 13 | image: community-ubuntu-server 14 | provider: virtualbox 15 | -------------------------------------------------------------------------------- /.azure-pipelines/docker-linux/community-ubuntu-server/vmware.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: ubuntu-server.2404-lts.vmware 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: docker-linux 13 | image: community-ubuntu-server 14 | provider: vmware 15 | -------------------------------------------------------------------------------- /.azure-pipelines/docker-windows/community-windows-server-core/hyperv.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: windows-server.2025-standard-core.hyperv 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: docker-windows 13 | image: community-windows-server-core 14 | provider: hyperv 15 | -------------------------------------------------------------------------------- /.azure-pipelines/docker-windows/community-windows-server-core/virtualbox.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: windows-server.2025-standard-core.virtualbox 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: docker-windows 13 | image: community-windows-server-core 14 | provider: virtualbox 15 | -------------------------------------------------------------------------------- /.azure-pipelines/docker-windows/community-windows-server-core/vmware.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: windows-server.2025-standard-core.vmware 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: docker-windows 13 | image: community-windows-server-core 14 | provider: vmware 15 | -------------------------------------------------------------------------------- /.azure-pipelines/docker-windows/community-windows-server/hyperv.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: windows-server.2025-standard.hyperv 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: docker-windows 13 | image: community-windows-server 14 | provider: hyperv 15 | -------------------------------------------------------------------------------- /.azure-pipelines/docker-windows/community-windows-server/virtualbox.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: windows-server.2025-standard.virtualbox 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: docker-windows 13 | image: community-windows-server 14 | provider: virtualbox 15 | -------------------------------------------------------------------------------- /.azure-pipelines/docker-windows/community-windows-server/vmware.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: windows-server.2025-standard.vmware 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: docker-windows 13 | image: community-windows-server 14 | provider: vmware 15 | -------------------------------------------------------------------------------- /.azure-pipelines/iis/windows-server-core/hyperv.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: windows-server.2022-standard-core.hyperv 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: iis 13 | image: windows-server-core 14 | provider: hyperv 15 | -------------------------------------------------------------------------------- /.azure-pipelines/iis/windows-server-core/virtualbox.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: windows-server.2022-standard-core.virtualbox 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: iis 13 | image: windows-server-core 14 | provider: virtualbox 15 | -------------------------------------------------------------------------------- /.azure-pipelines/iis/windows-server-core/vmware.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: windows-server.2022-standard-core.vmware 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: iis 13 | image: windows-server-core 14 | provider: vmware 15 | -------------------------------------------------------------------------------- /.azure-pipelines/iis/windows-server/hyperv.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: windows-server.2022-standard.hyperv 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: iis 13 | image: windows-server 14 | provider: hyperv 15 | -------------------------------------------------------------------------------- /.azure-pipelines/iis/windows-server/virtualbox.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: windows-server.2022-standard.virtualbox 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: iis 13 | image: windows-server 14 | provider: virtualbox 15 | -------------------------------------------------------------------------------- /.azure-pipelines/iis/windows-server/vmware.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: windows-server.2022-standard.vmware 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: iis 13 | image: windows-server 14 | provider: vmware 15 | -------------------------------------------------------------------------------- /.azure-pipelines/kitchen-ubuntu/2204/hyperv.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: ubuntu-server.2204-lts.hyperv 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: kitchen-ubuntu 13 | image: "2204" 14 | provider: hyperv 15 | -------------------------------------------------------------------------------- /.azure-pipelines/kitchen-ubuntu/2204/virtualbox.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: ubuntu-server.2204-lts.virtualbox 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: kitchen-ubuntu 13 | image: "2204" 14 | provider: virtualbox 15 | -------------------------------------------------------------------------------- /.azure-pipelines/kitchen-ubuntu/2204/vmware.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: ubuntu-server.2204-lts.vmware 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: kitchen-ubuntu 13 | image: "2204" 14 | provider: vmware 15 | -------------------------------------------------------------------------------- /.azure-pipelines/kitchen-ubuntu/2404/hyperv.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: ubuntu-server.2404-lts.hyperv 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: kitchen-ubuntu 13 | image: "2404" 14 | provider: hyperv 15 | -------------------------------------------------------------------------------- /.azure-pipelines/kitchen-ubuntu/2404/virtualbox.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: ubuntu-server.2404-lts.virtualbox 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: kitchen-ubuntu 13 | image: "2404" 14 | provider: virtualbox 15 | -------------------------------------------------------------------------------- /.azure-pipelines/kitchen-ubuntu/2404/vmware.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: ubuntu-server.2404-lts.vmware 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: kitchen-ubuntu 13 | image: "2404" 14 | provider: vmware 15 | -------------------------------------------------------------------------------- /.azure-pipelines/kitchen-windows/2022/hyperv.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: windows-server.2022-standard.hyperv 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: kitchen-windows 13 | image: "2022" 14 | provider: hyperv 15 | -------------------------------------------------------------------------------- /.azure-pipelines/kitchen-windows/2022/virtualbox.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: windows-server.2022-standard.virtualbox 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: kitchen-windows 13 | image: "2022" 14 | provider: virtualbox 15 | -------------------------------------------------------------------------------- /.azure-pipelines/kitchen-windows/2022/vmware.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: windows-server.2022-standard.vmware 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: kitchen-windows 13 | image: "2022" 14 | provider: vmware 15 | -------------------------------------------------------------------------------- /.azure-pipelines/kitchen-windows/2025/hyperv.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: windows-server.2025-standard.hyperv 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: kitchen-windows 13 | image: "2025" 14 | provider: hyperv 15 | -------------------------------------------------------------------------------- /.azure-pipelines/kitchen-windows/2025/virtualbox.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: windows-server.2025-standard.virtualbox 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: kitchen-windows 13 | image: "2025" 14 | provider: virtualbox 15 | -------------------------------------------------------------------------------- /.azure-pipelines/kitchen-windows/2025/vmware.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: windows-server.2025-standard.vmware 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: kitchen-windows 13 | image: "2025" 14 | provider: vmware 15 | -------------------------------------------------------------------------------- /.azure-pipelines/sql-server/2019-developer-windows-server-core/hyperv.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: windows-server.2022-standard-core.hyperv 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: sql-server 13 | image: 2019-developer-windows-server-core 14 | provider: hyperv 15 | -------------------------------------------------------------------------------- /.azure-pipelines/sql-server/2019-developer-windows-server-core/virtualbox.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: windows-server.2022-standard-core.virtualbox 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: sql-server 13 | image: 2019-developer-windows-server-core 14 | provider: virtualbox 15 | -------------------------------------------------------------------------------- /.azure-pipelines/sql-server/2019-developer-windows-server-core/vmware.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: windows-server.2022-standard-core.vmware 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: sql-server 13 | image: 2019-developer-windows-server-core 14 | provider: vmware 15 | -------------------------------------------------------------------------------- /.azure-pipelines/sql-server/2019-developer-windows-server/hyperv.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: windows-server.2022-standard.hyperv 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: sql-server 13 | image: 2019-developer-windows-server 14 | provider: hyperv 15 | -------------------------------------------------------------------------------- /.azure-pipelines/sql-server/2019-developer-windows-server/virtualbox.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: windows-server.2022-standard.virtualbox 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: sql-server 13 | image: 2019-developer-windows-server 14 | provider: virtualbox 15 | -------------------------------------------------------------------------------- /.azure-pipelines/sql-server/2019-developer-windows-server/vmware.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: windows-server.2022-standard.vmware 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: sql-server 13 | image: 2019-developer-windows-server 14 | provider: vmware 15 | -------------------------------------------------------------------------------- /.azure-pipelines/stages.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | sample: '' 3 | image: '' 4 | provider: '' 5 | 6 | stages: 7 | - stage: native 8 | displayName: Native 9 | 10 | jobs: 11 | - template: ./jobs.yml 12 | parameters: 13 | sample: ${{ parameters.sample }} 14 | image: ${{ parameters.image }} 15 | provider: ${{ parameters.provider }} 16 | build: native 17 | 18 | - stage: vagrant 19 | displayName: Vagrant 20 | 21 | jobs: 22 | - template: ./jobs.yml 23 | parameters: 24 | sample: ${{ parameters.sample }} 25 | image: ${{ parameters.image }} 26 | provider: ${{ parameters.provider }} 27 | build: vagrant 28 | -------------------------------------------------------------------------------- /.azure-pipelines/ubuntu-desktop/2004-lts-ubuntu/hyperv.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: ubuntu-server.2004-lts.hyperv 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: ubuntu-desktop 13 | image: 2004-lts-ubuntu 14 | provider: hyperv 15 | -------------------------------------------------------------------------------- /.azure-pipelines/ubuntu-desktop/2004-lts-ubuntu/virtualbox.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: ubuntu-server.2004-lts.virtualbox 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: ubuntu-desktop 13 | image: 2004-lts-ubuntu 14 | provider: virtualbox 15 | -------------------------------------------------------------------------------- /.azure-pipelines/ubuntu-desktop/2004-lts-ubuntu/vmware.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: ubuntu-server.2004-lts.vmware 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: ubuntu-desktop 13 | image: 2004-lts-ubuntu 14 | provider: vmware 15 | -------------------------------------------------------------------------------- /.azure-pipelines/ubuntu-desktop/2004-lts-xubuntu/hyperv.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: ubuntu-server.2004-lts.hyperv 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: ubuntu-desktop 13 | image: 2004-lts-xubuntu 14 | provider: hyperv 15 | -------------------------------------------------------------------------------- /.azure-pipelines/ubuntu-desktop/2004-lts-xubuntu/virtualbox.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: ubuntu-server.2004-lts.virtualbox 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: ubuntu-desktop 13 | image: 2004-lts-xubuntu 14 | provider: virtualbox 15 | -------------------------------------------------------------------------------- /.azure-pipelines/ubuntu-desktop/2004-lts-xubuntu/vmware.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: ubuntu-server.2004-lts.vmware 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: ubuntu-desktop 13 | image: 2004-lts-xubuntu 14 | provider: vmware 15 | -------------------------------------------------------------------------------- /.azure-pipelines/ubuntu-desktop/2204-lts-ubuntu/hyperv.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: ubuntu-server.2204-lts.hyperv 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: ubuntu-desktop 13 | image: 2204-lts-ubuntu 14 | provider: hyperv 15 | -------------------------------------------------------------------------------- /.azure-pipelines/ubuntu-desktop/2204-lts-ubuntu/virtualbox.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: ubuntu-server.2204-lts.virtualbox 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: ubuntu-desktop 13 | image: 2204-lts-ubuntu 14 | provider: virtualbox 15 | -------------------------------------------------------------------------------- /.azure-pipelines/ubuntu-desktop/2204-lts-ubuntu/vmware.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: ubuntu-server.2204-lts.vmware 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: ubuntu-desktop 13 | image: 2204-lts-ubuntu 14 | provider: vmware 15 | -------------------------------------------------------------------------------- /.azure-pipelines/ubuntu-desktop/2204-lts-xubuntu/hyperv.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: ubuntu-server.2204-lts.hyperv 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: ubuntu-desktop 13 | image: 2204-lts-xubuntu 14 | provider: hyperv 15 | -------------------------------------------------------------------------------- /.azure-pipelines/ubuntu-desktop/2204-lts-xubuntu/virtualbox.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: ubuntu-server.2204-lts.virtualbox 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: ubuntu-desktop 13 | image: 2204-lts-xubuntu 14 | provider: virtualbox 15 | -------------------------------------------------------------------------------- /.azure-pipelines/ubuntu-desktop/2204-lts-xubuntu/vmware.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: ubuntu-server.2204-lts.vmware 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: ubuntu-desktop 13 | image: 2204-lts-xubuntu 14 | provider: vmware 15 | -------------------------------------------------------------------------------- /.azure-pipelines/ubuntu-desktop/2404-lts-ubuntu/hyperv.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: ubuntu-desktop 8 | image: 2404-lts-ubuntu 9 | provider: hyperv 10 | -------------------------------------------------------------------------------- /.azure-pipelines/ubuntu-desktop/2404-lts-ubuntu/virtualbox.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: ubuntu-desktop 8 | image: 2404-lts-ubuntu 9 | provider: virtualbox 10 | -------------------------------------------------------------------------------- /.azure-pipelines/ubuntu-desktop/2404-lts-ubuntu/vmware.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: ubuntu-desktop 8 | image: 2404-lts-ubuntu 9 | provider: vmware 10 | -------------------------------------------------------------------------------- /.azure-pipelines/ubuntu-desktop/2404-lts-xubuntu/hyperv.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: ubuntu-desktop 8 | image: 2404-lts-xubuntu 9 | provider: hyperv 10 | -------------------------------------------------------------------------------- /.azure-pipelines/ubuntu-desktop/2404-lts-xubuntu/virtualbox.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: ubuntu-desktop 8 | image: 2404-lts-xubuntu 9 | provider: virtualbox 10 | -------------------------------------------------------------------------------- /.azure-pipelines/ubuntu-desktop/2404-lts-xubuntu/vmware.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: ubuntu-desktop 8 | image: 2404-lts-xubuntu 9 | provider: vmware 10 | -------------------------------------------------------------------------------- /.azure-pipelines/ubuntu-server/2004-lts/hyperv.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: ubuntu-server 8 | image: 2004-lts 9 | provider: hyperv 10 | -------------------------------------------------------------------------------- /.azure-pipelines/ubuntu-server/2004-lts/virtualbox.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: ubuntu-server 8 | image: 2004-lts 9 | provider: virtualbox 10 | -------------------------------------------------------------------------------- /.azure-pipelines/ubuntu-server/2004-lts/vmware.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: ubuntu-server 8 | image: 2004-lts 9 | provider: vmware 10 | -------------------------------------------------------------------------------- /.azure-pipelines/ubuntu-server/2204-lts/hyperv.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: ubuntu-server 8 | image: 2204-lts 9 | provider: hyperv 10 | -------------------------------------------------------------------------------- /.azure-pipelines/ubuntu-server/2204-lts/virtualbox.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: ubuntu-server 8 | image: 2204-lts 9 | provider: virtualbox 10 | -------------------------------------------------------------------------------- /.azure-pipelines/ubuntu-server/2204-lts/vmware.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: ubuntu-server 8 | image: 2204-lts 9 | provider: vmware 10 | -------------------------------------------------------------------------------- /.azure-pipelines/ubuntu-server/2404-lts/hyperv.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: ubuntu-server 8 | image: 2404-lts 9 | provider: hyperv 10 | -------------------------------------------------------------------------------- /.azure-pipelines/ubuntu-server/2404-lts/virtualbox.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: ubuntu-server 8 | image: 2404-lts 9 | provider: virtualbox 10 | -------------------------------------------------------------------------------- /.azure-pipelines/ubuntu-server/2404-lts/vmware.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: ubuntu-server 8 | image: 2404-lts 9 | provider: vmware 10 | -------------------------------------------------------------------------------- /.azure-pipelines/visual-studio/2022-community-windows-10/hyperv.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: windows-10.22h2-enterprise.hyperv 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: visual-studio 13 | image: 2022-community-windows-10 14 | provider: hyperv 15 | -------------------------------------------------------------------------------- /.azure-pipelines/visual-studio/2022-community-windows-10/virtualbox.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: windows-10.22h2-enterprise.virtualbox 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: visual-studio 13 | image: 2022-community-windows-10 14 | provider: virtualbox 15 | -------------------------------------------------------------------------------- /.azure-pipelines/visual-studio/2022-community-windows-10/vmware.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: windows-10.22h2-enterprise.vmware 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: visual-studio 13 | image: 2022-community-windows-10 14 | provider: vmware 15 | -------------------------------------------------------------------------------- /.azure-pipelines/visual-studio/2022-community-windows-11/hyperv.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: windows-11.24h2-enterprise.hyperv 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: visual-studio 13 | image: 2022-community-windows-11 14 | provider: hyperv 15 | -------------------------------------------------------------------------------- /.azure-pipelines/visual-studio/2022-community-windows-11/virtualbox.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: windows-11.24h2-enterprise.virtualbox 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: visual-studio 13 | image: 2022-community-windows-11 14 | provider: virtualbox 15 | -------------------------------------------------------------------------------- /.azure-pipelines/visual-studio/2022-community-windows-11/vmware.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | resources: 5 | pipelines: 6 | - pipeline: source 7 | source: windows-11.24h2-enterprise.vmware 8 | 9 | stages: 10 | - template: ../../stages.yml 11 | parameters: 12 | sample: visual-studio 13 | image: 2022-community-windows-11 14 | provider: vmware 15 | -------------------------------------------------------------------------------- /.azure-pipelines/windows-10/21h2-enterprise-ltsc/hyperv.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: windows-10 8 | image: 21h2-enterprise-ltsc 9 | provider: hyperv 10 | -------------------------------------------------------------------------------- /.azure-pipelines/windows-10/21h2-enterprise-ltsc/virtualbox.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: windows-10 8 | image: 21h2-enterprise-ltsc 9 | provider: virtualbox 10 | -------------------------------------------------------------------------------- /.azure-pipelines/windows-10/21h2-enterprise-ltsc/vmware.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: windows-10 8 | image: 21h2-enterprise-ltsc 9 | provider: vmware 10 | -------------------------------------------------------------------------------- /.azure-pipelines/windows-10/22h2-enterprise/hyperv.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: windows-10 8 | image: 22h2-enterprise 9 | provider: hyperv 10 | -------------------------------------------------------------------------------- /.azure-pipelines/windows-10/22h2-enterprise/virtualbox.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: windows-10 8 | image: 22h2-enterprise 9 | provider: virtualbox 10 | -------------------------------------------------------------------------------- /.azure-pipelines/windows-10/22h2-enterprise/vmware.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: windows-10 8 | image: 22h2-enterprise 9 | provider: vmware 10 | -------------------------------------------------------------------------------- /.azure-pipelines/windows-11/21h2-enterprise/hyperv.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: windows-11 8 | image: 21h2-enterprise 9 | provider: hyperv 10 | -------------------------------------------------------------------------------- /.azure-pipelines/windows-11/21h2-enterprise/virtualbox.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: windows-11 8 | image: 21h2-enterprise 9 | provider: virtualbox 10 | -------------------------------------------------------------------------------- /.azure-pipelines/windows-11/21h2-enterprise/vmware.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: windows-11 8 | image: 21h2-enterprise 9 | provider: vmware 10 | -------------------------------------------------------------------------------- /.azure-pipelines/windows-11/22h2-enterprise/hyperv.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: windows-11 8 | image: 22h2-enterprise 9 | provider: hyperv 10 | -------------------------------------------------------------------------------- /.azure-pipelines/windows-11/22h2-enterprise/virtualbox.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: windows-11 8 | image: 22h2-enterprise 9 | provider: virtualbox 10 | -------------------------------------------------------------------------------- /.azure-pipelines/windows-11/22h2-enterprise/vmware.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: windows-11 8 | image: 22h2-enterprise 9 | provider: vmware 10 | -------------------------------------------------------------------------------- /.azure-pipelines/windows-11/23h2-enterprise/hyperv.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: windows-11 8 | image: 23h2-enterprise 9 | provider: hyperv 10 | -------------------------------------------------------------------------------- /.azure-pipelines/windows-11/23h2-enterprise/virtualbox.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: windows-11 8 | image: 23h2-enterprise 9 | provider: virtualbox 10 | -------------------------------------------------------------------------------- /.azure-pipelines/windows-11/23h2-enterprise/vmware.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: windows-11 8 | image: 23h2-enterprise 9 | provider: vmware 10 | -------------------------------------------------------------------------------- /.azure-pipelines/windows-11/24h2-enterprise-ltsc/hyperv.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: windows-11 8 | image: 24h2-enterprise-ltsc 9 | provider: hyperv 10 | -------------------------------------------------------------------------------- /.azure-pipelines/windows-11/24h2-enterprise-ltsc/virtualbox.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: windows-11 8 | image: 24h2-enterprise-ltsc 9 | provider: virtualbox 10 | -------------------------------------------------------------------------------- /.azure-pipelines/windows-11/24h2-enterprise-ltsc/vmware.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: windows-11 8 | image: 24h2-enterprise-ltsc 9 | provider: vmware 10 | -------------------------------------------------------------------------------- /.azure-pipelines/windows-11/24h2-enterprise/hyperv.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: windows-11 8 | image: 24h2-enterprise 9 | provider: hyperv 10 | -------------------------------------------------------------------------------- /.azure-pipelines/windows-11/24h2-enterprise/virtualbox.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: windows-11 8 | image: 24h2-enterprise 9 | provider: virtualbox 10 | -------------------------------------------------------------------------------- /.azure-pipelines/windows-11/24h2-enterprise/vmware.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: windows-11 8 | image: 24h2-enterprise 9 | provider: vmware 10 | -------------------------------------------------------------------------------- /.azure-pipelines/windows-11/insider-preview-enterprise/hyperv.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: windows-11 8 | image: insider-preview-enterprise 9 | provider: hyperv 10 | -------------------------------------------------------------------------------- /.azure-pipelines/windows-11/insider-preview-enterprise/virtualbox.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: windows-11 8 | image: insider-preview-enterprise 9 | provider: virtualbox 10 | -------------------------------------------------------------------------------- /.azure-pipelines/windows-11/insider-preview-enterprise/vmware.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: windows-11 8 | image: insider-preview-enterprise 9 | provider: vmware 10 | -------------------------------------------------------------------------------- /.azure-pipelines/windows-server/2022-standard-core/hyperv.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: windows-server 8 | image: 2022-standard-core 9 | provider: hyperv 10 | -------------------------------------------------------------------------------- /.azure-pipelines/windows-server/2022-standard-core/virtualbox.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: windows-server 8 | image: 2022-standard-core 9 | provider: virtualbox 10 | -------------------------------------------------------------------------------- /.azure-pipelines/windows-server/2022-standard-core/vmware.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: windows-server 8 | image: 2022-standard-core 9 | provider: vmware 10 | -------------------------------------------------------------------------------- /.azure-pipelines/windows-server/2022-standard/hyperv.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: windows-server 8 | image: 2022-standard 9 | provider: hyperv 10 | -------------------------------------------------------------------------------- /.azure-pipelines/windows-server/2022-standard/virtualbox.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: windows-server 8 | image: 2022-standard 9 | provider: virtualbox 10 | -------------------------------------------------------------------------------- /.azure-pipelines/windows-server/2022-standard/vmware.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: windows-server 8 | image: 2022-standard 9 | provider: vmware 10 | -------------------------------------------------------------------------------- /.azure-pipelines/windows-server/2025-standard-core/hyperv.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: windows-server 8 | image: 2025-standard-core 9 | provider: hyperv 10 | -------------------------------------------------------------------------------- /.azure-pipelines/windows-server/2025-standard-core/virtualbox.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: windows-server 8 | image: 2025-standard-core 9 | provider: virtualbox 10 | -------------------------------------------------------------------------------- /.azure-pipelines/windows-server/2025-standard-core/vmware.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: windows-server 8 | image: 2025-standard-core 9 | provider: vmware 10 | -------------------------------------------------------------------------------- /.azure-pipelines/windows-server/2025-standard/hyperv.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: windows-server 8 | image: 2025-standard 9 | provider: hyperv 10 | -------------------------------------------------------------------------------- /.azure-pipelines/windows-server/2025-standard/virtualbox.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: windows-server 8 | image: 2025-standard 9 | provider: virtualbox 10 | -------------------------------------------------------------------------------- /.azure-pipelines/windows-server/2025-standard/vmware.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: windows-server 8 | image: 2025-standard 9 | provider: vmware 10 | -------------------------------------------------------------------------------- /.azure-pipelines/windows-server/insider-preview-standard-core/hyperv.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: windows-server 8 | image: insider-preview-standard-core 9 | provider: hyperv 10 | -------------------------------------------------------------------------------- /.azure-pipelines/windows-server/insider-preview-standard-core/virtualbox.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: windows-server 8 | image: insider-preview-standard-core 9 | provider: virtualbox 10 | -------------------------------------------------------------------------------- /.azure-pipelines/windows-server/insider-preview-standard-core/vmware.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: windows-server 8 | image: insider-preview-standard-core 9 | provider: vmware 10 | -------------------------------------------------------------------------------- /.azure-pipelines/windows-server/insider-preview-standard/hyperv.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: windows-server 8 | image: insider-preview-standard 9 | provider: hyperv 10 | -------------------------------------------------------------------------------- /.azure-pipelines/windows-server/insider-preview-standard/virtualbox.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: windows-server 8 | image: insider-preview-standard 9 | provider: virtualbox 10 | -------------------------------------------------------------------------------- /.azure-pipelines/windows-server/insider-preview-standard/vmware.yml: -------------------------------------------------------------------------------- 1 | trigger: none 2 | pr: none 3 | 4 | stages: 5 | - template: ../../stages.yml 6 | parameters: 7 | sample: windows-server 8 | image: insider-preview-standard 9 | provider: vmware 10 | -------------------------------------------------------------------------------- /.config/dotnet-tools.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "isRoot": true, 4 | "tools": { 5 | "cake.tool": { 6 | "version": "4.0.0", 7 | "commands": [ 8 | "dotnet-cake" 9 | ], 10 | "rollForward": false 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | 3 | *.sh text eol=lf 4 | *.ps1 text eol=crlf 5 | 6 | *.cfg text eol=lf 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.lock.json 2 | packer_cache 3 | artifacts 4 | .vagrant 5 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "lib/gusztavvargadr/chef"] 2 | path = lib/gusztavvargadr/chef 3 | url = https://github.com/gusztavvargadr/chef.git 4 | -------------------------------------------------------------------------------- /.rubocop.yml: -------------------------------------------------------------------------------- 1 | AllCops: 2 | Exclude: 3 | - ./artifacts/**/* 4 | - ./lib/**/* 5 | 6 | Layout/EndOfLine: 7 | Enabled: false 8 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Packer 2 | 3 | This repository contains [Packer] templates for building Windows and Ubuntu images in various development scenarios. 4 | 5 | > [!IMPORTANT] 6 | > The templates [have been upgraded][PackerJSONToHCL] from Packer's legacy JSON format to use the newer HCL format, resulting in breaking changes in the image build process. 7 | > 8 | > To upgrade your fork or other customizations to the newer HCL format, please follow the documentation on [contributing]. Feature updates and bug fixes will be available only in this version in the future. 9 | > 10 | > To continue using the version based on the legacy JSON format, use the tag of the [2310.0.0][LastJSONRelease] release. Feature updates and bug fixes will not be backported to this version in the future. 11 | 12 | [PackerJSONToHCL]: https://developer.hashicorp.com/packer/docs/templates/json_to_hcl 13 | [Contributing]: #contributing 14 | [LastJSONRelease]: https://github.com/gusztavvargadr/packer/tree/2310.0.0 15 | 16 | ## Overview 17 | 18 | Ready-to-use [Vagrant] boxes built using this repository are published to the [HCP Vagrant Registry][VagrantBoxes]. 19 | 20 | See the [documentation][DocumentationOverview] for more details on the available images for [Hyper-V], [VirtualBox] and [VMware]. 21 | 22 | [VagrantBoxes]: https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr 23 | 24 | [DocumentationOverview]: ./samples/README.md#overview 25 | 26 | ## Usage 27 | 28 | Simple [Vagrant] environments demonstrating the capabilities of the published boxes are available at the [samples][Samples]. 29 | 30 | See the [documentation][DocumentationUsage] for more details on using the images with [Hyper-V], [VirtualBox] and [VMware]. 31 | 32 | [DocumentationUsage]: ./samples/README.md#usage 33 | 34 | ## Contributing 35 | 36 | Complete [Packer] templates used for building the published boxes are available at the [samples][Samples]. 37 | 38 | See the [documentation][DocumentationContributing] for more details on building the images for [Hyper-V], [VirtualBox] and [VMware] with [Chef]. 39 | 40 | To report bugs, propose changes, request new features or provide feedback in general, please take a look at the [discussions] or [issues] first. [Pull requests] are also welcome and are greatly appreciated. 41 | 42 | [DocumentationContributing]: ./samples/README.md#contributing 43 | 44 | [Discussions]: https://github.com/gusztavvargadr/packer/discussions 45 | [Issues]: https://github.com/gusztavvargadr/packer/issues 46 | [Pull requests]: https://github.com/gusztavvargadr/packer/pulls 47 | 48 | ## Support 49 | 50 | > [!TIP] 51 | > Are you interested in more images and providers or deployments of custom environments based on them? 52 | > 53 | > The following services are also available on-demand in a professional setting: 54 | > 55 | > - Custom images with additional virtualization and cloud providers 56 | > - Custom build schedules with new versions published as soon as the official updates are available 57 | > - Custom environments like build agent pools, test matrices and deployment targets based on the images 58 | > 59 | > Please reach out at [mail@gv4c.com][MailTo] for more details. 60 | 61 | [MailTo]: mailto:mail@gv4c.com 62 | 63 | ## Resources 64 | 65 | This repository could not exist without the following excellent tools and technologies: 66 | 67 | - [Packer] 68 | - [Vagrant] 69 | - [Hyper-V] 70 | - [VirtualBox] 71 | - [VMware] 72 | - [Chef] 73 | 74 | This repository builds on awesome ideas and solutions from the following authors and sources: 75 | 76 | - [Matt Wrock] 77 | - [Jacqueline] 78 | - [Joe Fitzgerald] 79 | - [Boxcutter] 80 | - [Bento] 81 | 82 | [Resources]: #resources 83 | 84 | [Packer]: https://www.packer.io 85 | [Vagrant]: https://www.vagrantup.com 86 | [Hyper-V]: https://learn.microsoft.com/en-us/virtualization/ 87 | [VirtualBox]: https://www.virtualbox.org 88 | [VMware]: https://www.vmware.com/products/workstation-pro.html 89 | [Chef]: https://www.chef.io 90 | 91 | [Matt Wrock]: https://github.com/mwrock/packer-templates 92 | [Jacqueline]: https://github.com/jacqinthebox/packer-templates 93 | [Joe Fitzgerald]: https://github.com/joefitzgerald/packer-windows 94 | [Boxcutter]: https://github.com/boxcutter/windows 95 | [Bento]: https://github.com/chef/bento 96 | 97 | [Samples]: ./samples 98 | -------------------------------------------------------------------------------- /build.cake: -------------------------------------------------------------------------------- 1 | var configuration = Argument("configuration", string.Empty); 2 | var target = Argument("target", "default"); 3 | 4 | var author = Argument("author", "gusztavvargadr"); 5 | var version = Argument("version", "2503"); 6 | 7 | var configurationParts = configuration.Split('/', StringSplitOptions.RemoveEmptyEntries); 8 | var sample = configurationParts.ElementAtOrDefault(0) ?? Argument("sample"); 9 | var image = configurationParts.ElementAtOrDefault(1) ?? Argument("image"); 10 | var provider = configurationParts.ElementAtOrDefault(2) ?? Argument("provider"); 11 | var build = configurationParts.ElementAtOrDefault(3) ?? Argument("build"); 12 | 13 | var platform = (sample.Contains("ubuntu") || sample.Contains("linux")) ? "ubuntu" : "windows"; 14 | 15 | var sampleDirectory = Directory($"samples/{sample}"); 16 | var platformDirectory = Directory($"../../src/{platform}"); 17 | var artifactsDirectory = Directory($"artifacts"); 18 | 19 | Task("init") 20 | .Does(() => { 21 | PackerInit(); 22 | }); 23 | 24 | Task("restore") 25 | .Does(() => { 26 | PackerBuild("restore"); 27 | }); 28 | 29 | Task("build") 30 | .Does(() => { 31 | PackerBuild("build"); 32 | }); 33 | 34 | Task("test") 35 | .Does(() => { 36 | PackerBuild("test"); 37 | }); 38 | 39 | Task("publish") 40 | .Does(() => { 41 | PackerBuild("publish"); 42 | }); 43 | 44 | Task("download") 45 | .Does(() => { 46 | PackerBuild("download"); 47 | }); 48 | 49 | Task("clean") 50 | .Does(() => { 51 | CleanDirectory(artifactsDirectory); 52 | }); 53 | 54 | Task("default") 55 | .IsDependentOn("init") 56 | .IsDependentOn("restore") 57 | .IsDependentOn("build") 58 | .IsDependentOn("test"); 59 | 60 | RunTarget(target); 61 | 62 | void PackerInit() { 63 | var arguments = new ProcessArgumentBuilder(); 64 | 65 | arguments.Append("init"); 66 | arguments.Append(platformDirectory); 67 | 68 | Packer(arguments); 69 | } 70 | 71 | void PackerBuild(string stage) { 72 | var arguments = new ProcessArgumentBuilder(); 73 | 74 | arguments.Append("build"); 75 | arguments.Append($"-var author=\"{author}\""); 76 | arguments.Append($"-var version=\"{version}\""); 77 | arguments.Append($"-var-file=\"images.pkrvars.hcl\""); 78 | arguments.Append($"-var image=\"{image}\""); 79 | arguments.Append($"-var provider=\"{provider}\""); 80 | arguments.Append($"-var build=\"{build}\""); 81 | arguments.Append($"-only \"{build}-{stage}.*\""); 82 | arguments.Append("-force"); 83 | arguments.Append("-timestamp-ui"); 84 | arguments.Append(platformDirectory); 85 | 86 | Packer(arguments); 87 | } 88 | 89 | void Packer(ProcessArgumentBuilder arguments) { 90 | var result = StartProcess("packer", new ProcessSettings { 91 | Arguments = arguments, 92 | WorkingDirectory = sampleDirectory 93 | }); 94 | 95 | if (result != 0) { 96 | throw new Exception($"Packer failed with code {result} ."); 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /samples/core.Vagrantfile: -------------------------------------------------------------------------------- 1 | Vagrant.configure("2") do |config| 2 | provider_linked_clone = ENV.fetch("VAGRANT_PROVIDER_LINKED_CLONE", "false").to_s.downcase == "true" 3 | provider_synced_folder_disabled = ENV.fetch("VAGRANT_PROVIDER_SYNCED_FOLDER_DISABLED", "true").to_s.downcase == "true" 4 | 5 | config.vm.provider "hyperv" do |provider, override| 6 | provider.linked_clone = provider_linked_clone 7 | 8 | hyperv_network_bridge = ENV.fetch("VAGRANT_HYPERV_NETWORK_BRIDGE", "Default Switch") 9 | override.vm.network "private_network", bridge: hyperv_network_bridge 10 | end 11 | 12 | config.vm.provider "virtualbox" do |provider, _override| 13 | provider.linked_clone = provider_linked_clone 14 | end 15 | 16 | config.vm.provider "vmware_desktop" do |provider, _override| 17 | provider.linked_clone = provider_linked_clone 18 | end 19 | 20 | config.vm.synced_folder ".", "/vagrant", disabled: true if provider_synced_folder_disabled 21 | end 22 | 23 | def config_vm_define(config, vm_name, box_name) 24 | box_author = ENV["VAGRANT_BOX_AUTHOR"] || "gusztavvargadr" 25 | box_author = box_author.to_s.strip 26 | box_url = ENV["VAGRANT_BOX_URL"] 27 | box_url = box_url.to_s.strip 28 | 29 | box = !box_url.empty? ? "#{box_author}-test/#{box_name}" : "#{box_author}/#{box_name}" 30 | 31 | config.vm.define vm_name, autostart: false do |config| 32 | config.vm.box = box 33 | config.vm.box_url = box_url unless box_url.empty? 34 | 35 | config.trigger.after :destroy do |trigger| 36 | trigger.info = "Deleting box" 37 | trigger.run = { inline: "vagrant box remove #{box}"} 38 | end 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /samples/development-ubuntu/Policyfile.rb: -------------------------------------------------------------------------------- 1 | require "#{File.dirname(__FILE__)}/../../src/ubuntu/chef/Policyfile" 2 | 3 | name 'gusztavvargadr_packer_development_ubuntu' 4 | 5 | gusztavvargadr_packer_ubuntu_sources 6 | 7 | run_list( 8 | 'recipe[gusztavvargadr_packer_ubuntu::initialize]', 9 | 'recipe[gusztavvargadr_packer_ubuntu::apply]', 10 | 'recipe[gusztavvargadr_development::default]', 11 | 'recipe[gusztavvargadr_chef::default]', 12 | 'recipe[gusztavvargadr_packer_ubuntu::cleanup]' 13 | ) 14 | 15 | attributes( 16 | [ 17 | "#{File.dirname(__FILE__)}/Policyfile.yml", 18 | ] 19 | ) 20 | -------------------------------------------------------------------------------- /samples/development-ubuntu/Policyfile.yml: -------------------------------------------------------------------------------- 1 | gusztavvargadr_git: 2 | tools: 3 | app:latest: 4 | 5 | gusztavvargadr_dotnet: 6 | tools: 7 | sdk:9.0: 8 | sdk:8.0: 9 | 10 | gusztavvargadr_docker: 11 | tools: 12 | engine:latest-community: 13 | 14 | gusztavvargadr_hashicorp: 15 | tools: 16 | vagrant:latest: 17 | packer:latest: 18 | terraform:latest: 19 | consul-template:latest: 20 | consul:latest: 21 | vault:latest: 22 | nomad:latest: 23 | 24 | gusztavvargadr_chef: 25 | tools: 26 | workstation:latest: 27 | -------------------------------------------------------------------------------- /samples/development-ubuntu/README.md: -------------------------------------------------------------------------------- 1 | # Packer samples for Development Ubuntu 2 | 3 | This folder contains Packer templates for building `Development Ubuntu` images. 4 | -------------------------------------------------------------------------------- /samples/development-ubuntu/Vagrantfile: -------------------------------------------------------------------------------- 1 | load "#{File.dirname(__FILE__)}/../core.Vagrantfile" 2 | 3 | Vagrant.configure("2") do |config| 4 | config_vm_define config, "2404", "development-ubuntu-2404" 5 | config_vm_define config, "2204", "development-ubuntu-2204" 6 | 7 | config.vm.provision "shell", inline: <<-EOH 8 | uname -a 9 | lsb_release -a 10 | 11 | lshw -short 12 | lscpu 13 | lsmem 14 | 15 | apt list --installed 16 | 17 | git --version 18 | 19 | dotnet --info 20 | 21 | docker version 22 | docker compose version 23 | 24 | vagrant --version 25 | packer --version 26 | terraform --version 27 | consul-template --version 28 | consul --version 29 | vault --version 30 | nomad --version 31 | 32 | chef --version 33 | EOH 34 | end 35 | -------------------------------------------------------------------------------- /samples/development-ubuntu/images.pkrvars.hcl: -------------------------------------------------------------------------------- 1 | images = { 2 | "2404" = { 3 | core = { 4 | image_description = "Development on ubuntu-2404" 5 | image_version = "2404.0" 6 | } 7 | 8 | native = { 9 | source_image = "ubuntu-server/2404-lts" 10 | } 11 | } 12 | 13 | "2204" = { 14 | core = { 15 | image_description = "Development on ubuntu-2204" 16 | image_version = "2204.0" 17 | } 18 | 19 | native = { 20 | source_image = "ubuntu-server/2204-lts" 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /samples/docker-linux/Policyfile.rb: -------------------------------------------------------------------------------- 1 | require "#{File.dirname(__FILE__)}/../../src/ubuntu/chef/Policyfile" 2 | 3 | name 'gusztavvargadr_packer_docker_ubuntu' 4 | 5 | gusztavvargadr_packer_ubuntu_sources 6 | 7 | run_list( 8 | 'recipe[gusztavvargadr_packer_ubuntu::initialize]', 9 | 'recipe[gusztavvargadr_packer_ubuntu::apply]', 10 | 'recipe[gusztavvargadr_docker::default]', 11 | 'recipe[gusztavvargadr_packer_ubuntu::cleanup]' 12 | ) 13 | 14 | attributes( 15 | [ 16 | "#{File.dirname(__FILE__)}/Policyfile.yml", 17 | ] 18 | ) 19 | -------------------------------------------------------------------------------- /samples/docker-linux/Policyfile.yml: -------------------------------------------------------------------------------- 1 | gusztavvargadr_docker: 2 | tools: 3 | engine:latest-community: 4 | -------------------------------------------------------------------------------- /samples/docker-linux/README.md: -------------------------------------------------------------------------------- 1 | # Packer samples for Docker Linux 2 | 3 | This folder contains Packer templates for building `Docker Linux` images. 4 | 5 | ## Overview 6 | 7 | See the links below for the details of the available images: 8 | 9 | - [Community Ubuntu Server](#community-ubuntu-server) 10 | 11 | ## Community Ubuntu Server 12 | 13 | [Vagrant box](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/docker-community-ubuntu-server) | [Vagrant alias](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/docker-linux) 14 | 15 | The template has the following settings: 16 | 17 | - [**Ubuntu Server 24.04 LTS**](../ubuntu-server/README.md#2404-lts) 18 | - [**Docker Engine**](https://docs.docker.com/engine/) 19 | -------------------------------------------------------------------------------- /samples/docker-linux/Vagrantfile: -------------------------------------------------------------------------------- 1 | load "#{File.dirname(__FILE__)}/../core.Vagrantfile" 2 | 3 | Vagrant.configure("2") do |config| 4 | config_vm_define config, "community-ubuntu-server", "docker-community-ubuntu-server" 5 | config_vm_define config, "community-ubuntu-server-alias", "docker-linux" 6 | 7 | config.vm.provision "shell", inline: <<-EOH 8 | uname -a 9 | lsb_release -a 10 | 11 | lshw -short 12 | lscpu 13 | lsmem 14 | 15 | apt list --installed 16 | 17 | docker version 18 | docker compose version 19 | EOH 20 | end 21 | -------------------------------------------------------------------------------- /samples/docker-linux/images.pkrvars.hcl: -------------------------------------------------------------------------------- 1 | images = { 2 | "community-ubuntu-server" = { 3 | core = { 4 | image_description = "Docker Community on Ubuntu Server" 5 | image_version = "2600.2404" 6 | } 7 | 8 | native = { 9 | source_image = "ubuntu-server/2404-lts" 10 | } 11 | 12 | vagrant = { 13 | box_name = "docker-community-ubuntu-server" 14 | box_alias = "docker-linux" 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /samples/docker-windows/Policyfile.rb: -------------------------------------------------------------------------------- 1 | require "#{File.dirname(__FILE__)}/../../src/windows/chef/Policyfile" 2 | 3 | name 'gusztavvargadr_packer_docker_windows' 4 | 5 | gusztavvargadr_packer_windows_sources 6 | 7 | run_list( 8 | 'recipe[gusztavvargadr_packer_windows::initialize]', 9 | 'recipe[gusztavvargadr_packer_windows::apply]', 10 | 'recipe[gusztavvargadr_docker::default]', 11 | 'recipe[gusztavvargadr_packer_windows::cleanup]' 12 | ) 13 | 14 | attributes( 15 | [ 16 | "#{File.dirname(__FILE__)}/Policyfile.yml", 17 | ] 18 | ) 19 | -------------------------------------------------------------------------------- /samples/docker-windows/Policyfile.yml: -------------------------------------------------------------------------------- 1 | gusztavvargadr_docker: 2 | tools: 3 | engine:latest-community: 4 | -------------------------------------------------------------------------------- /samples/docker-windows/README.md: -------------------------------------------------------------------------------- 1 | # Packer samples for Docker Windows 2 | 3 | This folder contains Packer templates for building `Docker Windows` images. 4 | 5 | ## Overview 6 | 7 | See the links below for the details of the available images: 8 | 9 | - [Community Windows Server](#community-windows-server) 10 | - [Community Windows Server Core](#community-windows-server-core) 11 | 12 | ## Community Windows Server 13 | 14 | [Vagrant box](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/docker-community-windows-server) | [Vagrant alias](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/docker-windows) 15 | 16 | The template has the following settings: 17 | 18 | - [**Windows Server 2022 Standard**](../windows-server/README.md#2022-standard) 19 | - [**Docker Engine**](https://docs.docker.com/engine/) 20 | 21 | ## Community Windows Server Core 22 | 23 | [Vagrant box](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/docker-community-windows-server-core) 24 | 25 | The template has the following settings: 26 | 27 | - [**Windows Server 2022 Standard Core**](../windows-server/README.md#2022-standard-core) 28 | - [**Docker Engine**](https://docs.docker.com/engine/) 29 | -------------------------------------------------------------------------------- /samples/docker-windows/Vagrantfile: -------------------------------------------------------------------------------- 1 | load "#{File.dirname(__FILE__)}/../core.Vagrantfile" 2 | 3 | Vagrant.configure("2") do |config| 4 | config_vm_define config, "community-windows-server", "docker-community-windows-server" 5 | config_vm_define config, "community-windows-server-alias", "docker-windows" 6 | config_vm_define config, "community-windows-server-core", "docker-community-windows-server-core" 7 | 8 | config.vm.provision "shell", inline: <<-EOH 9 | cmd /c ver 10 | 11 | systeminfo 12 | Get-ComputerInfo 13 | 14 | Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) 15 | choco list -i 16 | 17 | docker version 18 | docker compose version 19 | EOH 20 | end 21 | -------------------------------------------------------------------------------- /samples/docker-windows/images.pkrvars.hcl: -------------------------------------------------------------------------------- 1 | images = { 2 | "community-windows-server" = { 3 | core = { 4 | image_description = "Docker Community on Windows Server" 5 | image_version = "2600.2402" 6 | } 7 | 8 | native = { 9 | source_image = "windows-server/2025-standard" 10 | } 11 | 12 | vagrant = { 13 | box_name = "docker-community-windows-server" 14 | box_alias = "docker-windows" 15 | } 16 | } 17 | 18 | "community-windows-server-core" = { 19 | core = { 20 | image_description = "Docker Community on Windows Server Core" 21 | image_version = "2600.2402" 22 | } 23 | 24 | native = { 25 | source_image = "windows-server/2025-standard-core" 26 | } 27 | 28 | vagrant = { 29 | box_name = "docker-community-windows-server-core" 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /samples/iis/Policyfile.rb: -------------------------------------------------------------------------------- 1 | require "#{File.dirname(__FILE__)}/../../src/windows/chef/Policyfile" 2 | 3 | name 'gusztavvargadr_packer_iis' 4 | 5 | gusztavvargadr_packer_windows_sources 6 | 7 | run_list( 8 | 'recipe[gusztavvargadr_packer_windows::initialize]', 9 | 'recipe[gusztavvargadr_packer_windows::apply]', 10 | 'recipe[gusztavvargadr_iis::default]', 11 | 'recipe[gusztavvargadr_packer_windows::cleanup]' 12 | ) 13 | 14 | attributes( 15 | [ 16 | "#{File.dirname(__FILE__)}/Policyfile.yml", 17 | ] 18 | ) 19 | -------------------------------------------------------------------------------- /samples/iis/Policyfile.yml: -------------------------------------------------------------------------------- 1 | gusztavvargadr_iis: 2 | tools: 3 | server:latest: 4 | -------------------------------------------------------------------------------- /samples/iis/README.md: -------------------------------------------------------------------------------- 1 | # Packer samples for IIS 2 | 3 | This folder contains Packer templates for building `IIS` images. 4 | 5 | ## Overview 6 | 7 | See the links below for the details of the available images: 8 | 9 | - [Windows Server](#windows-server) 10 | - [Windows Server Core](#windows-server-core) 11 | 12 | ## Windows Server 13 | 14 | [Vagrant box](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/iis-windows-server) | [Vagrant alias](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/iis) 15 | 16 | The template has the following settings: 17 | 18 | - [**Windows Server 2022 Standard**](../windows-server/README.md#2022-standard) 19 | - **IIS** 20 | - **.NET** 21 | - **.NET Framework** 22 | 23 | ## Windows Server Core 24 | 25 | [Vagrant box](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/iis-windows-server-core) 26 | 27 | The template has the following settings: 28 | 29 | - [**Windows Server 2022 Standard Core**](../windows-server/README.md#2022-standard-core) 30 | - **IIS** 31 | - **.NET** 32 | - **.NET Framework** 33 | -------------------------------------------------------------------------------- /samples/iis/Vagrantfile: -------------------------------------------------------------------------------- 1 | load "#{File.dirname(__FILE__)}/../core.Vagrantfile" 2 | 3 | Vagrant.configure("2") do |config| 4 | config_vm_define config, "windows-server", "iis-windows-server" 5 | config_vm_define config, "windows-server-alias", "iis" 6 | config_vm_define config, "windows-server-core", "iis-windows-server-core" 7 | 8 | config.vm.provision "shell", inline: <<-EOH 9 | cmd /c ver 10 | 11 | systeminfo 12 | Get-ComputerInfo 13 | 14 | Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) 15 | choco list -i 16 | 17 | dotnet --info 18 | EOH 19 | end 20 | -------------------------------------------------------------------------------- /samples/iis/images.pkrvars.hcl: -------------------------------------------------------------------------------- 1 | images = { 2 | "windows-server" = { 3 | core = { 4 | image_description = "IIS on Windows Server" 5 | image_version = "2102.0" 6 | } 7 | 8 | native = { 9 | source_image = "windows-server/2022-standard" 10 | } 11 | 12 | vagrant = { 13 | ports = "3389,80" 14 | box_alias = "iis" 15 | } 16 | } 17 | 18 | "windows-server-core" = { 19 | core = { 20 | image_description = "IIS on Windows Server Core" 21 | image_version = "2102.0" 22 | } 23 | 24 | native = { 25 | source_image = "windows-server/2022-standard-core" 26 | } 27 | 28 | vagrant = { 29 | ports = "3389,80" 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /samples/kitchen-ubuntu/Policyfile.rb: -------------------------------------------------------------------------------- 1 | require "#{File.dirname(__FILE__)}/../../src/ubuntu/chef/Policyfile" 2 | 3 | name 'gusztavvargadr_packer_kitchen_ubuntu' 4 | 5 | gusztavvargadr_packer_ubuntu_sources 6 | 7 | run_list( 8 | 'recipe[gusztavvargadr_packer_ubuntu::default]', 9 | ) 10 | -------------------------------------------------------------------------------- /samples/kitchen-ubuntu/README.md: -------------------------------------------------------------------------------- 1 | # Packer samples for Kitchen Ubuntu 2 | 3 | This folder contains Packer templates for building `Kitchen Ubuntu` images. 4 | 5 | ## Overview 6 | 7 | See the links below for the details of the available images: 8 | 9 | - [2404](#2404) 10 | - [2204](#2204) 11 | 12 | ## 2404 13 | 14 | [Vagrant box](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/kitchen-ubuntu-2404) 15 | 16 | The template has the following settings: 17 | 18 | - [**Ubuntu Server 24.04 LTS**](../ubuntu-server/README.md#2404-lts) 19 | - [**Chef Infra Client**](https://docs.chef.io/chef_client_overview/) 20 | 21 | ## 2204 22 | 23 | [Vagrant box](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/kitchen-ubuntu-2204) 24 | 25 | The template has the following settings: 26 | 27 | - [**Ubuntu Server 22.04 LTS**](../ubuntu-server/README.md#2204-lts) 28 | - [**Chef Infra Client**](https://docs.chef.io/chef_client_overview/) 29 | -------------------------------------------------------------------------------- /samples/kitchen-ubuntu/Vagrantfile: -------------------------------------------------------------------------------- 1 | load "#{File.dirname(__FILE__)}/../core.Vagrantfile" 2 | 3 | Vagrant.configure("2") do |config| 4 | config_vm_define config, "2404", "kitchen-ubuntu-2404" 5 | config_vm_define config, "2204", "kitchen-ubuntu-2204" 6 | 7 | config.vm.provision "shell", inline: <<-EOH 8 | uname -a 9 | lsb_release -a 10 | 11 | lshw -short 12 | lscpu 13 | lsmem 14 | 15 | apt list --installed 16 | 17 | chef-client --version 18 | EOH 19 | end 20 | -------------------------------------------------------------------------------- /samples/kitchen-ubuntu/images.pkrvars.hcl: -------------------------------------------------------------------------------- 1 | images = { 2 | "2404" = { 3 | core = { 4 | image_description = "Test Kitchen target for ubuntu-2404" 5 | image_version = "2404.0" 6 | } 7 | 8 | native = { 9 | source_image = "ubuntu-server/2404-lts" 10 | chef_keep = "true" 11 | } 12 | } 13 | 14 | "2204" = { 15 | core = { 16 | image_description = "Test Kitchen target for ubuntu-2204" 17 | image_version = "2204.0" 18 | } 19 | 20 | native = { 21 | source_image = "ubuntu-server/2204-lts" 22 | chef_keep = "true" 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /samples/kitchen-windows/Policyfile.rb: -------------------------------------------------------------------------------- 1 | require "#{File.dirname(__FILE__)}/../../src/windows/chef/Policyfile" 2 | 3 | name 'gusztavvargadr_packer_kitchen_windows' 4 | 5 | gusztavvargadr_packer_windows_sources 6 | 7 | run_list( 8 | 'recipe[gusztavvargadr_packer_windows::default]', 9 | ) 10 | -------------------------------------------------------------------------------- /samples/kitchen-windows/README.md: -------------------------------------------------------------------------------- 1 | # Packer samples for Kitchen Windows 2 | 3 | This folder contains Packer templates for building `Kitchen Windows` images. 4 | 5 | ## Overview 6 | 7 | See the links below for the details of the available images: 8 | 9 | - [2022](#2022) 10 | 11 | ## 2022 12 | 13 | [Vagrant box](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/kitchen-windows-2022) 14 | 15 | The template has the following settings: 16 | 17 | - [**Windows Server 2022 Standard**](../windows-server/README.md#2022-standard) 18 | - [**Chef Infra Client**](https://docs.chef.io/chef_client_overview/) 19 | -------------------------------------------------------------------------------- /samples/kitchen-windows/Vagrantfile: -------------------------------------------------------------------------------- 1 | load "#{File.dirname(__FILE__)}/../core.Vagrantfile" 2 | 3 | Vagrant.configure("2") do |config| 4 | config_vm_define config, "2025", "kitchen-windows-2025" 5 | config_vm_define config, "2022", "kitchen-windows-2022" 6 | 7 | config.vm.provision "shell", inline: <<-EOH 8 | cmd /c ver 9 | 10 | systeminfo 11 | Get-ComputerInfo 12 | 13 | choco list -i 14 | 15 | chef-client --version 16 | EOH 17 | end 18 | -------------------------------------------------------------------------------- /samples/kitchen-windows/images.pkrvars.hcl: -------------------------------------------------------------------------------- 1 | images = { 2 | "2025" = { 3 | core = { 4 | image_description = "Test Kitchen target for windows-2025" 5 | image_version = "2402.0" 6 | } 7 | 8 | native = { 9 | source_image = "windows-server/2025-standard" 10 | chef_keep = "true" 11 | } 12 | } 13 | 14 | "2022" = { 15 | core = { 16 | image_description = "Test Kitchen target for windows-2022" 17 | image_version = "2102.0" 18 | } 19 | 20 | native = { 21 | source_image = "windows-server/2022-standard" 22 | chef_keep = "true" 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /samples/sql-server/Policyfile.rb: -------------------------------------------------------------------------------- 1 | require "#{File.dirname(__FILE__)}/../../src/windows/chef/Policyfile" 2 | 3 | name 'gusztavvargadr_packer_sql_server' 4 | 5 | gusztavvargadr_packer_windows_sources 6 | 7 | run_list( 8 | 'recipe[gusztavvargadr_packer_windows::initialize]', 9 | 'recipe[gusztavvargadr_packer_windows::apply]', 10 | 'recipe[gusztavvargadr_mssql::default]', 11 | 'recipe[gusztavvargadr_packer_windows::cleanup]' 12 | ) 13 | 14 | attributes( 15 | [ 16 | "#{File.dirname(__FILE__)}/Policyfile.yml", 17 | ] 18 | ) 19 | -------------------------------------------------------------------------------- /samples/sql-server/Policyfile.yml: -------------------------------------------------------------------------------- 1 | gusztavvargadr_mssql: 2 | tools: 3 | server:2019-developer: 4 | -------------------------------------------------------------------------------- /samples/sql-server/README.md: -------------------------------------------------------------------------------- 1 | # Packer samples for SQL Server 2 | 3 | This folder contains Packer templates for building `SQL Server` images. 4 | 5 | ## Overview 6 | 7 | See the links below for the details of the available images: 8 | 9 | - [2019 Developer Windows Server](#2019-developer-windows-server) 10 | - [2019 Developer Windows Server Core](#2019-developer-windows-server-core) 11 | 12 | ## 2019 Developer Windows Server 13 | 14 | [Vagrant box](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/sql-server-2019-developer-windows-server) | [Vagrant alias](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/sql-server) 15 | 16 | The template has the following settings: 17 | 18 | - [**Windows Server 2022 Standard**](../windows-server/README.md#2022-standard) 19 | - **SQL Server 2019 Developer** 20 | - Database Engine 21 | - Windows Authentication with user `vagrant` 22 | - SQL Server Authentication with user `sa` and password `Vagrant42` 23 | - FullText 24 | - **SQL Server Management Studio** 25 | 26 | ## 2019 Developer Windows Server Core 27 | 28 | [Vagrant box](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/sql-server-2019-developer-windows-server-core) 29 | 30 | The template has the following settings: 31 | 32 | - [**Windows Server 2022 Standard Core**](../windows-server/README.md#2022-standard-core) 33 | - **SQL Server 2019 Developer** 34 | - Database Engine 35 | - Windows Authentication with user `vagrant` 36 | - SQL Server Authentication with user `sa` and password `Vagrant42` 37 | - FullText 38 | -------------------------------------------------------------------------------- /samples/sql-server/Vagrantfile: -------------------------------------------------------------------------------- 1 | load "#{File.dirname(__FILE__)}/../core.Vagrantfile" 2 | 3 | Vagrant.configure("2") do |config| 4 | config_vm_define config, "2019-developer-windows-server", "sql-server-2019-developer-windows-server" 5 | config_vm_define config, "2019-developer-windows-server-alias", "sql-server" 6 | config_vm_define config, "2019-developer-windows-server-core", "sql-server-2019-developer-windows-server-core" 7 | 8 | config.vm.provision "shell", inline: <<-EOH 9 | cmd /c ver 10 | 11 | systeminfo 12 | Get-ComputerInfo 13 | 14 | Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) 15 | choco list -i 16 | 17 | sqlcmd -Q "SELECT @@VERSION" 18 | EOH 19 | end 20 | -------------------------------------------------------------------------------- /samples/sql-server/attributes.management-studio.json: -------------------------------------------------------------------------------- 1 | { 2 | "gusztavvargadr_mssql": { 3 | "tools": { 4 | "management-studio:latest": { 5 | } 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /samples/sql-server/images.pkrvars.hcl: -------------------------------------------------------------------------------- 1 | images = { 2 | "2019-developer-windows-server" = { 3 | core = { 4 | image_description = "SQL Server 2019 Developer on Windows Server" 5 | image_version = "2019.2102" 6 | } 7 | 8 | native = { 9 | source_image = "windows-server/2022-standard" 10 | 11 | chef_attributes = "management-studio" 12 | } 13 | 14 | vagrant = { 15 | ports = "3389,1433" 16 | box_alias = "sql-server" 17 | } 18 | } 19 | 20 | "2019-developer-windows-server-core" = { 21 | core = { 22 | image_description = "SQL Server 2019 Developer on Windows Server Core" 23 | image_version = "2019.2102" 24 | } 25 | 26 | native = { 27 | source_image = "windows-server/2022-standard-core" 28 | } 29 | 30 | vagrant = { 31 | ports = "3389,1433" 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /samples/ubuntu-desktop/Policyfile.rb: -------------------------------------------------------------------------------- 1 | require "#{File.dirname(__FILE__)}/../../src/ubuntu/chef/Policyfile" 2 | 3 | name 'gusztavvargadr_packer_ubuntu_desktop' 4 | 5 | gusztavvargadr_packer_ubuntu_sources 6 | 7 | run_list( 8 | 'recipe[gusztavvargadr_packer_ubuntu::initialize]', 9 | 'recipe[gusztavvargadr_packer_ubuntu::apply]', 10 | 'recipe[gusztavvargadr_ubuntu::default]', 11 | 'recipe[gusztavvargadr_packer_ubuntu::cleanup]' 12 | ) 13 | -------------------------------------------------------------------------------- /samples/ubuntu-desktop/README.md: -------------------------------------------------------------------------------- 1 | # Packer samples for Ubuntu Desktop 2 | 3 | This folder contains Packer templates for building `Ubuntu Desktop` images. 4 | 5 | ## Overview 6 | 7 | See the links below for the details of the available images: 8 | 9 | - [24.04 LTS Ubuntu](#2404-lts-ubuntu) 10 | - [24.04 LTS Xubuntu](#2404-lts-xubuntu) 11 | - [22.04 LTS Ubuntu](#2204-lts-ubuntu) 12 | - [22.04 LTS Xubuntu](#2204-lts-xubuntu) 13 | - [20.04 LTS Ubuntu](#2004-lts-ubuntu) 14 | - [20.04 LTS Xubuntu](#2004-lts-xubuntu) 15 | 16 | ## 24.04 LTS Ubuntu 17 | 18 | [Vagrant box](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/ubuntu-desktop-2404-lts) | [Vagrant alias](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/ubuntu-desktop) 19 | 20 | The template has the following settings: 21 | 22 | - **Ubuntu Desktop 24.04 LTS** 23 | - OpenSSH Server 24 | - **Vagrant** 25 | - User `vagrant` with password `vagrant` and Vagrant's insecure key 26 | - 2 vCPUs 27 | - 4 GB RAM 28 | 29 | ## 24.04 LTS Xubuntu 30 | 31 | [Vagrant box](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/xubuntu-desktop-2404-lts) 32 | 33 | The template has the following settings: 34 | 35 | - **Xubuntu Desktop 24.04 LTS** 36 | - OpenSSH Server 37 | - **Vagrant** 38 | - User `vagrant` with password `vagrant` and Vagrant's insecure key 39 | - 2 vCPUs 40 | - 4 GB RAM 41 | 42 | ## 22.04 LTS Ubuntu 43 | 44 | [Vagrant box](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/ubuntu-desktop-2204-lts) 45 | 46 | The template has the following settings: 47 | 48 | - [**Ubuntu Server 22.04 LTS**](../ubuntu-server/README.md#2204-lts) 49 | - **ubuntu-desktop** 50 | - **Vagrant** 51 | - 4 GB RAM 52 | 53 | ## 22.04 LTS Xubuntu 54 | 55 | [Vagrant box](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/xubuntu-desktop-2204-lts) 56 | 57 | The template has the following settings: 58 | 59 | - [**Ubuntu Server 22.04 LTS**](../ubuntu-server/README.md#2204-lts) 60 | - **xubuntu-desktop** 61 | - **Vagrant** 62 | - 4 GB RAM 63 | 64 | ## 20.04 LTS Ubuntu 65 | 66 | [Vagrant box](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/ubuntu-desktop-2004-lts) 67 | 68 | The template has the following settings: 69 | 70 | - [**Ubuntu Server 20.04 LTS**](../ubuntu-server/README.md#2004-lts) 71 | - **ubuntu-desktop** 72 | - **Vagrant** 73 | - 4 GB RAM 74 | 75 | ## 20.04 LTS Xubuntu 76 | 77 | [Vagrant box](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/ubuntu-desktop-2004-lts-xfce) 78 | 79 | The template has the following settings: 80 | 81 | - [**Ubuntu Server 20.04 LTS**](../ubuntu-server/README.md#2004-lts) 82 | - **xubuntu-desktop** 83 | - **Vagrant** 84 | - 4 GB RAM 85 | -------------------------------------------------------------------------------- /samples/ubuntu-desktop/Vagrantfile: -------------------------------------------------------------------------------- 1 | load "#{File.dirname(__FILE__)}/../core.Vagrantfile" 2 | 3 | Vagrant.configure("2") do |config| 4 | config_vm_define config, "2404-lts-ubuntu", "ubuntu-desktop-2404-lts" 5 | config_vm_define config, "2404-lts-ubuntu-alias", "ubuntu-desktop" 6 | config_vm_define config, "2404-lts-xubuntu", "xubuntu-desktop-2404-lts" 7 | config_vm_define config, "2204-lts-ubuntu", "ubuntu-desktop-2204-lts" 8 | config_vm_define config, "2204-lts-xubuntu", "xubuntu-desktop-2204-lts" 9 | config_vm_define config, "2004-lts-ubuntu", "ubuntu-desktop-2004-lts" 10 | config_vm_define config, "2004-lts-xubuntu", "ubuntu-desktop-2004-lts-xfce" 11 | 12 | config.vm.provision "shell", inline: <<-EOH 13 | uname -a 14 | lsb_release -a 15 | 16 | lshw -short 17 | lscpu 18 | lsmem 19 | 20 | apt list --installed 21 | EOH 22 | end 23 | -------------------------------------------------------------------------------- /samples/ubuntu-desktop/attributes.ubuntu.json: -------------------------------------------------------------------------------- 1 | { 2 | "gusztavvargadr_ubuntu": { 3 | "tools": { 4 | "desktop:ubuntu": { 5 | } 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /samples/ubuntu-desktop/attributes.xubuntu.json: -------------------------------------------------------------------------------- 1 | { 2 | "gusztavvargadr_ubuntu": { 3 | "tools": { 4 | "desktop:xubuntu": { 5 | } 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /samples/ubuntu-desktop/images.pkrvars.hcl: -------------------------------------------------------------------------------- 1 | images = { 2 | "2404-lts-ubuntu" = { 3 | core = { 4 | image_description = "Ubuntu Desktop 24.04 LTS" 5 | image_version = "2404.0" 6 | } 7 | 8 | native = { 9 | source_iso_url_local = "ubuntu-24.04.2-desktop-amd64.iso" 10 | source_iso_url_remote = "https://releases.ubuntu.com/noble/ubuntu-24.04.2-desktop-amd64.iso" 11 | source_iso_checksum = "sha256:d7fe3d6a0419667d2f8eff12796996328daa2d4f90cd9f87aa9371b362f987bf" 12 | 13 | chef_attributes = "ubuntu" 14 | } 15 | 16 | vagrant = { 17 | memory = "4096" 18 | ports = "3389" 19 | box_name = "ubuntu-desktop-2404-lts" 20 | box_alias = "ubuntu-desktop" 21 | } 22 | 23 | virtualbox = { 24 | guest_os_type = "Ubuntu_64" 25 | } 26 | 27 | vmware = { 28 | guest_os_type = "ubuntu-64" 29 | } 30 | } 31 | 32 | "2404-lts-xubuntu" = { 33 | core = { 34 | image_description = "Xubuntu Desktop 24.04 LTS" 35 | image_version = "2404.0" 36 | } 37 | 38 | native = { 39 | source_iso_url_local = "xubuntu-24.04.2-desktop-amd64.iso" 40 | source_iso_url_remote = "https://cdimage.ubuntu.com/xubuntu/releases/noble/release/xubuntu-24.04.2-desktop-amd64.iso" 41 | source_iso_checksum = "sha256:ba76abf526b4c7ab22e8125cca69547f76559f703bd357c54bdf5d74be0bfd2b" 42 | 43 | chef_attributes = "xubuntu" 44 | } 45 | 46 | vagrant = { 47 | memory = "4096" 48 | ports = "3389" 49 | box_name = "xubuntu-desktop-2404-lts" 50 | } 51 | 52 | virtualbox = { 53 | guest_os_type = "Ubuntu_64" 54 | } 55 | 56 | vmware = { 57 | guest_os_type = "ubuntu-64" 58 | } 59 | } 60 | 61 | "2204-lts-ubuntu" = { 62 | core = { 63 | image_description = "Ubuntu Desktop 22.04 LTS" 64 | image_version = "2204.0" 65 | } 66 | 67 | native = { 68 | source_image = "ubuntu-server/2204-lts" 69 | 70 | chef_attributes = "ubuntu" 71 | } 72 | 73 | vagrant = { 74 | memory = "4096" 75 | ports = "3389" 76 | box_name = "ubuntu-desktop-2204-lts" 77 | } 78 | } 79 | 80 | "2204-lts-xubuntu" = { 81 | core = { 82 | image_description = "Xubuntu Desktop 22.04 LTS" 83 | image_version = "2204.0" 84 | } 85 | 86 | native = { 87 | source_image = "ubuntu-server/2204-lts" 88 | 89 | chef_attributes = "xubuntu" 90 | } 91 | 92 | vagrant = { 93 | memory = "4096" 94 | ports = "3389" 95 | box_name = "xubuntu-desktop-2204-lts" 96 | } 97 | } 98 | 99 | "2004-lts-ubuntu" = { 100 | core = { 101 | image_description = "Ubuntu Desktop 20.04 LTS" 102 | image_version = "2004.0" 103 | } 104 | 105 | native = { 106 | source_image = "ubuntu-server/2004-lts" 107 | 108 | chef_attributes = "ubuntu" 109 | } 110 | 111 | vagrant = { 112 | memory = "4096" 113 | ports = "3389" 114 | box_name = "ubuntu-desktop-2004-lts" 115 | } 116 | } 117 | 118 | "2004-lts-xubuntu" = { 119 | core = { 120 | image_name = "ubuntu-desktop/2004-lts-xubuntu" 121 | image_description = "Xubuntu Desktop 20.04 LTS" 122 | image_version = "2004.0" 123 | } 124 | 125 | native = { 126 | source_image = "ubuntu-server/2004-lts" 127 | 128 | chef_attributes = "xubuntu" 129 | } 130 | 131 | vagrant = { 132 | memory = "4096" 133 | ports = "3389" 134 | box_name = "ubuntu-desktop-2004-lts-xfce" 135 | } 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /samples/ubuntu-server/Policyfile.rb: -------------------------------------------------------------------------------- 1 | require "#{File.dirname(__FILE__)}/../../src/ubuntu/chef/Policyfile" 2 | 3 | name 'gusztavvargadr_packer_ubuntu_server' 4 | 5 | gusztavvargadr_packer_ubuntu_sources 6 | 7 | run_list( 8 | 'recipe[gusztavvargadr_packer_ubuntu::default]' 9 | ) 10 | -------------------------------------------------------------------------------- /samples/ubuntu-server/README.md: -------------------------------------------------------------------------------- 1 | # Packer samples for Ubuntu Server 2 | 3 | This folder contains Packer templates for building `Ubuntu Server` images. 4 | 5 | ## Overview 6 | 7 | See the links below for the details of the available images: 8 | 9 | - [24.04 LTS](#2404-lts) 10 | - [22.04 LTS](#2204-lts) 11 | - [20.04 LTS](#2004-lts) 12 | 13 | ## 24.04 LTS 14 | 15 | [Vagrant box](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/ubuntu-server-2404-lts) | [Vagrant alias](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/ubuntu-server) 16 | 17 | The template has the following settings: 18 | 19 | - **Ubuntu Server 24.04 LTS** 20 | - OpenSSH Server 21 | - **Vagrant** 22 | - User `vagrant` with password `vagrant` and Vagrant's insecure key 23 | - 2 vCPUs 24 | - 2 GB RAM 25 | 26 | ## 22.04 LTS 27 | 28 | [Vagrant box](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/ubuntu-server-2204-lts) 29 | 30 | The template has the following settings: 31 | 32 | - **Ubuntu Server 22.04 LTS** 33 | - OpenSSH Server 34 | - **Vagrant** 35 | - User `vagrant` with password `vagrant` and Vagrant's insecure key 36 | - 2 vCPUs 37 | - 2 GB RAM 38 | 39 | ## 20.04 LTS 40 | 41 | [Vagrant box](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/ubuntu-server-2004-lts) 42 | 43 | The template has the following settings: 44 | 45 | - **Ubuntu Server 20.04 LTS** 46 | - OpenSSH Server 47 | - **Vagrant** 48 | - User `vagrant` with password `vagrant` and Vagrant's insecure key 49 | - 2 vCPUs 50 | - 2 GB RAM 51 | -------------------------------------------------------------------------------- /samples/ubuntu-server/Vagrantfile: -------------------------------------------------------------------------------- 1 | load "#{File.dirname(__FILE__)}/../core.Vagrantfile" 2 | 3 | Vagrant.configure("2") do |config| 4 | config_vm_define config, "2404-lts", "ubuntu-server-2404-lts" 5 | config_vm_define config, "2404-lts-alias", "ubuntu-server" 6 | config_vm_define config, "2204-lts", "ubuntu-server-2204-lts" 7 | config_vm_define config, "2004-lts", "ubuntu-server-2004-lts" 8 | 9 | config.vm.provision "shell", inline: <<-EOH 10 | uname -a 11 | lsb_release -a 12 | 13 | lshw -short 14 | lscpu 15 | lsmem 16 | 17 | apt list --installed 18 | EOH 19 | end 20 | -------------------------------------------------------------------------------- /samples/ubuntu-server/images.pkrvars.hcl: -------------------------------------------------------------------------------- 1 | images = { 2 | "2404-lts" = { 3 | core = { 4 | image_description = "Ubuntu Server 24.04 LTS" 5 | image_version = "2404.0" 6 | } 7 | 8 | native = { 9 | source_iso_url_local = "ubuntu-24.04.2-live-server-amd64.iso" 10 | source_iso_url_remote = "https://releases.ubuntu.com/24.04/ubuntu-24.04.2-live-server-amd64.iso" 11 | source_iso_checksum = "sha256:d6dab0c3a657988501b4bd76f1297c053df710e06e0c3aece60dead24f270b4d" 12 | } 13 | 14 | vagrant = { 15 | box_alias = "ubuntu-server" 16 | } 17 | 18 | virtualbox = { 19 | guest_os_type = "Ubuntu_64" 20 | } 21 | 22 | vmware = { 23 | guest_os_type = "ubuntu-64" 24 | } 25 | } 26 | 27 | "2204-lts" = { 28 | core = { 29 | image_description = "Ubuntu Server 22.04 LTS" 30 | image_version = "2204.0" 31 | } 32 | 33 | native = { 34 | source_iso_url_local = "ubuntu-22.04.5-live-server-amd64.iso" 35 | source_iso_url_remote = "https://releases.ubuntu.com/22.04/ubuntu-22.04.5-live-server-amd64.iso" 36 | source_iso_checksum = "sha256:9bc6028870aef3f74f4e16b900008179e78b130e6b0b9a140635434a46aa98b0" 37 | } 38 | 39 | virtualbox = { 40 | guest_os_type = "Ubuntu_64" 41 | } 42 | 43 | vmware = { 44 | guest_os_type = "ubuntu-64" 45 | } 46 | } 47 | 48 | "2004-lts" = { 49 | core = { 50 | image_description = "Ubuntu Server 20.04 LTS" 51 | image_version = "2004.0" 52 | } 53 | 54 | native = { 55 | source_iso_url_local = "ubuntu-20.04.6-live-server-amd64.iso" 56 | source_iso_url_remote = "https://releases.ubuntu.com/20.04/ubuntu-20.04.6-live-server-amd64.iso" 57 | source_iso_checksum = "sha256:b8f31413336b9393ad5d8ef0282717b2ab19f007df2e9ed5196c13d8f9153c8b" 58 | } 59 | 60 | virtualbox = { 61 | guest_os_type = "Ubuntu_64" 62 | } 63 | 64 | vmware = { 65 | guest_os_type = "ubuntu-64" 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /samples/visual-studio/Policyfile.rb: -------------------------------------------------------------------------------- 1 | require "#{File.dirname(__FILE__)}/../../src/windows/chef/Policyfile" 2 | 3 | name 'gusztavvargadr_packer_visualstudio' 4 | 5 | gusztavvargadr_packer_windows_sources 6 | 7 | run_list( 8 | 'recipe[gusztavvargadr_packer_windows::initialize]', 9 | 'recipe[gusztavvargadr_packer_windows::apply]', 10 | 'recipe[gusztavvargadr_visualstudio::default]', 11 | 'recipe[gusztavvargadr_packer_windows::cleanup]' 12 | ) 13 | -------------------------------------------------------------------------------- /samples/visual-studio/README.md: -------------------------------------------------------------------------------- 1 | # Packer samples for Visual Studio 2 | 3 | This folder contains Packer templates for building `Visual Studio` images. 4 | 5 | ## Overview 6 | 7 | See the links below for the details of the available images: 8 | 9 | - [2022 Community Windows 11](#2022-community-windows-11) 10 | - [2022 Community Windows 10](#2022-community-windows-10) 11 | - ~~[2019 Community Windows 11](#2019-community-windows-11) Deprecated~~ 12 | - ~~[2019 Community Windows 10](#2019-community-windows-10) Deprecated~~ 13 | 14 | ## 2022 Community Windows 11 15 | 16 | [Vagrant box](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/visual-studio-2022-community-windows-11) | [Vagrant alias](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/visual-studio) 17 | 18 | The template has the following settings: 19 | 20 | - [**Windows 11 23H2 Enterprise**](../windows-11/README.md#23h2-enterprise) 21 | - **Visual Studio 2022 Community** 22 | - C# and F# 23 | - .NET Core cross-platform development 24 | - .NET desktop development 25 | - ASP.NET and web development 26 | - Data storage and processing 27 | - Azure development 28 | - **Vagrant** 29 | - 4 vCPUs 30 | - 8 GB RAM 31 | 32 | ## 2022 Community Windows 10 33 | 34 | [Vagrant box](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/visual-studio-2022-community-windows-10) 35 | 36 | The template has the following settings: 37 | 38 | - [**Windows 10 22H2 Enterprise**](../windows-10/README.md#22h2-enterprise) 39 | - **Visual Studio 2022 Community** 40 | - C# and F# 41 | - .NET Core cross-platform development 42 | - .NET desktop development 43 | - ASP.NET and web development 44 | - Data storage and processing 45 | - Azure development 46 | - **Vagrant** 47 | - 4 vCPUs 48 | - 8 GB RAM 49 | 50 | ## 2019 Community Windows 11 51 | 52 | **This template is ~~deprecated~~. Please use one of the other templates.** 53 | 54 | [Vagrant box](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/visual-studio-2019-community-windows-11) 55 | 56 | The template has the following settings: 57 | 58 | - [**Windows 11 23H2 Enterprise**](../windows-11/README.md#23h2-enterprise) 59 | - **Visual Studio 2019 Community** 60 | - C# and F# 61 | - .NET Core cross-platform development 62 | - .NET desktop development 63 | - ASP.NET and web development 64 | - Data storage and processing 65 | - Azure development 66 | - **Vagrant** 67 | - 4 vCPUs 68 | - 8 GB RAM 69 | 70 | ## 2019 Community Windows 10 71 | 72 | **This template is ~~deprecated~~. Please use one of the other templates.** 73 | 74 | [Vagrant box](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/visual-studio-2019-community-windows-10) 75 | 76 | The template has the following settings: 77 | 78 | - [**Windows 10 22H2 Enterprise**](../windows-10/README.md#22h2-enterprise) 79 | - **Visual Studio 2019 Community** 80 | - C# and F# 81 | - .NET Core cross-platform development 82 | - .NET desktop development 83 | - ASP.NET and web development 84 | - Data storage and processing 85 | - Azure development 86 | - **Vagrant** 87 | - 4 vCPUs 88 | - 8 GB RAM 89 | -------------------------------------------------------------------------------- /samples/visual-studio/Vagrantfile: -------------------------------------------------------------------------------- 1 | load "#{File.dirname(__FILE__)}/../core.Vagrantfile" 2 | 3 | Vagrant.configure("2") do |config| 4 | config_vm_define config, "2022-community-windows-11", "visual-studio-2022-community-windows-11" 5 | config_vm_define config, "2022-community-windows-11-alias", "visual-studio" 6 | config_vm_define config, "2022-community-windows-10", "visual-studio-2022-community-windows-10" 7 | 8 | config.vm.provision "shell", inline: <<-EOH 9 | cmd /c ver 10 | 11 | systeminfo 12 | Get-ComputerInfo 13 | 14 | Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) 15 | choco list -i 16 | 17 | dotnet --info 18 | EOH 19 | end 20 | -------------------------------------------------------------------------------- /samples/visual-studio/attributes.2022-community.json: -------------------------------------------------------------------------------- 1 | { 2 | "gusztavvargadr_visualstudio": { 3 | "tools": { 4 | "ide:2022-community": { 5 | } 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /samples/visual-studio/images.pkrvars.hcl: -------------------------------------------------------------------------------- 1 | images = { 2 | "2022-community-windows-11" = { 3 | core = { 4 | image_description = "Visual Studio 2022 Community on Windows 11" 5 | image_version = "2022.2402" 6 | } 7 | 8 | native = { 9 | source_image = "windows-11/24h2-enterprise" 10 | 11 | chef_attributes = "2022-community" 12 | } 13 | 14 | vagrant = { 15 | cpus = "4" 16 | memory = "8192" 17 | box_alias = "visual-studio" 18 | } 19 | } 20 | 21 | "2022-community-windows-10" = { 22 | core = { 23 | image_description = "Visual Studio 2022 Community on Windows 10" 24 | image_version = "2022.2202" 25 | } 26 | 27 | native = { 28 | source_image = "windows-10/22h2-enterprise" 29 | 30 | chef_attributes = "2022-community" 31 | } 32 | 33 | vagrant = { 34 | cpus = "4" 35 | memory = "8192" 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /samples/windows-10/Policyfile.rb: -------------------------------------------------------------------------------- 1 | require "#{File.dirname(__FILE__)}/../../src/windows/chef/Policyfile" 2 | 3 | name 'gusztavvargadr_packer_windows_10' 4 | 5 | gusztavvargadr_packer_windows_sources 6 | 7 | run_list( 8 | 'recipe[gusztavvargadr_packer_windows::default]' 9 | ) 10 | -------------------------------------------------------------------------------- /samples/windows-10/README.md: -------------------------------------------------------------------------------- 1 | # Packer samples for Windows 10 2 | 3 | This folder contains Packer templates for building `Windows 10` images. 4 | 5 | ## Overview 6 | 7 | See the links below for the details of the available images: 8 | 9 | - [22H2 Enterprise](#22h2-enterprise) 10 | - ~~[21H2 Enterprise](#21h2-enterprise) Deprecated~~ 11 | - [21H2 Enterprise LTSC](#21h2-enterprise-ltsc) 12 | - ~~[1809 Enterprise LTSC](#1809-enterprise-ltsc) Deprecated~~ 13 | 14 | ## 22H2 Enterprise 15 | 16 | [Vagrant box](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/windows-10-22h2-enterprise) | [Vagrant alias](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/windows-10) 17 | 18 | The template has the following settings: 19 | 20 | - **Windows 10 Version 22H2 Enterprise** Evaluation 21 | - OpenSSH Server and WinRM 22 | - Windows Updates disabled 23 | - Maintenance tasks disabled 24 | - Windows Defender disabled 25 | - UAC disabled 26 | - Generalized with Sysprep 27 | - **Vagrant** 28 | - User `vagrant` with password `vagrant` and Vagrant's insecure key 29 | - 2 vCPUs 30 | - 4 GB RAM 31 | 32 | ## 21H2 Enterprise 33 | 34 | **This template is ~~deprecated~~. Please use one of the other templates.** 35 | 36 | [Vagrant box](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/windows-10-21h2-enterprise) 37 | 38 | The template has the following settings: 39 | 40 | - **Windows 10 Version 21H2 Enterprise** Evaluation 41 | - OpenSSH Server and WinRM 42 | - Windows Updates disabled 43 | - Maintenance tasks disabled 44 | - Windows Defender disabled 45 | - UAC disabled 46 | - Generalized with Sysprep 47 | - **Vagrant** 48 | - User `vagrant` with password `vagrant` and Vagrant's insecure key 49 | - 2 vCPUs 50 | - 4 GB RAM 51 | 52 | ## 21H2 Enterprise LTSC 53 | 54 | [Vagrant box](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/windows-10-21h2-enterprise-ltsc) 55 | 56 | The template has the following settings: 57 | 58 | - **Windows 10 Version 21H2 Enterprise LTSC** Evaluation 59 | - OpenSSH Server and WinRM 60 | - Windows Updates disabled 61 | - Maintenance tasks disabled 62 | - Windows Defender disabled 63 | - UAC disabled 64 | - Generalized with Sysprep 65 | - **Vagrant** 66 | - User `vagrant` with password `vagrant` and Vagrant's insecure key 67 | - 2 vCPUs 68 | - 4 GB RAM 69 | 70 | ## 1809 Enterprise LTSC 71 | 72 | **This template is ~~deprecated~~. Please use one of the other templates.** 73 | 74 | [Vagrant box](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/windows-10-1809-enterprise-ltsc) 75 | 76 | The template has the following settings: 77 | 78 | - **Windows 10 Version 1809 Enterprise LTSC** Evaluation 79 | - OpenSSH Server and WinRM 80 | - Windows Updates disabled 81 | - Maintenance tasks disabled 82 | - Windows Defender disabled 83 | - UAC disabled 84 | - Generalized with Sysprep 85 | - **Vagrant** 86 | - User `vagrant` with password `vagrant` and Vagrant's insecure key 87 | - 2 vCPUs 88 | - 4 GB RAM 89 | -------------------------------------------------------------------------------- /samples/windows-10/Vagrantfile: -------------------------------------------------------------------------------- 1 | load "#{File.dirname(__FILE__)}/../core.Vagrantfile" 2 | 3 | Vagrant.configure("2") do |config| 4 | config_vm_define config, "22h2-enterprise", "windows-10-22h2-enterprise" 5 | config_vm_define config, "22h2-enterprise-alias", "windows-10" 6 | config_vm_define config, "21h2-enterprise-ltsc", "windows-10-21h2-enterprise-ltsc" 7 | 8 | config.vm.provision "shell", inline: <<-EOH 9 | cmd /c ver 10 | 11 | systeminfo 12 | Get-ComputerInfo 13 | 14 | Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) 15 | choco list -i 16 | EOH 17 | end 18 | -------------------------------------------------------------------------------- /samples/windows-10/images.pkrvars.hcl: -------------------------------------------------------------------------------- 1 | images = { 2 | "22h2-enterprise" = { 3 | core = { 4 | image_description = "Windows 10 Version 22H2 Enterprise" 5 | image_version = "2202.0" 6 | } 7 | 8 | native = { 9 | source_iso_url_local = "19045.2006.220908-0225.22h2_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso" 10 | source_iso_url_remote = "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" 11 | source_iso_checksum = "sha256:ef7312733a9f5d7d51cfa04ac497671995674ca5e1058d5164d6028f0938d668" 12 | } 13 | 14 | vagrant = { 15 | memory = "4096" 16 | box_alias = "windows-10" 17 | } 18 | 19 | virtualbox = { 20 | guest_os_type = "Windows10_64" 21 | } 22 | 23 | vmware = { 24 | guest_os_type = "windows9-64" 25 | } 26 | } 27 | 28 | "21h2-enterprise-ltsc" = { 29 | core = { 30 | image_description = "Windows 10 Version 21H2 Enterprise LTSC" 31 | image_version = "2102.0" 32 | } 33 | 34 | native = { 35 | source_iso_url_local = "19044.1288.211006-0501.21h2_release_svc_refresh_CLIENT_LTSC_EVAL_x64FRE_en-us.iso" 36 | source_iso_url_remote = "https://software-download.microsoft.com/download/db/444969d5-f34g-4e03-ac9d-1f9786c69161/19044.1288.211006-0501.21h2_release_svc_refresh_CLIENT_LTSC_EVAL_x64FRE_en-us.iso" 37 | source_iso_checksum = "sha256:e4ab2e3535be5748252a8d5d57539a6e59be8d6726345ee10e7afd2cb89fefb5" 38 | 39 | boot_image_name = "Windows 10 Enterprise LTSC 2021 Evaluation" 40 | } 41 | 42 | vagrant = { 43 | memory = "4096" 44 | } 45 | 46 | virtualbox = { 47 | guest_os_type = "Windows10_64" 48 | } 49 | 50 | vmware = { 51 | guest_os_type = "windows9-64" 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /samples/windows-11/Policyfile.rb: -------------------------------------------------------------------------------- 1 | require "#{File.dirname(__FILE__)}/../../src/windows/chef/Policyfile" 2 | 3 | name 'gusztavvargadr_packer_windows_11' 4 | 5 | gusztavvargadr_packer_windows_sources 6 | 7 | run_list( 8 | 'recipe[gusztavvargadr_packer_windows::default]' 9 | ) 10 | -------------------------------------------------------------------------------- /samples/windows-11/README.md: -------------------------------------------------------------------------------- 1 | # Packer samples for Windows 11 2 | 3 | This folder contains Packer templates for building `Windows 11` images. 4 | 5 | ## Overview 6 | 7 | See the links below for the details of the available images: 8 | 9 | - [24H2 Enterprise](#24h2-enterprise) 10 | - [24H2 Enterprise LTSC](#24h2-enterprise-ltsc) 11 | - [23H2 Enterprise](#23h2-enterprise) 12 | - [22H2 Enterprise](#22h2-enterprise) 13 | - [21H2 Enterprise](#21h2-enterprise) 14 | - [Insider Preview Enterprise](#insider-preview-enterprise) 15 | 16 | ## 24H2 Enterprise 17 | 18 | [Vagrant box](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/windows-11-24h2-enterprise) 19 | 20 | The template has the following settings: 21 | 22 | - **Windows 11 Version 24H2 Enterprise** Evaluation 23 | - OpenSSH Server and WinRM 24 | - Windows Updates disabled 25 | - Maintenance tasks disabled 26 | - Windows Defender disabled 27 | - UAC disabled 28 | - Generalized with Sysprep 29 | - **Vagrant** 30 | - User `vagrant` with password `vagrant` and Vagrant's insecure key 31 | - 2 vCPUs 32 | - 4 GB RAM 33 | 34 | ## 24H2 Enterprise LTSC 35 | 36 | [Vagrant box](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/windows-11-24h2-enterprise-ltsc) 37 | 38 | The template has the following settings: 39 | 40 | - **Windows 11 Version 24H2 Enterprise LTSC** Evaluation 41 | - OpenSSH Server and WinRM 42 | - Windows Updates disabled 43 | - Maintenance tasks disabled 44 | - Windows Defender disabled 45 | - UAC disabled 46 | - Generalized with Sysprep 47 | - **Vagrant** 48 | - User `vagrant` with password `vagrant` and Vagrant's insecure key 49 | - 2 vCPUs 50 | - 4 GB RAM 51 | 52 | ## 23H2 Enterprise 53 | 54 | [Vagrant box](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/windows-11-23h2-enterprise) | [Vagrant alias](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/windows-11) 55 | 56 | The template has the following settings: 57 | 58 | - **Windows 11 Version 23H2 Enterprise** Evaluation 59 | - OpenSSH Server and WinRM 60 | - Windows Updates disabled 61 | - Maintenance tasks disabled 62 | - Windows Defender disabled 63 | - UAC disabled 64 | - Generalized with Sysprep 65 | - **Vagrant** 66 | - User `vagrant` with password `vagrant` and Vagrant's insecure key 67 | - 2 vCPUs 68 | - 4 GB RAM 69 | 70 | ## 22H2 Enterprise 71 | 72 | [Vagrant box](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/windows-11-22h2-enterprise) 73 | 74 | The template has the following settings: 75 | 76 | - **Windows 11 Version 22H2 Enterprise** Evaluation 77 | - OpenSSH Server and WinRM 78 | - Windows Updates disabled 79 | - Maintenance tasks disabled 80 | - Windows Defender disabled 81 | - UAC disabled 82 | - Generalized with Sysprep 83 | - **Vagrant** 84 | - User `vagrant` with password `vagrant` and Vagrant's insecure key 85 | - 2 vCPUs 86 | - 4 GB RAM 87 | 88 | ## 21H2 Enterprise 89 | 90 | [Vagrant box](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/windows-11-21h2-enterprise) 91 | 92 | The template has the following settings: 93 | 94 | - **Windows 11 Version 21H2 Enterprise** Evaluation 95 | - OpenSSH Server and WinRM 96 | - Windows Updates disabled 97 | - Maintenance tasks disabled 98 | - Windows Defender disabled 99 | - UAC disabled 100 | - Generalized with Sysprep 101 | - **Vagrant** 102 | - User `vagrant` with password `vagrant` and Vagrant's insecure key 103 | - 2 vCPUs 104 | - 4 GB RAM 105 | 106 | ## Insider Preview Enterprise 107 | 108 | [Vagrant box](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/windows-11-insider-preview-enterprise) 109 | 110 | The template has the following settings: 111 | 112 | - **Windows 11 Insider Preview Enterprise** 113 | - OpenSSH Server and WinRM 114 | - Windows Updates disabled 115 | - Maintenance tasks disabled 116 | - Windows Defender disabled 117 | - UAC disabled 118 | - Generalized with Sysprep 119 | - **Vagrant** 120 | - User `vagrant` with password `vagrant` and Vagrant's insecure key 121 | - 2 vCPUs 122 | - 4 GB RAM 123 | -------------------------------------------------------------------------------- /samples/windows-11/Vagrantfile: -------------------------------------------------------------------------------- 1 | load "#{File.dirname(__FILE__)}/../core.Vagrantfile" 2 | 3 | Vagrant.configure("2") do |config| 4 | config_vm_define config, "24h2-enterprise", "windows-11-24h2-enterprise" 5 | config_vm_define config, "24h2-enterprise-alias", "windows-11" 6 | config_vm_define config, "24h2-enterprise-ltsc", "windows-11-24h2-enterprise-ltsc" 7 | config_vm_define config, "23h2-enterprise", "windows-11-23h2-enterprise" 8 | config_vm_define config, "22h2-enterprise", "windows-11-22h2-enterprise" 9 | config_vm_define config, "21h2-enterprise", "windows-11-21h2-enterprise" 10 | config_vm_define config, "insider-preview-enterprise", "windows-11-insider-preview-enterprise" 11 | 12 | config.vm.provision "shell", inline: <<-EOH 13 | cmd /c ver 14 | 15 | systeminfo 16 | Get-ComputerInfo 17 | 18 | Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) 19 | choco list -i 20 | EOH 21 | end 22 | -------------------------------------------------------------------------------- /samples/windows-11/images.pkrvars.hcl: -------------------------------------------------------------------------------- 1 | images = { 2 | "24h2-enterprise" = { 3 | core = { 4 | image_description = "Windows 11 Version 24H2 Enterprise" 5 | image_version = "2402.0" 6 | } 7 | 8 | native = { 9 | source_iso_url_local = "26100.1742.240906-0331.ge_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso" 10 | source_iso_url_remote = "https://software-static.download.prss.microsoft.com/dbazure/888969d5-f34g-4e03-ac9d-1f9786c66749/26100.1742.240906-0331.ge_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso" 11 | source_iso_checksum = "sha256:755a90d43e826a74b9e1932a34788b898e028272439b777e5593dee8d53622ae" 12 | 13 | boot_setup_script = "setup.cmd" 14 | } 15 | 16 | vagrant = { 17 | memory = "4096" 18 | box_alias = "windows-11" 19 | } 20 | 21 | virtualbox = { 22 | guest_os_type = "Windows11_64" 23 | } 24 | 25 | vmware = { 26 | guest_os_type = "windows11-64" 27 | } 28 | } 29 | 30 | "24h2-enterprise-ltsc" = { 31 | core = { 32 | image_description = "Windows 11 Version 24H2 Enterprise" 33 | image_version = "2402.0" 34 | } 35 | 36 | native = { 37 | source_iso_url_local = "26100.1742.240906-0331.ge_release_svc_refresh_CLIENT_LTSC_EVAL_x64FRE_en-us.iso" 38 | source_iso_url_remote = "https://software-static.download.prss.microsoft.com/dbazure/888969d5-f34g-4e03-ac9d-1f9786c66749/26100.1742.240906-0331.ge_release_svc_refresh_CLIENT_LTSC_EVAL_x64FRE_en-us.iso" 39 | source_iso_checksum = "sha256:67cec5865eaa037a72ddc633a717a10a2bed50778862267223ddb9c60ef5da68" 40 | 41 | boot_setup_script = "setup.cmd" 42 | boot_image_name = "Windows 11 Enterprise LTSC Evaluation" 43 | } 44 | 45 | vagrant = { 46 | memory = "4096" 47 | } 48 | 49 | virtualbox = { 50 | guest_os_type = "Windows11_64" 51 | } 52 | 53 | vmware = { 54 | guest_os_type = "windows11-64" 55 | } 56 | } 57 | 58 | "23h2-enterprise" = { 59 | core = { 60 | image_description = "Windows 11 Version 23H2 Enterprise" 61 | image_version = "2302.0" 62 | } 63 | 64 | native = { 65 | source_iso_url_local = "22631.2428.231001-0608.23H2_NI_RELEASE_SVC_REFRESH_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso" 66 | source_iso_url_remote = "https://software-static.download.prss.microsoft.com/dbazure/888969d5-f34g-4e03-ac9d-1f9786c66749/22631.2428.231001-0608.23H2_NI_RELEASE_SVC_REFRESH_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso" 67 | source_iso_checksum = "sha256:c8dbc96b61d04c8b01faf6ce0794fdf33965c7b350eaa3eb1e6697019902945c" 68 | 69 | boot_setup_script = "setup.cmd" 70 | } 71 | 72 | vagrant = { 73 | memory = "4096" 74 | } 75 | 76 | virtualbox = { 77 | guest_os_type = "Windows11_64" 78 | } 79 | 80 | vmware = { 81 | guest_os_type = "windows11-64" 82 | } 83 | } 84 | 85 | "22h2-enterprise" = { 86 | core = { 87 | image_description = "Windows 11 Version 22H2 Enterprise" 88 | image_version = "2202.0" 89 | } 90 | 91 | native = { 92 | source_iso_url_local = "22621.525.220925-0207.ni_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso" 93 | source_iso_url_remote = "https://software-static.download.prss.microsoft.com/dbazure/988969d5-f34g-4e03-ac9d-1f9786c66751/22621.525.220925-0207.ni_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso" 94 | source_iso_checksum = "sha256:ebbc79106715f44f5020f77bd90721b17c5a877cbc15a3535b99155493a1bb3f" 95 | 96 | boot_setup_script = "setup.cmd" 97 | } 98 | 99 | vagrant = { 100 | memory = "4096" 101 | } 102 | 103 | virtualbox = { 104 | guest_os_type = "Windows11_64" 105 | } 106 | 107 | vmware = { 108 | guest_os_type = "windows11-64" 109 | } 110 | } 111 | 112 | "21h2-enterprise" = { 113 | core = { 114 | image_description = "Windows 11 Version 21H2 Enterprise" 115 | image_version = "2102.0" 116 | } 117 | 118 | native = { 119 | source_iso_url_local = "22000.194.210913-1444.co_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso" 120 | source_iso_url_remote = "https://software-download.microsoft.com/download/sg/22000.194.210913-1444.co_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso" 121 | source_iso_checksum = "sha256:e8b1d2a1a85a09b4bf6154084a8be8e3c814894a15a7bcf3e8e63fcfa9a528cb" 122 | 123 | boot_setup_script = "setup.cmd" 124 | } 125 | 126 | vagrant = { 127 | memory = "4096" 128 | } 129 | 130 | virtualbox = { 131 | guest_os_type = "Windows11_64" 132 | } 133 | 134 | vmware = { 135 | guest_os_type = "windows11-64" 136 | } 137 | } 138 | 139 | "insider-preview-enterprise" = { 140 | core = { 141 | image_description = "Windows 11 Insider Preview Enterprise" 142 | image_version = "2402.0" 143 | } 144 | 145 | native = { 146 | source_iso_url_local = "Windows11_InsiderPreview_EnterpriseVL_x64_en-us_27774.iso" 147 | source_iso_url_remote = "https://api.hashicorp.cloud/vagrant/2022-08-01/gusztavvargadr-iso/boxes/windows-11-insider-preview/versions/2402.0.2503/providers/iso/amd64/vagrant.box" 148 | source_iso_checksum = "sha256:2957bd376379314d86befac4e15b984d46c5a09272026ab17ec0c30d66095b87" 149 | 150 | boot_setup_script = "setup.cmd" 151 | boot_image_name = "Windows 11 Enterprise" 152 | } 153 | 154 | vagrant = { 155 | memory = "4096" 156 | } 157 | 158 | virtualbox = { 159 | guest_os_type = "Windows11_64" 160 | } 161 | 162 | vmware = { 163 | guest_os_type = "windows11-64" 164 | } 165 | } 166 | } 167 | -------------------------------------------------------------------------------- /samples/windows-11/setup.cmd: -------------------------------------------------------------------------------- 1 | reg add HKLM\SYSTEM\Setup\LabConfig /t REG_DWORD /v BypassSecureBootCheck /d 1 2 | reg add HKLM\SYSTEM\Setup\LabConfig /t REG_DWORD /v BypassTPMCheck /d 1 3 | -------------------------------------------------------------------------------- /samples/windows-server/Policyfile.rb: -------------------------------------------------------------------------------- 1 | require "#{File.dirname(__FILE__)}/../../src/windows/chef/Policyfile" 2 | 3 | name 'gusztavvargadr_packer_windows_server' 4 | 5 | gusztavvargadr_packer_windows_sources 6 | 7 | run_list( 8 | 'recipe[gusztavvargadr_packer_windows::default]' 9 | ) 10 | -------------------------------------------------------------------------------- /samples/windows-server/README.md: -------------------------------------------------------------------------------- 1 | # Packer samples for Windows Server 2 | 3 | This folder contains Packer templates for building `Windows Server` images. 4 | 5 | ## Overview 6 | 7 | See the links below for the details of the available images: 8 | 9 | - [2022 Standard](#2022-standard) 10 | - [2022 Standard Core](#2022-standard-core) 11 | - ~~[2019 Standard](#2019-standard) Deprecated~~ 12 | - ~~[2019 Standard Core](#2019-standard-core) Deprecated~~ 13 | - [Insider Preview Standard](#insider-preview-standard) 14 | - [Insider Preview Standard Core](#insider-preview-standard-core) 15 | 16 | ## 2022 Standard 17 | 18 | [Vagrant box](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/windows-server-2022-standard) | [Vagrant alias](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/windows-server) 19 | 20 | The template has the following settings: 21 | 22 | - **Windows Server 2022 Standard** Evaluation 23 | - OpenSSH Server and WinRM 24 | - Windows Updates disabled 25 | - Maintenance tasks disabled 26 | - Windows Defender disabled 27 | - UAC disabled 28 | - Generalized with Sysprep 29 | - **Vagrant** 30 | - User `vagrant` with password `vagrant` and Vagrant's insecure key 31 | - 2 vCPUs 32 | - 2 GB RAM 33 | 34 | ## 2022 Standard Core 35 | 36 | [Vagrant box](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/windows-server-2022-standard-core) | [Vagrant alias](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/windows-server-core) 37 | 38 | The template has the following settings: 39 | 40 | - **Windows Server 2022 Standard Core** Evaluation 41 | - OpenSSH Server and WinRM 42 | - Windows Updates disabled 43 | - Maintenance tasks disabled 44 | - Windows Defender disabled 45 | - UAC disabled 46 | - Generalized with Sysprep 47 | - **Vagrant** 48 | - User `vagrant` with password `vagrant` and Vagrant's insecure key 49 | - 2 vCPUs 50 | - 2 GB RAM 51 | 52 | ## 2019 Standard 53 | 54 | **This template is ~~deprecated~~. Please use one of the other templates.** 55 | 56 | [Vagrant box](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/windows-server-2019-standard) 57 | 58 | The template has the following settings: 59 | 60 | - **Windows Server 2019 Standard** Evaluation 61 | - OpenSSH Server and WinRM 62 | - Windows Updates disabled 63 | - Maintenance tasks disabled 64 | - Windows Defender disabled 65 | - UAC disabled 66 | - Generalized with Sysprep 67 | - **Vagrant** 68 | - User `vagrant` with password `vagrant` and Vagrant's insecure key 69 | - 2 vCPUs 70 | - 2 GB RAM 71 | 72 | ## 2019 Standard Core 73 | 74 | **This template is ~~deprecated~~. Please use one of the other templates.** 75 | 76 | [Vagrant box](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/windows-server-2019-standard-core) 77 | 78 | The template has the following settings: 79 | 80 | - **Windows Server 2019 Standard Core** Evaluation 81 | - OpenSSH Server and WinRM 82 | - Windows Updates disabled 83 | - Maintenance tasks disabled 84 | - Windows Defender disabled 85 | - UAC disabled 86 | - Generalized with Sysprep 87 | - **Vagrant** 88 | - User `vagrant` with password `vagrant` and Vagrant's insecure key 89 | - 2 vCPUs 90 | - 2 GB RAM 91 | 92 | ## Insider Preview Standard 93 | 94 | [Vagrant box](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/windows-server-insider-preview-standard) 95 | 96 | The template has the following settings: 97 | 98 | - **Windows Server Insider Preview Standard** 99 | - OpenSSH Server and WinRM 100 | - Windows Updates disabled 101 | - Maintenance tasks disabled 102 | - Windows Defender disabled 103 | - UAC disabled 104 | - Generalized with Sysprep 105 | - **Vagrant** 106 | - User `vagrant` with password `vagrant` and Vagrant's insecure key 107 | - 2 vCPUs 108 | - 2 GB RAM 109 | 110 | ## Insider Preview Standard Core 111 | 112 | [Vagrant box](https://portal.cloud.hashicorp.com/vagrant/discover/gusztavvargadr/windows-server-insider-preview-standard-core) 113 | 114 | The template has the following settings: 115 | 116 | - **Windows Server Insider Preview Standard Core** 117 | - OpenSSH Server and WinRM 118 | - Windows Updates disabled 119 | - Maintenance tasks disabled 120 | - Windows Defender disabled 121 | - UAC disabled 122 | - Generalized with Sysprep 123 | - **Vagrant** 124 | - User `vagrant` with password `vagrant` and Vagrant's insecure key 125 | - 2 vCPUs 126 | - 2 GB RAM 127 | -------------------------------------------------------------------------------- /samples/windows-server/Vagrantfile: -------------------------------------------------------------------------------- 1 | load "#{File.dirname(__FILE__)}/../core.Vagrantfile" 2 | 3 | Vagrant.configure("2") do |config| 4 | config_vm_define config, "2025-standard", "windows-server-2025-standard" 5 | config_vm_define config, "2025-standard-alias", "windows-server" 6 | config_vm_define config, "2025-standard-core", "windows-server-2025-standard-core" 7 | config_vm_define config, "2025-standard-core-alias", "windows-server-core" 8 | config_vm_define config, "2022-standard", "windows-server-2022-standard" 9 | config_vm_define config, "2022-standard-core", "windows-server-2022-standard-core" 10 | config_vm_define config, "insider-preview-standard", "windows-server-insider-preview-standard" 11 | config_vm_define config, "insider-preview-standard-core", "windows-server-insider-preview-standard-core" 12 | 13 | config.vm.provision "shell", inline: <<-EOH 14 | cmd /c ver 15 | 16 | systeminfo 17 | Get-ComputerInfo 18 | 19 | Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) 20 | choco list -i 21 | EOH 22 | end 23 | -------------------------------------------------------------------------------- /samples/windows-server/images.pkrvars.hcl: -------------------------------------------------------------------------------- 1 | images = { 2 | "2025-standard" = { 3 | core = { 4 | image_description = "Windows Server 2025 Standard" 5 | image_version = "2402.0" 6 | } 7 | 8 | native = { 9 | source_iso_url_local = "26100.1742.240906-0331.ge_release_svc_refresh_SERVER_EVAL_x64FRE_en-us.iso" 10 | source_iso_url_remote = "https://software-static.download.prss.microsoft.com/dbazure/888969d5-f34g-4e03-ac9d-1f9786c66749/26100.1742.240906-0331.ge_release_svc_refresh_SERVER_EVAL_x64FRE_en-us.iso" 11 | source_iso_checksum = "sha256:d0ef4502e350e3c6c53c15b1b3020d38a5ded011bf04998e950720ac8579b23d" 12 | 13 | boot_image_name = "Windows Server 2025 SERVERSTANDARD" 14 | } 15 | 16 | vagrant = { 17 | box_alias = "windows-server" 18 | } 19 | 20 | virtualbox = { 21 | guest_os_type = "Windows2022_64" 22 | } 23 | 24 | vmware = { 25 | guest_os_type = "windows2019srvnext-64" 26 | } 27 | } 28 | 29 | "2025-standard-core" = { 30 | core = { 31 | image_description = "Windows Server 2025 Standard Core" 32 | image_version = "2402.0" 33 | } 34 | 35 | native = { 36 | source_iso_url_local = "26100.1742.240906-0331.ge_release_svc_refresh_SERVER_EVAL_x64FRE_en-us.iso" 37 | source_iso_url_remote = "https://software-static.download.prss.microsoft.com/dbazure/888969d5-f34g-4e03-ac9d-1f9786c66749/26100.1742.240906-0331.ge_release_svc_refresh_SERVER_EVAL_x64FRE_en-us.iso" 38 | source_iso_checksum = "sha256:d0ef4502e350e3c6c53c15b1b3020d38a5ded011bf04998e950720ac8579b23d" 39 | 40 | boot_image_name = "Windows Server 2025 SERVERSTANDARDCORE" 41 | } 42 | 43 | vagrant = { 44 | box_alias = "windows-server-core" 45 | } 46 | 47 | virtualbox = { 48 | guest_os_type = "Windows2022_64" 49 | } 50 | 51 | vmware = { 52 | guest_os_type = "windows2019srvnext-64" 53 | } 54 | } 55 | 56 | "2022-standard" = { 57 | core = { 58 | image_description = "Windows Server 2022 Standard" 59 | image_version = "2102.0" 60 | } 61 | 62 | native = { 63 | source_iso_url_local = "SERVER_EVAL_x64FRE_en-us.iso" 64 | source_iso_url_remote = "https://software-static.download.prss.microsoft.com/sg/download/888969d5-f34g-4e03-ac9d-1f9786c66749/SERVER_EVAL_x64FRE_en-us.iso" 65 | source_iso_checksum = "sha256:3e4fa6d8507b554856fc9ca6079cc402df11a8b79344871669f0251535255325" 66 | 67 | boot_image_name = "Windows Server 2022 SERVERSTANDARD" 68 | } 69 | 70 | virtualbox = { 71 | guest_os_type = "Windows2022_64" 72 | } 73 | 74 | vmware = { 75 | guest_os_type = "windows2019srvnext-64" 76 | } 77 | } 78 | 79 | "2022-standard-core" = { 80 | core = { 81 | image_description = "Windows Server 2022 Standard Core" 82 | image_version = "2102.0" 83 | } 84 | 85 | native = { 86 | source_iso_url_local = "SERVER_EVAL_x64FRE_en-us.iso" 87 | source_iso_url_remote = "https://software-static.download.prss.microsoft.com/sg/download/888969d5-f34g-4e03-ac9d-1f9786c66749/SERVER_EVAL_x64FRE_en-us.iso" 88 | source_iso_checksum = "sha256:3e4fa6d8507b554856fc9ca6079cc402df11a8b79344871669f0251535255325" 89 | 90 | boot_image_name = "Windows Server 2022 SERVERSTANDARDCORE" 91 | } 92 | 93 | virtualbox = { 94 | guest_os_type = "Windows2022_64" 95 | } 96 | 97 | vmware = { 98 | guest_os_type = "windows2019srvnext-64" 99 | } 100 | } 101 | 102 | "insider-preview-standard" = { 103 | core = { 104 | image_description = "Windows Server Insider Preview Standard" 105 | image_version = "2402.0" 106 | } 107 | 108 | native = { 109 | source_iso_url_local = "Windows_InsiderPreview_Server_vNext_en-us_26384.iso" 110 | source_iso_url_remote = "https://api.hashicorp.cloud/vagrant/2022-08-01/gusztavvargadr-iso/boxes/windows-server-insider-preview/versions/2402.0.2503/providers/iso/amd64/vagrant.box" 111 | source_iso_checksum = "sha256:0cfe9ea1f33125f1d2a634e5bed67cd17348be1f6460789c90f4d50c74699333" 112 | 113 | boot_image_name = "Windows Server 2025 SERVERSTANDARD" 114 | boot_product_key = "MFY9F-XBN2F-TYFMP-CCV49-RMYVH" 115 | } 116 | 117 | virtualbox = { 118 | guest_os_type = "Windows2022_64" 119 | } 120 | 121 | vmware = { 122 | guest_os_type = "windows2019srvnext-64" 123 | } 124 | } 125 | 126 | "insider-preview-standard-core" = { 127 | core = { 128 | image_description = "Windows Server Insider Preview Standard Core" 129 | image_version = "2402.0" 130 | } 131 | 132 | native = { 133 | source_iso_url_local = "Windows_InsiderPreview_Server_vNext_en-us_26384.iso" 134 | source_iso_url_remote = "https://api.hashicorp.cloud/vagrant/2022-08-01/gusztavvargadr-iso/boxes/windows-server-insider-preview/versions/2402.0.2503/providers/iso/amd64/vagrant.box" 135 | source_iso_checksum = "sha256:0cfe9ea1f33125f1d2a634e5bed67cd17348be1f6460789c90f4d50c74699333" 136 | 137 | boot_image_name = "Windows Server 2025 SERVERSTANDARDCORE" 138 | boot_product_key = "MFY9F-XBN2F-TYFMP-CCV49-RMYVH" 139 | } 140 | 141 | virtualbox = { 142 | guest_os_type = "Windows2022_64" 143 | } 144 | 145 | vmware = { 146 | guest_os_type = "windows2019srvnext-64" 147 | } 148 | } 149 | } 150 | -------------------------------------------------------------------------------- /src/ubuntu/boot/hyperv/meta-data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gusztavvargadr/packer/8dfd3b57f3ba0f202b6a9542f5a5281e8cbc28e5/src/ubuntu/boot/hyperv/meta-data -------------------------------------------------------------------------------- /src/ubuntu/boot/hyperv/user-data: -------------------------------------------------------------------------------- 1 | #cloud-config 2 | autoinstall: 3 | version: 1 4 | storage: 5 | layout: 6 | name: lvm 7 | sizing-policy: all 8 | apt: 9 | geoip: false 10 | timezone: UTC 11 | identity: 12 | hostname: vagrant 13 | realname: vagrant 14 | username: vagrant 15 | password: "$6$vagrant$aYdZwu4306HGdE39rROOrbSnB8G1Jser5zc9VMESSr8PouIZdgoO.OYQsFTOHXRXSYzB1oCD7571llAG6WR15." 16 | ssh: 17 | install-server: true 18 | user-data: 19 | users: 20 | - name: vagrant 21 | shell: /bin/bash 22 | groups: sudo 23 | sudo: ALL=(ALL) NOPASSWD:ALL 24 | packages: 25 | - linux-azure 26 | runcmd: 27 | - shutdown --reboot +1 28 | -------------------------------------------------------------------------------- /src/ubuntu/boot/virtualbox/meta-data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gusztavvargadr/packer/8dfd3b57f3ba0f202b6a9542f5a5281e8cbc28e5/src/ubuntu/boot/virtualbox/meta-data -------------------------------------------------------------------------------- /src/ubuntu/boot/virtualbox/user-data: -------------------------------------------------------------------------------- 1 | #cloud-config 2 | autoinstall: 3 | version: 1 4 | storage: 5 | layout: 6 | name: lvm 7 | sizing-policy: all 8 | apt: 9 | geoip: false 10 | timezone: UTC 11 | identity: 12 | hostname: vagrant 13 | realname: vagrant 14 | username: vagrant 15 | password: "$6$vagrant$aYdZwu4306HGdE39rROOrbSnB8G1Jser5zc9VMESSr8PouIZdgoO.OYQsFTOHXRXSYzB1oCD7571llAG6WR15." 16 | ssh: 17 | install-server: true 18 | user-data: 19 | users: 20 | - name: vagrant 21 | shell: /bin/bash 22 | groups: sudo 23 | sudo: ALL=(ALL) NOPASSWD:ALL 24 | -------------------------------------------------------------------------------- /src/ubuntu/boot/vmware/meta-data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gusztavvargadr/packer/8dfd3b57f3ba0f202b6a9542f5a5281e8cbc28e5/src/ubuntu/boot/vmware/meta-data -------------------------------------------------------------------------------- /src/ubuntu/boot/vmware/user-data: -------------------------------------------------------------------------------- 1 | #cloud-config 2 | autoinstall: 3 | version: 1 4 | storage: 5 | layout: 6 | name: lvm 7 | sizing-policy: all 8 | apt: 9 | geoip: false 10 | timezone: UTC 11 | identity: 12 | hostname: vagrant 13 | realname: vagrant 14 | username: vagrant 15 | password: "$6$vagrant$aYdZwu4306HGdE39rROOrbSnB8G1Jser5zc9VMESSr8PouIZdgoO.OYQsFTOHXRXSYzB1oCD7571llAG6WR15." 16 | ssh: 17 | install-server: true 18 | user-data: 19 | users: 20 | - name: vagrant 21 | shell: /bin/bash 22 | groups: sudo 23 | sudo: ALL=(ALL) NOPASSWD:ALL 24 | packages: 25 | - open-vm-tools 26 | - open-vm-tools-desktop 27 | -------------------------------------------------------------------------------- /src/ubuntu/build.native.pkr.hcl: -------------------------------------------------------------------------------- 1 | variable "userprofile_directory" { 2 | type = string 3 | default = env("USERPROFILE") 4 | } 5 | 6 | variable "home_directory" { 7 | type = string 8 | default = env("HOME") 9 | } 10 | 11 | locals { 12 | native_iso_sources = { 13 | virtualbox = "virtualbox-iso.core" 14 | vmware = "vmware-iso.core" 15 | hyperv = "hyperv-iso.core" 16 | } 17 | 18 | native_import_sources = { 19 | virtualbox = "virtualbox-ovf.core" 20 | vmware = "vmware-vmx.core" 21 | hyperv = "hyperv-vmcx.core" 22 | } 23 | 24 | native_iso = contains(keys(local.image_options.native), "source_iso_checksum") 25 | downloads_directory = "${coalesce(var.userprofile_directory, var.home_directory)}/Downloads" 26 | 27 | source_options_native = { 28 | iso_urls = local.native_iso ? [ 29 | "${local.downloads_directory}/${local.image_options.native.source_iso_url_local}", 30 | local.image_options.native.source_iso_url_remote 31 | ] : [] 32 | iso_checksum = local.native_iso ? local.image_options.native.source_iso_checksum : "" 33 | http_directory = "${path.root}/boot" 34 | 35 | import_directory = local.native_build ? "${path.cwd}/../../artifacts/${lookup(local.image_options.native, "source_image", "")}/${local.image_provider}/native" : "" 36 | 37 | boot_command = local.native_iso ? [ 38 | "c", 39 | "set gfxpayload=keep", 40 | "linux /casper/vmlinuz quiet autoinstall 'ds=nocloud-net;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/${local.image_provider}/'", 41 | "initrd /casper/initrd", 42 | "bootwait>", 43 | ] : [] 44 | shutdown_command = "sudo -S shutdown -P now" 45 | } 46 | } 47 | 48 | build { 49 | name = "native-restore" 50 | 51 | sources = ["null.core"] 52 | 53 | provisioner "shell-local" { 54 | inline = [ 55 | "chef install --chef-license accept-silent", 56 | "chef update --attributes", 57 | "chef export ${local.artifacts_directory}/chef --force" 58 | ] 59 | } 60 | } 61 | 62 | locals { 63 | chef_destination = "/var/tmp/packer-build/chef/" 64 | chef_max_retries = 10 65 | chef_attributes = lookup(local.image_options.native, "chef_attributes", "") 66 | chef_keep = lookup(local.image_options.native, "chef_keep", "false") 67 | } 68 | 69 | build { 70 | name = "native-build" 71 | 72 | sources = local.native_build ? (local.native_iso ? compact([lookup(local.native_iso_sources, local.image_provider, "")]) : compact([lookup(local.native_import_sources, local.image_provider, "")])) : ["null.core"] 73 | 74 | provisioner "shell" { 75 | script = "${path.root}/chef/initialize.sh" 76 | } 77 | 78 | provisioner "file" { 79 | source = "${local.artifacts_directory}/chef/" 80 | destination = local.chef_destination 81 | } 82 | 83 | provisioner "file" { 84 | sources = fileset(path.cwd, "attributes.*.json") 85 | destination = local.chef_destination 86 | } 87 | 88 | provisioner "shell" { 89 | script = "${path.root}/chef/apply.sh" 90 | valid_exit_codes = [0, 35] 91 | 92 | env = { 93 | CHEF_ATTRIBUTES = local.chef_attributes 94 | } 95 | } 96 | 97 | provisioner "shell" { 98 | inline = ["sudo shutdown --reboot +1"] 99 | } 100 | 101 | provisioner "shell" { 102 | script = "${path.root}/chef/apply.sh" 103 | max_retries = local.chef_max_retries 104 | pause_before = "120s" 105 | 106 | env = { 107 | CHEF_ATTRIBUTES = local.chef_attributes 108 | } 109 | } 110 | 111 | provisioner "shell" { 112 | script = "${path.root}/chef/cleanup.sh" 113 | expect_disconnect = true 114 | 115 | env = { 116 | CHEF_KEEP = local.chef_keep 117 | } 118 | } 119 | 120 | post-processor "manifest" { 121 | output = "${local.artifacts_directory}/manifest.json" 122 | } 123 | 124 | post-processor "checksum" { 125 | checksum_types = ["sha256"] 126 | output = "${local.artifacts_directory}/checksum.{{ .ChecksumType }}" 127 | } 128 | } 129 | 130 | build { 131 | name = "native-test" 132 | 133 | sources = ["null.core"] 134 | } 135 | 136 | build { 137 | name = "native-publish" 138 | 139 | sources = ["null.core"] 140 | } 141 | -------------------------------------------------------------------------------- /src/ubuntu/build.vagrant.pkr.hcl: -------------------------------------------------------------------------------- 1 | packer { 2 | required_plugins { 3 | vagrant = { 4 | version = "~> 1.1.4" 5 | source = "github.com/hashicorp/vagrant" 6 | } 7 | } 8 | } 9 | 10 | locals { 11 | vagrant_import_sources = { 12 | virtualbox = "virtualbox-ovf.core" 13 | vmware = "vmware-vmx.core" 14 | hyperv = "hyperv-vmcx.core" 15 | } 16 | 17 | source_options_vagrant = { 18 | iso_urls = [] 19 | iso_checksum = "" 20 | http_directory = "" 21 | 22 | import_directory = local.vagrant_build ? "${local.artifacts_directory}/../native" : "" 23 | 24 | boot_command = compact([]) 25 | shutdown_command = "sudo -S shutdown -P now" 26 | } 27 | 28 | vagrant_providers = { 29 | virtualbox = "virtualbox" 30 | vmware = "vmware_desktop" 31 | hyperv = "hyperv" 32 | } 33 | } 34 | 35 | locals { 36 | vagrant_options_core = { 37 | cpus = "2" 38 | memory = "2048" 39 | ports = "" 40 | architecture = "amd64" 41 | } 42 | vagrant_options_image = lookup(local.image_options, "vagrant", {}) 43 | vagrant_options = merge(local.vagrant_options_core, local.vagrant_options_image) 44 | } 45 | 46 | source "file" "Vagrantfile" { 47 | content = templatefile("${path.root}/vagrant/template.Vagrantfile", { options = local.vagrant_options }) 48 | target = "${local.artifacts_directory}/Vagrantfile" 49 | } 50 | 51 | build { 52 | name = "vagrant-restore" 53 | 54 | sources = ["file.Vagrantfile"] 55 | } 56 | 57 | build { 58 | name = "vagrant-build" 59 | 60 | sources = local.vagrant_build ? compact([lookup(local.vagrant_import_sources, local.image_provider, "")]) : ["null.core"] 61 | 62 | provisioner "shell" { 63 | environment_vars = [ 64 | "HOME_DIR=/home/vagrant" 65 | ] 66 | execute_command = "{{.Vars}} sudo -S -E bash -eux '{{.Path}}'" 67 | expect_disconnect = true 68 | scripts = [ 69 | "${path.root}/vagrant/vagrant.sh" 70 | ] 71 | } 72 | 73 | post-processors { 74 | post-processor "vagrant" { 75 | vagrantfile_template = "${local.artifacts_directory}/Vagrantfile" 76 | output = "${local.artifacts_directory}/vagrant/vagrant.box" 77 | } 78 | 79 | post-processor "manifest" { 80 | output = "${local.artifacts_directory}/manifest.json" 81 | } 82 | 83 | post-processor "checksum" { 84 | checksum_types = ["sha256"] 85 | output = "${local.artifacts_directory}/checksum.{{ .ChecksumType }}" 86 | } 87 | } 88 | } 89 | 90 | build { 91 | name = "vagrant-test" 92 | 93 | sources = ["null.core"] 94 | 95 | provisioner "shell-local" { 96 | inline = [ 97 | "vagrant destroy -f ${var.image}", 98 | ] 99 | 100 | valid_exit_codes = [0, 1] 101 | 102 | env = { 103 | VAGRANT_BOX_URL = "${local.artifacts_directory}/vagrant/vagrant.box" 104 | } 105 | } 106 | 107 | provisioner "shell-local" { 108 | inline = [ 109 | "vagrant up ${var.image} --provider ${lookup(local.vagrant_providers, local.image_provider, "")}", 110 | ] 111 | 112 | max_retries = 1 113 | 114 | env = { 115 | VAGRANT_BOX_URL = "${local.artifacts_directory}/vagrant/vagrant.box" 116 | } 117 | } 118 | 119 | provisioner "shell-local" { 120 | inline = [ 121 | "vagrant destroy -f ${var.image}", 122 | ] 123 | 124 | valid_exit_codes = [0, 1] 125 | 126 | env = { 127 | VAGRANT_BOX_URL = "${local.artifacts_directory}/vagrant/vagrant.box" 128 | } 129 | } 130 | } 131 | 132 | build { 133 | name = "vagrant-publish" 134 | 135 | sources = ["null.core"] 136 | 137 | post-processors { 138 | post-processor "artifice" { 139 | files = ["${local.artifacts_directory}/vagrant/vagrant.box"] 140 | } 141 | 142 | post-processor "vagrant-registry" { 143 | box_tag = "${local.image_author}/${lookup(local.vagrant_options, "box_name", replace(local.image_name, "/", "-"))}" 144 | version = local.image_version 145 | box_checksum = "SHA256:${split("\t", file("${local.artifacts_directory}/checksum.sha256"))[0]}" 146 | architecture = local.vagrant_options.architecture 147 | default_architecture = local.vagrant_options.architecture 148 | // no_release = true 149 | } 150 | } 151 | 152 | dynamic "post-processors" { 153 | for_each = compact([lookup(local.vagrant_options, "box_alias", "")]) 154 | 155 | content { 156 | post-processor "artifice" { 157 | files = ["${local.artifacts_directory}/vagrant/vagrant.box"] 158 | } 159 | 160 | post-processor "vagrant-registry" { 161 | box_tag = "${local.image_author}/${post-processors.value}" 162 | version = local.image_version 163 | box_download_url = "https://api.hashicorp.cloud/vagrant/2022-08-01/${local.image_author}/boxes/${lookup(local.vagrant_options, "box_name", replace(local.image_name, "/", "-"))}/versions/${local.image_version}/providers/${lookup(local.vagrant_providers, local.image_provider, "")}/${local.vagrant_options.architecture}/vagrant.box" 164 | box_checksum = "SHA256:${split("\t", file("${local.artifacts_directory}/checksum.sha256"))[0]}" 165 | architecture = local.vagrant_options.architecture 166 | default_architecture = local.vagrant_options.architecture 167 | // no_release = true 168 | } 169 | } 170 | } 171 | } 172 | 173 | build { 174 | name = "vagrant-download" 175 | 176 | sources = ["null.core"] 177 | 178 | provisioner "shell-local" { 179 | inline = [ 180 | "vagrant destroy -f ${var.image}", 181 | ] 182 | 183 | valid_exit_codes = [0, 1] 184 | } 185 | 186 | provisioner "shell-local" { 187 | inline = [ 188 | "vagrant up ${var.image} --provider ${lookup(local.vagrant_providers, local.image_provider, "")}", 189 | ] 190 | 191 | max_retries = 1 192 | } 193 | 194 | provisioner "shell-local" { 195 | inline = [ 196 | "vagrant destroy -f ${var.image}", 197 | ] 198 | 199 | valid_exit_codes = [0, 1] 200 | } 201 | } 202 | -------------------------------------------------------------------------------- /src/ubuntu/chef/Policyfile.rb: -------------------------------------------------------------------------------- 1 | require "#{File.dirname(__FILE__)}/../../../lib/gusztavvargadr/chef/src/Policyfile" 2 | 3 | def gusztavvargadr_packer_ubuntu_sources 4 | gusztavvargadr_chef_sources 5 | default_source :chef_repo, "#{File.dirname(__FILE__)}/cookbooks" 6 | end 7 | -------------------------------------------------------------------------------- /src/ubuntu/chef/apply.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail 4 | 5 | cd /var/tmp/packer-build/chef 6 | 7 | RUN_OPTIONS="--local-mode" 8 | if ! [ -z ${CHEF_ATTRIBUTES} ]; then 9 | RUN_OPTIONS="${RUN_OPTIONS} --json-attributes attributes.${CHEF_ATTRIBUTES}.json" 10 | fi 11 | 12 | sudo CHEF_LICENSE="accept-silent" chef-client ${RUN_OPTIONS} 13 | -------------------------------------------------------------------------------- /src/ubuntu/chef/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -eux 4 | 5 | dpkg --list \ 6 | | awk '{ print $2 }' \ 7 | | grep 'linux-image-.*-generic' \ 8 | | grep -v `uname -r` \ 9 | | sudo xargs apt-get -y purge; 10 | 11 | # Delete Linux source 12 | dpkg --list \ 13 | | awk '{ print $2 }' \ 14 | | grep linux-source \ 15 | | sudo xargs apt-get -y purge; 16 | 17 | # Delete development packages 18 | # dpkg --list \ 19 | # | awk '{ print $2 }' \ 20 | # | grep -- '-dev\(:[a-z0-9]\+\)\?$' \ 21 | # | sudo xargs apt-get -y purge; 22 | 23 | # delete docs packages 24 | dpkg --list \ 25 | | awk '{ print $2 }' \ 26 | | grep -- '-doc$' \ 27 | | sudo xargs apt-get -y purge; 28 | 29 | if [ "${CHEF_KEEP}" != "true" ]; then 30 | sudo apt-get -y purge chef 31 | fi 32 | 33 | sudo apt-get -y autoremove; 34 | sudo apt-get -y clean; 35 | 36 | # Remove caches 37 | sudo find /var/cache -type f -exec rm -rf {} \; 38 | 39 | # delete any logs that have built up during the install 40 | sudo find /var/log -type f -exec truncate --size=0 {} \; 41 | 42 | # Whiteout root 43 | count=$(df --sync -kP / | tail -n1 | awk -F ' ' '{print $4}') 44 | count=$(($count-1)) 45 | sudo dd if=/dev/zero of=/tmp/whitespace bs=1M count=$count || echo "dd exit code $? is suppressed"; 46 | sudo rm /tmp/whitespace 47 | 48 | # Whiteout /boot 49 | count=$(df --sync -kP /boot | tail -n1 | awk -F ' ' '{print $4}') 50 | count=$(($count-1)) 51 | sudo dd if=/dev/zero of=/boot/whitespace bs=1M count=$count || echo "dd exit code $? is suppressed"; 52 | sudo rm /boot/whitespace 53 | 54 | set +e 55 | swapuuid="`/sbin/blkid -o value -l -s UUID -t TYPE=swap`"; 56 | case "$?" in 57 | 2|0) ;; 58 | *) exit 1 ;; 59 | esac 60 | set -e 61 | 62 | if [ "x${swapuuid}" != "x" ]; then 63 | # Whiteout the swap partition to reduce box size 64 | # Swap is disabled till reboot 65 | swappart="`readlink -f /dev/disk/by-uuid/$swapuuid`"; 66 | sudo /sbin/swapoff "$swappart"; 67 | sudo dd if=/dev/zero of="$swappart" bs=1M || echo "dd exit code $? is suppressed"; 68 | sudo /sbin/mkswap -U "$swapuuid" "$swappart"; 69 | fi 70 | 71 | sudo sync; 72 | -------------------------------------------------------------------------------- /src/ubuntu/chef/cookbooks/gusztavvargadr_packer_ubuntu/metadata.rb: -------------------------------------------------------------------------------- 1 | name 'gusztavvargadr_packer_ubuntu' 2 | description 'Installs/Configures Packer Ubuntu' 3 | license 'Unlicense' 4 | maintainer 'Gusztáv Varga' 5 | maintainer_email 'mail@gusztavvargadr.me' 6 | 7 | version '0.0.0' 8 | depends 'gusztavvargadr_ubuntu' 9 | 10 | chef_version '>= 18.0' 11 | supports 'ubuntu' 12 | -------------------------------------------------------------------------------- /src/ubuntu/chef/cookbooks/gusztavvargadr_packer_ubuntu/recipes/apply.rb: -------------------------------------------------------------------------------- 1 | bash 'update' do 2 | code <<-EOH 3 | export DEBIAN_FRONTEND=noninteractive 4 | 5 | # Disable release-upgrades 6 | sed -i.bak 's/^Prompt=.*$/Prompt=never/' /etc/update-manager/release-upgrades; 7 | 8 | # Disable systemd apt timers/services 9 | systemctl stop apt-daily.timer; 10 | systemctl stop apt-daily-upgrade.timer; 11 | systemctl disable apt-daily.timer; 12 | systemctl disable apt-daily-upgrade.timer; 13 | systemctl mask apt-daily.service; 14 | systemctl mask apt-daily-upgrade.service; 15 | systemctl daemon-reload; 16 | 17 | # Disable periodic activities of apt to be safe 18 | cat </etc/apt/apt.conf.d/10periodic; 19 | APT::Periodic::Enable "0"; 20 | APT::Periodic::Update-Package-Lists "0"; 21 | APT::Periodic::Download-Upgradeable-Packages "0"; 22 | APT::Periodic::AutocleanInterval "0"; 23 | APT::Periodic::Unattended-Upgrade "0"; 24 | EOF 25 | 26 | # Clean and nuke the package from orbit 27 | rm -rf /var/log/unattended-upgrades; 28 | apt-get -y purge unattended-upgrades ubuntu-release-upgrader-core; 29 | 30 | echo "update the package list" 31 | apt-get -y update; 32 | 33 | # Upgrade all installed packages incl. kernel and kernel headers 34 | apt-get -y dist-upgrade -o Dpkg::Options::="--force-confnew"; 35 | EOH 36 | action :run 37 | end 38 | 39 | apt_package [ 'net-tools', 'apt-transport-https', 'ntp', 'rsync', 'cifs-utils', 'nfs-common', 'perl', 'software-properties-common', 'ifupdown', 'build-essential' ] do 40 | action :upgrade 41 | end 42 | 43 | reboot 'gusztavvargadr_packer_ubuntu::apply' do 44 | delay_mins 1 45 | action :reboot_now 46 | only_if { reboot_pending? } 47 | end 48 | -------------------------------------------------------------------------------- /src/ubuntu/chef/cookbooks/gusztavvargadr_packer_ubuntu/recipes/cleanup.rb: -------------------------------------------------------------------------------- 1 | reboot 'gusztavvargadr_packer_ubuntu::cleanup' do 2 | delay_mins 1 3 | action :reboot_now 4 | only_if { reboot_pending? } 5 | end 6 | -------------------------------------------------------------------------------- /src/ubuntu/chef/cookbooks/gusztavvargadr_packer_ubuntu/recipes/default.rb: -------------------------------------------------------------------------------- 1 | include_recipe 'gusztavvargadr_packer_ubuntu::initialize' 2 | include_recipe 'gusztavvargadr_packer_ubuntu::apply' 3 | include_recipe 'gusztavvargadr_packer_ubuntu::cleanup' 4 | -------------------------------------------------------------------------------- /src/ubuntu/chef/cookbooks/gusztavvargadr_packer_ubuntu/recipes/initialize.rb: -------------------------------------------------------------------------------- 1 | apt_update '' do 2 | action :update 3 | end 4 | 5 | if hyperv? 6 | apt_package [ 'linux-azure' ] do 7 | action :install 8 | notifies :request_reboot, 'reboot[gusztavvargadr_packer_ubuntu]', :immediately 9 | end 10 | end 11 | 12 | if vbox? 13 | kernel_version = shell_out('uname -r').stdout.strip 14 | apt_package [ 'build-essential', 'dkms', "linux-headers-#{kernel_version}" ] do 15 | action :install 16 | end 17 | 18 | vbox_version = (shell_out('VBoxControl -v').stdout rescue '').strip 19 | 20 | unless vbox_version.include?('6.') || vbox_version.include?('7.') 21 | bash 'guest-additions' do 22 | code <<-EOH 23 | VER="`cat /home/vagrant/.vbox_version`"; 24 | ISO="VBoxGuestAdditions_$VER.iso"; 25 | wget http://download.virtualbox.org/virtualbox/$VER/$ISO 26 | mkdir -p /tmp/vbox; 27 | mount -o loop $ISO /tmp/vbox; 28 | sh /tmp/vbox/VBoxLinuxAdditions.run \ 29 | || echo "VBoxLinuxAdditions.run exited $? and is suppressed." \ 30 | "For more read https://www.virtualbox.org/ticket/12479"; 31 | umount /tmp/vbox; 32 | rm -rf /tmp/vbox; 33 | rm -f *.iso; 34 | EOH 35 | action :run 36 | notifies :request_reboot, 'reboot[gusztavvargadr_packer_ubuntu]', :immediately 37 | end 38 | end 39 | end 40 | 41 | if vmware? 42 | apt_package [ 'open-vm-tools', 'open-vm-tools-desktop' ] do 43 | action :install 44 | notifies :request_reboot, 'reboot[gusztavvargadr_packer_ubuntu]', :immediately 45 | end 46 | end 47 | 48 | if !ec2? 49 | bash 'sshd' do 50 | code <<-EOH 51 | SSHD_CONFIG="/etc/ssh/sshd_config" 52 | 53 | # ensure that there is a trailing newline before attempting to concatenate 54 | sed -i -e '$a\' "$SSHD_CONFIG" 55 | 56 | USEDNS="UseDNS no" 57 | if grep -q -E "^[[:space:]]*UseDNS" "$SSHD_CONFIG"; then 58 | sed -i "s/^\s*UseDNS.*/${USEDNS}/" "$SSHD_CONFIG" 59 | else 60 | echo "$USEDNS" >>"$SSHD_CONFIG" 61 | fi 62 | 63 | GSSAPI="GSSAPIAuthentication no" 64 | if grep -q -E "^[[:space:]]*GSSAPIAuthentication" "$SSHD_CONFIG"; then 65 | sed -i "s/^\s*GSSAPIAuthentication.*/${GSSAPI}/" "$SSHD_CONFIG" 66 | else 67 | echo "$GSSAPI" >>"$SSHD_CONFIG" 68 | fi 69 | EOH 70 | action :run 71 | end 72 | 73 | file '/etc/netplan/01-netcfg.yaml' do 74 | content <<-EOH 75 | network: 76 | version: 2 77 | ethernets: 78 | eth0: 79 | dhcp4: true 80 | EOH 81 | action :create 82 | notifies :run, 'bash[netcfg]', :immediately 83 | end 84 | 85 | bash 'netcfg' do 86 | code <<-EOH 87 | sed -i 's/GRUB_CMDLINE_LINUX="\\(.*\\)"/GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0 \\1"/g' /etc/default/grub 88 | sed -i "/recordfail_broken=/{s/1/0/}" /etc/grub.d/00_header 89 | update-grub 90 | EOH 91 | action :nothing 92 | notifies :request_reboot, 'reboot[gusztavvargadr_packer_ubuntu]', :immediately 93 | end 94 | end 95 | 96 | reboot 'gusztavvargadr_packer_ubuntu' do 97 | action :nothing 98 | end 99 | 100 | reboot 'gusztavvargadr_packer_ubuntu::initialize' do 101 | delay_mins 1 102 | action :reboot_now 103 | only_if { reboot_pending? } 104 | end 105 | -------------------------------------------------------------------------------- /src/ubuntu/chef/initialize.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail 4 | 5 | sudo cloud-init status --wait 6 | 7 | sudo apt-get update -y 8 | sudo apt-get install -y curl 9 | 10 | mkdir -p /var/tmp/packer-build/chef 11 | 12 | if ! [ -x "$(command -v chef-client)" ]; then 13 | curl -Ls https://omnitruck.chef.io/install.sh | sudo bash -s -- -P chef -v 18.6.2 14 | fi 15 | chef-client --version 16 | 17 | sudo lvextend -l +100%FREE -r /dev/mapper/ubuntu--vg-ubuntu--lv 18 | -------------------------------------------------------------------------------- /src/ubuntu/core.pkr.hcl: -------------------------------------------------------------------------------- 1 | packer { 2 | required_version = "~> 1.12.0" 3 | } 4 | 5 | variable "author" { 6 | type = string 7 | } 8 | 9 | variable "version" { 10 | type = string 11 | } 12 | 13 | variable "images" { 14 | type = map(map(map(string))) 15 | } 16 | 17 | variable "image" { 18 | type = string 19 | } 20 | 21 | variable "provider" { 22 | type = string 23 | } 24 | 25 | variable "build" { 26 | type = string 27 | } 28 | 29 | locals { 30 | image_options = var.images[var.image] 31 | 32 | image_author = var.author 33 | image_name = "${basename(path.cwd)}/${var.image}" 34 | image_description = local.image_options.core.image_description 35 | image_version = "${local.image_options.core.image_version}.${var.version}" 36 | image_provider = var.provider 37 | image_build = var.build 38 | 39 | artifacts_directory = "${path.cwd}/../../artifacts/${local.image_name}/${local.image_provider}/${var.build}" 40 | } 41 | -------------------------------------------------------------------------------- /src/ubuntu/source.amazon-ebs.pkr.hcl: -------------------------------------------------------------------------------- 1 | packer { 2 | required_plugins { 3 | amazon = { 4 | version = "~> 1.3.2" 5 | source = "github.com/hashicorp/amazon" 6 | } 7 | } 8 | } 9 | 10 | source "amazon-ebs" "core" { 11 | ami_name = local.vm_name 12 | 13 | spot_price = "auto" 14 | spot_instance_types = ["t3.xlarge"] 15 | 16 | ebs_optimized = true 17 | 18 | launch_block_device_mappings { 19 | device_name = "/dev/sda1" 20 | volume_size = "31" 21 | volume_type = "gp3" 22 | delete_on_termination = true 23 | } 24 | 25 | source_ami_filter { 26 | filters = { 27 | // name = "Windows_Server-2022-English-Full-Base-*" 28 | virtualization-type = "hvm" 29 | root-device-type = "ebs" 30 | } 31 | 32 | owners = ["amazon"] 33 | 34 | most_recent = true 35 | } 36 | 37 | // user_data = "\r\n${file("${path.root}/boot/autounattend-first-logon.ps1")}\r\n" 38 | 39 | tags = { 40 | "Name" = local.vm_name 41 | "packer" = "" 42 | } 43 | 44 | run_tags = { 45 | "Name" = local.vm_name 46 | "packer" = "" 47 | } 48 | 49 | spot_tags = { 50 | "Name" = local.vm_name 51 | "packer" = "" 52 | } 53 | 54 | communicator = local.communicator.type 55 | ssh_username = local.communicator.username 56 | ssh_password = local.communicator.password 57 | ssh_timeout = local.communicator.timeout 58 | } 59 | -------------------------------------------------------------------------------- /src/ubuntu/source.core.pkr.hcl: -------------------------------------------------------------------------------- 1 | locals { 2 | timestamp = "${formatdate("YYMMDD'-'hhmmss", timestamp())}" 3 | 4 | source_options_core = { 5 | vm_name = "${replace(local.image_name, "/", "-")}-${local.timestamp}" 6 | headless = true 7 | output_directory = "${local.artifacts_directory}/image" 8 | 9 | cpus = 4 10 | memory = 8192 11 | disk_size = 130048 12 | 13 | boot_wait = "2s" 14 | shutdown_timeout = "5m" 15 | } 16 | 17 | communicator = { 18 | type = "ssh" 19 | username = "vagrant" 20 | password = "vagrant" 21 | timeout = "30m" 22 | } 23 | 24 | native_build = local.image_build == "native" 25 | vagrant_build = local.image_build == "vagrant" 26 | } 27 | 28 | locals { 29 | source_options_build = merge(local.source_options_core, local.native_build ? local.source_options_native : local.source_options_vagrant) 30 | } 31 | 32 | source "null" "core" { 33 | communicator = "none" 34 | } 35 | -------------------------------------------------------------------------------- /src/ubuntu/source.hyperv.pkr.hcl: -------------------------------------------------------------------------------- 1 | packer { 2 | required_plugins { 3 | hyperv = { 4 | version = "~> 1.1.3" 5 | source = "github.com/hashicorp/hyperv" 6 | } 7 | } 8 | } 9 | 10 | variable "hyperv_switch" { 11 | type = string 12 | default = "Default Switch" 13 | } 14 | 15 | locals { 16 | hyperv_source_options = { 17 | generation = 2 18 | configuration_version = "9.0" 19 | enable_virtualization_extensions = false 20 | enable_dynamic_memory = false 21 | enable_secure_boot = false 22 | switch_name = var.hyperv_switch 23 | enable_mac_spoofing = true 24 | disk_block_size = "1" 25 | guest_additions_mode = "disable" 26 | } 27 | } 28 | 29 | locals { 30 | hyperv_iso_source_options = merge(local.source_options_build, local.hyperv_source_options, lookup(local.image_options, "hyperv", {})) 31 | } 32 | 33 | source "hyperv-iso" "core" { 34 | vm_name = local.hyperv_iso_source_options.vm_name 35 | headless = local.hyperv_iso_source_options.headless 36 | output_directory = local.hyperv_iso_source_options.output_directory 37 | 38 | cpus = local.hyperv_iso_source_options.cpus 39 | memory = local.hyperv_iso_source_options.memory 40 | disk_size = local.hyperv_iso_source_options.disk_size 41 | iso_urls = local.hyperv_iso_source_options.iso_urls 42 | iso_checksum = local.hyperv_iso_source_options.iso_checksum 43 | http_directory = local.hyperv_iso_source_options.http_directory 44 | 45 | generation = local.hyperv_iso_source_options.generation 46 | configuration_version = local.hyperv_iso_source_options.configuration_version 47 | enable_virtualization_extensions = local.hyperv_iso_source_options.enable_virtualization_extensions 48 | enable_dynamic_memory = local.hyperv_iso_source_options.enable_dynamic_memory 49 | enable_secure_boot = local.hyperv_iso_source_options.enable_secure_boot 50 | switch_name = local.hyperv_iso_source_options.switch_name 51 | enable_mac_spoofing = local.hyperv_iso_source_options.enable_mac_spoofing 52 | disk_block_size = local.hyperv_iso_source_options.disk_block_size 53 | guest_additions_mode = local.hyperv_iso_source_options.guest_additions_mode 54 | 55 | boot_command = local.hyperv_iso_source_options.boot_command 56 | boot_wait = local.hyperv_iso_source_options.boot_wait 57 | shutdown_command = local.hyperv_iso_source_options.shutdown_command 58 | shutdown_timeout = local.hyperv_iso_source_options.shutdown_timeout 59 | 60 | communicator = local.communicator.type 61 | ssh_username = local.communicator.username 62 | ssh_password = local.communicator.password 63 | ssh_timeout = local.communicator.timeout 64 | } 65 | 66 | locals { 67 | hyperv_vmcx_source_options = merge(local.source_options_build, local.hyperv_source_options, lookup(local.image_options, "hyperv", {})) 68 | } 69 | 70 | source "hyperv-vmcx" "core" { 71 | vm_name = local.hyperv_vmcx_source_options.vm_name 72 | headless = local.hyperv_vmcx_source_options.headless 73 | output_directory = local.hyperv_vmcx_source_options.output_directory 74 | 75 | cpus = local.hyperv_vmcx_source_options.cpus 76 | memory = local.hyperv_vmcx_source_options.memory 77 | clone_from_vmcx_path = "${local.hyperv_vmcx_source_options.import_directory}/${join("", fileset(local.hyperv_vmcx_source_options.import_directory, "**/*.vmcx"))}" 78 | 79 | generation = local.hyperv_vmcx_source_options.generation 80 | configuration_version = local.hyperv_vmcx_source_options.configuration_version 81 | enable_virtualization_extensions = local.hyperv_vmcx_source_options.enable_virtualization_extensions 82 | enable_dynamic_memory = local.hyperv_vmcx_source_options.enable_dynamic_memory 83 | enable_secure_boot = local.hyperv_vmcx_source_options.enable_secure_boot 84 | switch_name = local.hyperv_vmcx_source_options.switch_name 85 | enable_mac_spoofing = local.hyperv_vmcx_source_options.enable_mac_spoofing 86 | guest_additions_mode = local.hyperv_iso_source_options.guest_additions_mode 87 | 88 | boot_command = local.hyperv_vmcx_source_options.boot_command 89 | boot_wait = local.hyperv_vmcx_source_options.boot_wait 90 | shutdown_command = local.hyperv_vmcx_source_options.shutdown_command 91 | shutdown_timeout = local.hyperv_vmcx_source_options.shutdown_timeout 92 | 93 | communicator = local.communicator.type 94 | ssh_username = local.communicator.username 95 | ssh_password = local.communicator.password 96 | ssh_timeout = local.communicator.timeout 97 | } 98 | -------------------------------------------------------------------------------- /src/ubuntu/source.virtualbox.pkr.hcl: -------------------------------------------------------------------------------- 1 | packer { 2 | required_plugins { 3 | virtualbox = { 4 | version = "~> 1.1.0" 5 | source = "github.com/hashicorp/virtualbox" 6 | } 7 | } 8 | } 9 | 10 | locals { 11 | virtualbox_source_options = { 12 | guest_additions_mode = "disable" 13 | firmware = "efi" 14 | nested_virt = false 15 | hard_drive_interface = "sata" 16 | gfx_controller = "vmsvga" 17 | gfx_vram_size = 128 18 | post_shutdown_delay = "15s" 19 | } 20 | } 21 | 22 | locals { 23 | virtualbox_iso_source_options = merge(local.source_options_build, local.virtualbox_source_options, lookup(local.image_options, "virtualbox", {})) 24 | } 25 | 26 | source "virtualbox-iso" "core" { 27 | vm_name = local.virtualbox_iso_source_options.vm_name 28 | headless = local.virtualbox_iso_source_options.headless 29 | output_directory = local.virtualbox_iso_source_options.output_directory 30 | 31 | cpus = local.virtualbox_iso_source_options.cpus 32 | memory = local.virtualbox_iso_source_options.memory 33 | disk_size = local.virtualbox_iso_source_options.disk_size 34 | iso_urls = local.virtualbox_iso_source_options.iso_urls 35 | iso_checksum = local.virtualbox_iso_source_options.iso_checksum 36 | http_directory = local.virtualbox_iso_source_options.http_directory 37 | 38 | guest_os_type = local.virtualbox_iso_source_options.guest_os_type 39 | guest_additions_mode = local.virtualbox_iso_source_options.guest_additions_mode 40 | firmware = local.virtualbox_iso_source_options.firmware 41 | nested_virt = local.virtualbox_iso_source_options.nested_virt 42 | hard_drive_interface = local.virtualbox_iso_source_options.hard_drive_interface 43 | gfx_controller = local.virtualbox_iso_source_options.gfx_controller 44 | gfx_vram_size = local.virtualbox_iso_source_options.gfx_vram_size 45 | 46 | boot_command = local.virtualbox_iso_source_options.boot_command 47 | boot_wait = local.virtualbox_iso_source_options.boot_wait 48 | shutdown_command = local.virtualbox_iso_source_options.shutdown_command 49 | shutdown_timeout = local.virtualbox_iso_source_options.shutdown_timeout 50 | 51 | communicator = local.communicator.type 52 | ssh_username = local.communicator.username 53 | ssh_password = local.communicator.password 54 | ssh_timeout = local.communicator.timeout 55 | } 56 | 57 | locals { 58 | virtualbox_ovf_source_options = merge(local.source_options_build, local.virtualbox_source_options, lookup(local.image_options, "virtualbox", {})) 59 | } 60 | 61 | source "virtualbox-ovf" "core" { 62 | vm_name = local.virtualbox_ovf_source_options.vm_name 63 | headless = local.virtualbox_ovf_source_options.headless 64 | output_directory = local.virtualbox_ovf_source_options.output_directory 65 | 66 | source_path = "${local.virtualbox_ovf_source_options.import_directory}/${join("", fileset(local.virtualbox_ovf_source_options.import_directory, "**/*.ovf"))}" 67 | 68 | guest_additions_mode = local.virtualbox_ovf_source_options.guest_additions_mode 69 | 70 | boot_command = local.virtualbox_ovf_source_options.boot_command 71 | boot_wait = local.virtualbox_ovf_source_options.boot_wait 72 | shutdown_command = local.virtualbox_ovf_source_options.shutdown_command 73 | shutdown_timeout = local.virtualbox_ovf_source_options.shutdown_timeout 74 | 75 | communicator = local.communicator.type 76 | ssh_username = local.communicator.username 77 | ssh_password = local.communicator.password 78 | ssh_timeout = local.communicator.timeout 79 | } 80 | -------------------------------------------------------------------------------- /src/ubuntu/source.vmware.pkr.hcl: -------------------------------------------------------------------------------- 1 | packer { 2 | required_plugins { 3 | vmware = { 4 | version = "~> 1.0.11" 5 | source = "github.com/hashicorp/vmware" 6 | } 7 | } 8 | } 9 | 10 | locals { 11 | vmware_source_options = { 12 | version = 20 13 | disk_type_id = 0 14 | disk_adapter_type = "nvme" 15 | vmx_data = { 16 | firmware = "efi" 17 | "vhv.enable" = "FALSE" 18 | } 19 | vmx_remove_ethernet_interfaces = local.native_build ? false : true 20 | } 21 | } 22 | 23 | locals { 24 | vmware_iso_source_options = merge(local.source_options_build, local.vmware_source_options, lookup(local.image_options, "vmware", {})) 25 | } 26 | 27 | source "vmware-iso" "core" { 28 | vm_name = local.vmware_iso_source_options.vm_name 29 | headless = local.vmware_iso_source_options.headless 30 | output_directory = local.vmware_iso_source_options.output_directory 31 | 32 | cpus = local.vmware_iso_source_options.cpus 33 | memory = local.vmware_iso_source_options.memory 34 | disk_size = local.vmware_iso_source_options.disk_size 35 | iso_urls = local.vmware_iso_source_options.iso_urls 36 | iso_checksum = local.vmware_iso_source_options.iso_checksum 37 | http_directory = local.vmware_iso_source_options.http_directory 38 | 39 | version = local.vmware_iso_source_options.version 40 | guest_os_type = local.vmware_iso_source_options.guest_os_type 41 | disk_type_id = local.vmware_iso_source_options.disk_type_id 42 | disk_adapter_type = local.vmware_iso_source_options.disk_adapter_type 43 | vmx_data = local.vmware_iso_source_options.vmx_data 44 | vmx_remove_ethernet_interfaces = local.vmware_iso_source_options.vmx_remove_ethernet_interfaces 45 | 46 | boot_command = local.vmware_iso_source_options.boot_command 47 | boot_wait = local.vmware_iso_source_options.boot_wait 48 | shutdown_command = local.vmware_iso_source_options.shutdown_command 49 | shutdown_timeout = local.vmware_iso_source_options.shutdown_timeout 50 | 51 | communicator = local.communicator.type 52 | ssh_username = local.communicator.username 53 | ssh_password = local.communicator.password 54 | ssh_timeout = local.communicator.timeout 55 | } 56 | 57 | locals { 58 | vmware_vmx_source_options = merge(local.source_options_build, local.vmware_source_options, lookup(local.image_options, "vmware", {})) 59 | } 60 | 61 | source "vmware-vmx" "core" { 62 | vm_name = local.vmware_vmx_source_options.vm_name 63 | headless = local.vmware_vmx_source_options.headless 64 | output_directory = local.vmware_vmx_source_options.output_directory 65 | 66 | source_path = "${local.vmware_vmx_source_options.import_directory}/${join("", fileset(local.vmware_vmx_source_options.import_directory, "**/*.vmx"))}" 67 | 68 | vmx_remove_ethernet_interfaces = local.vmware_vmx_source_options.vmx_remove_ethernet_interfaces 69 | 70 | boot_command = local.vmware_vmx_source_options.boot_command 71 | boot_wait = local.vmware_vmx_source_options.boot_wait 72 | shutdown_command = local.vmware_vmx_source_options.shutdown_command 73 | shutdown_timeout = local.vmware_vmx_source_options.shutdown_timeout 74 | 75 | communicator = local.communicator.type 76 | ssh_username = local.communicator.username 77 | ssh_password = local.communicator.password 78 | ssh_timeout = local.communicator.timeout 79 | } 80 | -------------------------------------------------------------------------------- /src/ubuntu/vagrant/template.Vagrantfile: -------------------------------------------------------------------------------- 1 | Vagrant.configure(2) do |config| 2 | config.vm.provider 'virtualbox' do |provider, override| 3 | provider.cpus = ${options.cpus} 4 | provider.memory = ${options.memory} 5 | 6 | %{ for port in compact(split(",", options.ports)) ~} 7 | override.vm.network :forwarded_port, guest: ${port}, host: ${50000 + port}, auto_correct: true 8 | %{ endfor ~} 9 | end 10 | 11 | config.vm.provider 'vmware_desktop' do |provider, override| 12 | provider.cpus = ${options.cpus} 13 | provider.memory = ${options.memory} 14 | 15 | %{ for port in compact(split(",", options.ports)) ~} 16 | override.vm.network :forwarded_port, guest: ${port}, host: ${50000 + port}, auto_correct: true 17 | %{ endfor ~} 18 | end 19 | 20 | config.vm.provider 'hyperv' do |provider, _override| 21 | provider.cpus = ${options.cpus} 22 | provider.memory = ${options.memory} 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /src/ubuntu/vagrant/vagrant.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eux 2 | 3 | case "$PACKER_BUILDER_TYPE" in 4 | virtualbox-ovf|hyperv-vmcx|vmware-vmx) 5 | pubkey_url="https://raw.githubusercontent.com/hashicorp/vagrant/main/keys/vagrant.pub"; 6 | mkdir -p $HOME_DIR/.ssh; 7 | if command -v wget >/dev/null 2>&1; then 8 | wget --no-check-certificate "$pubkey_url" -O $HOME_DIR/.ssh/authorized_keys; 9 | elif command -v curl >/dev/null 2>&1; then 10 | curl --insecure --location "$pubkey_url" > $HOME_DIR/.ssh/authorized_keys; 11 | else 12 | echo "Cannot download vagrant public key"; 13 | exit 1; 14 | fi 15 | chown -R vagrant $HOME_DIR/.ssh; 16 | chmod -R go-rwsx $HOME_DIR/.ssh; 17 | 18 | echo "blank netplan machine-id (DUID) so machines get unique ID generated on boot" 19 | truncate -s 0 /etc/machine-id 20 | 21 | echo "remove the contents of /tmp" 22 | rm -rf /tmp/* 23 | 24 | echo "force a new random seed to be generated" 25 | rm -f /var/lib/systemd/random-seed 26 | 27 | echo "clear the history so our install isn't there" 28 | rm -f /root/.wget-hsts 29 | export HISTSIZE=0 30 | esac 31 | -------------------------------------------------------------------------------- /src/windows/boot/autounattend-first-logon.ps1: -------------------------------------------------------------------------------- 1 | Write-Host "Configure PowerShell" 2 | $ProgressPreference = 'SilentlyContinue' 3 | [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 4 | 5 | Write-Host "Install Chocolatey" 6 | %{ for chocolatey_version in compact([lookup(boot, "boot_chocolatey_version", "2.4.3")]) ~} 7 | $env:chocolateyVersion = '${chocolatey_version}' 8 | %{ endfor ~} 9 | Set-ExecutionPolicy Bypass -Scope Process -Force; Invoke-WebRequest https://chocolatey.org/install.ps1 -UseBasicParsing | Invoke-Expression 10 | 11 | Write-Host "Install OpenSSH" 12 | netsh advfirewall firewall add rule name="OpenSSH-Install" dir=in localport=22 protocol=TCP action=block 13 | choco install openssh -y --version 8.0.0.1 -params '"/SSHServerFeature"' # /PathSpecsToProbeForShellEXEString:$env:windir\system32\windowspowershell\v1.0\powershell.exe"' 14 | net stop sshd 15 | netsh advfirewall firewall delete rule name="OpenSSH-Install" 16 | 17 | Write-Host "Configure OpenSSH" 18 | $sshd_config = "$($env:ProgramData)\ssh\sshd_config" 19 | (Get-Content $sshd_config).Replace("Match Group administrators", "# Match Group administrators") | Set-Content $sshd_config 20 | (Get-Content $sshd_config).Replace("AuthorizedKeysFile", "# AuthorizedKeysFile") | Set-Content $sshd_config 21 | net start sshd 22 | sc.exe config sshd start= auto 23 | 24 | Write-Host "Install WinRM" 25 | netsh advfirewall firewall add rule name="WinRM-Install" dir=in localport=5985 protocol=TCP action=block 26 | Get-NetConnectionProfile | ForEach-Object { Set-NetConnectionProfile -InterfaceIndex $_.InterfaceIndex -NetworkCategory Private } 27 | winrm quickconfig -q 28 | winrm quickconfig -transport:http 29 | winrm set winrm/config '@{MaxTimeoutms="1800000"}' 30 | winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="800"}' 31 | winrm set winrm/config/service '@{AllowUnencrypted="true"}' 32 | winrm set winrm/config/service/auth '@{Basic="true"}' 33 | winrm set winrm/config/client/auth '@{Basic="true"}' 34 | net stop winrm 35 | netsh advfirewall firewall delete rule name="WinRM-Install" 36 | 37 | Write-Host "Configure WinRM" 38 | netsh advfirewall firewall add rule name="WinRM-HTTP" dir=in localport=5985 protocol=TCP action=allow 39 | net start winrm 40 | sc.exe config winrm start= auto 41 | -------------------------------------------------------------------------------- /src/windows/build.native.pkr.hcl: -------------------------------------------------------------------------------- 1 | variable "userprofile_directory" { 2 | type = string 3 | default = env("USERPROFILE") 4 | } 5 | 6 | variable "home_directory" { 7 | type = string 8 | default = env("HOME") 9 | } 10 | 11 | locals { 12 | native_iso_sources = { 13 | virtualbox = "virtualbox-iso.core" 14 | vmware = "vmware-iso.core" 15 | hyperv = "hyperv-iso.core" 16 | } 17 | 18 | native_import_sources = { 19 | virtualbox = "virtualbox-ovf.core" 20 | vmware = "vmware-vmx.core" 21 | hyperv = "hyperv-vmcx.core" 22 | } 23 | 24 | native_iso = contains(keys(local.image_options.native), "source_iso_checksum") 25 | downloads_directory = "${coalesce(var.userprofile_directory, var.home_directory)}/Downloads" 26 | 27 | source_options_native = { 28 | iso_urls = local.native_iso ? [ 29 | "${local.downloads_directory}/${local.image_options.native.source_iso_url_local}", 30 | local.image_options.native.source_iso_url_remote 31 | ] : [] 32 | iso_checksum = local.native_iso ? local.image_options.native.source_iso_checksum : "" 33 | cd_content = merge({ 34 | "autounattend.xml" = templatefile("${path.root}/boot/autounattend.xml", { boot = local.image_options.native }) 35 | "autounattend-first-logon.ps1" = templatefile("${path.root}/boot/autounattend-first-logon.ps1", { boot = local.image_options.native }) 36 | }, { 37 | for setup_script in compact([lookup(local.image_options.native, "boot_setup_script", "")]) : setup_script => file("${path.cwd}/${setup_script}") 38 | }) 39 | 40 | import_directory = local.native_build ? "${path.cwd}/../../artifacts/${lookup(local.image_options.native, "source_image", "")}/${local.image_provider}/native" : "" 41 | 42 | boot_command = local.native_iso ? [ 43 | "" 44 | ] : [] 45 | shutdown_command = "shutdown /s /t 10" 46 | } 47 | } 48 | 49 | build { 50 | name = "native-restore" 51 | 52 | sources = ["null.core"] 53 | 54 | provisioner "shell-local" { 55 | inline = [ 56 | "chef install --chef-license accept-silent", 57 | "chef update --attributes", 58 | "chef export ${local.artifacts_directory}/chef --force" 59 | ] 60 | } 61 | } 62 | 63 | locals { 64 | chef_destination = "C:/Windows/Temp/chef/" 65 | chef_max_retries = 10 66 | chef_attributes = lookup(local.image_options.native, "chef_attributes", "") 67 | chef_keep = lookup(local.image_options.native, "chef_keep", "false") 68 | } 69 | 70 | build { 71 | name = "native-build" 72 | 73 | sources = local.native_build ? (local.native_iso ? compact([lookup(local.native_iso_sources, local.image_provider, "")]) : compact([lookup(local.native_import_sources, local.image_provider, "")])) : ["null.core"] 74 | 75 | provisioner "powershell" { 76 | script = "${path.root}/chef/initialize.ps1" 77 | pause_before = "15s" 78 | 79 | elevated_user = local.communicator.username 80 | elevated_password = local.communicator.password 81 | } 82 | 83 | provisioner "file" { 84 | source = "${local.artifacts_directory}/chef/" 85 | destination = local.chef_destination 86 | } 87 | 88 | provisioner "file" { 89 | sources = fileset(path.cwd, "attributes.*.json") 90 | destination = local.chef_destination 91 | } 92 | 93 | provisioner "powershell" { 94 | script = "${path.root}/chef/apply.ps1" 95 | valid_exit_codes = [0, 35] 96 | 97 | env = { 98 | CHEF_ATTRIBUTES = local.chef_attributes 99 | } 100 | 101 | elevated_user = local.communicator.username 102 | elevated_password = local.communicator.password 103 | } 104 | 105 | provisioner "powershell" { 106 | inline = ["shutdown /r /t 60"] 107 | valid_exit_codes = [0, 1190] 108 | 109 | elevated_user = local.communicator.username 110 | elevated_password = local.communicator.password 111 | } 112 | 113 | provisioner "powershell" { 114 | script = "${path.root}/chef/apply.ps1" 115 | max_retries = local.chef_max_retries 116 | pause_before = "120s" 117 | 118 | env = { 119 | CHEF_ATTRIBUTES = local.chef_attributes 120 | } 121 | 122 | elevated_user = local.communicator.username 123 | elevated_password = local.communicator.password 124 | } 125 | 126 | provisioner "powershell" { 127 | script = "${path.root}/chef/cleanup.ps1" 128 | 129 | env = { 130 | CHEF_KEEP = local.chef_keep 131 | } 132 | 133 | elevated_user = local.communicator.username 134 | elevated_password = local.communicator.password 135 | } 136 | 137 | post-processor "manifest" { 138 | output = "${local.artifacts_directory}/manifest.json" 139 | } 140 | 141 | post-processor "checksum" { 142 | checksum_types = ["sha256"] 143 | output = "${local.artifacts_directory}/checksum.{{ .ChecksumType }}" 144 | } 145 | } 146 | 147 | build { 148 | name = "native-test" 149 | 150 | sources = ["null.core"] 151 | } 152 | 153 | build { 154 | name = "native-publish" 155 | 156 | sources = ["null.core"] 157 | } 158 | -------------------------------------------------------------------------------- /src/windows/build.vagrant.pkr.hcl: -------------------------------------------------------------------------------- 1 | packer { 2 | required_plugins { 3 | vagrant = { 4 | version = "~> 1.1.4" 5 | source = "github.com/hashicorp/vagrant" 6 | } 7 | } 8 | } 9 | 10 | locals { 11 | vagrant_import_sources = { 12 | virtualbox = "virtualbox-ovf.core" 13 | vmware = "vmware-vmx.core" 14 | hyperv = "hyperv-vmcx.core" 15 | } 16 | 17 | source_options_vagrant = { 18 | iso_urls = [] 19 | iso_checksum = "" 20 | cd_content = {} 21 | 22 | import_directory = local.vagrant_build ? "${local.artifacts_directory}/../native" : "" 23 | 24 | boot_command = compact([]) 25 | shutdown_command = "C:/Windows/Temp/packer/shutdown.cmd" 26 | } 27 | 28 | vagrant_providers = { 29 | virtualbox = "virtualbox" 30 | vmware = "vmware_desktop" 31 | hyperv = "hyperv" 32 | } 33 | } 34 | 35 | locals { 36 | vagrant_options_core = { 37 | cpus = "2" 38 | memory = "2048" 39 | ports = "3389" 40 | architecture = "amd64" 41 | } 42 | vagrant_options_image = lookup(local.image_options, "vagrant", {}) 43 | vagrant_options = merge(local.vagrant_options_core, local.vagrant_options_image) 44 | } 45 | 46 | source "file" "Vagrantfile" { 47 | content = templatefile("${path.root}/vagrant/template.Vagrantfile", { options = local.vagrant_options }) 48 | target = "${local.artifacts_directory}/Vagrantfile" 49 | } 50 | 51 | build { 52 | name = "vagrant-restore" 53 | 54 | sources = ["file.Vagrantfile"] 55 | } 56 | 57 | locals { 58 | packer_destination = "C:/Windows/Temp/packer/" 59 | } 60 | 61 | build { 62 | name = "vagrant-build" 63 | 64 | sources = local.vagrant_build ? compact([lookup(local.vagrant_import_sources, local.image_provider, "")]) : ["null.core"] 65 | 66 | provisioner "powershell" { 67 | inline = ["mkdir -Force ${local.packer_destination}"] 68 | } 69 | 70 | provisioner "file" { 71 | source = "${path.root}/vagrant/" 72 | destination = local.packer_destination 73 | } 74 | 75 | provisioner "powershell" { 76 | script = "${path.root}/vagrant/cleanup.ps1" 77 | 78 | elevated_user = local.communicator.username 79 | elevated_password = local.communicator.password 80 | } 81 | 82 | post-processors { 83 | post-processor "vagrant" { 84 | vagrantfile_template = "${local.artifacts_directory}/Vagrantfile" 85 | output = "${local.artifacts_directory}/vagrant/vagrant.box" 86 | } 87 | 88 | post-processor "manifest" { 89 | output = "${local.artifacts_directory}/manifest.json" 90 | } 91 | 92 | post-processor "checksum" { 93 | checksum_types = ["sha256"] 94 | output = "${local.artifacts_directory}/checksum.{{ .ChecksumType }}" 95 | } 96 | } 97 | } 98 | 99 | build { 100 | name = "vagrant-test" 101 | 102 | sources = ["null.core"] 103 | 104 | provisioner "shell-local" { 105 | inline = [ 106 | "vagrant destroy -f ${var.image}", 107 | ] 108 | 109 | valid_exit_codes = [0, 1] 110 | 111 | env = { 112 | VAGRANT_BOX_URL = "${local.artifacts_directory}/vagrant/vagrant.box" 113 | } 114 | } 115 | 116 | provisioner "shell-local" { 117 | inline = [ 118 | "vagrant up ${var.image} --provider ${lookup(local.vagrant_providers, local.image_provider, "")}", 119 | ] 120 | 121 | max_retries = 1 122 | 123 | env = { 124 | VAGRANT_BOX_URL = "${local.artifacts_directory}/vagrant/vagrant.box" 125 | } 126 | } 127 | 128 | provisioner "shell-local" { 129 | inline = [ 130 | "vagrant destroy -f ${var.image}", 131 | ] 132 | 133 | valid_exit_codes = [0, 1] 134 | 135 | env = { 136 | VAGRANT_BOX_URL = "${local.artifacts_directory}/vagrant/vagrant.box" 137 | } 138 | } 139 | } 140 | 141 | build { 142 | name = "vagrant-publish" 143 | 144 | sources = ["null.core"] 145 | 146 | post-processors { 147 | post-processor "artifice" { 148 | files = ["${local.artifacts_directory}/vagrant/vagrant.box"] 149 | } 150 | 151 | post-processor "vagrant-registry" { 152 | box_tag = "${local.image_author}/${lookup(local.vagrant_options, "box_name", replace(local.image_name, "/", "-"))}" 153 | version = local.image_version 154 | box_checksum = "SHA256:${split("\t", file("${local.artifacts_directory}/checksum.sha256"))[0]}" 155 | architecture = local.vagrant_options.architecture 156 | default_architecture = local.vagrant_options.architecture 157 | // no_release = true 158 | } 159 | } 160 | 161 | dynamic "post-processors" { 162 | for_each = compact([lookup(local.vagrant_options, "box_alias", "")]) 163 | 164 | content { 165 | post-processor "artifice" { 166 | files = ["${local.artifacts_directory}/vagrant/vagrant.box"] 167 | } 168 | 169 | post-processor "vagrant-registry" { 170 | box_tag = "${local.image_author}/${post-processors.value}" 171 | version = local.image_version 172 | box_download_url = "https://api.hashicorp.cloud/vagrant/2022-08-01/${local.image_author}/boxes/${lookup(local.vagrant_options, "box_name", replace(local.image_name, "/", "-"))}/versions/${local.image_version}/providers/${lookup(local.vagrant_providers, local.image_provider, "")}/${local.vagrant_options.architecture}/vagrant.box" 173 | box_checksum = "SHA256:${split("\t", file("${local.artifacts_directory}/checksum.sha256"))[0]}" 174 | architecture = local.vagrant_options.architecture 175 | default_architecture = local.vagrant_options.architecture 176 | // no_release = true 177 | } 178 | } 179 | } 180 | } 181 | 182 | build { 183 | name = "vagrant-download" 184 | 185 | sources = ["null.core"] 186 | 187 | provisioner "shell-local" { 188 | inline = [ 189 | "vagrant destroy -f ${var.image}", 190 | ] 191 | 192 | valid_exit_codes = [0, 1] 193 | } 194 | 195 | provisioner "shell-local" { 196 | inline = [ 197 | "vagrant up ${var.image} --provider ${lookup(local.vagrant_providers, local.image_provider, "")}", 198 | ] 199 | 200 | max_retries = 1 201 | } 202 | 203 | provisioner "shell-local" { 204 | inline = [ 205 | "vagrant destroy -f ${var.image}", 206 | ] 207 | 208 | valid_exit_codes = [0, 1] 209 | } 210 | } 211 | -------------------------------------------------------------------------------- /src/windows/chef/Policyfile.rb: -------------------------------------------------------------------------------- 1 | require "#{File.dirname(__FILE__)}/../../../lib/gusztavvargadr/chef/src/Policyfile" 2 | 3 | def gusztavvargadr_packer_windows_sources 4 | gusztavvargadr_chef_sources 5 | default_source :chef_repo, "#{File.dirname(__FILE__)}/cookbooks" 6 | end 7 | -------------------------------------------------------------------------------- /src/windows/chef/apply.ps1: -------------------------------------------------------------------------------- 1 | $ErrorActionPreference = 'Stop' 2 | $ProgressPreference = 'SilentlyContinue' 3 | 4 | cd C:/Windows/Temp/chef 5 | 6 | $runOptions = "--local-mode" 7 | 8 | if (![string]::IsNullOrEmpty($env:CHEF_ATTRIBUTES)) { 9 | $runOptions = "$($runOptions) --json-attributes attributes.$($env:CHEF_ATTRIBUTES).json" 10 | } 11 | 12 | $env:CHEF_LICENSE = "accept-silent" 13 | Invoke-Expression "C:/opscode/chef/bin/chef-client.bat $($runOptions)" 14 | -------------------------------------------------------------------------------- /src/windows/chef/cleanup.ps1: -------------------------------------------------------------------------------- 1 | $ErrorActionPreference = 'Stop' 2 | $ProgressPreference = 'SilentlyContinue' 3 | 4 | if ($env:CHEF_KEEP -ne "true") { 5 | $app = Get-WmiObject -Class Win32_Product | Where-Object -Property Name -Match "Chef Infra Client" 6 | $app.Uninstall() 7 | 8 | $userKey = [Microsoft.Win32.Registry]::CurrentUser.OpenSubKey('Environment',$true) 9 | $userPath = $userKey.GetValue('PATH', [string]::Empty, 'DoNotExpandEnvironmentNames').ToString() 10 | 11 | $machineKey = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey('SYSTEM\ControlSet001\Control\Session Manager\Environment\',$true) 12 | $machinePath = $machineKey.GetValue('PATH', [string]::Empty, 'DoNotExpandEnvironmentNames').ToString() 13 | 14 | if ($userPath -like "*$env:ChocolateyInstall*") { 15 | $newUserPATH = @( 16 | $userPath -split [System.IO.Path]::PathSeparator | 17 | Where-Object { $_ -and $_ -ne "$env:ChocolateyInstall\bin" } 18 | ) -join [System.IO.Path]::PathSeparator 19 | 20 | $userKey.SetValue('PATH', $newUserPATH, 'ExpandString') 21 | } 22 | 23 | if ($machinePath -like "*$env:ChocolateyInstall*") { 24 | $newMachinePATH = @( 25 | $machinePath -split [System.IO.Path]::PathSeparator | 26 | Where-Object { $_ -and $_ -ne "$env:ChocolateyInstall\bin" } 27 | ) -join [System.IO.Path]::PathSeparator 28 | 29 | $machineKey.SetValue('PATH', $newMachinePATH, 'ExpandString') 30 | } 31 | 32 | $agentService = Get-Service -Name chocolatey-agent -ErrorAction SilentlyContinue 33 | if ($agentService -and $agentService.Status -eq 'Running') { 34 | $agentService.Stop() 35 | } 36 | 37 | Remove-Item -Path $env:ChocolateyInstall -Recurse -Force 38 | 39 | 'ChocolateyInstall', 'ChocolateyLastPathUpdate' | ForEach-Object { 40 | foreach ($scope in 'User', 'Machine') { 41 | [Environment]::SetEnvironmentVariable($_, [string]::Empty, $scope) 42 | } 43 | } 44 | 45 | $machineKey.Close() 46 | $userKey.Close() 47 | 48 | if ($env:ChocolateyToolsLocation -and (Test-Path $env:ChocolateyToolsLocation)) { 49 | Remove-Item -Path $env:ChocolateyToolsLocation -Recurse -Force 50 | } 51 | 52 | foreach ($scope in 'User', 'Machine') { 53 | [Environment]::SetEnvironmentVariable('ChocolateyToolsLocation', [string]::Empty, $scope) 54 | } 55 | } 56 | 57 | Optimize-Volume -DriveLetter C -Analyze -Defrag 58 | 59 | sdelete -accepteula -nobanner -q -z C: 60 | -------------------------------------------------------------------------------- /src/windows/chef/cookbooks/gusztavvargadr_packer_windows/metadata.rb: -------------------------------------------------------------------------------- 1 | name 'gusztavvargadr_packer_windows' 2 | description 'Installs/Configures Packer Windows' 3 | license 'Unlicense' 4 | maintainer 'Gusztáv Varga' 5 | maintainer_email 'mail@gusztavvargadr.me' 6 | 7 | version '0.0.0' 8 | depends 'gusztavvargadr_windows' 9 | 10 | chef_version '>= 18.0' 11 | supports 'windows' 12 | -------------------------------------------------------------------------------- /src/windows/chef/cookbooks/gusztavvargadr_packer_windows/recipes/apply.rb: -------------------------------------------------------------------------------- 1 | gusztavvargadr_windows_update '' do 2 | action :install 3 | end 4 | 5 | chocolatey_package 'chocolatey' do 6 | action :upgrade 7 | end 8 | 9 | reboot 'gusztavvargadr_packer_windows::apply' do 10 | delay_mins 1 11 | action :reboot_now 12 | only_if { reboot_pending? } 13 | end 14 | -------------------------------------------------------------------------------- /src/windows/chef/cookbooks/gusztavvargadr_packer_windows/recipes/cleanup.rb: -------------------------------------------------------------------------------- 1 | reboot 'gusztavvargadr_packer_windows::cleanup' do 2 | delay_mins 1 3 | action :reboot_now 4 | only_if { reboot_pending? } 5 | end 6 | 7 | powershell_script 'Clearing temporary files' do 8 | code <<-EOH 9 | @( 10 | "$env:localappdata\\temp\\*", 11 | "$env:windir\\logs", 12 | "$env:windir\\panther", 13 | "$env:programdata\\Microsoft\\Windows Defender\\Scans\\*" 14 | ) | % { 15 | Write-Host "Removing $_" 16 | try { 17 | Takeown /d Y /R /f $_ 18 | Icacls $_ /GRANT:r administrators:F /T /c /q 2>&1 | Out-Null 19 | Remove-Item $_ -Recurse -Force | Out-Null 20 | } catch { $global:error.RemoveAt(0) } 21 | } 22 | EOH 23 | action :run 24 | end 25 | 26 | gusztavvargadr_windows_update '' do 27 | action :cleanup 28 | end 29 | 30 | reboot 'gusztavvargadr_packer_windows::cleanup' do 31 | delay_mins 1 32 | action :reboot_now 33 | only_if { reboot_pending? } 34 | end 35 | -------------------------------------------------------------------------------- /src/windows/chef/cookbooks/gusztavvargadr_packer_windows/recipes/default.rb: -------------------------------------------------------------------------------- 1 | include_recipe 'gusztavvargadr_packer_windows::initialize' 2 | include_recipe 'gusztavvargadr_packer_windows::apply' 3 | include_recipe 'gusztavvargadr_packer_windows::cleanup' 4 | -------------------------------------------------------------------------------- /src/windows/chef/cookbooks/gusztavvargadr_packer_windows/recipes/initialize.rb: -------------------------------------------------------------------------------- 1 | windows_defender_exclusion '' do 2 | paths ['C:\\'] 3 | action :add 4 | end 5 | 6 | windows_uac '' do 7 | enable_uac false 8 | action :configure 9 | notifies :request_reboot, 'reboot[gusztavvargadr_packer_windows]', :immediately 10 | end 11 | 12 | registry_key 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System' do 13 | values [{ 14 | name: 'LocalAccountTokenFilterPolicy', 15 | type: :dword, 16 | data: 1, 17 | }] 18 | recursive true 19 | action :create 20 | end 21 | 22 | gusztavvargadr_windows_update '' do 23 | action :initialize 24 | end 25 | 26 | registry_key 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Schedule\\Maintenance' do 27 | values [{ 28 | name: 'MaintenanceDisabled', 29 | type: :dword, 30 | data: 1, 31 | }] 32 | recursive true 33 | action :create 34 | end 35 | 36 | registry_key 'HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Terminal Server' do 37 | values [{ 38 | name: 'fDenyTSConnections', 39 | type: :dword, 40 | data: 0, 41 | }] 42 | recursive true 43 | action :create 44 | end 45 | 46 | windows_firewall_rule 'Remote Desktop' do 47 | direction :inbound 48 | local_port '3389' 49 | protocol 'TCP' 50 | firewall_action :allow 51 | action :create 52 | end 53 | 54 | sdelete_archive_source = 'https://download.sysinternals.com/files/SDelete.zip' 55 | sdelete_archive_target = "#{Chef::Config['file_cache_path']}/SDelete.zip" 56 | sdelete_archive_destination = "#{Chef::Config['file_cache_path']}/sdelete" 57 | sdelete_executable_source = "file:///#{Chef::Config['file_cache_path']}/sdelete/sdelete64.exe" 58 | sdelete_executable_target = "#{powershell_out('$env:SystemRoot').stdout.strip}/System32/sdelete.exe" 59 | 60 | remote_file sdelete_archive_target do 61 | source sdelete_archive_source 62 | action :create 63 | end 64 | 65 | archive_file sdelete_archive_target do 66 | destination sdelete_archive_destination 67 | action :extract 68 | end 69 | 70 | remote_file sdelete_executable_target do 71 | source sdelete_executable_source 72 | action :create 73 | end 74 | 75 | if vbox? 76 | vbox_version = (powershell_out('& "C:/Program Files/Oracle/VirtualBox Guest Additions/VBoxControl.exe" -v').stdout rescue '').strip 77 | 78 | unless vbox_version.include?('6.') || vbox_version.include?('7.') 79 | vbox_version = powershell_out('cat $env:HOME/.vbox_version').stdout.strip 80 | vbox_guest_additions_path = "#{Chef::Config['file_cache_path']}/VBoxGuestAdditions.iso" 81 | vbox_guest_additions_source = "https://download.virtualbox.org/virtualbox/#{vbox_version}/VBoxGuestAdditions_#{vbox_version}.iso" 82 | 83 | remote_file vbox_guest_additions_path do 84 | source vbox_guest_additions_source 85 | action :create 86 | end 87 | 88 | gusztavvargadr_windows_iso '' do 89 | iso_path vbox_guest_additions_path 90 | iso_drive_letter 'Z' 91 | action :mount 92 | end 93 | 94 | powershell_script 'Install VirtualBox certificates' do 95 | code <<-EOH 96 | Start-Process "VBoxCertUtil.exe" "add-trusted-publisher vbox*.cer --root vbox*.cer" -Wait 97 | EOH 98 | cwd 'Z:/cert' 99 | action :run 100 | end 101 | 102 | powershell_script 'Install VirtualBox Guest Additions' do 103 | code <<-EOH 104 | Start-Process "VBoxWindowsAdditions.exe" "/S" -Wait 105 | EOH 106 | cwd 'Z:' 107 | action :run 108 | notifies :request_reboot, 'reboot[gusztavvargadr_packer_windows]', :immediately 109 | end 110 | 111 | gusztavvargadr_windows_iso '' do 112 | iso_path vbox_guest_additions_path 113 | iso_drive_letter 'Z' 114 | action :dismount 115 | end 116 | end 117 | end 118 | 119 | if vmware? 120 | vmware_version = (powershell_out('& "C:/Program Files/VMware/VMware Tools/VMwareToolboxCmd.exe" -v').stdout rescue '').strip 121 | 122 | unless vmware_version.include?('12.') 123 | vmware_tools_source = 'https://packages.vmware.com/tools/releases/12.5.1/windows/x64/VMware-tools-12.5.1-24649672-x64.exe' 124 | vmware_tools_target = "#{Chef::Config['file_cache_path']}/VMware-tools.exe" 125 | 126 | remote_file vmware_tools_target do 127 | source vmware_tools_source 128 | action :create 129 | end 130 | 131 | powershell_script 'Install VMware Tools' do 132 | code <<-EOH 133 | Start-Process "#{vmware_tools_target}" "/S /v /qn REBOOT=R ADDLOCAL=ALL" -Wait 134 | EOH 135 | action :run 136 | notifies :request_reboot, 'reboot[gusztavvargadr_packer_windows]', :immediately 137 | end 138 | end 139 | end 140 | 141 | reboot 'gusztavvargadr_packer_windows' do 142 | action :nothing 143 | end 144 | 145 | reboot 'gusztavvargadr_packer_windows::initialize' do 146 | delay_mins 1 147 | action :reboot_now 148 | only_if { reboot_pending? } 149 | end 150 | -------------------------------------------------------------------------------- /src/windows/chef/initialize.ps1: -------------------------------------------------------------------------------- 1 | $ErrorActionPreference = 'Stop' 2 | $ProgressPreference = 'SilentlyContinue' 3 | 4 | mkdir -Force C:/Windows/Temp/chef 5 | 6 | If ((Get-Command "C:/opscode/chef/bin/chef-client.bat" -ErrorAction Ignore).Count -eq 0) { 7 | . { iwr -useb https://omnitruck.chef.io/install.ps1 } | iex; install -project chef -version 18.6.2 8 | } 9 | C:/opscode/chef/bin/chef-client.bat --version 10 | 11 | If ((Get-Command "choco" -ErrorAction Ignore).Count -eq 0) { 12 | Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) 13 | } 14 | choco --version 15 | -------------------------------------------------------------------------------- /src/windows/core.pkr.hcl: -------------------------------------------------------------------------------- 1 | packer { 2 | required_version = "~> 1.12.0" 3 | } 4 | 5 | variable "author" { 6 | type = string 7 | } 8 | 9 | variable "version" { 10 | type = string 11 | } 12 | 13 | variable "images" { 14 | type = map(map(map(string))) 15 | } 16 | 17 | variable "image" { 18 | type = string 19 | } 20 | 21 | variable "provider" { 22 | type = string 23 | } 24 | 25 | variable "build" { 26 | type = string 27 | } 28 | 29 | locals { 30 | image_options = var.images[var.image] 31 | 32 | image_author = var.author 33 | image_name = "${basename(path.cwd)}/${var.image}" 34 | image_description = local.image_options.core.image_description 35 | image_version = "${local.image_options.core.image_version}.${var.version}" 36 | image_provider = var.provider 37 | image_build = var.build 38 | 39 | artifacts_directory = "${path.cwd}/../../artifacts/${local.image_name}/${local.image_provider}/${var.build}" 40 | } 41 | -------------------------------------------------------------------------------- /src/windows/source.amazon-ebs.pkr.hcl: -------------------------------------------------------------------------------- 1 | packer { 2 | required_plugins { 3 | amazon = { 4 | version = "~> 1.3.2" 5 | source = "github.com/hashicorp/amazon" 6 | } 7 | } 8 | } 9 | 10 | source "amazon-ebs" "core" { 11 | ami_name = local.vm_name 12 | 13 | spot_price = "auto" 14 | spot_instance_types = ["t3.xlarge"] 15 | 16 | ebs_optimized = true 17 | 18 | launch_block_device_mappings { 19 | device_name = "/dev/sda1" 20 | volume_size = "31" 21 | volume_type = "gp3" 22 | delete_on_termination = true 23 | } 24 | 25 | source_ami_filter { 26 | filters = { 27 | // name = "Windows_Server-2022-English-Full-Base-*" 28 | virtualization-type = "hvm" 29 | root-device-type = "ebs" 30 | } 31 | 32 | owners = ["amazon"] 33 | 34 | most_recent = true 35 | } 36 | 37 | // user_data = "\r\n${file("${path.root}/boot/autounattend-first-logon.ps1")}\r\n" 38 | 39 | tags = { 40 | "Name" = local.vm_name 41 | "packer" = "" 42 | } 43 | 44 | run_tags = { 45 | "Name" = local.vm_name 46 | "packer" = "" 47 | } 48 | 49 | spot_tags = { 50 | "Name" = local.vm_name 51 | "packer" = "" 52 | } 53 | 54 | communicator = local.communicator.type 55 | ssh_username = local.communicator.username 56 | ssh_password = local.communicator.password 57 | ssh_timeout = local.communicator.timeout 58 | } 59 | -------------------------------------------------------------------------------- /src/windows/source.core.pkr.hcl: -------------------------------------------------------------------------------- 1 | locals { 2 | timestamp = "${formatdate("YYMMDD'-'hhmmss", timestamp())}" 3 | 4 | source_options_core = { 5 | vm_name = "${replace(local.image_name, "/", "-")}-${local.timestamp}" 6 | headless = true 7 | output_directory = "${local.artifacts_directory}/image" 8 | 9 | cpus = 4 10 | memory = 8192 11 | disk_size = 130048 12 | 13 | boot_wait = "1s" 14 | shutdown_timeout = "5m" 15 | } 16 | 17 | communicator = { 18 | type = "ssh" 19 | username = "Administrator" 20 | password = "Packer42-" 21 | timeout = "30m" 22 | } 23 | 24 | native_build = local.image_build == "native" 25 | vagrant_build = local.image_build == "vagrant" 26 | } 27 | 28 | locals { 29 | source_options_build = merge(local.source_options_core, local.native_build ? local.source_options_native : local.source_options_vagrant) 30 | } 31 | 32 | source "null" "core" { 33 | communicator = "none" 34 | } 35 | -------------------------------------------------------------------------------- /src/windows/source.hyperv.pkr.hcl: -------------------------------------------------------------------------------- 1 | packer { 2 | required_plugins { 3 | hyperv = { 4 | version = "~> 1.1.3" 5 | source = "github.com/hashicorp/hyperv" 6 | } 7 | } 8 | } 9 | 10 | variable "hyperv_switch" { 11 | type = string 12 | default = "Default Switch" 13 | } 14 | 15 | locals { 16 | hyperv_source_options = { 17 | generation = 2 18 | configuration_version = "9.0" 19 | enable_virtualization_extensions = false 20 | enable_dynamic_memory = false 21 | enable_secure_boot = true 22 | secure_boot_template = "MicrosoftWindows" 23 | switch_name = var.hyperv_switch 24 | enable_mac_spoofing = true 25 | 26 | boot_wait = "-1s" 27 | } 28 | } 29 | 30 | locals { 31 | hyperv_iso_source_options = merge(local.source_options_build, local.hyperv_source_options, lookup(local.image_options, "hyperv", {})) 32 | } 33 | 34 | source "hyperv-iso" "core" { 35 | vm_name = local.hyperv_iso_source_options.vm_name 36 | headless = local.hyperv_iso_source_options.headless 37 | output_directory = local.hyperv_iso_source_options.output_directory 38 | 39 | cpus = local.hyperv_iso_source_options.cpus 40 | memory = local.hyperv_iso_source_options.memory 41 | disk_size = local.hyperv_iso_source_options.disk_size 42 | iso_urls = local.hyperv_iso_source_options.iso_urls 43 | iso_checksum = local.hyperv_iso_source_options.iso_checksum 44 | cd_content = local.hyperv_iso_source_options.cd_content 45 | 46 | generation = local.hyperv_iso_source_options.generation 47 | configuration_version = local.hyperv_iso_source_options.configuration_version 48 | enable_virtualization_extensions = local.hyperv_iso_source_options.enable_virtualization_extensions 49 | enable_dynamic_memory = local.hyperv_iso_source_options.enable_dynamic_memory 50 | enable_secure_boot = local.hyperv_iso_source_options.enable_secure_boot 51 | secure_boot_template = local.hyperv_iso_source_options.secure_boot_template 52 | switch_name = local.hyperv_iso_source_options.switch_name 53 | enable_mac_spoofing = local.hyperv_iso_source_options.enable_mac_spoofing 54 | 55 | boot_command = local.hyperv_iso_source_options.boot_command 56 | boot_wait = local.hyperv_iso_source_options.boot_wait 57 | shutdown_command = local.hyperv_iso_source_options.shutdown_command 58 | shutdown_timeout = local.hyperv_iso_source_options.shutdown_timeout 59 | 60 | communicator = local.communicator.type 61 | ssh_username = local.communicator.username 62 | ssh_password = local.communicator.password 63 | ssh_timeout = local.communicator.timeout 64 | } 65 | 66 | locals { 67 | hyperv_vmcx_source_options = merge(local.source_options_build, local.hyperv_source_options, lookup(local.image_options, "hyperv", {})) 68 | } 69 | 70 | source "hyperv-vmcx" "core" { 71 | vm_name = local.hyperv_vmcx_source_options.vm_name 72 | headless = local.hyperv_vmcx_source_options.headless 73 | output_directory = local.hyperv_vmcx_source_options.output_directory 74 | 75 | cpus = local.hyperv_vmcx_source_options.cpus 76 | memory = local.hyperv_vmcx_source_options.memory 77 | clone_from_vmcx_path = "${local.hyperv_vmcx_source_options.import_directory}/${join("", fileset(local.hyperv_vmcx_source_options.import_directory, "**/*.vmcx"))}" 78 | 79 | generation = local.hyperv_vmcx_source_options.generation 80 | configuration_version = local.hyperv_vmcx_source_options.configuration_version 81 | enable_virtualization_extensions = local.hyperv_vmcx_source_options.enable_virtualization_extensions 82 | enable_dynamic_memory = local.hyperv_vmcx_source_options.enable_dynamic_memory 83 | enable_secure_boot = local.hyperv_vmcx_source_options.enable_secure_boot 84 | secure_boot_template = local.hyperv_vmcx_source_options.secure_boot_template 85 | switch_name = local.hyperv_vmcx_source_options.switch_name 86 | enable_mac_spoofing = local.hyperv_vmcx_source_options.enable_mac_spoofing 87 | 88 | boot_command = local.hyperv_vmcx_source_options.boot_command 89 | boot_wait = local.hyperv_vmcx_source_options.boot_wait 90 | shutdown_command = local.hyperv_vmcx_source_options.shutdown_command 91 | shutdown_timeout = local.hyperv_vmcx_source_options.shutdown_timeout 92 | 93 | communicator = local.communicator.type 94 | ssh_username = local.communicator.username 95 | ssh_password = local.communicator.password 96 | ssh_timeout = local.communicator.timeout 97 | } 98 | -------------------------------------------------------------------------------- /src/windows/source.virtualbox.pkr.hcl: -------------------------------------------------------------------------------- 1 | packer { 2 | required_plugins { 3 | virtualbox = { 4 | version = "~> 1.1.0" 5 | source = "github.com/hashicorp/virtualbox" 6 | } 7 | } 8 | } 9 | 10 | locals { 11 | virtualbox_source_options = { 12 | guest_additions_mode = "disable" 13 | firmware = "efi" 14 | nested_virt = false 15 | hard_drive_interface = "sata" 16 | gfx_controller = "vboxsvga" 17 | gfx_vram_size = 64 18 | post_shutdown_delay = "15s" 19 | } 20 | } 21 | 22 | locals { 23 | virtualbox_iso_source_options = merge(local.source_options_build, local.virtualbox_source_options, lookup(local.image_options, "virtualbox", {})) 24 | } 25 | 26 | source "virtualbox-iso" "core" { 27 | vm_name = local.virtualbox_iso_source_options.vm_name 28 | headless = local.virtualbox_iso_source_options.headless 29 | output_directory = local.virtualbox_iso_source_options.output_directory 30 | 31 | cpus = local.virtualbox_iso_source_options.cpus 32 | memory = local.virtualbox_iso_source_options.memory 33 | disk_size = local.virtualbox_iso_source_options.disk_size 34 | iso_urls = local.virtualbox_iso_source_options.iso_urls 35 | iso_checksum = local.virtualbox_iso_source_options.iso_checksum 36 | cd_content = local.virtualbox_iso_source_options.cd_content 37 | 38 | guest_os_type = local.virtualbox_iso_source_options.guest_os_type 39 | guest_additions_mode = local.virtualbox_iso_source_options.guest_additions_mode 40 | firmware = local.virtualbox_iso_source_options.firmware 41 | nested_virt = local.virtualbox_iso_source_options.nested_virt 42 | hard_drive_interface = local.virtualbox_iso_source_options.hard_drive_interface 43 | gfx_controller = local.virtualbox_iso_source_options.gfx_controller 44 | gfx_vram_size = local.virtualbox_iso_source_options.gfx_vram_size 45 | post_shutdown_delay = local.virtualbox_iso_source_options.post_shutdown_delay 46 | 47 | boot_command = local.virtualbox_iso_source_options.boot_command 48 | boot_wait = local.virtualbox_iso_source_options.boot_wait 49 | shutdown_command = local.virtualbox_iso_source_options.shutdown_command 50 | shutdown_timeout = local.virtualbox_iso_source_options.shutdown_timeout 51 | 52 | communicator = local.communicator.type 53 | ssh_username = local.communicator.username 54 | ssh_password = local.communicator.password 55 | ssh_timeout = local.communicator.timeout 56 | } 57 | 58 | locals { 59 | virtualbox_ovf_source_options = merge(local.source_options_build, local.virtualbox_source_options, lookup(local.image_options, "virtualbox", {})) 60 | } 61 | 62 | source "virtualbox-ovf" "core" { 63 | vm_name = local.virtualbox_ovf_source_options.vm_name 64 | headless = local.virtualbox_ovf_source_options.headless 65 | output_directory = local.virtualbox_ovf_source_options.output_directory 66 | 67 | source_path = "${local.virtualbox_ovf_source_options.import_directory}/${join("", fileset(local.virtualbox_ovf_source_options.import_directory, "**/*.ovf"))}" 68 | 69 | guest_additions_mode = local.virtualbox_ovf_source_options.guest_additions_mode 70 | post_shutdown_delay = local.virtualbox_ovf_source_options.post_shutdown_delay 71 | 72 | boot_command = local.virtualbox_ovf_source_options.boot_command 73 | boot_wait = local.virtualbox_ovf_source_options.boot_wait 74 | shutdown_command = local.virtualbox_ovf_source_options.shutdown_command 75 | shutdown_timeout = local.virtualbox_ovf_source_options.shutdown_timeout 76 | 77 | communicator = local.communicator.type 78 | ssh_username = local.communicator.username 79 | ssh_password = local.communicator.password 80 | ssh_timeout = local.communicator.timeout 81 | } 82 | -------------------------------------------------------------------------------- /src/windows/source.vmware.pkr.hcl: -------------------------------------------------------------------------------- 1 | packer { 2 | required_plugins { 3 | vmware = { 4 | version = "~> 1.0.11" 5 | source = "github.com/hashicorp/vmware" 6 | } 7 | } 8 | } 9 | 10 | locals { 11 | vmware_source_options = { 12 | version = 20 13 | disk_type_id = 0 14 | disk_adapter_type = "nvme" 15 | vmx_data = { 16 | firmware = "efi" 17 | "vhv.enable" = "FALSE" 18 | "sata1.present" = "TRUE" 19 | } 20 | vmx_remove_ethernet_interfaces = local.native_build ? false : true 21 | } 22 | } 23 | 24 | locals { 25 | vmware_iso_source_options = merge(local.source_options_build, local.vmware_source_options, lookup(local.image_options, "vmware", {})) 26 | } 27 | 28 | source "vmware-iso" "core" { 29 | vm_name = local.vmware_iso_source_options.vm_name 30 | headless = local.vmware_iso_source_options.headless 31 | output_directory = local.vmware_iso_source_options.output_directory 32 | 33 | cpus = local.vmware_iso_source_options.cpus 34 | memory = local.vmware_iso_source_options.memory 35 | disk_size = local.vmware_iso_source_options.disk_size 36 | iso_urls = local.vmware_iso_source_options.iso_urls 37 | iso_checksum = local.vmware_iso_source_options.iso_checksum 38 | cd_content = local.vmware_iso_source_options.cd_content 39 | 40 | version = local.vmware_iso_source_options.version 41 | guest_os_type = local.vmware_iso_source_options.guest_os_type 42 | disk_type_id = local.vmware_iso_source_options.disk_type_id 43 | disk_adapter_type = local.vmware_iso_source_options.disk_adapter_type 44 | vmx_data = local.vmware_iso_source_options.vmx_data 45 | vmx_remove_ethernet_interfaces = local.vmware_iso_source_options.vmx_remove_ethernet_interfaces 46 | 47 | boot_command = local.vmware_iso_source_options.boot_command 48 | boot_wait = local.vmware_iso_source_options.boot_wait 49 | shutdown_command = local.vmware_iso_source_options.shutdown_command 50 | shutdown_timeout = local.vmware_iso_source_options.shutdown_timeout 51 | 52 | communicator = local.communicator.type 53 | ssh_username = local.communicator.username 54 | ssh_password = local.communicator.password 55 | ssh_timeout = local.communicator.timeout 56 | } 57 | 58 | locals { 59 | vmware_vmx_source_options = merge(local.source_options_build, local.vmware_source_options, lookup(local.image_options, "vmware", {})) 60 | } 61 | 62 | source "vmware-vmx" "core" { 63 | vm_name = local.vmware_vmx_source_options.vm_name 64 | headless = local.vmware_vmx_source_options.headless 65 | output_directory = local.vmware_vmx_source_options.output_directory 66 | 67 | source_path = "${local.vmware_vmx_source_options.import_directory}/${join("", fileset(local.vmware_vmx_source_options.import_directory, "**/*.vmx"))}" 68 | 69 | vmx_remove_ethernet_interfaces = local.vmware_vmx_source_options.vmx_remove_ethernet_interfaces 70 | 71 | boot_command = local.vmware_vmx_source_options.boot_command 72 | boot_wait = local.vmware_vmx_source_options.boot_wait 73 | shutdown_command = local.vmware_vmx_source_options.shutdown_command 74 | shutdown_timeout = local.vmware_vmx_source_options.shutdown_timeout 75 | 76 | communicator = local.communicator.type 77 | ssh_username = local.communicator.username 78 | ssh_password = local.communicator.password 79 | ssh_timeout = local.communicator.timeout 80 | } 81 | -------------------------------------------------------------------------------- /src/windows/vagrant/Autounattend.ps1: -------------------------------------------------------------------------------- 1 | Set-LocalUser -Name vagrant -PasswordNeverExpires $true 2 | 3 | sc.exe config winrm start= auto 4 | net start winrm 5 | 6 | Write-Host "Configure OpenSSH" 7 | mkdir -Force C:/Users/vagrant/.ssh 8 | cp C:/Windows/Temp/packer/vagrant.pub C:/Users/vagrant/.ssh/authorized_keys 9 | 10 | sc.exe config sshd start= auto 11 | net start sshd 12 | -------------------------------------------------------------------------------- /src/windows/vagrant/Autounattend.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | en-US 6 | en-US 7 | en-US 8 | en-US 9 | 10 | 11 | 12 | true 13 | true 14 | true 15 | true 16 | true 17 | Home 18 | 3 19 | true 20 | true 21 | 22 | 23 | 24 | vagrant 25 | true</PlainText> 26 | </AdministratorPassword> 27 | <LocalAccounts> 28 | <LocalAccount wcm:action="add"> 29 | <Password> 30 | <Value>vagrant</Value> 31 | <PlainText>true</PlainText> 32 | </Password> 33 | <Group>Administrators</Group> 34 | <DisplayName>Vagrant</DisplayName> 35 | <Name>vagrant</Name> 36 | <Description>Vagrant</Description> 37 | </LocalAccount> 38 | </LocalAccounts> 39 | </UserAccounts> 40 | <RegisteredOwner/> 41 | <AutoLogon> 42 | <Password> 43 | <Value>vagrant</Value> 44 | <PlainText>true</PlainText> 45 | </Password> 46 | <Enabled>true</Enabled> 47 | <Username>vagrant</Username> 48 | <LogonCount>2</LogonCount> 49 | </AutoLogon> 50 | <FirstLogonCommands> 51 | <SynchronousCommand wcm:action="add"> 52 | <CommandLine>C:\Windows\System32\WindowsPowershell\v1.0\powershell.exe -Command "Set-ExecutionPolicy Bypass -Force; C:\Windows\Temp\packer\Autounattend.ps1"</CommandLine> 53 | <Description>Autounattend.ps1</Description> 54 | <Order>1</Order> 55 | <RequiresUserInput>true</RequiresUserInput> 56 | </SynchronousCommand> 57 | </FirstLogonCommands> 58 | </component> 59 | </settings> 60 | </unattend> 61 | -------------------------------------------------------------------------------- /src/windows/vagrant/cleanup.ps1: -------------------------------------------------------------------------------- 1 | Get-AppxPackage -Name "*BingSearch*" | Remove-AppxPackage 2 | -------------------------------------------------------------------------------- /src/windows/vagrant/shutdown.cmd: -------------------------------------------------------------------------------- 1 | sc.exe config winrm start= disabled 2 | sc.exe config sshd start= disabled 3 | 4 | C:\Windows\System32\Sysprep\sysprep.exe /generalize /oobe /quiet /shutdown /unattend:C:\Windows\Temp\packer\Autounattend.xml 5 | -------------------------------------------------------------------------------- /src/windows/vagrant/template.Vagrantfile: -------------------------------------------------------------------------------- 1 | Vagrant.configure(2) do |config| 2 | config.vm.guest = :windows 3 | config.vm.communicator = 'winrm' 4 | config.winssh.shell = 'powershell' 5 | 6 | config.vm.provider 'virtualbox' do |provider, override| 7 | provider.cpus = ${options.cpus} 8 | provider.memory = ${options.memory} 9 | 10 | %{ for port in compact(split(",", options.ports)) ~} 11 | override.vm.network :forwarded_port, guest: ${port}, host: ${50000 + port}, auto_correct: true 12 | %{ endfor ~} 13 | end 14 | 15 | config.vm.provider 'vmware_desktop' do |provider, override| 16 | provider.cpus = ${options.cpus} 17 | provider.memory = ${options.memory} 18 | 19 | %{ for port in compact(split(",", options.ports)) ~} 20 | override.vm.network :forwarded_port, guest: ${port}, host: ${50000 + port}, auto_correct: true 21 | %{ endfor ~} 22 | end 23 | 24 | config.vm.provider 'hyperv' do |provider, _override| 25 | provider.cpus = ${options.cpus} 26 | provider.memory = ${options.memory} 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /src/windows/vagrant/vagrant.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key 2 | ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN1YdxBpNlzxDqfJyw/QKow1F+wvG9hXGoqiysfJOn5Y vagrant insecure public key 3 | --------------------------------------------------------------------------------