Compare commits

..
12 Commits
Author SHA1 Message Date
installer 10a8ca7ab7 Good unattended 2026-04-22 08:56:57 +02:00
TheHitman1977 36fe734184 Merge pull request #20 from ajschroeder/develop
merge develop into main
2026-02-21 07:01:46 -06:00
TheHitman1977 f5a25eca4e Merge pull request #19 from Veidit/debian-13-support
Add Debian 13 support and update Debian 11/12 ISOs
2026-02-21 06:57:38 -06:00
AJ Schroeder a76f8bfb16 refactor: make script more DRY 2025-11-17 20:57:24 -06:00
John Angelmo 90bd5733cf Add Debian 13 support and update Debian 11/12 ISOs
- Add complete Debian 13 (Trixie) support with all necessary configuration files
- Update Debian 11 ISO to 11.11.0 with SHA512 checksum
- Update Debian 12 ISO to 12.12.0 with SHA512 checksum
- Created new debian/13 directory with packer templates and variables
- Added preseed configuration for Debian 13 automated installation
2025-11-16 18:20:03 +01:00
TheHitman1977 14f2af170a fix: remove invalid variable (#18) 2025-10-21 21:22:49 -05:00
TheHitman1977 f9eea48212 Merge pull request #17 from ajschroeder/develop
feat: add Ubuntu 25.04
2025-10-21 20:24:45 -05:00
vorpaxandTheHitman1977 d321a1356f update repository link inside download section (#16)
Co-authored-by: TheHitman1977 <6432150+ajschroeder@users.noreply.github.com>
2025-10-21 20:21:19 -05:00
AJ Schroeder 2e6ef06d46 fix: update path for corrected distro name 2025-10-21 20:17:57 -05:00
TheHitman1977 57d76b51f7 refactor: 25.04 is not an Ubuntu LTS release (#15)
* feat: 25.04 is not an Ubuntu LTS release

* doc: removed LTS from Ubuntu 25.04
2025-10-13 23:28:07 -05:00
TheHitman1977 4151a047c0 Merge pull request #10 from ajschroeder/develop
feat: add almalinux and rocky linux version 10
2025-06-18 23:52:05 -05:00
TheHitman1977 8534448cab Merge pull request #7 from ajschroeder/develop
feat: Major updates to vars, added builds, added validator script, updated docs
2025-06-15 08:09:40 -05:00
44 changed files with 1983 additions and 1057 deletions

No files matched your search

+3
View File
@@ -29,3 +29,6 @@ manifests/*.json
plugin.hwm plugin.hwm
plugin.pwd plugin.pwd
plugin.pwi plugin.pwi
crash.log
tmp/
+3 -3
View File
@@ -39,7 +39,7 @@ The following builds are available:
| Rocky Linux | 10 | &check; | &check; | &check; | &check; | | Rocky Linux | 10 | &check; | &check; | &check; | &check; |
| Rocky Linux | 9 | &check; | &check; | &check; | &check; | | Rocky Linux | 9 | &check; | &check; | &check; | &check; |
| Rocky Linux | 8 | &check; | &check; | &check; | &check; | | Rocky Linux | 8 | &check; | &check; | &check; | &check; |
| Ubuntu Server | 25.04 LTS | &check; | &check; | &check; | &check; | | Ubuntu Server | 25.04 | &check; | &check; | &check; | &check; |
| Ubuntu Server | 24.04 LTS | &check; | &check; | &check; | &check; | | Ubuntu Server | 24.04 LTS | &check; | &check; | &check; | &check; |
| Ubuntu Server | 22.04 LTS | &check; | &check; | &check; | &check; | | Ubuntu Server | 22.04 LTS | &check; | &check; | &check; | &check; |
| Ubuntu Server | 20.04 LTS | &check; | &check; | &check; | &check; | | Ubuntu Server | 20.04 LTS | &check; | &check; | &check; | &check; |
@@ -189,8 +189,8 @@ Operating systems and versions tested with the project:
After installing the required software, the quickest way to get building is to clone this repository. After installing the required software, the quickest way to get building is to clone this repository.
```shell ```shell
git clone https://github.com/ajschroeder/packer-examples-for-proxmox.git git clone https://github.com/ajschroeder/proxmox-packer-examples.git
cd packer-examples-for-proxmox cd proxmox-packer-examples
``` ```
The following table describes the directory structure. The following table describes the directory structure.
+103 -809
View File
@@ -48,30 +48,85 @@ if [ "$debug_mode" = true ]; then
menu_message+=" \e[31m(Debug Mode)\e[0m" menu_message+=" \e[31m(Debug Mode)\e[0m"
fi fi
menu_option_1() { # Menu registry
INPUT_PATH="$SCRIPT_PATH"/builds/linux/almalinux/10/ # Format: key="Label|RelativeInputPath"
BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"} declare -A MENU_ITEMS=(
[1]="AlmaLinux 10|linux/almalinux/10"
[2]="AlmaLinux 9|linux/almalinux/9"
[3]="AlmaLinux 8|linux/almalinux/8"
[4]="CentOS 10 Stream|linux/centos/10-stream"
[5]="CentOS 9 Stream|linux/centos/9-stream"
[6]="Debian 12 (Bookworm)|linux/debian/12"
[7]="Debian 12 (Bullseye)|linux/debian/11"
[8]="openSUSE Leap 15.6|linux/opensuse/leap-15-6"
[9]="openSUSE Leap 15.5|linux/opensuse/leap-15-5"
[10]="Oracle Linux 9|linux/oracle/9"
[11]="Oracle Linux 8|linux/oracle/8"
[12]="Rocky Linux 10|linux/rocky/10"
[13]="Rocky Linux 9|linux/rocky/9"
[14]="Rocky Linux 8|linux/rocky/8"
[15]="Ubuntu Server 25.04|linux/ubuntu/25-04"
[16]="Ubuntu Server 24.04 LTS|linux/ubuntu/24-04-lts"
[17]="Ubuntu Server 22.04|linux/ubuntu/22-04-lts"
[18]="Ubuntu Server 20.04|linux/ubuntu/20-04-lts"
[19]="Windows 11 - All|windows/desktop/11|"
[20]="Windows 11 - Enterprise|windows/desktop/11|--only proxmox-iso.windows-desktop-ent"
[21]="Windows 11 - Professional|windows/desktop/11|--only proxmox-iso.windows-desktop-pro"
[I]="Information|info"
[Q]="Quit|quit_program"
)
build_template() {
local label="$1"
local relative_path="$2"
local extra_args="$3"
INPUT_PATH="$SCRIPT_PATH/builds/$relative_path"
BUILD_PATH="${relative_path}"
BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl" BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl"
echo -e "\nCONFIRM: Build a AlmaLinux 10 Template for Proxmox?" # List of required var files
echo -e "\nContinue? (y/n)" local var_files=(
read -r REPLY "$CONFIG_PATH/ansible.pkrvars.hcl"
if [[ ! $REPLY =~ ^[Yy]$ ]] "$CONFIG_PATH/build.pkrvars.hcl"
then "$CONFIG_PATH/common.pkrvars.hcl"
exit 1 "$CONFIG_PATH/linux-storage.pkrvars.hcl"
"$CONFIG_PATH/network.pkrvars.hcl"
"$CONFIG_PATH/proxmox.pkrvars.hcl"
"$CONFIG_PATH/$BUILD_VARS"
)
# Validate all var files exist
local missing_files=()
for file in "${var_files[@]}"; do
if [[ ! -f "$file" ]]; then
missing_files+=("$file")
fi
done
if [[ ${#missing_files[@]} -ne 0 ]]; then
echo "Error: The following required .pkrvars.hcl files are missing:"
for f in "${missing_files[@]}"; do
echo " - $f"
done
echo "Aborting build."
return 1
fi fi
### Build a AlmaLinux 10 Template for Proxmox. ### # Confirmation prompt
echo "Building a AlmaLinux 10 Template for Proxmox..." echo -e "\nCONFIRM: Build a $label Template for Proxmox?"
read -rp "Continue? (y/n) " REPLY
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "Aborted."
return
fi
### Initialize HashiCorp Packer and required plugins. ### echo "Building a $label Template for Proxmox..."
echo "Initializing HashiCorp Packer and required plugins..." echo "Initializing HashiCorp Packer and required plugins..."
packer init "$INPUT_PATH" packer init "$INPUT_PATH"
### Start the Build. ### echo "Starting the build..."
echo "Starting the build...." packer build -force -on-error=ask $debug_option $extra_args \
echo "packer build -force -on-error=ask $debug_option"
packer build -force -on-error=ask $debug_option \
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \ -var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \ -var-file="$CONFIG_PATH/build.pkrvars.hcl" \
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \ -var-file="$CONFIG_PATH/common.pkrvars.hcl" \
@@ -81,748 +136,24 @@ menu_option_1() {
-var-file="$CONFIG_PATH/$BUILD_VARS" \ -var-file="$CONFIG_PATH/$BUILD_VARS" \
"$INPUT_PATH" "$INPUT_PATH"
### All done. ###
echo "Done." echo "Done."
} }
menu_option_2() { dispatch_selection() {
INPUT_PATH="$SCRIPT_PATH"/builds/linux/almalinux/9/ entry="${MENU_ITEMS[$selection]}"
BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"} if [[ -z "$entry" ]]; then
BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl" echo "Invalid selection."
return
echo -e "\nCONFIRM: Build a AlmaLinux 9 Template for Proxmox?"
echo -e "\nContinue? (y/n)"
read -r REPLY
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi fi
### Build a AlmaLinux 9 Template for Proxmox. ### IFS='|' read -r label path_or_function extra_args <<< "$entry"
echo "Building a AlmaLinux 9 Template for Proxmox..."
### Initialize HashiCorp Packer and required plugins. ### # Decide if it’s a build or a function
echo "Initializing HashiCorp Packer and required plugins..." if [[ -d "$SCRIPT_PATH/builds/$path_or_function" ]]; then
packer init "$INPUT_PATH" build_template "$label" "$path_or_function" "$extra_args"
else
### Start the Build. ### $path_or_function
echo "Starting the build...."
echo "packer build -force -on-error=ask $debug_option"
packer build -force -on-error=ask $debug_option \
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
-var-file="$CONFIG_PATH/$BUILD_VARS" \
"$INPUT_PATH"
### All done. ###
echo "Done."
}
menu_option_3() {
INPUT_PATH="$SCRIPT_PATH"/builds/linux/almalinux/8/
BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"}
BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl"
echo -e "\nCONFIRM: Build a AlmaLinux 8 Template for Proxmox?"
echo -e "\nContinue? (y/n)"
read -r REPLY
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi fi
### Build a AlmaLinux 8 Template for Proxmox. ###
echo "Building a AlmaLinux 8 Template for Proxmox..."
### Initialize HashiCorp Packer and required plugins. ###
echo "Initializing HashiCorp Packer and required plugins..."
packer init "$INPUT_PATH"
### Start the Build. ###
echo "Starting the build...."
echo "packer build -force -on-error=ask $debug_option"
packer build -force -on-error=ask $debug_option \
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
-var-file="$CONFIG_PATH/$BUILD_VARS" \
"$INPUT_PATH"
### All done. ###
echo "Done."
}
menu_option_4() {
INPUT_PATH="$SCRIPT_PATH"/builds/linux/centos/10-stream/
BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"}
BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl"
echo -e "\nCONFIRM: Build a CentOS 10 Stream Template for Proxmox?"
echo -e "\nContinue? (y/n)"
read -r REPLY
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi
### Build a CentOS 10 Stream Template for Proxmox. ###
echo "Building a CentOS 10 Stream Template for Proxmox..."
### Initialize HashiCorp Packer and required plugins. ###
echo "Initializing HashiCorp Packer and required plugins..."
packer init "$INPUT_PATH"
### Start the Build. ###
echo "Starting the build...."
echo "packer build -force -on-error=ask $debug_option"
packer build -force -on-error=ask $debug_option \
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
-var-file="$CONFIG_PATH/$BUILD_VARS" \
"$INPUT_PATH"
### All done. ###
echo "Done."
}
menu_option_5() {
INPUT_PATH="$SCRIPT_PATH"/builds/linux/centos/9-stream/
BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"}
BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl"
echo -e "\nCONFIRM: Build a CentOS 9 Stream Template for Proxmox?"
echo -e "\nContinue? (y/n)"
read -r REPLY
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi
### Build a CentOS 9 Stream Template for Proxmox. ###
echo "Building a CentOS 9 Stream Template for Proxmox..."
### Initialize HashiCorp Packer and required plugins. ###
echo "Initializing HashiCorp Packer and required plugins..."
packer init "$INPUT_PATH"
### Start the Build. ###
echo "Starting the build...."
echo "packer build -force -on-error=ask $debug_option"
packer build -force -on-error=ask $debug_option \
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
-var-file="$CONFIG_PATH/$BUILD_VARS" \
"$INPUT_PATH"
### All done. ###
echo "Done."
}
menu_option_6() {
INPUT_PATH="$SCRIPT_PATH"/builds/linux/debian/12/
BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"}
BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl"
echo -e "\nCONFIRM: Build a Debian 12 (Bookworm) Template for Proxmox?"
echo -e "\nContinue? (y/n)"
read -r REPLY
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi
### Build a Debian 12 (Bookworm) for Proxmox. ###
echo "Building a Debian 12 (Bookworm) for Proxmox..."
### Initialize HashiCorp Packer and required plugins. ###
echo "Initializing HashiCorp Packer and required plugins..."
packer init "$INPUT_PATH"
### Start the Build. ###
echo "Starting the build...."
echo "packer build -force -on-error=ask $debug_option"
packer build -force -on-error=ask $debug_option \
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
-var-file="$CONFIG_PATH/$BUILD_VARS" \
"$INPUT_PATH"
### All done. ###
echo "Done."
}
menu_option_7() {
INPUT_PATH="$SCRIPT_PATH"/builds/linux/debian/11/
BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"}
BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl"
echo -e "\nCONFIRM: Build a Debian 11 (Bullseye) Template for Proxmox?"
echo -e "\nContinue? (y/n)"
read -r REPLY
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi
### Build a Debian 11 (Bullseye) for Proxmox. ###
echo "Building a Debian 11 (Bullseye) for Proxmox..."
### Initialize HashiCorp Packer and required plugins. ###
echo "Initializing HashiCorp Packer and required plugins..."
packer init "$INPUT_PATH"
### Start the Build. ###
echo "Starting the build...."
echo "packer build -force -on-error=ask $debug_option"
packer build -force -on-error=ask $debug_option \
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
-var-file="$CONFIG_PATH/$BUILD_VARS" \
"$INPUT_PATH"
### All done. ###
echo "Done."
}
menu_option_8() {
INPUT_PATH="$SCRIPT_PATH"/builds/linux/opensuse/leap-15-6/
BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"}
BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl"
echo -e "\nCONFIRM: Build a OpenSUSE Leap 15.6 Template for Proxmox?"
echo -e "\nContinue? (y/n)"
read -r REPLY
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi
### Build a OpenSUSE Leap 15.6 Template for Proxmox. ###
echo "Building a OpenSUSE Leap 15.6 Template for Proxmox..."
### Initialize HashiCorp Packer and required plugins. ###
echo "Initializing HashiCorp Packer and required plugins..."
packer init "$INPUT_PATH"
### Start the Build. ###
echo "Starting the build...."
echo "packer build -force -on-error=ask $debug_option"
packer build -force -on-error=ask $debug_option \
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
-var-file="$CONFIG_PATH/$BUILD_VARS" \
"$INPUT_PATH"
### All done. ###
echo "Done."
}
menu_option_9() {
INPUT_PATH="$SCRIPT_PATH"/builds/linux/opensuse/leap-15-5/
BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"}
BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl"
echo -e "\nCONFIRM: Build a OpenSUSE Leap 15.5 Template for Proxmox?"
echo -e "\nContinue? (y/n)"
read -r REPLY
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi
### Build a OpenSUSE Leap 15.5 Template for Proxmox. ###
echo "Building a OpenSUSE Leap 15.5 Template for Proxmox..."
### Initialize HashiCorp Packer and required plugins. ###
echo "Initializing HashiCorp Packer and required plugins..."
packer init "$INPUT_PATH"
### Start the Build. ###
echo "Starting the build...."
echo "packer build -force -on-error=ask $debug_option"
packer build -force -on-error=ask $debug_option \
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
-var-file="$CONFIG_PATH/$BUILD_VARS" \
"$INPUT_PATH"
### All done. ###
echo "Done."
}
menu_option_10() {
INPUT_PATH="$SCRIPT_PATH"/builds/linux/oracle/9/
BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"}
BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl"
echo -e "\nCONFIRM: Build a Oracle Linux 9 Template for Proxmox?"
echo -e "\nContinue? (y/n)"
read -r REPLY
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi
### Build a Oracle Linux 9 Template for Proxmox. ###
echo "Building a Oracle Linux 9 Template for Proxmox..."
### Initialize HashiCorp Packer and required plugins. ###
echo "Initializing HashiCorp Packer and required plugins..."
packer init "$INPUT_PATH"
### Start the Build. ###
echo "Starting the build...."
echo "packer build -force -on-error=ask $debug_option"
packer build -force -on-error=ask $debug_option \
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
-var-file="$CONFIG_PATH/$BUILD_VARS" \
"$INPUT_PATH"
### All done. ###
echo "Done."
}
menu_option_11() {
INPUT_PATH="$SCRIPT_PATH"/builds/linux/oracle/8/
BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"}
BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl"
echo -e "\nCONFIRM: Build a Oracle Linux 8 Template for Proxmox?"
echo -e "\nContinue? (y/n)"
read -r REPLY
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi
### Build a Oracle Linux 8 Template for Proxmox. ###
echo "Building a Oracle Linux 8 Template for Proxmox..."
### Initialize HashiCorp Packer and required plugins. ###
echo "Initializing HashiCorp Packer and required plugins..."
packer init "$INPUT_PATH"
### Start the Build. ###
echo "Starting the build...."
echo "packer build -force -on-error=ask $debug_option"
packer build -force -on-error=ask $debug_option \
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
-var-file="$CONFIG_PATH/$BUILD_VARS" \
"$INPUT_PATH"
### All done. ###
echo "Done."
}
menu_option_12() {
INPUT_PATH="$SCRIPT_PATH"/builds/linux/rocky/10/
BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"}
BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl"
echo -e "\nCONFIRM: Build a Rocky Linux 10 Template for Proxmox?"
echo -e "\nContinue? (y/n)"
read -r REPLY
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi
### Build a Rocky Linux 10 for Proxmox. ###
echo "Building a Rocky Linux 10 for Proxmox..."
### Initialize HashiCorp Packer and required plugins. ###
echo "Initializing HashiCorp Packer and required plugins..."
packer init "$INPUT_PATH"
### Start the Build. ###
echo "Starting the build...."
echo "packer build -force -on-error=ask $debug_option"
packer build -force -on-error=ask $debug_option \
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
-var-file="$CONFIG_PATH/$BUILD_VARS" \
"$INPUT_PATH"
### All done. ###
echo "Done."
}
menu_option_13() {
INPUT_PATH="$SCRIPT_PATH"/builds/linux/rocky/9/
BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"}
BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl"
echo -e "\nCONFIRM: Build a Rocky Linux 9 Template for Proxmox?"
echo -e "\nContinue? (y/n)"
read -r REPLY
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi
### Build a Rocky Linux 9 for Proxmox. ###
echo "Building a Rocky Linux 9 for Proxmox..."
### Initialize HashiCorp Packer and required plugins. ###
echo "Initializing HashiCorp Packer and required plugins..."
packer init "$INPUT_PATH"
### Start the Build. ###
echo "Starting the build...."
echo "packer build -force -on-error=ask $debug_option"
packer build -force -on-error=ask $debug_option \
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
-var-file="$CONFIG_PATH/$BUILD_VARS" \
"$INPUT_PATH"
### All done. ###
echo "Done."
}
menu_option_14() {
INPUT_PATH="$SCRIPT_PATH"/builds/linux/rocky/8/
BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"}
BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl"
echo -e "\nCONFIRM: Build a Rocky Linux 8 Template for Proxmox?"
echo -e "\nContinue? (y/n)"
read -r REPLY
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi
### Build a Rocky Linux 8 for Proxmox. ###
echo "Building a Rocky Linux 8 for Proxmox..."
### Initialize HashiCorp Packer and required plugins. ###
echo "Initializing HashiCorp Packer and required plugins..."
packer init "$INPUT_PATH"
### Start the Build. ###
echo "Starting the build...."
echo "packer build -force -on-error=ask $debug_option"
packer build -force -on-error=ask $debug_option \
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
-var-file="$CONFIG_PATH/$BUILD_VARS" \
"$INPUT_PATH"
### All done. ###
echo "Done."
}
menu_option_15() {
INPUT_PATH="$SCRIPT_PATH"/builds/linux/ubuntu/25-04-lts/
BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"}
BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl"
echo -e "\nCONFIRM: Build a Ubuntu Server 25.04 LTS Template for Proxmox?"
echo -e "\nContinue? (y/n)"
read -r REPLY
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi
### Build a Ubuntu Server 25.04 LTS Template for Proxmox. ###
echo "Building a Ubuntu Server 25.04 LTS Template for Proxmox..."
### Initialize HashiCorp Packer and required plugins. ###
echo "Initializing HashiCorp Packer and required plugins..."
packer init "$INPUT_PATH"
### Start the Build. ###
echo "Starting the build...."
echo "packer build -force -on-error=ask $debug_option"
packer build -force -on-error=ask $debug_option \
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
-var-file="$CONFIG_PATH/$BUILD_VARS" \
"$INPUT_PATH"
### All done. ###
echo "Done."
}
menu_option_16() {
INPUT_PATH="$SCRIPT_PATH"/builds/linux/ubuntu/24-04-lts/
BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"}
BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl"
echo -e "\nCONFIRM: Build a Ubuntu Server 24.04 LTS Template for Proxmox?"
echo -e "\nContinue? (y/n)"
read -r REPLY
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi
### Build a Ubuntu Server 24.04 LTS Template for Proxmox. ###
echo "Building a Ubuntu Server 24.04 LTS Template for Proxmox..."
### Initialize HashiCorp Packer and required plugins. ###
echo "Initializing HashiCorp Packer and required plugins..."
packer init "$INPUT_PATH"
### Start the Build. ###
echo "Starting the build...."
echo "packer build -force -on-error=ask $debug_option"
packer build -force -on-error=ask $debug_option \
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
-var-file="$CONFIG_PATH/$BUILD_VARS" \
"$INPUT_PATH"
### All done. ###
echo "Done."
}
menu_option_17() {
INPUT_PATH="$SCRIPT_PATH"/builds/linux/ubuntu/22-04-lts/
BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"}
BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl"
echo -e "\nCONFIRM: Build a Ubuntu Server 22.04 LTS Template for Proxmox?"
echo -e "\nContinue? (y/n)"
read -r REPLY
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi
### Build a Ubuntu Server 22.04 LTS Template for Proxmox. ###
echo "Building a Ubuntu Server 22.04 LTS Template for Proxmox..."
### Initialize HashiCorp Packer and required plugins. ###
echo "Initializing HashiCorp Packer and required plugins..."
packer init "$INPUT_PATH"
### Start the Build. ###
echo "Starting the build...."
echo "packer build -force -on-error=ask $debug_option"
packer build -force -on-error=ask $debug_option \
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
-var-file="$CONFIG_PATH/$BUILD_VARS" \
"$INPUT_PATH"
### All done. ###
echo "Done."
}
menu_option_18() {
INPUT_PATH="$SCRIPT_PATH"/builds/linux/ubuntu/20-04-lts/
BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"}
BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl"
echo -e "\nCONFIRM: Build a Ubuntu Server 20.04 LTS Template for Proxmox?"
echo -e "\nContinue? (y/n)"
read -r REPLY
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi
### Build a Ubuntu Server 20.04 LTS Template for Proxmox. ###
echo "Building a Ubuntu Server 20.04 LTS Template for Proxmox..."
### Initialize HashiCorp Packer and required plugins. ###
echo "Initializing HashiCorp Packer and required plugins..."
packer init "$INPUT_PATH"
### Start the Build. ###
echo "Starting the build...."
echo "packer build -force -on-error=ask $debug_option"
packer build -force -on-error=ask $debug_option \
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
-var-file="$CONFIG_PATH/linux-storage.pkrvars.hcl" \
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
-var-file="$CONFIG_PATH/$BUILD_VARS" \
"$INPUT_PATH"
### All done. ###
echo "Done."
}
menu_option_19() {
INPUT_PATH="$SCRIPT_PATH"/builds/windows/desktop/11/
BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"}
BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl"
echo -e "\nCONFIRM: Build all Windows 11 Templates for Proxmox?"
echo -e "\nContinue? (y/n)"
read -r REPLY
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi
### Build all Windows 11 Templates for Proxmox. ###
echo "Building all Windows 11 Templates for Proxmox..."
### Initialize HashiCorp Packer and required plugins. ###
echo "Initializing HashiCorp Packer and required plugins..."
packer init "$INPUT_PATH"
### Start the Build. ###
echo "Starting the build...."
echo "packer build -force -on-error=ask $debug_option"
packer build -force -on-error=ask $debug_option \
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
-var-file="$CONFIG_PATH/$BUILD_VARS" \
"$INPUT_PATH"
### All done. ###
echo "Done."
}
menu_option_20() {
INPUT_PATH="$SCRIPT_PATH"/builds/windows/desktop/11/
BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"}
BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl"
echo -e "\nCONFIRM: Build a Windows 11 - Enterprise Template for Proxmox?"
echo -e "\nContinue? (y/n)"
read -r REPLY
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi
### Build a Windows 11 - Enterprise Template for Proxmox. ###
echo "Building a Windows 11 - Enterprise Template for Proxmox..."
### Initialize HashiCorp Packer and required plugins. ###
echo "Initializing HashiCorp Packer and required plugins..."
packer init "$INPUT_PATH"
### Start the Build. ###
echo "Starting the build...."
echo "packer build -force -on-error=ask $debug_option"
packer build -force -on-error=ask $debug_option \
--only proxmox-iso.windows-desktop-ent \
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
-var-file="$CONFIG_PATH/$BUILD_VARS" \
"$INPUT_PATH"
### All done. ###
echo "Done."
}
menu_option_21() {
INPUT_PATH="$SCRIPT_PATH"/builds/windows/desktop/11/
BUILD_PATH=${INPUT_PATH#"${SCRIPT_PATH}/builds/"}
BUILD_VARS="$(echo "${BUILD_PATH%/}" | tr -s '/' | tr '/' '-').pkrvars.hcl"
echo -e "\nCONFIRM: Build a Windows 11 - Professional Template for Proxmox?"
echo -e "\nContinue? (y/n)"
read -r REPLY
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi
### Build a Windows 11 - Professional Templates for Proxmox. ###
echo "Building a Windows 11 - Professional Template for Proxmox..."
### Initialize HashiCorp Packer and required plugins. ###
echo "Initializing HashiCorp Packer and required plugins..."
packer init "$INPUT_PATH"
### Start the Build. ###
echo "Starting the build...."
echo "packer build -force -on-error=ask $debug_option"
packer build -force -on-error=ask $debug_option \
--only proxmox-iso.windows-desktop-pro \
-var-file="$CONFIG_PATH/ansible.pkrvars.hcl" \
-var-file="$CONFIG_PATH/build.pkrvars.hcl" \
-var-file="$CONFIG_PATH/common.pkrvars.hcl" \
-var-file="$CONFIG_PATH/network.pkrvars.hcl" \
-var-file="$CONFIG_PATH/proxmox.pkrvars.hcl" \
-var-file="$CONFIG_PATH/$BUILD_VARS" \
"$INPUT_PATH"
### All done. ###
echo "Done."
} }
press_enter() { press_enter() {
@@ -839,11 +170,17 @@ info() {
read -r read -r
} }
incorrect_selection() { quit_program() {
echo "Invalid selection, please try again." echo "Exiting..."
exit 0
} }
until [ "$selection" = "0" ]; do read_selection() {
read -rp "Selection: " input
echo "${input^^}" # always uppercase
}
display_menu() {
clear clear
echo "" echo ""
echo " ____ __ ____ " echo " ____ __ ____ "
@@ -857,61 +194,18 @@ until [ "$selection" = "0" ]; do
echo -n " Select a HashiCorp Packer build for your hypervisor:" echo -n " Select a HashiCorp Packer build for your hypervisor:"
echo "" echo ""
echo "" echo ""
echo " Linux Distribution:"
for key in $(printf "%s\n" "${!MENU_ITEMS[@]}" | sort -n 2>/dev/null); do
IFS='|' read -r label _ <<< "${MENU_ITEMS[$key]}"
printf " %2s - %s\n" "$key" "$label"
done
echo "" echo ""
echo " 1 - AlmaLinux 10" selection=$(read_selection)
echo " 2 - AlmaLinux 9" }
echo " 3 - AlmaLinux 8"
echo " 4 - CentOS 10 Stream" while true; do
echo " 5 - CentOS 9 Stream" display_menu
echo " 6 - Debian 12" dispatch_selection
echo " 7 - Debian 11"
echo " 8 - OpenSUSE Leap 15.6"
echo " 9 - OpenSUSE Leap 15.5"
echo " 10 - Oracle Linux 9"
echo " 11 - Oracle Linux 8"
echo " 12 - Rocky Linux 10"
echo " 13 - Rocky Linux 9"
echo " 14 - Rocky Linux 8"
echo " 15 - Ubuntu Server 25.04 LTS"
echo " 16 - Ubuntu Server 24.04 LTS"
echo " 17 - Ubuntu Server 22.04 LTS"
echo " 18 - Ubuntu Server 20.04 LTS"
echo " 19 - Windows 11 - All"
echo " 20 - Windows 11 - Enterprise Only"
echo " 21 - Windows 11 - Professional Only"
echo "" echo ""
echo " Other:" read -rp "Press enter to continue..."
echo ""
echo " I - Information"
echo " Q - Quit"
echo ""
read -r selection
echo ""
case $selection in
1 ) clear ; menu_option_1 ; press_enter ;;
2 ) clear ; menu_option_2 ; press_enter ;;
3 ) clear ; menu_option_3 ; press_enter ;;
4 ) clear ; menu_option_4 ; press_enter ;;
5 ) clear ; menu_option_5 ; press_enter ;;
6 ) clear ; menu_option_6 ; press_enter ;;
7 ) clear ; menu_option_7 ; press_enter ;;
8 ) clear ; menu_option_8 ; press_enter ;;
9 ) clear ; menu_option_9 ; press_enter ;;
10) clear ; menu_option_10 ; press_enter ;;
11) clear ; menu_option_11 ; press_enter ;;
12) clear ; menu_option_12 ; press_enter ;;
13) clear ; menu_option_13 ; press_enter ;;
14) clear ; menu_option_14 ; press_enter ;;
15) clear ; menu_option_15 ; press_enter ;;
16) clear ; menu_option_16 ; press_enter ;;
17) clear ; menu_option_17 ; press_enter ;;
18) clear ; menu_option_18 ; press_enter ;;
19) clear ; menu_option_19 ; press_enter ;;
20) clear ; menu_option_20 ; press_enter ;;
21) clear ; menu_option_21 ; press_enter ;;
[Ii] ) clear ; info ; press_enter ;;
[Qq] ) clear ; exit ;;
* ) clear ; incorrect_selection ; press_enter ;;
esac
done done
@@ -142,7 +142,6 @@ source "proxmox-iso" "linux-almalinux" {
ssh_username = "${var.build_username}" ssh_username = "${var.build_username}"
ssh_password = "${var.build_password}" ssh_password = "${var.build_password}"
ssh_timeout = "${var.timeout}" ssh_timeout = "${var.timeout}"
ssh_port = "22"
qemu_agent = true qemu_agent = true
network_adapters { network_adapters {
@@ -142,7 +142,6 @@ source "proxmox-iso" "linux-almalinux" {
ssh_username = "${var.build_username}" ssh_username = "${var.build_username}"
ssh_password = "${var.build_password}" ssh_password = "${var.build_password}"
ssh_timeout = "${var.timeout}" ssh_timeout = "${var.timeout}"
ssh_port = "22"
qemu_agent = true qemu_agent = true
network_adapters { network_adapters {
@@ -142,7 +142,6 @@ source "proxmox-iso" "linux-almalinux" {
ssh_username = "${var.build_username}" ssh_username = "${var.build_username}"
ssh_password = "${var.build_password}" ssh_password = "${var.build_password}"
ssh_timeout = "${var.timeout}" ssh_timeout = "${var.timeout}"
ssh_port = "22"
qemu_agent = true qemu_agent = true
network_adapters { network_adapters {
@@ -141,7 +141,6 @@ source "proxmox-iso" "linux-centos-stream" {
ssh_username = "${var.build_username}" ssh_username = "${var.build_username}"
ssh_password = "${var.build_password}" ssh_password = "${var.build_password}"
ssh_timeout = "${var.timeout}" ssh_timeout = "${var.timeout}"
ssh_port = "22"
qemu_agent = true qemu_agent = true
network_adapters { network_adapters {
@@ -141,7 +141,6 @@ source "proxmox-iso" "linux-centos-stream" {
ssh_username = "${var.build_username}" ssh_username = "${var.build_username}"
ssh_password = "${var.build_password}" ssh_password = "${var.build_password}"
ssh_timeout = "${var.timeout}" ssh_timeout = "${var.timeout}"
ssh_port = "22"
qemu_agent = true qemu_agent = true
network_adapters { network_adapters {
@@ -164,7 +164,6 @@ source "proxmox-iso" "debian" {
ssh_username = "${var.build_username}" ssh_username = "${var.build_username}"
ssh_password = "${var.build_password}" ssh_password = "${var.build_password}"
ssh_timeout = "${var.timeout}" ssh_timeout = "${var.timeout}"
ssh_port = "22"
qemu_agent = true qemu_agent = true
network_adapters { network_adapters {
@@ -29,8 +29,8 @@ vm_network_card_model = "virtio"
// Removable Media Settings // Removable Media Settings
iso_path = "iso" iso_path = "iso"
iso_file = "debian-11.8.0-amd64-netinst.iso" iso_file = "debian-11.11.0-amd64-netinst.iso"
iso_checksum = "d7a74813a734083df30c8d35784926deaa36bc41e5c0766388e9f591ab056b72" iso_checksum = "file:https://get.debian.org/images/archive/11.11.0/amd64/iso-cd/SHA512SUMS"
// Boot Settings // Boot Settings
vm_boot = "order=virtio0;ide2;net0" vm_boot = "order=virtio0;ide2;net0"
@@ -163,7 +163,6 @@ source "proxmox-iso" "debian" {
ssh_username = "${var.build_username}" ssh_username = "${var.build_username}"
ssh_password = "${var.build_password}" ssh_password = "${var.build_password}"
ssh_timeout = "${var.timeout}" ssh_timeout = "${var.timeout}"
ssh_port = "22"
qemu_agent = true qemu_agent = true
network_adapters { network_adapters {
@@ -29,8 +29,8 @@ vm_network_card_model = "virtio"
// Removable Media Settings // Removable Media Settings
iso_path = "iso" iso_path = "iso"
iso_file = "debian-12.2.0-amd64-netinst.iso" iso_file = "debian-12.12.0-amd64-netinst.iso"
iso_checksum = "file:https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/SHA512SUMS" iso_checksum = "file:https://cdimage.debian.org/images/archive/12.12.0/amd64/iso-cd/SHA512SUMS"
// Boot Settings // Boot Settings
vm_boot = "order=virtio0;ide2;net0" vm_boot = "order=virtio0;ide2;net0"
@@ -0,0 +1,9 @@
d-i netcfg/choose_interface select ${device}
%{ if ip != null ~}
d-i netcfg/disable_autoconfig boolean true
d-i netcfg/get_ipaddress string ${ip}
d-i netcfg/get_netmask string ${cidrnetmask("${ip}/${netmask}")}
d-i netcfg/get_gateway string ${gateway}
d-i netcfg/get_nameservers string ${join(" ", dns)}
d-i netcfg/confirm_static boolean true
%{ endif ~}
@@ -0,0 +1,94 @@
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# Debian 13 (Trixie) Preseed File
# https://www.debian.org/releases/bullseye/amd64/
# Locale and Keyboard
d-i debian-installer/locale string ${vm_os_language}
d-i keyboard-configuration/xkb-keymap select ${vm_os_keyboard}
# Clock and Timezone
d-i clock-setup/utc boolean true
d-i clock-setup/ntp boolean true
d-i time/zone string ${vm_os_timezone}
# Grub and Reboot Message
d-i finish-install/reboot_in_progress note
d-i grub-installer/only_debian boolean true
# Partitioning
${storage}
# Network configuration
${network}
### Apt setup
# Choose, if you want to scan additional installation media
# (default: false).
d-i apt-setup/cdrom/set-first boolean false
# You can choose to install non-free firmware.
#d-i apt-setup/non-free-firmware boolean true
# You can choose to install non-free and contrib software.
#d-i apt-setup/non-free boolean true
#d-i apt-setup/contrib boolean true
# Uncomment the following line, if you don't want to have the sources.list
# entry for a DVD/BD installation image active in the installed system
# (entries for netinst or CD images will be disabled anyway, regardless of
# this setting).
#d-i apt-setup/disable-cdrom-entries boolean true
# Uncomment this if you don't want to use a network mirror.
#d-i apt-setup/use_mirror boolean false
# Select which update services to use; define the mirrors to be used.
# Values shown below are the normal defaults.
#d-i apt-setup/services-select multiselect security, updates
#d-i apt-setup/security_host string security.debian.org
# Mirror settings
d-i mirror/country string manual
d-i mirror/http/hostname string cdn-fastly.deb.debian.org
d-i mirror/http/directory string /debian
d-i mirror/http/proxy string
# User Configuration
d-i passwd/root-login boolean false
d-i passwd/user-fullname string ${build_username}
d-i passwd/username string ${build_username}
d-i passwd/user-password-crypted password ${build_password_encrypted}
# Package Configuration
d-i pkgsel/run_tasksel boolean false
d-i pkgsel/include string openssh-server qemu-guest-agent python3-apt ${additional_packages}
# You can choose, if your system will report back on what software you have
# installed, and what software you use. The default is not to report back,
# but sending reports helps the project determine what software is most
# popular and should be included on the first CD/DVD.
popularity-contest popularity-contest/participate boolean false
### Boot loader installation
# Grub is the boot loader (for x86).
# This is fairly safe to set, it makes grub install automatically to the UEFI
# partition/boot record if no other operating system is detected on the machine.
d-i grub-installer/only_debian boolean true
# Avoid that last message about the install being complete.
d-i finish-install/reboot_in_progress note
# Post-install script
# - Add User to Sudoers
# - Remove lv_delete volume group
d-i preseed/late_command string \
echo '${build_username} ALL=(ALL) NOPASSWD: ALL' > /target/etc/sudoers.d/${build_username} ; \
in-target chmod 440 /etc/sudoers.d/${build_username}%{ if length(lvm) != 0 ~} ; \
lvremove -f /dev/%{ for volume_group in lvm ~}${volume_group.name}%{ endfor ~}/lv_delete > /dev/null 2>&1%{ endif }
%{ if common_data_source == "disk" ~}
# Umount preseed media early
d-i preseed/early_command string \
umount /media && echo 1 > /sys/block/sr1/device/delete ;
%{ endif ~}
@@ -0,0 +1,157 @@
%{~ if length(lvm) != 0 ~}
d-i partman-auto/method string lvm
d-i partman-auto-lvm/guided_size string max
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-lvm/device_remove_lvm boolean true
%{~ for volume_group in lvm ~}
d-i partman-auto-lvm/new_vg_name string ${volume_group.name}
%{~ endfor ~}
%{~ endif ~}
d-i partman-efi/non_efi_system boolean true
# Ensure the partition table is GPT - this is required for EFI
d-i partman-partitioning/choose_label select gpt
d-i partman-partitioning/default_label string gpt
# If there is only one partition defined and its name is 'autopart'
# then use auto partitioning
%{~ if length(partitions) == 1 && partitions[0].name == "autopart" ~}
d-i partman-auto/disk string /dev/${device}
%{~ if partitions[0].format.fstype == "lvm" ~}
d-i partman-auto/method string lvm
# You can define the amount of space that will be used for the LVM volume
# group. It can either be a size with its unit (eg. 20 GB), a percentage of
# free space or the 'max' keyword.
d-i partman-auto-lvm/guided_size string max
# If one of the disks that are going to be automatically partitioned
# contains an old LVM configuration, the user will normally receive a
# warning. This can be preseeded away...
d-i partman-lvm/device_remove_lvm boolean true
# And the same goes for the confirmation to write the lvm partitions.
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
%{~ endif ~}
%{~ if partitions[0].format.fstype == "simple" ~}
d-i partman-auto/method string regular
%{~ endif ~}
%{ if partitions[0].format.fstype == "" ~}
d-i partman-auto/method string regular
%{~ endif ~}
# You can choose one of the three predefined partitioning recipes:
# - atomic: all files in one partition
# - home: separate /home partition
# - multi: separate /home, /var, and /tmp partitions
d-i partman-auto/choose_recipe select atomic
%{~ else ~} # if length(partitions) == 1 && partitions[0].name == "autopart"
%{~ if swap == false ~}
d-i partman-basicfilesystems/no_swap boolean false
%{~ endif ~}
d-i partman-auto/expert_recipe string \
custom :: \
%{~ for partition in partitions ~}
%{~ if lookup(partition, "volume_group", "") == "" ~}
%{~ if partition.size != -1 ~}
${partition.size} ${partition.size} ${partition.size} ${partition.format.fstype} \
%{~ else ~}
100 100 -1 ${partition.format.fstype} \
%{~ endif ~}
$primary{ } \
%{~ if partition.mount.path == "/boot" ~}
$bootable{ } \
mountpoint{ /boot } \
method{ format } \
%{~ endif ~}
%{~ if partition.mount.path == "/boot/efi" ~}
mountpoint{ /boot/efi } \
method{ efi } \
%{~ endif ~}
%{~ if partition.mount.path != "/boot" && partition.mount.path != "/boot/efi" ~}
%{~ if partition.mount.path != "" ~}
mountpoint{ ${partition.mount.path} } \
%{~ endif ~}
method{ ${partition.format.fstype} } \
%{~ endif ~}
format{ } \
%{~ if partition.format.fstype != "swap" ~}
use_filesystem{ } \
%{~ if partition.format.fstype == "fat32" ~}
filesystem{ vfat } \
%{~ else ~}
filesystem{ ${partition.format.fstype} } \
%{~ endif ~}
%{~ endif ~}
label { ${partition.format.label} } \
%{~ for option in split(",", lookup(partition.mount, "options", "")) ~}
%{~ if option != "" ~}
options/${option}{ ${option} } \
%{~ endif ~}
%{~ endfor ~}
. \
%{~ else /* if lookup(partition, "volume_group", "") == "" */ ~}
%{~ for volume_group in lvm ~}
%{~ if volume_group.name == partition.volume_group ~}
%{~ for partition in volume_group.partitions ~}
%{ if partition.size != -1 ~}
%{ if partition.format.fstype == "swap" ~}
${partition.size} ${partition.size} ${partition.size} linux-swap \
%{~ else ~}
${partition.size} ${partition.size} ${partition.size} ${partition.format.fstype} \
%{~ endif ~}
%{~ else ~}
%{~ if partition.format.fstype != "swap" /* I don't know who would fill their disk with swap but it could happen */ ~}
100 100 -1 ${partition.format.fstype} \
%{~ else ~}
100 100 -1 linux-swap \
%{~ endif ~}
%{ endif ~}
$lvmok{ } \
%{~ if partition.mount.path != "" ~}
mountpoint{ ${partition.mount.path} } \
%{~ endif ~}
lv_name{ ${partition.name} } \
in_vg { ${volume_group.name} } \
%{~ if partition.format.fstype == "swap" ~}
method{ swap } \
%{~ else ~}
method{ format } \
%{~ endif ~}
format{ } \
%{~ if partition.format.fstype != "swap" ~}
use_filesystem{ } \
filesystem{ ${partition.format.fstype} } \
%{~ endif ~}
label { ${partition.format.label} } \
%{~ for option in split(",", lookup(partition.mount, "options", "")) ~}
%{~ if option != "" ~}
options/${option}{ ${option} } \
%{~ endif ~}
%{~ endfor ~}
. \
%{~ endfor /* partition in volume_group.partitions */ ~}
1024 1024 1024 ext4 \
method{ lvm } \
$lvmok{ } \
lv_name{ lv_delete } \
mountpoint{ /tmp/lv_delete } \
. \
%{~ endif /* volume_group.name == partition.volume_group */ ~}
%{~ endfor /* for volume_group in lvm */ ~}
%{~ endif /* if lookup(partition, "volume_group", "") == "" */ ~}
%{~ endfor /* for partition in partitions */ ~}
%{~ endif /* if length(partitions) == 1 && partitions[0].name == "autopart" */ ~}
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
# To make sure the machine can boot we install grub on the first harddisk:
d-i grub-installer/bootdev string /dev/${device}
+255
View File
@@ -0,0 +1,255 @@
/*
DESCRIPTION:
Debian 13 template using the Packer Builder for Proxmox (proxmox-iso).
*/
// BLOCK: packer
// The Packer configuration.
packer {
required_version = ">= 1.12.0"
required_plugins {
ansible = {
source = "github.com/hashicorp/ansible"
version = "~> 1"
}
git = {
version = ">= 0.6.2"
source = "github.com/ethanmdavidson/git"
}
proxmox = {
version = "= 1.2.1"
source = "github.com/hashicorp/proxmox"
}
}
}
// BLOCK: data
// Defines the data sources.
data "git-repository" "cwd" {}
// BLOCK: locals
// Defines the local variables.
locals {
bios_boot_command = [
"<wait><wait><wait><esc><wait><wait><wait>",
"/install.amd/vmlinuz ",
"initrd=/install.amd/initrd.gz ",
"auto=true ",
"${local.data_source_command} ",
// "hostname=${var.vm_os_name}-${var.vm_os_version} ",
"netcfg/get_hostname=debian netcfg/get_domain=example.com ",
"interface=auto ",
"vga=788 noprompt quiet --<enter>"
]
uefi_boot_command = [
// This waits for 3 seconds, sends the "c" key, and then waits for another 3 seconds. In the GRUB boot loader, this is used to enter command line mode.
"<wait3s>c<wait3s>",
// This types a command to load the Linux kernel from the specified path.
"linux /install.amd/vmlinuz",
// This types a string that sets the auto-install/enable option to true. This is used to automate the installation process.
" auto-install/enable=true",
// This types a string that sets the debconf/priority option to critical. This is used to minimize the number of questions asked during the installation process.
" debconf/priority=critical",
// This types the value of the 'data_source_command' local variable. This is used to specify the kickstart data source configured in the common variables.
" ${local.data_source_command}",
// This types a string that sets the noprompt option and then sends the "enter" key. This is used to prevent the installer from pausing for user input.
" noprompt --<enter>",
// This types a command to load the initial RAM disk from the specified path and then sends the "enter" key.
"initrd /install.amd/initrd.gz<enter>",
// This types the "boot" command and then sends the "enter" key. This starts the boot process using the loaded kernel and initial RAM disk.
"boot<enter>",
// This waits for 30 seconds. This is typically used to give the system time to boot before sending more commands.
"<wait30s>",
// This sends the "enter" key and then waits. This is typically used to dismiss any prompts or messages that appear during boot.
"<enter><wait>",
// This sends the "enter" key and then waits. This is typically used to dismiss any prompts or messages that appear during boot.
"<enter><wait>",
// This types the value of the `mount_cdrom` local variable. This is typically used to mount the installation media.
" ${local.mount_cdrom}",
// This sends four "down arrow" keys and then the "enter" key. This is typically used to select a specific option in a menu.
"<down><down><down><down><enter>"
]
build_by = "Built by: HashiCorp Packer ${packer.version}"
build_date = formatdate("DD-MM-YYYY hh:mm ZZZ", "${timestamp()}" )
build_version = data.git-repository.cwd.head
build_description = "Version: ${local.build_version}\nBuilt on: ${local.build_date}\n${local.build_by}\nCloud-Init: ${var.vm_cloudinit}"
vm_disk_type = var.vm_disk_type == "virtio" ? "vda" : "sda"
manifest_date = formatdate("YYYY-MM-DD hh:mm:ss", timestamp())
manifest_path = "${path.cwd}/manifests/"
manifest_output = "${local.manifest_path}${local.manifest_date}.json"
data_source_content = {
"/preseed.cfg" = templatefile("${abspath(path.root)}/data/preseed.pkrtpl.hcl", {
build_username = var.build_username
build_password = var.build_password
build_password_encrypted = var.build_password_encrypted
vm_disk_type = local.vm_disk_type
vm_os_language = var.vm_os_language
vm_os_keyboard = var.vm_os_keyboard
vm_os_timezone = var.vm_os_timezone
common_data_source = var.common_data_source
network = templatefile("${abspath(path.root)}/data/network.pkrtpl.hcl", {
device = var.vm_network_device
ip = var.vm_ip_address
netmask = var.vm_ip_netmask
gateway = var.vm_ip_gateway
dns = var.vm_dns_list
})
# lvm needs to be here so late commands can access vg names
lvm = var.vm_disk_lvm
storage = templatefile("${abspath(path.root)}/data/storage.pkrtpl.hcl", {
device = var.vm_disk_device
swap = var.vm_disk_use_swap
partitions = var.vm_disk_partitions
lvm = var.vm_disk_lvm
vm_bios = var.vm_bios
})
additional_packages = join(" ", var.additional_packages)
})
}
data_source_command = var.common_data_source == "http" ? "url=http://{{.HTTPIP}}:{{.HTTPPort}}/preseed.cfg" : "file=/media/preseed.cfg"
mount_cdrom_command = "<leftAltOn><f2><leftAltOff> <enter><wait> mount /dev/sr1 /media<enter> <leftAltOn><f1><leftAltOff>"
mount_cdrom = var.common_data_source == "http" ? " " : local.mount_cdrom_command
vm_name = "${var.vm_os_family}-${var.vm_os_name}-${var.vm_os_version}"
boot_command = var.vm_bios == "ovmf" ? local.uefi_boot_command : local.bios_boot_command
vm_bios = var.vm_bios == "ovmf" ? var.vm_firmware_path : null
}
// BLOCK: source
// Defines the builder configuration blocks.
source "proxmox-iso" "debian" {
// Proxmox Connection Settings and Credentials
proxmox_url = "https://${var.proxmox_hostname}:8006/api2/json"
username = "${var.proxmox_api_token_id}"
token = "${var.proxmox_api_token_secret}"
insecure_skip_tls_verify = "${var.proxmox_insecure_connection}"
// Proxmox Settings
node = "${var.proxmox_node}"
// Virtual Machine Settings
vm_name = "${local.vm_name}"
bios = "${var.vm_bios}"
sockets = "${var.vm_cpu_sockets}"
cores = "${var.vm_cpu_count}"
cpu_type = "${var.vm_cpu_type}"
memory = "${var.vm_mem_size}"
os = "${var.vm_os_type}"
scsi_controller = "${var.vm_disk_controller_type}"
disks {
disk_size = "${var.vm_disk_size}"
type = "${var.vm_disk_type}"
storage_pool = "${var.vm_storage_pool}"
format = "${var.vm_disk_format}"
}
dynamic "efi_config" {
for_each = var.vm_bios == "ovmf" ? [1] : []
content {
efi_storage_pool = var.vm_bios == "ovmf" ? var.vm_efi_storage_pool : null
efi_type = var.vm_bios == "ovmf" ? var.vm_efi_type : null
pre_enrolled_keys = var.vm_bios == "ovmf" ? var.vm_efi_pre_enrolled_keys : null
}
}
ssh_username = "${var.build_username}"
ssh_password = "${var.build_password}"
ssh_timeout = "${var.timeout}"
ssh_port = "22"
qemu_agent = true
network_adapters {
bridge = "${var.vm_bridge_interface}"
model = "${var.vm_network_card_model}"
vlan_tag = "${var.vm_vlan_tag}"
}
// Removable Media Settings
http_content = "${var.common_data_source}" == "http" ? "${local.data_source_content}" : null
// Boot and Provisioning Settings
http_interface = var.common_data_source == "http" ? var.common_http_interface : null
http_bind_address = var.common_data_source == "http" ? var.common_http_bind_address : null
http_port_min = var.common_data_source == "http" ? var.common_http_port_min : null
http_port_max = var.common_data_source == "http" ? var.common_http_port_max : null
boot = var.vm_boot
boot_wait = var.vm_boot_wait
boot_command = local.boot_command
boot_iso {
iso_file = "${var.common_iso_storage}:${var.iso_path}/${var.iso_file}"
unmount = true
iso_checksum = "${var.iso_checksum}"
}
dynamic "additional_iso_files" {
for_each = var.common_data_source == "disk" ? [1] : []
content {
cd_files = var.common_data_source == "disk" ? local.data_source_content : null
cd_label = var.common_data_source == "disk" ? "cidata" : null
iso_storage_pool = var.common_data_source == "disk" ? "local" : null
}
}
template_name = "${local.vm_name}"
template_description = "${local.build_description}"
# VM Cloud Init Settings
cloud_init = var.vm_cloudinit
cloud_init_storage_pool = var.vm_cloudinit == true ? var.vm_storage_pool : null
}
# Build Definition to create the VM Template
build {
sources = ["source.proxmox-iso.debian"]
provisioner "ansible" {
user = var.build_username
galaxy_file = "${path.cwd}/ansible/linux-requirements.yml"
galaxy_force_with_deps = true
playbook_file = "${path.cwd}/ansible/linux-playbook.yml"
roles_path = "${path.cwd}/ansible/roles"
ansible_env_vars = [
"ANSIBLE_CONFIG=${path.cwd}/ansible/ansible.cfg",
"ANSIBLE_PYTHON_INTERPRETER=/usr/bin/python3"
]
extra_arguments = [
"--extra-vars", "display_skipped_hosts=false",
"--extra-vars", "build_username=${var.build_username}",
"--extra-vars", "build_key='${var.build_key}'",
"--extra-vars", "ansible_username=${var.ansible_username}",
"--extra-vars", "ansible_key='${var.ansible_key}'",
"--extra-vars", "enable_cloudinit='${var.vm_cloudinit}'",
]
}
post-processor "manifest" {
output = local.manifest_output
strip_path = true
strip_time = true
custom_data = {
ansible_username = "${var.ansible_username}"
build_username = "${var.build_username}"
build_date = "${local.build_date}"
build_version = "${local.build_version}"
common_data_source = "${var.common_data_source}"
vm_cpu_sockets = "${var.vm_cpu_sockets}"
vm_cpu_count = "${var.vm_cpu_count}"
vm_disk_size = "${var.vm_disk_size}"
vm_bios = "${var.vm_bios}"
vm_os_type = "${var.vm_os_type}"
vm_mem_size = "${var.vm_mem_size}"
vm_network_card_model = "${var.vm_network_card_model}"
vm_cloudinit = "${var.vm_cloudinit}"
}
}
}
@@ -0,0 +1,40 @@
/*
DESCRIPTION:
Debian 13 variables used by the Packer Plugin for Proxmox (proxmox-iso).
*/
// Guest Operating System Metadata
vm_os_language = "en_US"
vm_os_keyboard = "us"
vm_os_timezone = "UTC"
vm_os_family = "linux"
vm_os_name = "debian"
vm_os_version = "13"
// Virtual Machine Guest Operating System Setting
vm_os_type = "l26"
vm_cloudinit = true
// Virtual Machine Hardware Settings
vm_bios = "ovmf"
vm_cpu_count = 1
vm_cpu_sockets = 1
vm_cpu_type = "kvm64"
vm_mem_size = 2048
vm_disk_type = "virtio"
vm_disk_size = "32G"
vm_disk_format = "raw"
vm_disk_controller_type = "virtio-scsi-pci"
vm_network_card_model = "virtio"
// Removable Media Settings
iso_path = "iso"
iso_file = "debian-13.2.0-amd64-netinst.iso"
iso_checksum = "file:https://cdimage.debian.org/debian-cd/13.2.0/amd64/iso-cd/SHA512SUMS"
// Boot Settings
vm_boot = "order=virtio0;ide2;net0"
vm_boot_wait = "5s"
// EFI Settings
vm_firmware_path = "./OVMF.fd"
@@ -0,0 +1,36 @@
/*
DESCRIPTION:
Debian Linux 13 network variables used by the Packer Plugin for VMware vSphere (vsphere-iso).
*/
// VM Network Settings
variable "vm_network_device" {
type = string
description = "The network device of the VM."
default = "ens192"
}
variable "vm_ip_address" {
type = string
description = "The IP address of the VM (e.g. 172.16.100.192)."
default = null
}
variable "vm_ip_netmask" {
type = number
description = "The netmask of the VM (e.g. 24)."
default = null
}
variable "vm_ip_gateway" {
type = string
description = "The gateway of the VM (e.g. 172.16.100.1)."
default = null
}
variable "vm_dns_list" {
type = list(string)
description = "The nameservers of the VM."
default = []
}
@@ -0,0 +1,53 @@
/*
DESCRIPTION:
Debian 13 storage variables used by the Packer Plugin for Proxmox (proxmox-iso).
*/
// VM Storage Settings
variable "vm_disk_device" {
type = string
description = "The device for the virtual disk. (e.g. 'sda')"
}
variable "vm_disk_use_swap" {
type = bool
description = "Whether to use a swap partition."
}
variable "vm_disk_partitions" {
type = list(object({
name = string
size = number
format = object({
label = string
fstype = string
})
mount = object({
path = string
options = string
})
volume_group = string
}))
description = "The disk partitions for the virtual disk."
}
variable "vm_disk_lvm" {
type = list(object({
name = string
partitions = list(object({
name = string
size = number
format = object({
label = string
fstype = string
})
mount = object({
path = string
options = string
})
}))
}))
description = "The LVM configuration for the virtual disk."
default = []
}
+313
View File
@@ -0,0 +1,313 @@
/*
DESCRIPTION:
Debian 13 variables using the Packer Builder for Proxmox (proxmox-iso).
*/
// BLOCK: variable
// Defines the input variables.
// Proxmox Credentials
variable "proxmox_hostname" {
type = string
description = "The FQDN or IP address of a Proxmox node. Only one node should be specified in a cluster."
}
variable "proxmox_api_token_id" {
type = string
description = "The token to login to the Proxmox node/cluster. The format is USER@REALM!TOKENID. (e.g. packer@pam!packer_pve_token)"
}
variable "proxmox_api_token_secret" {
type = string
description = "The secret for the API token used to login to the Proxmox API."
# sensitive = true
}
variable "proxmox_insecure_connection" {
description = "true/false to skip Proxmox TLS certificate checks."
type = bool
default = true
}
// Proxmox Settings
variable "proxmox_node" {
type = string
description = "The name of the Proxmox node that Packer will build templates on."
}
// Virtual Machine Settings
variable "vm_os_language" {
type = string
description = "The guest operating system language."
default = "en_US"
}
variable "vm_os_keyboard" {
type = string
description = "The guest operating system keyboard layout."
default = "us"
}
variable "vm_os_timezone" {
type = string
description = "The guest operating system timezone."
default = "UTC"
}
variable "vm_os_family" {
type = string
description = "The guest operating system family. Used for naming. (e.g. 'linux')"
}
variable "vm_os_name" {
type = string
description = "The guest operating system name. Used for naming. (e.g. 'ubuntu')"
}
variable "vm_os_version" {
type = string
description = "The guest operating system version. Used for naming. (e.g. '22-04-lts')"
}
variable "vm_os_type" {
type = string
description = "The guest operating system type. (e.g. 'l26')"
}
variable "vm_bios" {
type = string
description = "The firmware type. Allowed values 'ovmf' or 'seabios'"
default = "ovmf"
validation {
condition = contains(["ovmf", "seabios"], var.vm_bios)
error_message = "The vm_bios value must be 'ovmf' or 'seabios'."
}
}
variable "vm_firmware_path" {
type = string
description = "The firmware file to be used. Needed for EFI"
default = "/usr/share/ovmf/OVMF.fd"
}
variable "vm_efi_storage_pool" {
type = string
description = "Set the UEFI disk storage location. (e.g. 'local-lvm')"
default = "local-lvm"
}
variable "vm_efi_type" {
type = string
description = "Specifies the version of the OVMF firmware to be used. (e.g. '4m')"
default = "4m"
}
variable "vm_efi_pre_enrolled_keys" {
type = bool
description = "Whether Microsoft Standard Secure Boot keys should be pre-loaded on the EFI disk. (e.g. false)"
default = false
}
variable "vm_cpu_count" {
type = number
description = "The number of virtual CPUs. (e.g. '2')"
}
variable "vm_cpu_sockets" {
type = number
description = "The number of virtual CPU sockets. (e.g. '1')"
}
variable "vm_cpu_type" {
type = string
description = "The CPU type to emulate. See the Proxmox API documentation for the complete list of accepted values. For best performance, set this to host. Defaults to kvm64."
}
variable "vm_mem_size" {
type = number
description = "The size for the virtual memory in MB. (e.g. '2048')"
}
variable "vm_disk_controller_type" {
type = string
description = "The SCSI controller model to emulate. (e.g. 'virtio-scsi-pci')"
}
variable "vm_disk_type" {
type = string
description = "The type of disk to emulate. (e.g. 'virtio')"
}
variable "vm_storage_pool" {
type = string
description = "The name of the Proxmox storage pool to store the VM template. (e.g. 'local-lvm')"
}
variable "vm_disk_size" {
type = string
description = "The size for the virtual disk in GB. (e.g. '32G')"
}
variable "vm_disk_format" {
type = string
description = "The format of the file backing the disk. (e.g. 'qcow2')"
}
variable "vm_network_card_model" {
type = string
description = "The model of the virtual network adapter to emulate. (e.g. 'virtio')"
}
variable "vm_bridge_interface" {
type = string
description = "The name of the Proxmox bridge to attach the adapter to."
}
variable "vm_vlan_tag" {
type = string
description = "If the adapter should tag packets, give the VLAN ID. (e.g. '102')"
}
// Cloud-Init Settings
variable "vm_cloudinit" {
type = bool
description = "Enable or disable cloud-init drive in Proxmox. (e.g. false)"
default = false
}
// Removable Media Settings
variable "common_iso_storage" {
type = string
description = "The name of the source Proxmox storage location for ISO images. (e.g. 'local-lvm')"
}
variable "iso_path" {
type = string
description = "The path on the source Proxmox storage location for ISO images. (e.g. 'iso')"
}
variable "iso_file" {
type = string
description = "The file name of the ISO image used by the vendor. (e.g. 'ubuntu-<version>-live-server-amd64.iso')"
}
variable "iso_checksum" {
type = string
description = "The checksum value of the ISO image provided by the vendor."
}
// Boot Settings
variable "common_data_source" {
type = string
description = "The provisioning data source. (e.g. 'http' or 'disk')"
}
variable "common_http_bind_address" {
type = string
description = "Define an IP address on the host to use for the HTTP server."
default = null
}
variable "common_http_interface" {
type = string
description = "Name of the network interface that Packer gets HTTPIP from. Defaults to the first non loopback interface."
default = null
}
variable "common_http_port_min" {
type = number
description = "The start of the HTTP port range."
}
variable "common_http_port_max" {
type = number
description = "The end of the HTTP port range."
}
variable "vm_boot" {
type = string
description = "The boot order for virtual machine devices. (e.g. 'order=virtio0;ide2;net0')"
}
variable "vm_boot_wait" {
type = string
description = "The time to wait after booting the initial VM before typing the boot_command (e.g '10s')"
}
variable "common_ip_wait_timeout" {
type = string
description = "Time to wait for guest operating system IP address response."
}
variable "common_shutdown_timeout" {
type = string
description = "Time to wait for guest operating system shutdown."
}
// Communicator Settings and Credentials
variable "build_username" {
type = string
description = "The username to login to the guest operating system. (e.g. 'ubuntu')"
# sensitive = true
}
variable "build_password" {
type = string
description = "The password to login to the guest operating system."
# sensitive = true
}
variable "build_password_encrypted" {
type = string
description = "The encrypted password to login to the guest operating system."
# sensitive = true
}
variable "build_key" {
type = string
description = "The SSH public key to login to the guest operating system."
# sensitive = true
}
variable "timeout" {
description = "not sure why I need so high a timeout but here we are"
default = "90m"
}
// Ansible Credentials
variable "ansible_username" {
type = string
description = "The username for Ansible to login to the guest operating system. (e.g. 'ansible')"
# sensitive = true
}
variable "ansible_key" {
type = string
description = "The public key for Ansible to login to the guest operating system."
# sensitive = true
}
// HCP Packer Settings
variable "common_hcp_packer_registry_enabled" {
type = bool
description = "Enable the HCP Packer registry."
default = false
}
// Additional Settings
variable "additional_packages" {
type = list(string)
description = "Additional packages to install."
default = []
}
@@ -146,7 +146,6 @@ source "proxmox-iso" "linux-opensuse-leap" {
ssh_username = "${var.build_username}" ssh_username = "${var.build_username}"
ssh_password = "${var.build_password}" ssh_password = "${var.build_password}"
ssh_timeout = "${var.timeout}" ssh_timeout = "${var.timeout}"
ssh_port = "22"
qemu_agent = true qemu_agent = true
network_adapters { network_adapters {
@@ -139,7 +139,6 @@ source "proxmox-iso" "linux-opensuse-leap" {
ssh_username = "${var.build_username}" ssh_username = "${var.build_username}"
ssh_password = "${var.build_password}" ssh_password = "${var.build_password}"
ssh_timeout = "${var.timeout}" ssh_timeout = "${var.timeout}"
ssh_port = "22"
qemu_agent = true qemu_agent = true
network_adapters { network_adapters {
@@ -142,7 +142,6 @@ source "proxmox-iso" "linux-oracle" {
ssh_username = "${var.build_username}" ssh_username = "${var.build_username}"
ssh_password = "${var.build_password}" ssh_password = "${var.build_password}"
ssh_timeout = "${var.timeout}" ssh_timeout = "${var.timeout}"
ssh_port = "22"
qemu_agent = true qemu_agent = true
network_adapters { network_adapters {
@@ -142,7 +142,6 @@ source "proxmox-iso" "linux-oracle" {
ssh_username = "${var.build_username}" ssh_username = "${var.build_username}"
ssh_password = "${var.build_password}" ssh_password = "${var.build_password}"
ssh_timeout = "${var.timeout}" ssh_timeout = "${var.timeout}"
ssh_port = "22"
qemu_agent = true qemu_agent = true
network_adapters { network_adapters {
@@ -142,7 +142,6 @@ source "proxmox-iso" "linux-rocky" {
ssh_username = "${var.build_username}" ssh_username = "${var.build_username}"
ssh_password = "${var.build_password}" ssh_password = "${var.build_password}"
ssh_timeout = "${var.timeout}" ssh_timeout = "${var.timeout}"
ssh_port = "22"
qemu_agent = true qemu_agent = true
network_adapters { network_adapters {
-1
View File
@@ -142,7 +142,6 @@ source "proxmox-iso" "linux-rocky" {
ssh_username = "${var.build_username}" ssh_username = "${var.build_username}"
ssh_password = "${var.build_password}" ssh_password = "${var.build_password}"
ssh_timeout = "${var.timeout}" ssh_timeout = "${var.timeout}"
ssh_port = "22"
qemu_agent = true qemu_agent = true
network_adapters { network_adapters {
-1
View File
@@ -142,7 +142,6 @@ source "proxmox-iso" "linux-rocky" {
ssh_username = "${var.build_username}" ssh_username = "${var.build_username}"
ssh_password = "${var.build_password}" ssh_password = "${var.build_password}"
ssh_timeout = "${var.timeout}" ssh_timeout = "${var.timeout}"
ssh_port = "22"
qemu_agent = true qemu_agent = true
network_adapters { network_adapters {
@@ -149,7 +149,6 @@ source "proxmox-iso" "ubuntu" {
ssh_username = "${var.build_username}" ssh_username = "${var.build_username}"
ssh_password = "${var.build_password}" ssh_password = "${var.build_password}"
ssh_timeout = "${var.timeout}" ssh_timeout = "${var.timeout}"
ssh_port = "22"
qemu_agent = true qemu_agent = true
network_adapters { network_adapters {
@@ -145,7 +145,6 @@ source "proxmox-iso" "ubuntu" {
ssh_username = "${var.build_username}" ssh_username = "${var.build_username}"
ssh_password = "${var.build_password}" ssh_password = "${var.build_password}"
ssh_timeout = "${var.timeout}" ssh_timeout = "${var.timeout}"
ssh_port = "22"
qemu_agent = true qemu_agent = true
network_adapters { network_adapters {
@@ -145,7 +145,6 @@ source "proxmox-iso" "ubuntu" {
ssh_username = "${var.build_username}" ssh_username = "${var.build_username}"
ssh_password = "${var.build_password}" ssh_password = "${var.build_password}"
ssh_timeout = "${var.timeout}" ssh_timeout = "${var.timeout}"
ssh_port = "22"
qemu_agent = true qemu_agent = true
network_adapters { network_adapters {
@@ -145,7 +145,6 @@ source "proxmox-iso" "ubuntu" {
ssh_username = "${var.build_username}" ssh_username = "${var.build_username}"
ssh_password = "${var.build_password}" ssh_password = "${var.build_password}"
ssh_timeout = "${var.timeout}" ssh_timeout = "${var.timeout}"
ssh_port = "22"
qemu_agent = true qemu_agent = true
network_adapters { network_adapters {
@@ -1,220 +1,690 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend"> <unattend xmlns="urn:schemas-microsoft-com:unattend" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State">
<settings pass="windowsPE"> <!--https://schneegans.de/windows/unattend-generator/?LanguageMode=Unattended&UILanguage=fr-FR&Locale=fr-FR&Keyboard=0000040c&UseKeyboard2=true&Locale2=en-US&Keyboard2=00000409&GeoLocation=84&ProcessorArchitecture=amd64&BypassRequirementsCheck=true&ComputerNameMode=Random&CompactOsMode=Default&TimeZoneMode=Explicit&TimeZone=Romance+Standard+Time&PartitionMode=Unattended&PartitionLayout=GPT&EspSize=300&RecoveryMode=None&DiskAssertionMode=Skip&WindowsEditionMode=Generic&WindowsEdition=pro&InstallFromMode=Automatic&PEMode=Default&UserAccountMode=Unattended&AccountName0=Admin&AccountDisplayName0=&AccountPassword0=&AccountGroup0=Administrators&AccountName1=Installer&AccountDisplayName1=Installer&AccountPassword1=Stid_2026-03&AccountGroup1=Users&AutoLogonMode=Own&PasswordExpirationMode=Unlimited&LockoutMode=Default&HideFiles=Hidden&ShowFileExtensions=true&ClassicContextMenu=true&TaskbarSearch=Box&TaskbarIconsMode=Default&DisableWidgets=true&StartTilesMode=Default&StartPinsMode=Empty&DisableDefender=true&DisableUac=true&DisableSystemRestore=true&EnableRemoteDesktop=true&AllowPowerShellScripts=true&TurnOffSystemSounds=true&DisableAppSuggestions=true&PreventDeviceEncryption=true&HideEdgeFre=true&DisableEdgeStartupBoost=true&EffectsMode=Performance&DesktopIconsMode=Default&StartFoldersMode=Default&VirtIoGuestTools=true&WifiMode=Skip&ExpressSettings=DisableAll&LockKeysMode=Skip&StickyKeysMode=Default&ColorMode=Default&WallpaperMode=Default&LockScreenMode=Default&Remove3DViewer=true&RemoveBingSearch=true&RemoveCalculator=true&RemoveCamera=true&RemoveClipchamp=true&RemoveCopilot=true&RemoveCortana=true&RemoveDevHome=true&RemoveWindowsHello=true&RemoveFamily=true&RemoveFeedbackHub=true&RemoveGameAssist=true&RemoveGetHelp=true&RemoveHandwriting=true&RemoveInternetExplorer=true&RemoveMailCalendar=true&RemoveMaps=true&RemoveMathInputPanel=true&RemoveMediaFeatures=true&RemoveStore=true&RemoveMixedReality=true&RemoveZuneVideo=true&RemoveNews=true&RemoveOffice365=true&RemoveOneDrive=true&RemoveOneNote=true&RemoveOneSync=true&RemoveOpenSSHClient=true&RemoveOutlook=true&RemovePaint=true&RemovePaint3D=true&RemovePeople=true&RemovePhotos=true&RemovePowerAutomate=true&RemoveQuickAssist=true&RemoveRecall=true&RemoveRdpClient=true&RemoveSkype=true&RemoveSnippingTool=true&RemoveSolitaire=true&RemoveSpeech=true&RemoveStepsRecorder=true&RemoveStickyNotes=true&RemoveTeams=true&RemoveGetStarted=true&RemoveToDo=true&RemoveVoiceRecorder=true&RemoveWallet=true&RemoveWeather=true&RemoveFaxAndScan=true&RemoveWindowsMediaPlayer=true&RemoveZuneMusic=true&RemoveWordPad=true&RemoveXboxApps=true&RemoveYourPhone=true&WdacMode=Skip&AppLockerMode=Skip-->
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> <settings pass="offlineServicing"></settings>
<SetupUILanguage> <settings pass="windowsPE">
<UILanguage>${vm_inst_os_language}</UILanguage> <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
</SetupUILanguage> <UILanguage>fr-FR</UILanguage>
<InputLocale>${vm_inst_os_keyboard}</InputLocale> </component>
<SystemLocale>${vm_inst_os_language}</SystemLocale> <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<UILanguage>${vm_inst_os_language}</UILanguage> <ImageInstall>
<UILanguageFallback>${vm_inst_os_language}</UILanguageFallback> <OSImage>
<UserLocale>${vm_inst_os_language}</UserLocale> <InstallTo>
</component> <DiskID>0</DiskID>
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-PnpCustomizationsWinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> <PartitionID>3</PartitionID>
<DriverPaths> </InstallTo>
<PathAndCredentials wcm:action="add" wcm:keyValue="3"> </OSImage>
<Path>F:\viostor\w11\amd64\</Path> </ImageInstall>
</PathAndCredentials> <UserData>
<PathAndCredentials wcm:action="add" wcm:keyValue="4"> <ProductKey>
<Path>F:\NetKVM\w11\amd64\</Path> <Key>VK7JG-NPHTM-C97JM-9MPGT-3V66T</Key>
</PathAndCredentials> <WillShowUI>OnError</WillShowUI>
</DriverPaths> </ProductKey>
</component> <AcceptEula>true</AcceptEula>
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> </UserData>
<DiskConfiguration> <UseConfigurationSet>false</UseConfigurationSet>
<Disk wcm:action="add"> <RunSynchronous>
<DiskID>0</DiskID> <RunSynchronousCommand wcm:action="add">
<WillWipeDisk>true</WillWipeDisk> <Order>1</Order>
<CreatePartitions> <Path>reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassTPMCheck /t REG_DWORD /d 1 /f</Path>
<!-- Windows RE Tools partition --> </RunSynchronousCommand>
<CreatePartition wcm:action="add"> <RunSynchronousCommand wcm:action="add">
<Order>1</Order> <Order>2</Order>
<Type>Primary</Type> <Path>reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassSecureBootCheck /t REG_DWORD /d 1 /f</Path>
<Size>550</Size> </RunSynchronousCommand>
</CreatePartition> <RunSynchronousCommand wcm:action="add">
<!-- System partition (ESP) --> <Order>3</Order>
<CreatePartition wcm:action="add"> <Path>reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassRAMCheck /t REG_DWORD /d 1 /f</Path>
<Order>2</Order> </RunSynchronousCommand>
<Type>EFI</Type> <RunSynchronousCommand wcm:action="add">
<Size>100</Size> <Order>4</Order>
</CreatePartition> <Path>cmd.exe /c &gt;&gt;X:\diskpart.txt (echo:SELECT DISK=0&amp;echo:CLEAN&amp;echo:CONVERT GPT&amp;echo:CREATE PARTITION EFI SIZE=300&amp;echo:FORMAT QUICK FS=FAT32 LABEL=^"System^"&amp;echo:ASSIGN LETTER=S&amp;echo:CREATE PARTITION MSR SIZE=16&amp;echo:CREATE PARTITION PRIMARY)</Path>
<!-- Microsoft reserved partition (MSR) --> </RunSynchronousCommand>
<CreatePartition wcm:action="add"> <RunSynchronousCommand wcm:action="add">
<Order>3</Order> <Order>5</Order>
<Type>MSR</Type> <Path>cmd.exe /c &gt;&gt;X:\diskpart.txt (echo:FORMAT QUICK FS=NTFS LABEL=^"Windows^"&amp;echo:ASSIGN LETTER=W)</Path>
<Size>128</Size> </RunSynchronousCommand>
</CreatePartition> <RunSynchronousCommand wcm:action="add">
<!-- Windows partition --> <Order>6</Order>
<CreatePartition wcm:action="add"> <Path>cmd.exe /c "diskpart.exe /s "X:\diskpart.txt" &gt;&gt;"X:\diskpart.log" || ( type "X:\diskpart.log" &amp; echo diskpart encountered an error. &amp; pause &amp; exit /b 1 )"</Path>
<Order>4</Order> </RunSynchronousCommand>
<Type>Primary</Type> <RunSynchronousCommand wcm:action="add">
<Extend>true</Extend> <Order>7</Order>
</CreatePartition> <Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:WScript.Echo ^"Scanning for newly created SYSTEM registry hive file to disable Windows Defender services...^"&amp;echo:Set fso = CreateObject(^"Scripting.FileSystemObject^"^))</Path>
</CreatePartitions> </RunSynchronousCommand>
<ModifyPartitions> <RunSynchronousCommand wcm:action="add">
<!-- Windows RE Tools partition --> <Order>8</Order>
<ModifyPartition wcm:action="add"> <Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:Set existing = CreateObject(^"Scripting.Dictionary^"^)&amp;echo:Function Execute(command^)&amp;echo:WScript.Echo ^"Running command '^" + command + ^"'^"&amp;echo:Set shell = CreateObject(^"WScript.Shell^"^))</Path>
<Order>1</Order> </RunSynchronousCommand>
<PartitionID>1</PartitionID> <RunSynchronousCommand wcm:action="add">
<Label>WINRE</Label> <Order>9</Order>
<Format>NTFS</Format> <Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:Set exec = shell.Exec(command^)&amp;echo:Do While exec.Status = 0&amp;echo:WScript.Sleep 100&amp;echo:Loop&amp;echo:WScript.Echo exec.StdOut.ReadAll&amp;echo:WScript.Echo exec.StdErr.ReadAll&amp;echo:Execute = exec.ExitCode&amp;echo:End Function)</Path>
<TypeID>DE94BBA4-06D1-4D40-A16A-BFD50179D6AC</TypeID> </RunSynchronousCommand>
</ModifyPartition> <RunSynchronousCommand wcm:action="add">
<!-- System partition (ESP) --> <Order>10</Order>
<ModifyPartition wcm:action="add"> <Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:Function FindHiveFiles&amp;echo:Set FindHiveFiles = CreateObject(^"Scripting.Dictionary^"^)&amp;echo:For Each drive In fso.Drives&amp;echo:If drive.IsReady And drive.DriveLetter ^&lt;^&gt; ^"X^" Then)</Path>
<Order>2</Order> </RunSynchronousCommand>
<PartitionID>2</PartitionID> <RunSynchronousCommand wcm:action="add">
<Label>System</Label> <Order>11</Order>
<Format>FAT32</Format> <Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:For Each folder In Array(^"$Windows.~BT\NewOS\Windows^", ^"Windows^"^)&amp;echo:file = fso.BuildPath(fso.BuildPath(drive.RootFolder, folder^), ^"System32\config\SYSTEM^"^))</Path>
</ModifyPartition> </RunSynchronousCommand>
<!-- MSR partition does not need to be modified --> <RunSynchronousCommand wcm:action="add">
<ModifyPartition wcm:action="add"> <Order>12</Order>
<Order>3</Order> <Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:If fso.FileExists(file^) And fso.FileExists(file + ^".LOG1^"^) And fso.FileExists(file + ^".LOG2^"^) Then&amp;echo:FindHiveFiles.Add file, Nothing&amp;echo:End If&amp;echo:Next&amp;echo:End If&amp;echo:Next&amp;echo:End Function)</Path>
<PartitionID>3</PartitionID> </RunSynchronousCommand>
</ModifyPartition> <RunSynchronousCommand wcm:action="add">
<!-- Windows partition --> <Order>13</Order>
<ModifyPartition wcm:action="add"> <Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:For Each file In FindHiveFiles&amp;echo:WScript.Echo ^"Will ignore file at '^" + file + ^"' because it was already present when Windows Setup started.^"&amp;echo:existing.Add file, Nothing&amp;echo:Next&amp;echo:Do)</Path>
<Order>4</Order> </RunSynchronousCommand>
<PartitionID>4</PartitionID> <RunSynchronousCommand wcm:action="add">
<Label>OS</Label> <Order>14</Order>
<Letter>C</Letter> <Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:For Each file In FindHiveFiles&amp;echo:If Not existing.Exists(file^) Then&amp;echo:ret = 1&amp;echo:While ret ^&gt; 0&amp;echo:WScript.Sleep 500&amp;echo:ret = Execute(^"reg.exe LOAD HKLM\mount ^" + file^)&amp;echo:Wend)</Path>
<Format>NTFS</Format> </RunSynchronousCommand>
</ModifyPartition> <RunSynchronousCommand wcm:action="add">
</ModifyPartitions> <Order>15</Order>
</Disk> <Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:For Each service In Array(^"Sense^", ^"WdBoot^", ^"WdFilter^", ^"WdNisDrv^", ^"WdNisSvc^", ^"WinDefend^"^))</Path>
</DiskConfiguration> </RunSynchronousCommand>
<ImageInstall> <RunSynchronousCommand wcm:action="add">
<OSImage> <Order>16</Order>
<InstallFrom> <Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:ret = Execute(^"reg.exe ADD HKLM\mount\ControlSet001\Services\^" + service + ^" /v Start /t REG_DWORD /d 4 /f^"^)&amp;echo:Next&amp;echo:ret = Execute(^"reg.exe UNLOAD HKLM\mount^"^))</Path>
<MetaData wcm:action="add"> </RunSynchronousCommand>
<Key>/IMAGE/NAME</Key> <RunSynchronousCommand wcm:action="add">
<Value>${vm_inst_os_image}</Value> <Order>17</Order>
</MetaData> <Path>cmd.exe /c &gt;&gt;X:\defender.vbs (echo:WScript.Echo ^"Found and successfully modified SYSTEM registry hive file at '^" + file + ^"'. This window will now close.^"&amp;echo:WScript.Sleep 5000&amp;echo:Exit Do&amp;echo:End If&amp;echo:WScript.Sleep 1000&amp;echo:Next&amp;echo:Loop)</Path>
</InstallFrom> </RunSynchronousCommand>
<InstallTo> <RunSynchronousCommand wcm:action="add">
<DiskID>0</DiskID> <Order>18</Order>
<PartitionID>4</PartitionID> <Path>cmd.exe /c "start /MIN cscript.exe //E:vbscript X:\defender.vbs"</Path>
</InstallTo> </RunSynchronousCommand>
</OSImage> </RunSynchronous>
</ImageInstall> </component>
<RunSynchronous> </settings>
<RunSynchronousCommand> <settings pass="generalize"></settings>
<Order>1</Order> <settings pass="specialize">
<!-- Set power scheme to high performance in WinPE for faster imaging. --> <component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<Path>cmd /c powercfg.exe /s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c</Path> <RunSynchronous>
</RunSynchronousCommand> <RunSynchronousCommand wcm:action="add">
</RunSynchronous> <Order>1</Order>
<UserData> <Path>powershell.exe -WindowStyle "Normal" -NoProfile -Command "$xml = [xml]::new(); $xml.Load('C:\Windows\Panther\unattend.xml'); $sb = [scriptblock]::Create( $xml.unattend.Extensions.ExtractScript ); Invoke-Command -ScriptBlock $sb -ArgumentList $xml;"</Path>
<AcceptEula>true</AcceptEula> </RunSynchronousCommand>
<FullName>${build_username}</FullName> <RunSynchronousCommand wcm:action="add">
<Organization>${build_username}</Organization> <Order>2</Order>
%{if vm_inst_os_eval != true ~} <Path>powershell.exe -WindowStyle "Normal" -ExecutionPolicy "Unrestricted" -NoProfile -File "C:\Windows\Setup\Scripts\Specialize.ps1"</Path>
<ProductKey> </RunSynchronousCommand>
<Key>${vm_inst_os_key}</Key> <RunSynchronousCommand wcm:action="add">
<WillShowUI>OnError</WillShowUI> <Order>3</Order>
</ProductKey> <Path>reg.exe load "HKU\DefaultUser" "C:\Users\Default\NTUSER.DAT"</Path>
%{ endif ~} </RunSynchronousCommand>
</UserData> <RunSynchronousCommand wcm:action="add">
<EnableFirewall>false</EnableFirewall> <Order>4</Order>
</component> <Path>powershell.exe -WindowStyle "Normal" -ExecutionPolicy "Unrestricted" -NoProfile -File "C:\Windows\Setup\Scripts\DefaultUser.ps1"</Path>
</settings> </RunSynchronousCommand>
<settings pass="offlineServicing"> <RunSynchronousCommand wcm:action="add">
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-LUA-Settings" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> <Order>5</Order>
<EnableLUA>false</EnableLUA> <Path>reg.exe unload "HKU\DefaultUser"</Path>
</component> </RunSynchronousCommand>
</settings> </RunSynchronous>
<settings pass="generalize"> </component>
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Security-SPP" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<SkipRearm>1</SkipRearm> <TimeZone>Romance Standard Time</TimeZone>
</component> </component>
</settings> </settings>
<settings pass="specialize"> <settings pass="auditSystem"></settings>
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> <settings pass="auditUser"></settings>
<OEMInformation> <settings pass="oobeSystem">
<HelpCustomized>false</HelpCustomized> <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
</OEMInformation> <InputLocale>040c:0000040c;0409:00000409</InputLocale>
<TimeZone>${vm_guest_os_timezone}</TimeZone> <SystemLocale>fr-FR</SystemLocale>
<RegisteredOwner /> <UILanguage>fr-FR</UILanguage>
</component> <UserLocale>fr-FR</UserLocale>
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-ServerManager-SvrMgrNc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> </component>
<DoNotOpenServerManagerAtLogon>true</DoNotOpenServerManagerAtLogon> <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
</component> <UserAccounts>
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-OutOfBoxExperience" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> <LocalAccounts>
<DoNotOpenInitialConfigurationTasksAtLogon>true</DoNotOpenInitialConfigurationTasksAtLogon> <LocalAccount wcm:action="add">
</component> <Name>Admin</Name>
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Security-SPP-UX" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> <DisplayName></DisplayName>
<SkipAutoActivation>true</SkipAutoActivation> <Group>Administrators</Group>
</component> <Password>
</settings> <Value></Value>
<settings pass="oobeSystem"> <PlainText>true</PlainText>
<component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> </Password>
<InputLocale>${vm_guest_os_keyboard}</InputLocale> </LocalAccount>
<SystemLocale>${vm_guest_os_language}</SystemLocale> <LocalAccount wcm:action="add">
<UILanguage>${vm_guest_os_language}</UILanguage> <Name>Installer</Name>
<UILanguageFallback>${vm_guest_os_language}</UILanguageFallback> <DisplayName>Installer</DisplayName>
<UserLocale>${vm_guest_os_language}</UserLocale> <Group>Users</Group>
</component> <Password>
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"> <Value>Stid_2026-03</Value>
<AutoLogon> <PlainText>true</PlainText>
<Password> </Password>
<Value>${build_password}</Value> </LocalAccount>
<PlainText>true</PlainText> </LocalAccounts>
</Password> </UserAccounts>
<Enabled>true</Enabled> <AutoLogon>
<Username>${build_username}</Username> <Username>Admin</Username>
</AutoLogon> <Enabled>true</Enabled>
<OOBE> <LogonCount>1</LogonCount>
<HideEULAPage>true</HideEULAPage> <Password>
<HideLocalAccountScreen>true</HideLocalAccountScreen> <Value></Value>
<HideOEMRegistrationScreen>true</HideOEMRegistrationScreen> <PlainText>true</PlainText>
<HideOnlineAccountScreens>true</HideOnlineAccountScreens> </Password>
<HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE> </AutoLogon>
<NetworkLocation>Work</NetworkLocation> <OOBE>
<ProtectYourPC>2</ProtectYourPC> <ProtectYourPC>3</ProtectYourPC>
</OOBE> <HideEULAPage>true</HideEULAPage>
<UserAccounts> <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
<AdministratorPassword> <HideOnlineAccountScreens>false</HideOnlineAccountScreens>
<Value>${build_password}</Value> </OOBE>
<PlainText>true</PlainText> <FirstLogonCommands>
</AdministratorPassword> <SynchronousCommand wcm:action="add">
<LocalAccounts> <Order>1</Order>
<LocalAccount wcm:action="add"> <CommandLine>powershell.exe -WindowStyle "Normal" -ExecutionPolicy "Unrestricted" -NoProfile -File "C:\Windows\Setup\Scripts\FirstLogon.ps1"</CommandLine>
<Password> </SynchronousCommand>
<Value>${build_password}</Value> </FirstLogonCommands>
<PlainText>true</PlainText> </component>
</Password> </settings>
<Group>administrators</Group> <Extensions xmlns="https://schneegans.de/windows/unattend-generator/">
<DisplayName>${build_username}</DisplayName> <Build>
<Name>${build_username}</Name> <Commit>
<Description>Build Account</Description> <Hash>b5944ad0b8d26588e78d963562e0f80ee2e33aeb</Hash>
</LocalAccount> <GitHubUrl>https://github.com/cschneegans/unattend-generator/commit/b5944ad0b8d26588e78d963562e0f80ee2e33aeb</GitHubUrl>
</LocalAccounts> </Commit>
</UserAccounts> </Build>
<FirstLogonCommands> <ExtractScript>
<SynchronousCommand wcm:action="add"> param(
<CommandLine>%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine> [xml] $Document
<Description>Set Execution Policy 64-Bit</Description> );
<Order>1</Order>
<RequiresUserInput>true</RequiresUserInput> foreach( $file in $Document.unattend.Extensions.File ) {
</SynchronousCommand> $path = [System.Environment]::ExpandEnvironmentVariables( $file.GetAttribute( 'path' ) );
<SynchronousCommand wcm:action="add"> mkdir -Path( $path | Split-Path -Parent ) -ErrorAction 'SilentlyContinue';
<CommandLine>%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine> $encoding = switch( [System.IO.Path]::GetExtension( $path ) ) {
<Description>Set Execution Policy 32-Bit</Description> { $_ -in '.ps1', '.xml' } { [System.Text.Encoding]::UTF8; }
<Order>2</Order> { $_ -in '.reg', '.vbs', '.js' } { [System.Text.UnicodeEncoding]::new( $false, $true ); }
<RequiresUserInput>true</RequiresUserInput> default { [System.Text.Encoding]::Default; }
</SynchronousCommand> };
<SynchronousCommand wcm:action="add"> $bytes = $encoding.GetPreamble() + $encoding.GetBytes( $file.InnerText.Trim() );
<CommandLine>%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -File E:\windows-virtio.ps1</CommandLine> [System.IO.File]::WriteAllBytes( $path, $bytes );
<Order>3</Order> }
<Description>Install VMware Tools</Description> </ExtractScript>
</SynchronousCommand> <File path="C:\Windows\Setup\Scripts\RemovePackages.ps1">
<SynchronousCommand wcm:action="add"> $selectors = @(
<CommandLine>%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -File E:\windows-init.ps1</CommandLine> 'Microsoft.Microsoft3DViewer';
<Order>4</Order> 'Microsoft.BingSearch';
<Description>Initial Configuration</Description> 'Microsoft.WindowsCalculator';
</SynchronousCommand> 'Microsoft.WindowsCamera';
</FirstLogonCommands> 'Clipchamp.Clipchamp';
</component> 'Microsoft.Copilot';
</settings> 'Microsoft.549981C3F5F10';
'Microsoft.Windows.DevHome';
'MicrosoftCorporationII.MicrosoftFamily';
'Microsoft.WindowsFeedbackHub';
'Microsoft.Edge.GameAssist';
'Microsoft.GetHelp';
'Microsoft.Getstarted';
'microsoft.windowscommunicationsapps';
'Microsoft.WindowsMaps';
'Microsoft.MixedReality.Portal';
'Microsoft.BingNews';
'Microsoft.MicrosoftOfficeHub';
'Microsoft.Office.OneNote';
'Microsoft.OutlookForWindows';
'Microsoft.Paint';
'Microsoft.MSPaint';
'Microsoft.People';
'Microsoft.Windows.Photos';
'Microsoft.PowerAutomateDesktop';
'MicrosoftCorporationII.QuickAssist';
'Microsoft.SkypeApp';
'Microsoft.ScreenSketch';
'Microsoft.MicrosoftSolitaireCollection';
'Microsoft.MicrosoftStickyNotes';
'Microsoft.WindowsStore';
'Microsoft.StorePurchaseApp';
'MicrosoftTeams';
'MSTeams';
'Microsoft.Todos';
'Microsoft.WindowsSoundRecorder';
'Microsoft.Wallet';
'Microsoft.BingWeather';
'Microsoft.Xbox.TCUI';
'Microsoft.XboxApp';
'Microsoft.XboxGameOverlay';
'Microsoft.XboxGamingOverlay';
'Microsoft.XboxIdentityProvider';
'Microsoft.XboxSpeechToTextOverlay';
'Microsoft.GamingApp';
'Microsoft.YourPhone';
'Microsoft.ZuneMusic';
'Microsoft.ZuneVideo';
);
$getCommand = {
Get-AppxProvisionedPackage -Online;
};
$filterCommand = {
$_.DisplayName -eq $selector;
};
$removeCommand = {
[CmdletBinding()]
param(
[Parameter( Mandatory, ValueFromPipeline )]
$InputObject
);
process {
$InputObject | Remove-AppxProvisionedPackage -AllUsers -Online -ErrorAction 'Continue';
}
};
$type = 'Package';
$logfile = 'C:\Windows\Setup\Scripts\RemovePackages.log';
&amp; {
$installed = &amp; $getCommand;
foreach( $selector in $selectors ) {
$result = [ordered] @{
Selector = $selector;
};
$found = $installed | Where-Object -FilterScript $filterCommand;
if( $found ) {
$result.Output = $found | &amp; $removeCommand;
if( $? ) {
$result.Message = "$type removed.";
} else {
$result.Message = "$type not removed.";
$result.Error = $Error[0];
}
} else {
$result.Message = "$type not installed.";
}
$result | ConvertTo-Json -Depth 3 -Compress;
}
} *&gt;&amp;1 | Out-String -Width 1KB -Stream &gt;&gt; $logfile;
</File>
<File path="C:\Windows\Setup\Scripts\RemoveCapabilities.ps1">
$selectors = @(
'Print.Fax.Scan';
'Language.Handwriting';
'Browser.InternetExplorer';
'MathRecognizer';
'OneCoreUAP.OneSync';
'OpenSSH.Client';
'Microsoft.Windows.MSPaint';
'App.Support.QuickAssist';
'Microsoft.Windows.SnippingTool';
'Language.Speech';
'Language.TextToSpeech';
'App.StepsRecorder';
'Hello.Face.18967';
'Hello.Face.Migration.18967';
'Hello.Face.20134';
'Media.WindowsMediaPlayer';
'Microsoft.Windows.WordPad';
);
$getCommand = {
Get-WindowsCapability -Online | Where-Object -Property 'State' -NotIn -Value @(
'NotPresent';
'Removed';
);
};
$filterCommand = {
($_.Name -split '~')[0] -eq $selector;
};
$removeCommand = {
[CmdletBinding()]
param(
[Parameter( Mandatory, ValueFromPipeline )]
$InputObject
);
process {
$InputObject | Remove-WindowsCapability -Online -ErrorAction 'Continue';
}
};
$type = 'Capability';
$logfile = 'C:\Windows\Setup\Scripts\RemoveCapabilities.log';
&amp; {
$installed = &amp; $getCommand;
foreach( $selector in $selectors ) {
$result = [ordered] @{
Selector = $selector;
};
$found = $installed | Where-Object -FilterScript $filterCommand;
if( $found ) {
$result.Output = $found | &amp; $removeCommand;
if( $? ) {
$result.Message = "$type removed.";
} else {
$result.Message = "$type not removed.";
$result.Error = $Error[0];
}
} else {
$result.Message = "$type not installed.";
}
$result | ConvertTo-Json -Depth 3 -Compress;
}
} *&gt;&amp;1 | Out-String -Width 1KB -Stream &gt;&gt; $logfile;
</File>
<File path="C:\Windows\Setup\Scripts\RemoveFeatures.ps1">
$selectors = @(
'MediaPlayback';
'Microsoft-RemoteDesktopConnection';
'Recall';
'Microsoft-SnippingTool';
);
$getCommand = {
Get-WindowsOptionalFeature -Online | Where-Object -Property 'State' -NotIn -Value @(
'Disabled';
'DisabledWithPayloadRemoved';
);
};
$filterCommand = {
$_.FeatureName -eq $selector;
};
$removeCommand = {
[CmdletBinding()]
param(
[Parameter( Mandatory, ValueFromPipeline )]
$InputObject
);
process {
$InputObject | Disable-WindowsOptionalFeature -Online -Remove -NoRestart -ErrorAction 'Continue';
}
};
$type = 'Feature';
$logfile = 'C:\Windows\Setup\Scripts\RemoveFeatures.log';
&amp; {
$installed = &amp; $getCommand;
foreach( $selector in $selectors ) {
$result = [ordered] @{
Selector = $selector;
};
$found = $installed | Where-Object -FilterScript $filterCommand;
if( $found ) {
$result.Output = $found | &amp; $removeCommand;
if( $? ) {
$result.Message = "$type removed.";
} else {
$result.Message = "$type not removed.";
$result.Error = $Error[0];
}
} else {
$result.Message = "$type not installed.";
}
$result | ConvertTo-Json -Depth 3 -Compress;
}
} *&gt;&amp;1 | Out-String -Width 1KB -Stream &gt;&gt; $logfile;
</File>
<File path="C:\Windows\Setup\Scripts\TurnOffSystemSounds.ps1">
$excludes = Get-ChildItem -LiteralPath 'Registry::HKU\DefaultUser\AppEvents\EventLabels' |
Where-Object -FilterScript { ($_ | Get-ItemProperty).ExcludeFromCPL -eq 1; } |
Select-Object -ExpandProperty 'PSChildName';
Get-ChildItem -Path 'Registry::HKU\DefaultUser\AppEvents\Schemes\Apps\*\*' |
Where-Object -Property 'PSChildName' -NotIn $excludes |
Get-ChildItem -Include '.Current' | Set-ItemProperty -Name '(Default)' -Value '';
</File>
<File path="C:\Windows\Setup\Scripts\VirtIoGuestTools.ps1">
&amp; {
foreach( $letter in 'DEFGHIJKLMNOPQRSTUVWXYZ'.ToCharArray() ) {
$exe = "${letter}:\virtio-win-guest-tools.exe";
if( Test-Path -LiteralPath $exe ) {
Start-Process -FilePath $exe -ArgumentList '/passive', '/norestart' -Wait;
return;
}
}
'VirtIO Guest Tools image (virtio-win-*.iso) is not attached to this VM.';
} *&gt;&amp;1 | Out-String -Width 1KB -Stream &gt;&gt; 'C:\Windows\Setup\Scripts\VirtIoGuestTools.log';
</File>
<File path="C:\Windows\Setup\Scripts\SetStartPins.ps1">
$json = '{"pinnedList":[]}';
if( [System.Environment]::OSVersion.Version.Build -lt 20000 ) {
return;
}
$key = 'Registry::HKLM\SOFTWARE\Microsoft\PolicyManager\current\device\Start';
New-Item -Path $key -ItemType 'Directory' -ErrorAction 'SilentlyContinue';
Set-ItemProperty -LiteralPath $key -Name 'ConfigureStartPins' -Value $json -Type 'String';
</File>
<File path="C:\Windows\Setup\Scripts\Specialize.ps1">
$scripts = @(
{
reg.exe add "HKLM\SYSTEM\Setup\MoSetup" /v AllowUpgradesWithUnsupportedTPMOrCPU /t REG_DWORD /d 1 /f;
};
{
ReAgentc.exe /disable;
Remove-Item -LiteralPath 'C:\Windows\System32\Recovery\Winre.wim' -Force -ErrorAction 'SilentlyContinue';
};
{
Remove-Item -LiteralPath 'Registry::HKLM\Software\Microsoft\WindowsUpdate\Orchestrator\UScheduler_Oobe\DevHomeUpdate' -Force -ErrorAction 'SilentlyContinue';
};
{
Remove-Item -LiteralPath 'C:\Users\Default\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\OneDrive.lnk', 'C:\Windows\System32\OneDriveSetup.exe', 'C:\Windows\SysWOW64\OneDriveSetup.exe' -ErrorAction 'Continue';
};
{
Remove-Item -LiteralPath 'Registry::HKLM\Software\Microsoft\WindowsUpdate\Orchestrator\UScheduler_Oobe\OutlookUpdate' -Force -ErrorAction 'SilentlyContinue';
};
{
reg.exe add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Communications" /v ConfigureChatAutoInstall /t REG_DWORD /d 0 /f;
};
{
&amp; 'C:\Windows\Setup\Scripts\RemovePackages.ps1';
};
{
&amp; 'C:\Windows\Setup\Scripts\RemoveCapabilities.ps1';
};
{
&amp; 'C:\Windows\Setup\Scripts\RemoveFeatures.ps1';
};
{
net.exe accounts /maxpwage:UNLIMITED;
};
{
reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender Security Center\Notifications" /v DisableNotifications /t REG_DWORD /d 1 /f;
};
{
reg.exe add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v EnableLUA /t REG_DWORD /d 0 /f
};
{
netsh.exe advfirewall firewall set rule group="@FirewallAPI.dll,-28752" new enable=Yes;
reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f;
};
{
Set-ExecutionPolicy -Scope 'LocalMachine' -ExecutionPolicy 'RemoteSigned' -Force;
};
{
reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Dsh" /v AllowNewsAndInterests /t REG_DWORD /d 0 /f;
};
{
reg.exe add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\BootAnimation" /v DisableStartupSound /t REG_DWORD /d 1 /f;
reg.exe add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\EditionOverrides" /v UserSetting_DisableStartupSound /t REG_DWORD /d 1 /f;
};
{
reg.exe add "HKLM\Software\Policies\Microsoft\Windows\CloudContent" /v "DisableWindowsConsumerFeatures" /t REG_DWORD /d 1 /f;
};
{
reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\BitLocker" /v "PreventDeviceEncryption" /t REG_DWORD /d 1 /f;
};
{
reg.exe add "HKLM\Software\Policies\Microsoft\Edge" /v HideFirstRunExperience /t REG_DWORD /d 1 /f;
};
{
reg.exe add "HKLM\Software\Policies\Microsoft\Edge\Recommended" /v BackgroundModeEnabled /t REG_DWORD /d 0 /f;
reg.exe add "HKLM\Software\Policies\Microsoft\Edge\Recommended" /v StartupBoostEnabled /t REG_DWORD /d 0 /f;
};
{
&amp; 'C:\Windows\Setup\Scripts\SetStartPins.ps1';
};
{
Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ControlAnimations" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\AnimateMinMax" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\TaskbarAnimations" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DWMAeroPeekEnabled" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\MenuAnimation" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\TooltipAnimation" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\SelectionFade" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DWMSaveThumbnailEnabled" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\CursorShadow" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ListviewShadow" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ThumbnailsOrIcon" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ListviewAlphaSelect" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DragFullWindows" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ComboBoxAnimation" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\FontSmoothing" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ListBoxSmoothScrolling" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DropShadow" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
};
);
&amp; {
[float] $complete = 0;
[float] $increment = 100 / $scripts.Count;
foreach( $script in $scripts ) {
Write-Progress -Id 0 -Activity 'Running scripts to customize your Windows installation. Do not close this window.' -PercentComplete $complete;
'*** Will now execute command &#xAB;{0}&#xBB;.' -f $(
$script.ToString().Trim() -replace '\s+', ' ' -replace '^(.{99})(.+)$', '$1&#x2026;';
);
$start = [datetime]::Now;
&amp; $script;
'*** Finished executing command after {0:0} ms.' -f [datetime]::Now.Subtract( $start ).TotalMilliseconds;
"`r`n" * 3;
$complete += $increment;
}
} *&gt;&amp;1 | Out-String -Width 1KB -Stream &gt;&gt; "C:\Windows\Setup\Scripts\Specialize.log";
</File>
<File path="C:\Windows\Setup\Scripts\UserOnce.ps1">
$scripts = @(
{
Get-AppxPackage -Name 'Microsoft.Windows.Ai.Copilot.Provider' | Remove-AppxPackage;
};
{
Set-ItemProperty -LiteralPath 'Registry::HKCU\AppEvents\Schemes' -Name '(Default)' -Type 'String' -Value '.None';
};
{
reg.exe add "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" /ve /f;
};
{
Set-ItemProperty -LiteralPath 'Registry::HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects' -Name 'VisualFXSetting' -Type 'DWord' -Value 2 -Force;
};
{
Get-Process -Name 'explorer' -ErrorAction 'SilentlyContinue' | Where-Object -FilterScript {
$_.SessionId -eq ( Get-Process -Id $PID ).SessionId;
} | Stop-Process -Force;
};
);
&amp; {
[float] $complete = 0;
[float] $increment = 100 / $scripts.Count;
foreach( $script in $scripts ) {
Write-Progress -Id 0 -Activity 'Running scripts to configure this user account. Do not close this window.' -PercentComplete $complete;
'*** Will now execute command &#xAB;{0}&#xBB;.' -f $(
$script.ToString().Trim() -replace '\s+', ' ' -replace '^(.{99})(.+)$', '$1&#x2026;';
);
$start = [datetime]::Now;
&amp; $script;
'*** Finished executing command after {0:0} ms.' -f [datetime]::Now.Subtract( $start ).TotalMilliseconds;
"`r`n" * 3;
$complete += $increment;
}
} *&gt;&amp;1 | Out-String -Width 1KB -Stream &gt;&gt; "$env:TEMP\UserOnce.log";
</File>
<File path="C:\Windows\Setup\Scripts\DefaultUser.ps1">
$scripts = @(
{
reg.exe add "HKU\DefaultUser\Software\Policies\Microsoft\Windows\WindowsCopilot" /v TurnOffWindowsCopilot /t REG_DWORD /d 1 /f;
};
{
reg.exe add "HKU\DefaultUser\Software\Microsoft\Internet Explorer\LowRegistry\Audio\PolicyConfig\PropertyStore" /f;
};
{
Remove-ItemProperty -LiteralPath 'Registry::HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Run' -Name 'OneDriveSetup' -Force -ErrorAction 'Continue';
};
{
reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\GameDVR" /v AppCaptureEnabled /t REG_DWORD /d 0 /f;
};
{
reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "HideFileExt" /t REG_DWORD /d 0 /f;
};
{
&amp; 'C:\Windows\Setup\Scripts\TurnOffSystemSounds.ps1';
};
{
$names = @(
'ContentDeliveryAllowed';
'FeatureManagementEnabled';
'OEMPreInstalledAppsEnabled';
'PreInstalledAppsEnabled';
'PreInstalledAppsEverEnabled';
'SilentInstalledAppsEnabled';
'SoftLandingEnabled';
'SubscribedContentEnabled';
'SubscribedContent-310093Enabled';
'SubscribedContent-338387Enabled';
'SubscribedContent-338388Enabled';
'SubscribedContent-338389Enabled';
'SubscribedContent-338393Enabled';
'SubscribedContent-353694Enabled';
'SubscribedContent-353696Enabled';
'SubscribedContent-353698Enabled';
'SystemPaneSuggestionsEnabled';
);
foreach( $name in $names ) {
reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v $name /t REG_DWORD /d 0 /f;
}
};
{
reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\RunOnce" /v "UnattendedSetup" /t REG_SZ /d "powershell.exe -WindowStyle \""Normal\"" -ExecutionPolicy \""Unrestricted\"" -NoProfile -File \""C:\Windows\Setup\Scripts\UserOnce.ps1\""" /f;
};
);
&amp; {
[float] $complete = 0;
[float] $increment = 100 / $scripts.Count;
foreach( $script in $scripts ) {
Write-Progress -Id 0 -Activity 'Running scripts to modify the default user&#x2019;&#x2019;s registry hive. Do not close this window.' -PercentComplete $complete;
'*** Will now execute command &#xAB;{0}&#xBB;.' -f $(
$script.ToString().Trim() -replace '\s+', ' ' -replace '^(.{99})(.+)$', '$1&#x2026;';
);
$start = [datetime]::Now;
&amp; $script;
'*** Finished executing command after {0:0} ms.' -f [datetime]::Now.Subtract( $start ).TotalMilliseconds;
"`r`n" * 3;
$complete += $increment;
}
} *&gt;&amp;1 | Out-String -Width 1KB -Stream &gt;&gt; "C:\Windows\Setup\Scripts\DefaultUser.log";
</File>
<File path="C:\Windows\Setup\Scripts\FirstLogon.ps1">
$scripts = @(
{
Set-ItemProperty -LiteralPath 'Registry::HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' -Name 'AutoLogonCount' -Type 'DWord' -Force -Value 0;
};
{
Disable-ComputerRestore -Drive 'C:\';
};
{
&amp; 'C:\Windows\Setup\Scripts\VirtIoGuestTools.ps1';
};
{
Remove-Item -LiteralPath @(
'C:\Windows\Panther\unattend.xml';
'C:\Windows\Panther\unattend-original.xml';
'C:\Windows\Setup\Scripts\Wifi.xml';
) -Force -ErrorAction 'SilentlyContinue' -Verbose;
};
);
&amp; {
[float] $complete = 0;
[float] $increment = 100 / $scripts.Count;
foreach( $script in $scripts ) {
Write-Progress -Id 0 -Activity 'Running scripts to finalize your Windows installation. Do not close this window.' -PercentComplete $complete;
'*** Will now execute command &#xAB;{0}&#xBB;.' -f $(
$script.ToString().Trim() -replace '\s+', ' ' -replace '^(.{99})(.+)$', '$1&#x2026;';
);
$start = [datetime]::Now;
&amp; $script;
'*** Finished executing command after {0:0} ms.' -f [datetime]::Now.Subtract( $start ).TotalMilliseconds;
"`r`n" * 3;
$complete += $increment;
}
} *&gt;&amp;1 | Out-String -Width 1KB -Stream &gt;&gt; "C:\Windows\Setup\Scripts\FirstLogon.log";
</File>
</Extensions>
</unattend> </unattend>
@@ -0,0 +1,220 @@
<?xml version="1.0" encoding="UTF-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="windowsPE">
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<SetupUILanguage>
<UILanguage>${vm_inst_os_language}</UILanguage>
</SetupUILanguage>
<InputLocale>${vm_inst_os_keyboard}</InputLocale>
<SystemLocale>${vm_inst_os_language}</SystemLocale>
<UILanguage>${vm_inst_os_language}</UILanguage>
<UILanguageFallback>${vm_inst_os_language}</UILanguageFallback>
<UserLocale>${vm_inst_os_language}</UserLocale>
</component>
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-PnpCustomizationsWinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<DriverPaths>
<PathAndCredentials wcm:action="add" wcm:keyValue="3">
<Path>F:\viostor\w11\amd64\</Path>
</PathAndCredentials>
<PathAndCredentials wcm:action="add" wcm:keyValue="4">
<Path>F:\NetKVM\w11\amd64\</Path>
</PathAndCredentials>
</DriverPaths>
</component>
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<DiskConfiguration>
<Disk wcm:action="add">
<DiskID>0</DiskID>
<WillWipeDisk>true</WillWipeDisk>
<CreatePartitions>
<!-- Windows RE Tools partition -->
<CreatePartition wcm:action="add">
<Order>1</Order>
<Type>Primary</Type>
<Size>550</Size>
</CreatePartition>
<!-- System partition (ESP) -->
<CreatePartition wcm:action="add">
<Order>2</Order>
<Type>EFI</Type>
<Size>100</Size>
</CreatePartition>
<!-- Microsoft reserved partition (MSR) -->
<CreatePartition wcm:action="add">
<Order>3</Order>
<Type>MSR</Type>
<Size>128</Size>
</CreatePartition>
<!-- Windows partition -->
<CreatePartition wcm:action="add">
<Order>4</Order>
<Type>Primary</Type>
<Extend>true</Extend>
</CreatePartition>
</CreatePartitions>
<ModifyPartitions>
<!-- Windows RE Tools partition -->
<ModifyPartition wcm:action="add">
<Order>1</Order>
<PartitionID>1</PartitionID>
<Label>WINRE</Label>
<Format>NTFS</Format>
<TypeID>DE94BBA4-06D1-4D40-A16A-BFD50179D6AC</TypeID>
</ModifyPartition>
<!-- System partition (ESP) -->
<ModifyPartition wcm:action="add">
<Order>2</Order>
<PartitionID>2</PartitionID>
<Label>System</Label>
<Format>FAT32</Format>
</ModifyPartition>
<!-- MSR partition does not need to be modified -->
<ModifyPartition wcm:action="add">
<Order>3</Order>
<PartitionID>3</PartitionID>
</ModifyPartition>
<!-- Windows partition -->
<ModifyPartition wcm:action="add">
<Order>4</Order>
<PartitionID>4</PartitionID>
<Label>OS</Label>
<Letter>C</Letter>
<Format>NTFS</Format>
</ModifyPartition>
</ModifyPartitions>
</Disk>
</DiskConfiguration>
<ImageInstall>
<OSImage>
<InstallFrom>
<MetaData wcm:action="add">
<Key>/IMAGE/NAME</Key>
<Value>${vm_inst_os_image}</Value>
</MetaData>
</InstallFrom>
<InstallTo>
<DiskID>0</DiskID>
<PartitionID>4</PartitionID>
</InstallTo>
</OSImage>
</ImageInstall>
<RunSynchronous>
<RunSynchronousCommand>
<Order>1</Order>
<!-- Set power scheme to high performance in WinPE for faster imaging. -->
<Path>cmd /c powercfg.exe /s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c</Path>
</RunSynchronousCommand>
</RunSynchronous>
<UserData>
<AcceptEula>true</AcceptEula>
<FullName>${build_username}</FullName>
<Organization>${build_username}</Organization>
%{if vm_inst_os_eval != true ~}
<ProductKey>
<Key>${vm_inst_os_key}</Key>
<WillShowUI>OnError</WillShowUI>
</ProductKey>
%{ endif ~}
</UserData>
<EnableFirewall>false</EnableFirewall>
</component>
</settings>
<settings pass="offlineServicing">
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-LUA-Settings" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<EnableLUA>false</EnableLUA>
</component>
</settings>
<settings pass="generalize">
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Security-SPP" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<SkipRearm>1</SkipRearm>
</component>
</settings>
<settings pass="specialize">
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<OEMInformation>
<HelpCustomized>false</HelpCustomized>
</OEMInformation>
<TimeZone>${vm_guest_os_timezone}</TimeZone>
<RegisteredOwner />
</component>
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-ServerManager-SvrMgrNc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<DoNotOpenServerManagerAtLogon>true</DoNotOpenServerManagerAtLogon>
</component>
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-OutOfBoxExperience" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<DoNotOpenInitialConfigurationTasksAtLogon>true</DoNotOpenInitialConfigurationTasksAtLogon>
</component>
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Security-SPP-UX" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<SkipAutoActivation>true</SkipAutoActivation>
</component>
</settings>
<settings pass="oobeSystem">
<component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<InputLocale>${vm_guest_os_keyboard}</InputLocale>
<SystemLocale>${vm_guest_os_language}</SystemLocale>
<UILanguage>${vm_guest_os_language}</UILanguage>
<UILanguageFallback>${vm_guest_os_language}</UILanguageFallback>
<UserLocale>${vm_guest_os_language}</UserLocale>
</component>
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<AutoLogon>
<Password>
<Value>${build_password}</Value>
<PlainText>true</PlainText>
</Password>
<Enabled>true</Enabled>
<Username>${build_username}</Username>
</AutoLogon>
<OOBE>
<HideEULAPage>true</HideEULAPage>
<HideLocalAccountScreen>true</HideLocalAccountScreen>
<HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
<HideOnlineAccountScreens>true</HideOnlineAccountScreens>
<HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
<NetworkLocation>Work</NetworkLocation>
<ProtectYourPC>2</ProtectYourPC>
</OOBE>
<UserAccounts>
<AdministratorPassword>
<Value>${build_password}</Value>
<PlainText>true</PlainText>
</AdministratorPassword>
<LocalAccounts>
<LocalAccount wcm:action="add">
<Password>
<Value>${build_password}</Value>
<PlainText>true</PlainText>
</Password>
<Group>administrators</Group>
<DisplayName>${build_username}</DisplayName>
<Name>${build_username}</Name>
<Description>Build Account</Description>
</LocalAccount>
</LocalAccounts>
</UserAccounts>
<FirstLogonCommands>
<SynchronousCommand wcm:action="add">
<CommandLine>%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine>
<Description>Set Execution Policy 64-Bit</Description>
<Order>1</Order>
<RequiresUserInput>true</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<CommandLine>%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force"</CommandLine>
<Description>Set Execution Policy 32-Bit</Description>
<Order>2</Order>
<RequiresUserInput>true</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<CommandLine>%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -File E:\windows-virtio.ps1</CommandLine>
<Order>3</Order>
<Description>Install VMware Tools</Description>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<CommandLine>%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -File E:\windows-init.ps1</CommandLine>
<Order>4</Order>
<Description>Initial Configuration</Description>
</SynchronousCommand>
</FirstLogonCommands>
</component>
</settings>
</unattend>
+1 -1
View File
@@ -318,7 +318,7 @@ variable "vm_boot_order" {
variable "vm_boot_wait" { variable "vm_boot_wait" {
type = string type = string
description = "The time to wait before boot." description = "The time to wait before boot."
default = "5s" default = "10s"
} }
variable "vm_boot_command" { variable "vm_boot_command" {
+2 -2
View File
@@ -111,7 +111,7 @@ source "proxmox-iso" "windows-desktop-pro" {
// Removable Media Settings // Removable Media Settings
additional_iso_files { additional_iso_files {
iso_file = "${var.common_iso_storage}:iso/virtio-win.iso" iso_file = "${var.common_iso_storage}:iso/virtio-win-0.1.285.iso"
iso_storage_pool = var.common_iso_storage iso_storage_pool = var.common_iso_storage
cd_label = "VirtIO" cd_label = "VirtIO"
unmount = true unmount = true
@@ -223,7 +223,7 @@ source "proxmox-iso" "windows-desktop-ent" {
// Removable Media Settings // Removable Media Settings
additional_iso_files { additional_iso_files {
iso_file = "${var.common_iso_storage}:iso/virtio-win.iso" iso_file = "${var.common_iso_storage}:iso/virtio-win-0.1.285.iso"
iso_storage_pool = var.common_iso_storage iso_storage_pool = var.common_iso_storage
cd_label = "VirtIO" cd_label = "VirtIO"
unmount = true unmount = true
+1 -1
View File
@@ -30,7 +30,7 @@ INPUT_PATHS=(
"$SCRIPT_PATH/builds/linux/rocky/10/" "$SCRIPT_PATH/builds/linux/rocky/10/"
"$SCRIPT_PATH/builds/linux/rocky/9/" "$SCRIPT_PATH/builds/linux/rocky/9/"
"$SCRIPT_PATH/builds/linux/rocky/8/" "$SCRIPT_PATH/builds/linux/rocky/8/"
"$SCRIPT_PATH/builds/linux/ubuntu/25-04-lts/" "$SCRIPT_PATH/builds/linux/ubuntu/25-04/"
"$SCRIPT_PATH/builds/linux/ubuntu/24-04-lts/" "$SCRIPT_PATH/builds/linux/ubuntu/24-04-lts/"
"$SCRIPT_PATH/builds/linux/ubuntu/22-04-lts/" "$SCRIPT_PATH/builds/linux/ubuntu/22-04-lts/"
"$SCRIPT_PATH/builds/linux/ubuntu/20-04-lts/" "$SCRIPT_PATH/builds/linux/ubuntu/20-04-lts/"