{"id":13596563,"url":"https://github.com/cloudbase/windows-imaging-tools","last_synced_at":"2025-04-09T16:33:08.316Z","repository":{"id":11532265,"uuid":"14016464","full_name":"cloudbase/windows-imaging-tools","owner":"cloudbase","description":"Tools to automate the creation of a Windows image for OpenStack, supporting KVM, Hyper-V, ESXi and more.","archived":false,"fork":false,"pushed_at":"2025-03-25T10:08:22.000Z","size":14412,"stargazers_count":708,"open_issues_count":24,"forks_count":235,"subscribers_count":46,"default_branch":"master","last_synced_at":"2025-03-25T11:23:49.823Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloudbase.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"License","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":"2013-10-31T12:38:31.000Z","updated_at":"2025-03-25T10:08:27.000Z","dependencies_parsed_at":"2022-08-08T07:00:05.011Z","dependency_job_id":"3c0180a1-29a7-4a43-a6a3-f0e5fd28d980","html_url":"https://github.com/cloudbase/windows-imaging-tools","commit_stats":{"total_commits":312,"total_committers":28,"mean_commits":"11.142857142857142","dds":0.5480769230769231,"last_synced_commit":"0130ee5c53ea21b775c7a79548e44473e73fd514"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudbase%2Fwindows-imaging-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudbase%2Fwindows-imaging-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudbase%2Fwindows-imaging-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudbase%2Fwindows-imaging-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudbase","download_url":"https://codeload.github.com/cloudbase/windows-imaging-tools/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248067981,"owners_count":21042395,"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":[],"created_at":"2024-08-01T16:02:34.436Z","updated_at":"2025-04-09T16:33:03.308Z","avatar_url":"https://github.com/cloudbase.png","language":"PowerShell","readme":"Windows Imaging Tools\n===============================\n[![Master branch](https://ci.appveyor.com/api/projects/status/github/cloudbase/windows-openstack-imaging-tools?branch=master\u0026svg=true)](https://ci.appveyor.com/project/ader1990/windows-openstack-imaging-tools-w885m)\n\nWindows OpenStack Imaging Tools automates the generation of Windows images.\u003cbr/\u003e\nThe tools are a bundle of PowerShell modules and scripts.\n\nThe supported target environments for the Windows images are:\n* OpenStack with KVM, Hyper-V, VMware and baremetal hypervisor types\n* MAAS with KVM, Hyper-V, VMware and baremetal\n\nThe generation environment needs to be a Windows one, with Hyper-V virtualization enabled.\u003cbr/\u003e\nIf you plan to run the online Windows setup step on another system / hypervisor, the Hyper-V virtualization is not required.\n\nThe following versions of Windows images (both x86 / x64, if existent) to be generated are supported:\n* Windows Server 2008 / 2008 R2\n* Windows Server 2012 / 2012 R2\n* Windows Server 2016 \n* Windows Server 2019\n* Windows Server 2022\n* Windows 7 / 8 / 8.1 / 10 / 11\n\nTo generate Windows Nano Server 2016, please use the following repository:\n\nhttps://github.com/cloudbase/cloudbase-init-offline-install\n\n## Workflow of Windows imaging tools\n\u003cimg src=\"https://user-images.githubusercontent.com/1412442/29972658-8fd4d36a-8f35-11e7-80bd-cea90e48e8ba.png\" width=\"750\"\u003e\n\n\n\n## Fast path to create a Windows image\n\n### Requirements:\n\n* A Windows host, with Hyper-V virtualization enabled, PowerShell \u003e=v4 support\u003cbr/\u003e\nand Windows Assessment and Deployment Kit (ADK)\n* A Windows installation ISO or DVD\n* Windows compatible drivers, if required by the target environment\n* Git environment\n\n### Steps to generate the Windows image\n* Clone this repository\n* Mount or extract the Windows ISO file\n* Download and / or extract the Windows compatible drivers\n* If the target environment is MAAS or the image generation is configured to install updates,\u003cbr/\u003e\nthe windows-curtin-hooks and WindowsUpdates git submodules are required.\u003cbr/\u003e\nRun `git submodule update --init` to retrieve them\n* Import the WinImageBuilder.psm1 module\n* Use the New-WindowsCloudImage or New-WindowsOnlineCloudImage methods with \u003cbr/\u003e the appropriate configuration file\n\n### PowerShell image generation example for OpenStack KVM (host requires Hyper-V enabled)\n```powershell\ngit clone https://github.com/cloudbase/windows-openstack-imaging-tools.git\npushd windows-openstack-imaging-tools\nImport-Module .\\WinImageBuilder.psm1\nImport-Module .\\Config.psm1\nImport-Module .\\UnattendResources\\ini.psm1\n# Create a config.ini file using the built in function, then set them accordingly to your needs\n$ConfigFilePath = \".\\config.ini\"\nNew-WindowsImageConfig -ConfigFilePath $ConfigFilePath\n\n# To automate the config options setting:\nSet-IniFileValue -Path (Resolve-Path $ConfigFilePath) -Section \"DEFAULT\" `\n                                      -Key \"wim_file_path\" `\n                                      -Value \"D:\\Sources\\install.wim\"\n# Use the desired command with the config file you just created\n\nNew-WindowsOnlineImage -ConfigFilePath $ConfigFilePath\n\npopd\n\n```\n\n## Image generation workflow\n\n### New-WindowsCloudImage\n\nThis command does not require Hyper-V to be enabled, but the generated image\u003cbr/\u003e\nis not ready to be deployed, as it needs to be started manually on another hypervisor.\u003cbr/\u003e\nThe image is ready to be used when it shuts down.\n\nYou can find a PowerShell example to generate a raw OpenStack Ironic image that also works on KVM\u003cbr/\u003e\nin `Examples/create-windows-cloud-image.ps1`\n\n### New-WindowsOnlineImage\nThis command requires Hyper-V to be enabled, a VMSwitch to be configured for external\u003cbr/\u003e\nnetwork connectivity if the updates are to be installed, which is highly recommended.\n\nThis command uses internally the `New-WindowsCloudImage` to generate the base image and\u003cbr/\u003e\nstart a Hyper-V instance using the base image. After the Hyper-V instance shuts down, \u003cbr/\u003e\nthe resulting VHDX is shrinked to a minimum size and converted to the required format.\n\nYou can find a PowerShell example to generate a raw OpenStack Ironic image that also works on KVM\u003cbr/\u003e\nin `Examples/create-windows-online-cloud-image.ps1`\n\n## Frequently Asked Questions (FAQ)\n\n### The image generation never stops\n  * Make sure that the Hyper-V VMSwitch is correctly configured and it allows Internet connectivity\u003cbr/\u003e\n  if you have configured the image generation to install the Windows updates.\n  * Check in the associated Hyper-V VM that the Logon.ps1 script has not failed.\u003cbr/\u003e\n  If the script failed, there should be a PowerShell window showing the error message.\n\n### I booted an instance with the image and I got a BSOD\n  * This is the most common scenario that one can encounter and it is easily fixable.\n  * If you boot on KVM hypervisor, make sure that you configure the correct path for the ISO/folder with VirtIO drivers.\u003cbr/\u003e\n  The configuration options are `virtio_iso_path` and `virtio_base_path`.\n  * On the KVM hypervisor side, make sure you start the KVM vm process with the `--enable-kvm` flag.\n  * If you boot on a baremetal machine, make sure that either the basic Windows installation has the storage drivers builtin\u003cbr/\u003e\n  or that you specify the proper path to drivers folder for the `drivers_path` configuration option.\n\n### I booted an instance with the image and I got a forever Windows loading screen\n  * This usually happens when the hypervisor does not expose the CPU flags required for that specific Windows version.\n  * For example, with Windows 10, you can check https://www.microsoft.com/en-us/windows/windows-10-specifications \u003cbr/\u003e\n  and make sure that the CPU flags are exposed by your hypervisor of choice.\n\n### Useful links on ask.cloudbase.it\n  * https://ask.cloudbase.it/question/2365/windows-server-2016-standard-image-wont-boot-blue-windows-icon-hangs/\n  * https://ask.cloudbase.it/question/1227/nano-server-wont-boot/\n  * https://ask.cloudbase.it/question/1179/win2012-boot-error-on-openstack-in-vmware-env/\n\n## For developers\n\n### Running unit tests\n\nYou will need PowerShell Pester package installed on your system.\n\nIt should already be installed on your system if you are running Windows 10.\u003cbr/\u003e\nIf it is not installed you can install it on Windows 10 or greater:\n\n```powershell\nInstall-Package Pester\n```\n\nor you can clone it from: https://github.com/pester/Pester\n\n\nRunning the tests in a closed environment:\n\n```cmd\ncmd /c 'powershell.exe -NonInteractive { Invoke-Pester }'\n```\n\nThis will run all tests without polluting your current shell environment. \u003cbr/\u003e\nThis is not needed if you run it in a Continuous Integration environment.\n","funding_links":[],"categories":["PowerShell"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudbase%2Fwindows-imaging-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudbase%2Fwindows-imaging-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudbase%2Fwindows-imaging-tools/lists"}