This is Miteflux's fork of VirtFusion's template-builders. It adds support for Windows Consumer Editions (Windows 10/11 Pro Workstation via windows.pkr.hcl) and Windows Server 2012 R2 (eval image in windows-server.pkr.hcl).
Install Debian 11/12 on a VM with at least 2GB RAM. Then run the following to prepare the environment.
apt-get install git curl unzip gnupg2 software-properties-common ansible -y
apt-get install --no-install-recommends qemu-system qemu-utils -y
git clone https://github.com/miteflux/template-builders
cd packer
wget https://releases.hashicorp.com/packer/1.10.0/packer_1.10.0_linux_amd64.zip
unzip packer_1.10.0_linux_amd64.zip
OR
wget https://releases.hashicorp.com/packer/1.10.0/packer_1.10.0_linux_arm64.zip
unzip packer_1.10.0_linux_arm64.zip
./packer plugins install github.com/hashicorp/qemu
./packer plugins install github.com/hashicorp/ansible
mkdir sourceOnce all the requirements are installed you may build a template.
./packer build -only=qemu.base-9-x86_64 alma.pkr.hcl
./packer build -only=qemu.gnome-9-x86_64 alma.pkr.hcl./packer build -only=qemu.base-9-x86_64 rocky.pkr.hcl
./packer build -only=qemu.gnome-9-x86_64 rocky.pkr.hcl./packer build -only=qemu.base-10-x86_64 debian.pkr.hcl./packer build -only=qemu.base-11-x86_64 debian.pkr.hcl
./packer build -only=qemu.xfce-11-x86_64 debian.pkr.hcl./packer build -only=qemu.base-12-x86_64 debian.pkr.hcl
./packer build -only=qemu.base-12-ext4-x86_64 debian.pkr.hcl
./packer build -only=qemu.base-12-aarch64 debian.pkr.hcl./packer build -only=qemu.base-13-x86_64 debian.pkr.hcl
./packer build -only=qemu.base-13-xfs-x86_64 debian.pkr.hcl./packer build -only=qemu.base-9-x86_64 oracle.pkr.hcl
./packer build -only=qemu.base-uek-9-x86_64 oracle.pkr.hcl./packer build -only=qemu.base-9-x86_64 centos.pkr.hcl./packer build -only=qemu.base-3-19-x86_64 alpine.pkr.hclA script is supplied to download the evaluation versions of Windows Server and the VirtIO drivers (windows-sources.sh). This covers Server 2012 R2, 2019, 2022, 2025 eval ISOs and the VirtIO drivers.
Windows 10 and Windows 11 do not have an automatic download script. Microsoft does not provide direct, scriptable ISO downloads for consumer editions. You must obtain the Windows 10/11 Pro Workstation (or equivalent) ISOs yourself and place them in ./source/, then set the correct paths and checksums in windows.pkr.hcl.
sh windows-sources.shIf you would like to build from retail media for any Server edition, you will need to supply the ISO images.
./packer build -only=qemu.server-2012r2-standard-eval windows-server.pkr.hcl
``
#### Server 2019
```shell
./packer build -only=qemu.server-2019-standard windows-server.pkr.hcl
./packer build -only=qemu.server-2019-standard-eval windows-server.pkr.hcl./packer build -only=qemu.server-2022-standard windows-server.pkr.hcl
./packer build -only=qemu.server-2022-standard-eval windows-server.pkr.hcl./packer build -only=qemu.server-2025-standard windows-server.pkr.hclThere is no automatic download script for Windows 10 or Windows 11. Microsoft restricts how these ISOs are distributed, so you must obtain the ISOs yourself (e.g. from Microsoft's download pages or your volume-licensing portal), place them in ./source/, and set the variables windows_iso_10 / windows_iso_11 and their checksums in windows.pkr.hcl.
./packer build -only=qemu.windows-10-pro-workstation windows.pkr.hcl
./packer build -only=qemu.windows-11-pro-workstation windows.pkr.hclOr build both:
./packer build windows.pkr.hclreg delete HKEY_LOCAL_MACHINE\\Software\\Policies\\Microsoft\\Windows\\WindowsUpdate /fsecedit /export /cfg securityconfig.cfg
(Get-Content securityconfig.cfg).replace("AllowAdministratorLockout = 1", "AllowAdministratorLockout = 0") | Set-Content securityconfig.cfg
secedit /configure /db C:\Windows\security\local.sdb /cfg securityconfig.cfg /areas SECURITYPOLICY
Remove-Item securityconfig.cfg