{"id":23759713,"url":"https://github.com/rgl/windows-sysprep-playground","last_synced_at":"2026-05-04T11:41:20.901Z","repository":{"id":268926679,"uuid":"905136687","full_name":"rgl/windows-sysprep-playground","owner":"rgl","description":"A Windows sysprep playground","archived":false,"fork":false,"pushed_at":"2024-12-18T19:44:06.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-31T11:06:21.727Z","etag":null,"topics":["packer","sysprep","terraform","windows"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rgl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-18T08:31:44.000Z","updated_at":"2024-12-18T19:44:38.000Z","dependencies_parsed_at":"2024-12-19T18:45:50.370Z","dependency_job_id":"d2e575c8-ea1e-4c52-bbf0-db0b7862f9b9","html_url":"https://github.com/rgl/windows-sysprep-playground","commit_stats":null,"previous_names":["rgl/windows-sysprep-playground"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgl%2Fwindows-sysprep-playground","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgl%2Fwindows-sysprep-playground/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgl%2Fwindows-sysprep-playground/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgl%2Fwindows-sysprep-playground/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rgl","download_url":"https://codeload.github.com/rgl/windows-sysprep-playground/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239930290,"owners_count":19720297,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["packer","sysprep","terraform","windows"],"created_at":"2024-12-31T20:18:36.992Z","updated_at":"2026-05-04T11:41:20.895Z","avatar_url":"https://github.com/rgl.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# About\n\nThis is a Windows sysprep playground.\n\nThis will:\n\n* Clone one of the following Proxmox template images:\n  * `template-windows-11-24h2-uefi`.\n  * `template-windows-2022-uefi`.\n  * `template-windows-2025-uefi`.\n* Install Handle.\n* Install Chocolatey.\n* Generalize (Sysprep) the machine 3x (because the third time is the charm).\n  * 3x to test whether we can run sysprep several times.\n    * The last one leaves the template image in a generalized state.\n  * Windows 11 makes this harder than required, as it no longer let us seed the\n    OOBE user, instead, as a workaround, we have to use auto-logon.\n    * Sysprep also needs a little nudge to the installed appx packages before\n      it can be executed.\n  * Do all of this without Internet access.\n    * To test whether it can be done in offline mode.\n* Create the `template-windows-sysprep-playground` Proxmox template image.\n* Use terraform to try the created template image.\n   * The template image is in a generalized state.\n\n# Usage\n\nCreate one of the Proxmox template images by following the instructions at the [rgl/windows-vagrant repository](https://gitgub.com/rgl/windows-vagrant).\n\nSet your proxmox details:\n\n```bash\n# see https://registry.terraform.io/providers/bpg/proxmox/latest/docs#argument-reference\n# see https://github.com/bpg/terraform-provider-proxmox/blob/v0.94.0/proxmoxtf/provider/provider.go#L52-L61\ncat \u003esecrets-proxmox.sh \u003c\u003c'EOF'\nunset HTTPS_PROXY\n#export HTTPS_PROXY='http://localhost:8080'\nexport PROXMOX_USERNAME='root@pam'\nexport PROXMOX_PASSWORD='vagrant'\nexport PROXMOX_NODE='pve'\nexport PROXMOX_NODE_ADDRESS='192.168.8.21'\nexport PROXMOX_URL=\"https://$PROXMOX_NODE_ADDRESS:8006/api2/json\"\nexport TF_VAR_proxmox_pve_node_name=\"$PROXMOX_NODE\"\nexport TF_VAR_proxmox_pve_node_address=\"$PROXMOX_NODE_ADDRESS\"\nexport PROXMOX_VE_INSECURE='1'\nexport PROXMOX_VE_ENDPOINT=\"$PROXMOX_URL\"\nexport PROXMOX_VE_USERNAME=\"$PROXMOX_USERNAME\"\nexport PROXMOX_VE_PASSWORD=\"$PROXMOX_PASSWORD\"\nEOF\nsource secrets-proxmox.sh\n```\n\nCreate the template:\n\n```bash\n# NB use the same file that was created as described in the\n#    rgl/windows-vagrant repository.\nsource secrets-proxmox.sh\nCHECKPOINT_DISABLE=1 PACKER_LOG=1 PACKER_LOG_PATH=packer-init.log \\\n    packer init .\nCHECKPOINT_DISABLE=1 PACKER_LOG=1 PACKER_LOG_PATH=packer-build.log \\\n    packer build \\\n      -on-error=abort \\\n      -var source_template=template-windows-11-24h2-uefi \\\n      .\n```\n\nTry the template, using terraform:\n\n```bash\npushd example-terraform\nexport CHECKPOINT_DISABLE='1'\nexport TF_LOG='DEBUG' # TRACE, DEBUG, INFO, WARN or ERROR.\nexport TF_LOG_PATH='terraform.log'\nterraform init\nterraform plan -out=tfplan\ntime terraform apply tfplan\n```\n\nLogin into the machine using SSH:\n\n```bash\nssh-keygen -f ~/.ssh/known_hosts -R \"$(terraform output --raw ip)\"\nssh \"vagrant@$(terraform output --raw ip)\"\nwhoami /all\npwsh -Command \"Disable-NetFirewallRule PROVISION-BLOCK-INTERNET-Out\"\nping google.com\nexit # ssh\n```\n\nLogin into the machine using PowerShell Remoting over SSH:\n\n```bash\npwsh\nEnter-PSSession -HostName \"vagrant@$(terraform output --raw ip)\"\n$PSVersionTable\nwhoami /all\nDisable-NetFirewallRule PROVISION-BLOCK-INTERNET-Out\nping google.com\nexit # Enter-PSSession\nexit # pwsh\n```\n\nDestroy the example:\n\n```bash\ntime terraform destroy -auto-approve\npopd\n```\n\nLogin into your Proxmox and delete the created `template-windows-sysprep-playground` template image.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frgl%2Fwindows-sysprep-playground","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frgl%2Fwindows-sysprep-playground","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frgl%2Fwindows-sysprep-playground/lists"}