Skip to content

Commit

Permalink
let packer create the autounattend iso
Browse files Browse the repository at this point in the history
  • Loading branch information
rgl committed Sep 17, 2020
1 parent 78b7525 commit b7c7f83
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 22 deletions.
14 changes: 2 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ $(VSPHERE_BUILDS): build-%-vsphere: %-amd64-vsphere.box
@echo to add to local vagrant install do:
@echo vagrant box add -f $*-amd64 $@

%-amd64-hyperv.box: %.json Vagrantfile.template *.ps1 %-amd64-hyperv.iso
%-amd64-hyperv.box: %.json Vagrantfile.template *.ps1
rm -f $@
mkdir -p tmp
CHECKPOINT_DISABLE=1 PACKER_LOG=1 PACKER_LOG_PATH=$*-amd64-hyperv-packer.log \
Expand All @@ -88,14 +88,7 @@ $(VSPHERE_BUILDS): build-%-vsphere: %-amd64-vsphere.box
@echo to add to local vagrant install do:
@echo vagrant box add -f $*-amd64 $@

%-amd64-hyperv.iso: %-uefi/autounattend.xml winrm.ps1
xorrisofs -J -R -input-charset ascii -o $@ $^

# NB all windows 10 versions share the same autounattend.xml file.
windows-10-%-amd64-hyperv.iso: windows-10-uefi/autounattend.xml winrm.ps1
xorrisofs -J -R -input-charset ascii -o $@ $^

%-uefi-amd64-virtualbox.box: %-uefi.json %-uefi/autounattend.xml Vagrantfile-uefi.template *.ps1 drivers %-uefi-amd64-virtualbox.iso
%-uefi-amd64-virtualbox.box: %-uefi.json %-uefi/autounattend.xml Vagrantfile-uefi.template *.ps1 drivers
rm -f $@
CHECKPOINT_DISABLE=1 PACKER_LOG=1 PACKER_LOG_PATH=$*-uefi-amd64-virtualbox-packer.log \
packer build -only=$*-uefi-amd64-virtualbox -on-error=abort $*-uefi.json
Expand All @@ -117,9 +110,6 @@ windows-10-%-amd64-hyperv.iso: windows-10-uefi/autounattend.xml winrm.ps1
@echo to add to local vagrant install do:
@echo vagrant box add -f $*-uefi-amd64 $@

windows-2019-uefi-amd64-virtualbox.iso: windows-2019-uefi/autounattend.xml winrm.ps1
xorrisofs -J -R -input-charset ascii -o $@ $^

tmp/%-vsphere/autounattend.xml: %/autounattend.xml
mkdir -p "$$(dirname $@)"
@# add the vmware tools iso to the drivers search path.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
This builds Windows 2012R2/10/2016/2019 base Vagrant boxes using [Packer](https://www.packer.io/).
This builds Windows 2012R2/10/2016/2019 base Vagrant boxes using [Packer](https://www.packer.io/) and VirtualBox/Hyper-V/libvirt/qemu.


# Usage

Install [VirtualBox](https://www.virtualbox.org/) (or [libvirt](https://libvirt.org/) on Linux based systems), [packer 1.6+](https://www.packer.io/), [packer-provisioner-windows-update plugin](https://github.com/rgl/packer-provisioner-windows-update) and [vagrant](https://www.vagrantup.com/).
Install [VirtualBox](https://www.virtualbox.org/) (or [libvirt](https://libvirt.org/) on Linux based systems), [packer 1.6.3+](https://www.packer.io/), [packer-provisioner-windows-update plugin](https://github.com/rgl/packer-provisioner-windows-update) and [vagrant](https://www.vagrantup.com/).
If you are using Windows and [Chocolatey](https://chocolatey.org/), you can install everything with:

```batch
Expand Down
5 changes: 3 additions & 2 deletions windows-10-1809.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,9 @@
"disk_size": "{{user `disk_size`}}",
"iso_url": "{{user `iso_url`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"secondary_iso_images": [
"windows-10-1809-amd64-hyperv.iso"
"cd_files": [
"windows-10-uefi/autounattend.xml",
"winrm.ps1"
],
"first_boot_device": "DVD",
"boot_order": ["SCSI:0:0"],
Expand Down
5 changes: 3 additions & 2 deletions windows-10-2004.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,9 @@
"disk_size": "{{user `disk_size`}}",
"iso_url": "{{user `iso_url`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"secondary_iso_images": [
"windows-10-2004-amd64-hyperv.iso"
"cd_files": [
"windows-10-uefi/autounattend.xml",
"winrm.ps1"
],
"first_boot_device": "DVD",
"boot_order": ["SCSI:0:0"],
Expand Down
5 changes: 3 additions & 2 deletions windows-2016.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,9 @@
"disk_size": "{{user `disk_size`}}",
"iso_url": "{{user `iso_url`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"secondary_iso_images": [
"windows-2016-amd64-hyperv.iso"
"cd_files": [
"windows-2016-uefi/autounattend.xml",
"winrm.ps1"
],
"first_boot_device": "DVD",
"boot_order": ["SCSI:0:0"],
Expand Down
5 changes: 3 additions & 2 deletions windows-2019.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,9 @@
"disk_size": "{{user `disk_size`}}",
"iso_url": "{{user `iso_url`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"secondary_iso_images": [
"windows-2019-amd64-hyperv.iso"
"cd_files": [
"windows-2019-uefi/autounattend.xml",
"winrm.ps1"
],
"first_boot_device": "DVD",
"boot_order": ["SCSI:0:0"],
Expand Down

0 comments on commit b7c7f83

Please sign in to comment.