You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Windows Server 1709, 1803, 1809, 1903, 1909, and 2004 all without and with Docker
Windows Server InsiderPreview Semi-Annual without and with Docker
You may find other packer template files, but older versions of Windows doesn't
work so nice with a Retina display.
Windows Editions
All Windows Server versions are defaulted to the Server Datacenter edition. You
can modify this by editing the Autounattend.xml file, changing the
ImageInstall>OSImage>InstallFrom>MetaData>Value element (e.g. to
Windows Server 2019 SERVERSTANDARDCORE).
To retrieve the correct image name from an ISO file use the following two commands.
ImageIndex : 1 ImageName : Windows Server 2019 Standard ImageDescription : (Recommended) This option omits most of the Windows graphical environment. Manage with a command prompt and PowerShell, or remotely with Windows Admin Center or other tools. ImageSize : 8,388,579,855 bytes
ImageIndex : 2 ImageName : Windows Server 2019 Standard (Desktop Experience) ImageDescription : This option installs the full Windows graphical environment, consuming extra drive space. It can be useful if you want to use the Windows desktop or have an app that requires it. ImageSize : 14,668,863,719 bytes
ImageIndex : 3 ImageName : Windows Server 2019 Datacenter ImageDescription : (Recommended) This option omits most of the Windows graphical environment. Manage with a command prompt and PowerShell, or remotely with Windows Admin Center or other tools. ImageSize : 8,378,362,786 bytes
ImageIndex : 4 ImageName : Windows Server 2019 Datacenter (Desktop Experience) ImageDescription : This option installs the full Windows graphical environment, consuming extra drive space. It can be useful if you want to use the Windows desktop or have an app that requires it. ImageSize : 14,673,479,669 bytes
If you are not sure about the exact image name, you can use the index instead. Change the Key element to /IMAGE/INDEX and put the index number in the Value element.
Product Keys
The Autounattend.xml files are configured to work correctly with trial ISOs
(which will be downloaded and cached for you the first time you perform a
packer build). If you would like to use retail or volume license ISOs, you
need to update the UserData>ProductKey element as follows:
The scripts in this repo will install all Windows updates - by default - during
Windows Setup. This is a very time consuming process, depending on the age of
the OS and the quantity of updates released since the last service pack. You
might want to do yourself a favor during development and disable this
functionality, by commenting out the WITH WINDOWS UPDATES section and
uncommenting the WITHOUT WINDOWS UPDATES section in Autounattend.xml:
Doing so will give you hours back in your day, which is a good thing.
Windows 7 support
Windows 7 is going out of support in January 2020, and the scripts for building Windows 7 machines are only
sporadically maintained.
Windows 7 was first released in 2009. This means there are a lot of updates available for Windows 7,
and running Windows Updates on a Windows 7 box using the mechanism described above takes an extremely long time.
The Windows 7 templates therefore take a slightly different approach, first installing Service Pack 1,
updating the servicing stack and then installing the latest update rollup, .NET 4.8 and PowerShell 5.1.
Finally, any missing updates are installed using Ansible.
This means you'll need to install Ansible on your machine if you want to run the Windows 7 scripts.
You can install ansible on a Linux machine.
If you want to run these scripts on a Windows machine, you can try to run Ansible in cygwin or Bash on Ubuntu on Windows.
Alternatively, you can disable the ansible steps in the windows_7.json file. Make sure to manually run
Windows Update if you do!
WinRM
These boxes use WinRM. There is no OpenSSH installed.
Hyper-V Support
If you are running Windows 10, Windows Server 2016 or later, then you can also use these packerfiles to build
a Hyper-V virtual machine. I have the ISO already downloaded to save time, and
only have Hyper-V installed on my laptop, so I run:
Where Ethernet is the name of my default Hyper-V Virtual Switch. You then can use this box with Vagrant to spin up a Hyper-V VM.
Generation 2 VMs
Some of these images use Hyper-V "Generation 2" VMs to enable the latest features and faster booting. However, an extra manual step is needed to put the needed files into ISOs because Gen2 VMs don't support virtual floppy disks.
windows_server_insider.json
windows_server_insider_docker.json
windows_10_insider.json
Before running packer build, be sure to run ./make_unattend_iso.ps1 first. Otherwise the build will fail on a missing ISO file
hyperv-iso output will be in this color.
1 error(s) occurred:
* Secondary Dvd image does not exist: CreateFile ./iso/windows_server_insider_unattend.iso: The system cannot find the file specified.
KVM/qemu support
If you are using Linux and have KVM/qemu configured, you can use these packerfiles to build a KVM virtual machine.
To build a KVM/qemu box, first make sure:
You are a member of the kvm group on your machine. You can list the groups you are member of by running groups. It should
include the kvm group. If you're not a member, run sudo usermod -aG kvm $(whoami) to add yourself.
The Parallels builder config turns efi boot off in order to use the same answer file like all the other builders. If you find you need to turn efi boot on then make sure to adjust the appropriate answer file, especially the section regarding the partitioning of the disk.
If you need to further customize the VM, consult the documentation at https://www.packer.io/docs/builders/parallels-iso.html.
VirtualBox support
When using VirtualBox, you can use the following sample command to build a
corresponding VM image: