Giter VIP home page Giter VIP logo

windows-imaging-tools's Introduction

Windows Imaging Tools

Master branch

Windows OpenStack Imaging Tools automates the generation of Windows images.
The tools are a bundle of PowerShell modules and scripts.

The supported target environments for the Windows images are:

  • OpenStack with KVM, Hyper-V, VMware and baremetal hypervisor types
  • MAAS with KVM, Hyper-V, VMware and baremetal

The generation environment needs to be a Windows one, with Hyper-V virtualization enabled.
If you plan to run the online Windows setup step on another system / hypervisor, the Hyper-V virtualization is not required.

The following versions of Windows images (both x86 / x64, if existent) to be generated are supported:

  • Windows Server 2008 / 2008 R2
  • Windows Server 2012 / 2012 R2
  • Windows Server 2016
  • Windows Server 2019
  • Windows Server 2022
  • Windows 7 / 8 / 8.1 / 10 / 11

To generate Windows Nano Server 2016, please use the following repository:

https://github.com/cloudbase/cloudbase-init-offline-install

Workflow of Windows imaging tools

Fast path to create a Windows image

Requirements:

  • A Windows host, with Hyper-V virtualization enabled, PowerShell >=v4 support
    and Windows Assessment and Deployment Kit (ADK)
  • A Windows installation ISO or DVD
  • Windows compatible drivers, if required by the target environment
  • Git environment

Steps to generate the Windows image

  • Clone this repository
  • Mount or extract the Windows ISO file
  • Download and / or extract the Windows compatible drivers
  • If the target environment is MAAS or the image generation is configured to install updates,
    the windows-curtin-hooks and WindowsUpdates git submodules are required.
    Run git submodule update --init to retrieve them
  • Import the WinImageBuilder.psm1 module
  • Use the New-WindowsCloudImage or New-WindowsOnlineCloudImage methods with
    the appropriate configuration file

PowerShell image generation example for OpenStack KVM (host requires Hyper-V enabled)

git clone https://github.com/cloudbase/windows-openstack-imaging-tools.git
pushd windows-openstack-imaging-tools
Import-Module .\WinImageBuilder.psm1
Import-Module .\Config.psm1
Import-Module .\UnattendResources\ini.psm1
# Create a config.ini file using the built in function, then set them accordingly to your needs
$ConfigFilePath = ".\config.ini"
New-WindowsImageConfig -ConfigFilePath $ConfigFilePath

# To automate the config options setting:
Set-IniFileValue -Path (Resolve-Path $ConfigFilePath) -Section "DEFAULT" `
                                      -Key "wim_file_path" `
                                      -Value "D:\Sources\install.wim"
# Use the desired command with the config file you just created

New-WindowsOnlineImage -ConfigFilePath $ConfigFilePath

popd

Image generation workflow

New-WindowsCloudImage

This command does not require Hyper-V to be enabled, but the generated image
is not ready to be deployed, as it needs to be started manually on another hypervisor.
The image is ready to be used when it shuts down.

You can find a PowerShell example to generate a raw OpenStack Ironic image that also works on KVM
in Examples/create-windows-cloud-image.ps1

New-WindowsOnlineImage

This command requires Hyper-V to be enabled, a VMSwitch to be configured for external
network connectivity if the updates are to be installed, which is highly recommended.

This command uses internally the New-WindowsCloudImage to generate the base image and
start a Hyper-V instance using the base image. After the Hyper-V instance shuts down,
the resulting VHDX is shrinked to a minimum size and converted to the required format.

You can find a PowerShell example to generate a raw OpenStack Ironic image that also works on KVM
in Examples/create-windows-online-cloud-image.ps1

Frequently Asked Questions (FAQ)

The image generation never stops

  • Make sure that the Hyper-V VMSwitch is correctly configured and it allows Internet connectivity
    if you have configured the image generation to install the Windows updates.
  • Check in the associated Hyper-V VM that the Logon.ps1 script has not failed.
    If the script failed, there should be a PowerShell window showing the error message.

I booted an instance with the image and I got a BSOD

  • This is the most common scenario that one can encounter and it is easily fixable.
  • If you boot on KVM hypervisor, make sure that you configure the correct path for the ISO/folder with VirtIO drivers.
    The configuration options are virtio_iso_path and virtio_base_path.
  • On the KVM hypervisor side, make sure you start the KVM vm process with the --enable-kvm flag.
  • If you boot on a baremetal machine, make sure that either the basic Windows installation has the storage drivers builtin
    or that you specify the proper path to drivers folder for the drivers_path configuration option.

I booted an instance with the image and I got a forever Windows loading screen

Useful links on ask.cloudbase.it

For developers

Running unit tests

You will need PowerShell Pester package installed on your system.

It should already be installed on your system if you are running Windows 10.
If it is not installed you can install it on Windows 10 or greater:

Install-Package Pester

or you can clone it from: https://github.com/pester/Pester

Running the tests in a closed environment:

cmd /c 'powershell.exe -NonInteractive { Invoke-Pester }'

This will run all tests without polluting your current shell environment.
This is not needed if you run it in a Continuous Integration environment.

windows-imaging-tools's People

Contributors

acudovs avatar ader1990 avatar alexpilotti avatar andreitira avatar bitskri3g avatar embray avatar felfert avatar fguitton avatar gabriel-samfira avatar gluka-cbs avatar gnicoleta avatar hoppla20 avatar ilenghel avatar ionutbalutoiu avatar it-praktyk avatar jacekchalupka avatar logan2211 avatar lukaskoenen avatar ociuhandu avatar thorntonryan avatar tomcsanyid avatar ufflo avatar victormegherea avatar winscap avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

windows-imaging-tools's Issues

Exception in Powershell Script ?

I've downloaded and am trying to run this on Windows. Unfortunately I keep getting the following errors.

Any ideas ?

PS C:\Users\richard\Documents\cloudbase\windows-openstack-imaging-tools-master\windows-openstack-imaging-tools-master> Import-Module .\WinImageBuilder.psm1
You must provide a value expression on the right-hand side of the '-' operator.
At C:\Users\richard\Documents\cloudbase\windows-openstack-imaging-tools-master\windows-openstack-imaging-tools-master\W
inImageBuilder.psm1:326 char:33

  •     if ($VirtualDiskFormat - <<<< in @("VHD", "VHDX"))
    
    • CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
    • FullyQualifiedErrorId : ExpectedValueExpression

Import-Module : The specified module '.\WinImageBuilder.psm1' was not loaded because no valid module file was found in
any module directory.
At line:1 char:14

  • Import-Module <<<< .\WinImageBuilder.psm1
    • CategoryInfo : ResourceUnavailable: (.\WinImageBuilder.psm1:String) [Import-Module], FileNotFoundExcept
      ion
    • FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

BFSVC Error: Failed to validate boot manager checksum

My host is server 2012r2. Trying to create a windows 7 image. Only variable I've adjusted in the initial script is $virtIOISOPath. I adjusted the name of the iso here.

I launch the initial script and get a pop-up regarding the need to format drive E and then it errors out with this. Working through figuring it out now, but thought I would check to see if anything jumps out at anyone. Thanks!

**PS C:\mark\windows-openstack-imaging-tools-master> .\image_create.ps1

Handle : WIMInterop.NativeMethods+WimImageHandle
ImageIndex : 1
ImageName : Microsoft Windows PE (x64)
ImageEditionId : WindowsPE
ImageFlags :
ImageProductType : WinNT
ImageInstallationType : WindowsPE
ImageDescription : Microsoft Windows PE (x64)
ImageSize : 2487257353
ImageArchitecture : AMD64
ImageDefaultLanguage : en-US
ImageVersion : 6.3.9600.16384
ImageDisplayName :
ImageDisplayDescription :

WARNING: "E:\windows\system32\bcdboot.exe" not found, using online version
BFSVC Error: Failed to validate boot manager checksum (E:\windows\boot\PCAT\bootmgr)! Error code = 0xc1
Failure when attempting to copy boot files.
BCDBoot failed
At C:\mark\windows-openstack-imaging-tools-master\WinImageBuilder.psm1:138 char:25

  • if($LASTEXITCODE) { throw "BCDBoot failed" }
    
  •                     ~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : OperationStopped: (BCDBoot failed:String) [], RuntimeException
    • FullyQualifiedErrorId : BCDBoot failed**

Windows 2012R2 with VirtIO 0.1.126 fails to boot on KVM environment

A Windows Server 2012r2 image generated using VirtIO drivers version 0.1.126 (currently latest stable) fails to boot. It seems that this happens because WdfCoInstaller01011.dll is missing from 2k12R2 directory from the ISO file.

Solution: Windows Server 2012R2 and Windows 8.1 share the same kernel so we can use the WdfCoInstaller01011.dll file from 8.1\amd64. Extract the all folders from the VirtIO ISO and copy WdfCoInstaller01011.dll form 8.1\amd64 to 2k12R2\amd64. Also, the $VirtIOBasePath parameter must be set to the location of the directory where the ISO has been extracted.

VirtIO drivers require confirmation

When building Windows Server 2012 DataCenter with latest VirtIO (virtio-win-0.1-81.iso), during the installation process, the installer asks to confirm the drivers' signature.
There is only a few seconds to do that and if confirmed, everything works fine. If not, the image builds successfully but will die with a blue screen when deployed on a VirtIO devicde.

Not an issue, just a little praise

I am glad to see that you added the proper conditional statements to install VirtIO drivers correctly, I wrote the same exact code back in October. I like your addition of fixing the BCD File. I realized that had to be done but i just commented out the image conversion and after the script ran remounted the VHD, ran a fixboot, fixmbr, and rebuildbcd using bootrec, then unmounted the VHD and manually converted the VHD over to the OpenStack destination format.

Provided autounattend.xml doesn't work Wndows 2008 R2

I am using the evaluation ISO from Microsoft named "7601.17514.101119-1850_x64fre_server_eval_en-us-GRMSXEVAL_EN_DVD.iso"

I have edited autounattend.xml and replaced "Windows Server 2012 R2 SERVERSTANDARD" by Windows Server 2008 R2 SERVERSTANDARD

The installation fails quite early with the following error "Windows could not parse or process unattend answer file for pass [oobeSystem]"

Jordan

Document prerequisites

Hi,

could you add a description of the necessary environment to run this successfully?

This seems to run on Windows 8.1 but I had trouble getting this to work on 2008R2 where I initially started testing this. (i.e. it didn't work, crashed and somehow locked the created files until I rebooted.).

I managed so far to determine that you need at least

Powershell 3.0
.Net 4.5
ADK

Even on Windows 8.1 it concludes with:

Boot files successfully created.
New-WindowsCloudImage : Exception calling "OpenVirtualDisk" with "1" argument(s): "The system cannot find the file
specified"
At
C:\Users\john\Downloads\windows-openstack-imaging-tools-master\windows-openstack-imaging-tools-master\newiso.ps1:21
char:1

  • New-WindowsCloudImage -WimFilePath $wimFilePath -ImageName $image.ImageName `
  • - CategoryInfo          : NotSpecified: (:) [New-WindowsCloudImage], MethodInvocationException
    - FullyQualifiedErrorId : Win32Exception,New-WindowsCloudImage
    

How to generate mywindowsimage.qcow2

Hi
I use qemucommand " qemu-img create -f qcow2 mywindowsimage.qcow2 8192 " to generate mywindowsimage.qcow2 , but when run New-WindowsCloudImage , it tell me disk space not enough, can any one tell me how to fix it

New-WindowCloudImage: The variable '$v' cannot be retrieved

I am receiving the following error when trying to build a 2008 R2 qcow2 image:

New-WindowsCloudImage : The variable '$v' cannot be retrieved because it has not been set.
At C:\Images\windows-openstack-imaging-tools-master\build-2008r2-kvm.ps1:21 char:5
+     New-WindowsCloudImage -WimFilePath $wimFilePath -ImageName $image.ImageName  ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (v:String) [New-WindowsCloudImage], RuntimeException
    + FullyQualifiedErrorId : VariableIsUndefined,New-WindowsCloudImage

Here is my build script:

Import-Module .\WinImageBuilder.psm1


$virtualDiskPath = "C:\Images\windows-openstack-imaging-tools-master\win2008r2-002.qcow2"

$wimFilePath = "C:\Images\windows-openstack-imaging-tools-master\2008r2-src\sources\install.wim"

$virtIOISOPath = "C:\Images\windows-openstack-imaging-tools-master\virtio-win-0.1-81.iso"

$images = Get-WimFileImagesInfo -WimFilePath $wimFilePath

$image = $images[0]
$image

New-WindowsCloudImage -WimFilePath $wimFilePath -ImageName $image.ImageName -VirtualDiskFormat QCow2 -VirtualDiskPath $virtualDiskPath -SizeBytes 16GB -VirtIOISOPath $virtIOISOPath

Any ideas?

Powershell scripts won't run on start up due to execution policy

Once the image has been built, glance creates, and I start a new instance with it, I get the error:

C:\UnattendResources\Specialize.ps1 cannod be loaded. The file C:\UnattendResources\Specialize.ps1 is not digitally signed.

If I change the UnattendTemplate.xml file to open any of the powershell scripts (specialize/logon/firstlogon) with the argument "Bypass" or "Unrestricted" for the execution policy argument then it is ignored. Once the instance is created and I go into the console, I can see that the unattend.xml present is not the one that I specified! And the execution policy argument remains "RemoteSigned".

Any help would be much appreciated.

Custom Cloudbase Configuration Options

Hello,
I wonder if it's possible to pass configuration options to the Cloudbase-Init installer during New-WindowsOnlineImage? I want to configure several options in the cloudbase-init.conffile.

Unable to run Win 2008 and Win 2012 Instances as they keeps on rebooting

Hi,

I tried to build Windows 2008/Windows 2008 R2 and Windows 2012 instances through this tool. When tried to launch an instance on openstack with Win 2008 or Win 2008 R2 the instance keeps rebooting and before rebooting it encounter blue screen dump.

When I tried to build 2012 Std Edition image, the KVM did not exit on its own rather image on KVM keeps running and I have to manually shutdown the image on the KVM server. Also, I checked the NIC shown in the Windows 2012 image is "Realtek .xxxx" is this NIC right. Also, I could not neither ping any host on the internet nor any host in the LAN whereas the default gateway was responding. I disabled the Windows Firewall on the Win 2012. What could be for the KVM for not exiting properly.

When I tried to launch the instance based on Win 2012 image on Openstack, the image keep on rebooting itself..

Please tell me what logs should I share from the KVM server, Windows Images and from the Openstack to fix this problem..

Thanks & Regards

Ankush Grover

openstack-windows

No license file

Please, add a license to repository. Formally, nobody can use or modify your software for now, something like 'all rights reserved' applying.

bcdboot.exe : BFSVC Warning: Resource files missing

I try to create a win2012r2 image for MAAS. During the script execution, I got the following error:

bcdboot.exe : BFSVC Warning: Resource files missing from F:\windows\boot\Resources. These files are required for some editions of 
Windows. If you are servicing older versions of Windows, you can ignore this message.
At C:\Users\Administrator\Documents\windows-openstack-imaging-tools\WinImageBuilder.psm1:208 char:9
+         & $bcdbootPath ${windowsDrive}\windows /s ${systemDrive} /v / ...
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (BFSVC Warning: ...e this message.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

There is my PowerShell script:


# The Windows image file path that will be generated
$windowsImagePath = "D:\ISO\win2012hvr2-dd"

# The wim file path is the installation image on the Windows ISO
$wimFilePath = "E:\sources\install.wim"

# Every Windows ISO can contain multiple Windows flavors like Core, Standard, Datacenter
# Usually, the first image version is the Core one
$image = (Get-WimFileImagesInfo -WimFilePath $wimFilePath)[0]

New-MaaSImage -WimFilePath $wimFilePath -ImageName $image.ImageName `
    -MaaSImagePath $windowsImagePath -SizeBytes 16GB -Memory 4GB `
    -CpuCores 2 -DiskLayout BIOS -RunSysprep

I tried to re-download a new ISO of Windows Server 2012r2 (just to be sure) but it doesn't change anything...

Windowsupdate module is missing

Following the instructions in README, 'UnattendResources/WindowsUpdate' appears empty after cloning, resulting is IOFile -error when running 'New-WindowsOnlineImage -InstallUpdates'.

Instructions mentions the need for submodules in relation to MaaS and updates but it is easy to miss and as installing updates is the recommended approach, the instructions might benefit from including '--recursive' to clone submodules aswell for the example.

Detach-VirtualDisk Fails and Hangs Windows 10 During VirtIO Driver Copy

I've run into an issue during the build process on Windows 10 that seems new (same build worked about 6 months ago, so I'm wondering if one of these Win 10 updates changed something).

During creation of image, I add virtio drivers for KVM support. Powershell successfully shows the logs stating each driver was copied successfully. At the end, however, it hangs. Not only that, but the whole system becomes pretty non-responsive, windows explorer starts hanging, and the only solution is to physically power cycle the box.

After debugging, it looks like the hanging and issues kick in in the Detach-VirtualDisk function with the call to $v.DetachVirtualDisk() after copying all the drivers from ISO. I'm not sure what causes this. If I reboot, manually mount disk, and then make the same calls in powershell to detach, it works fine.

Anyone know what could cause this lock up?

The Boot Configuration Data for your PC is missing or contains errors (Windows-Server-2012-R2)

I get the below error in virtual box, after formatting the windows-server-2012-R2 ISO to VHD format

image

I believe I have done the below correctly

  • I'm running windows 10 host
  • I've unblocked the files in powershell
PS D:\Documents\MEP-OPENSTACK\windows-openstack-imaging-tools> dir


    Directory: D:\Documents\MEP-OPENSTACK\windows-openstack-imaging-tools


Mode                LastWriteTime         Length Name                                                               
----                -------------         ------ ----                                                               
d-----       15/02/2016  11:16 AM                bin                                                                
d-----       15/02/2016  11:16 AM                UnattendResources                                                  
-a----       15/02/2016  11:16 AM          50682 Interop.ps1                                                        
-a----       15/02/2016  11:16 AM           2890 README.md                                                          
-a----       15/02/2016  11:16 AM           4594 Unattend.xslt                                                      
-a----       15/02/2016  11:16 AM          10887 UnattendTemplate.xml                                               
-a----       15/02/2016  11:16 AM          15979 WinImageBuilder.psm1                                               



PS D:\Documents\MEP-OPENSTACK\windows-openstack-imaging-tools> Unblock-File -Path .\*

PS D:\Documents\MEP-OPENSTACK\windows-openstack-imaging-tools> Unblock-File -Path .\bin\*

PS D:\Documents\MEP-OPENSTACK\windows-openstack-imaging-tools> Unblock-File -Path .\UnattendResources\*

Windows 2012 R2 Ent with over 64GB of RAM

I used the script to build an image, which worked well, however now that im spinning up VMs with it i've come across an issue with VMs that have over 64GB of RAM. After the creation of an instance as windows boots I get the following error

Windows could not finish configuration the system. To attempt to resume configuration, restart computer.

So, i restart it and it ends up back at the same error message.

Thoughts?

Windows 7 BCDboot Error

Been trying to create a Windows 7 Image, Tried 3 different hosts and keep getting this error,

Deployment Image Servicing and Management tool
Version: 6.3.9600.17031

Applying image
[==========================100.0%==========================]
The operation completed successfully.

Bcdboot - Bcd boot file creation and repair tool.

The bcdboot.exe command-line tool is used to copy critical boot files to the
system partition and to create a new system BCD store.

bcdboot [/l ] [/s ] [/v]
[/m [{OS Loader ID}]]

source Specifies the location of the windows system root.

/l Specifies an optional locale parameter to use when
initializing the BCD store. The default is US English.

/s Specifies an optional volume letter parameter to designate
the target system partition where boot environment files are
copied. The default is the system partition identified by
the firmware.

/v Enables verbose mode.

/m If an OS loader GUID is provided, this option merges the
given loader object with the system template to produce a
bootable entry. Otherwise, only global objects are merged.

Examples: bcdboot c:\windows /l en-us
bcdboot c:\windows /s h:
bcdboot c:\windows /m {d58d10c6-df53-11dc-878f-00064f4f4e08}
BCDBoot failed
At C:\windows-openstack-imaging-tools-master\WinImageBuilder.psm1:99 char:25

  • if($LASTEXITCODE) { throw "BCDBoot failed" }
    
  •                     ~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : OperationStopped: (BCDBoot failed:String) [], RuntimeException
    • FullyQualifiedErrorId : BCDBoot failed

Thanks!

Exception calling "OpenVirtualDisk" with "1" argument(s)

After the vhd is created, mounted and the image is applied. I continue to get the following error. What am i missing/doing wrong? Any help would be greatly appreciated. Thanks!

Applying image
[==========================100.0%==========================]
The operation completed successfully.
BFSVC Warning: Resource files missing from F:\windows\boot\Resources. These files are required for some editions of Windows. If you are servicing older versions of Windows, you can ignore this message. Boot files successfully created.
C:\Temp\OpenStack\virtio-win-0.1-100.iso
C:\Temp\OpenStack\Images\Win2012r2.vhd

New-WindowsCloudImage : Exception calling "OpenVirtualDisk" with "1" argument(s): "The system cannot find the file specified"
At line:1 char:1

  • New-WindowsCloudImage -WimFilePath $wimFilePath -ImageName $image.ImageName -Vir ...
  • - CategoryInfo          : NotSpecified: (:) [New-WindowsCloudImage], MethodInvocationException
    - FullyQualifiedErrorId : Win32Exception,New-WindowsCloudImage
    

Windows 7 Unattend Template

Which settings would I need to adjust in the unattend file to get a Windows 7 Ultimate deploy working? I did not change any settings in it and just followed the README from this guide, which worked and generated the qcow2 image from virtio. I managed to get it imported into glance and launched, but at that point it was hung with an error "Windows could not parse or process the unattend answer file for pass [specialize]"

I noticed somewhere in the output from the powershell script that it thought it was Windows 7 HOMEBASIC detected - is this something I need to change somewhere or would that have no affect and is just used when figuring out which OS virtio drivers get installed?

Thanks in advance.

Logon.ps1 issue. No folder "$ENV:\ProgramFiles (x86)\" on x86 systems

  $Host.UI.RawUI.WindowTitle = "Running SetSetupComplete..."
    & "$ENV:ProgramFiles (x86)\Cloudbase Solutions\Cloudbase-Init\bin\SetSetupComplete.cmd"
    $Host.UI.RawUI.WindowTitle = "Running Sysprep..."
    $unattendedXmlPath = "$ENV:ProgramFiles (x86)\Cloudbase Solutions\Cloudbase-Init\conf\Unattend.xml"
    & "$ENV:SystemRoot\System32\Sysprep\Sysprep.exe" `/generalize`/oobe `/shutdown`/unattend:"$unattendedXmlPath" <\code><\pre>

About the Admin Account

Since I have to delete the "Administrator" account after the sysprep (it causes two desktop paths), I need to use the Admin account for the client OS access, so what is the default password for "Admin" (tried passwords in config.ini & UnattendTemplate.xml, did not work), or How can it be set? Thanks

Windows 2008 R2 BCDEdit

Hi , While trying to create the windows 2008 R2 image using the script it gives the BCDEdit warning message : WARNING: BCDEdit failed: bootmgr device locate. It does create an image file though, however once we boot the image it is giving error while installing the cloudbaseinit packages.

Building Windows 7

Would this work with Windows 7? What changes would I have to make? I see "WINDOWS 7 ENTERPRISE" in the Autounattend.xml file, but I'm guessing there would be more that would have to happen to build a Windows 7 image?

Windows 2016 - Boot Bluescreen

Hello,
Working to make a Win 2016 server standard (desktop experience) instance on OS. After uploading the vhd and creating an instance I get multiple BSOD like thi.s
image

After a couple of tries, Windows wants to be repaired.

I have a suspicion that it is related to some files that are not found during the New-WindowsCloudImage commandlet work.

image

The image created opened in virtual box quite nicely and did all the firstlogin, and login tasks and shutdown. But after uploading the resulting vhd to OpenStack, it doesn't start well.

Is there an example of config.ini for bare metal ?

Hi, I am trying to use Maas for deploying windows images into bare metal servers. As I followed the instruction from https://github.com/cloudbase/windows-openstack-imaging-tools/tree/experimental , I successfully created a windows-2012 image for MAAS (in my config.ini, "image_type=MAAS "), I noticed the README.MD explicitly shows the supported environments includes "MAAS with KVM, Hyper-V, VMware and baremetal" . But after the deployment at MAAS, the server keeps rebooting non-stop. So may I ask how should I make any adjustment?
Thanks

can't run the powershell

OS: win10 1703(15063.608)

PS D:\git\windows-openstack-imaging-tools\Examples> D:\git\windows-openstack-imaging-tools\Examples\create-windows-cloud-image.ps1
Image generation started at: 2017/9/19 10:49:05
Transform-Xml : 使用“3”个参数调用“AddParam”时发生异常:“值不能为 null。
参数名: parameter”
所在位置 D:\git\windows-openstack-imaging-tools\WinImageBuilder.psm1:281 字符: 5
+     Transform-Xml "$scriptPath\Unattend.xslt" $inUnattendXmlPath $out ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Transform-Xml], MethodInvocationException
    + FullyQualifiedErrorId : ArgumentNullException,Transform-Xml

PS D:\git\windows-openstack-imaging-tools\Examples>

Desktop Background

Hi

Just wondering, are we able to change the desktop background?

image

I've tried to manually change the desktop background, but seems like there're restrictions on doing this. The background doesn't change after "Save changes" is pressed

Windows 2008 R2 and 2012 STD Windows updates does not work

Hi Team,

Following to the suggestion provided by Adrian creating a new forum for the windows update issue.

Windows 2008 R2 updates was working till couple of days back which has now stopped working. Windows 2012 STD never worked for WSUS updates. we have our central WSUS server which we use for Windows updates and I also created a new WSUS server just to test these images. However it does not work with either of them. The challenge is the WSUS updates does not work during the logon script execution however if I stop the script, extract the content of PSWidowsupdate to powershell Module folder import the module and call Get-WUInstall it works perfectly fine. This behavior is same for both Windows 2008 R2 and 2012 STD.

Thanks,
Parth

How to do manual Partition ?

I created two images (windows server 2012 & windows server 2008) as the example instructs. But I found both of the images lead to utilization of whole hard disks being mounted as only one partition, which is quite disagrees with my goal. Could anyone please tell me how to specify the partition scheme? Thanks

Could not find the Wim file?

when I run :
git clone https://github.com/cloudbase/windows-openstack-imaging-tools.git
pushd windows-openstack-imaging-tools
git checkout experimental
Import-Module .\WinImageBuilder.psm1
Import-Module .\Config.psm1
Import-Module .\UnattendResources\ini.psm1

$ConfigFilePath = ".\config.ini"
New-WindowsImageConfig -ConfigFilePath $ConfigFilePath

Set-IniFileValue -Path (Resolve-Path $ConfigFilePath) -Section "DEFAULT" -Key "wim_file_path"
-Value "D:\Sources\install.wim"

New-WindowsOnlineImage -ConfigFilePath $ConfigFilePath

I got an error:
image

but my wim file is ready(I suppose):
image

image

Can anyone figure it out? I actually did it before, but after I closed former terminal. I am in trouble.

Can you use Windows 10 to generate the Image for Windows Server 2012 R2

Hi,

Just wondering can you use Windows 10 as the host to generate the Image for Windows Server 2012 R2. Also With the Windows ADK installation, does it matter the install location where you put the program?

This is the location of where I installed Windows ADK, as my C drive is running out of space 😄

image

Server 2008 R2 generation fails with bcdedit error

Server 2008 R2 has an older version of bcdedit which fails on the three instructions starting here:
https://github.com/cloudbase/windows-openstack-imaging-tools/blob/master/WinImageBuilder.psm1#L149

It doesn't contain the "locate" device. Changing it to "boot" seems to be an easy fix.
Proposed solution: using the logic just above it that determines the parameters for bcdboot.exe to determine the parameters for bcdedit as well.

Exact error message:

The device is not valid as specified.
Run "bcdedit /?" for command line assistance.
The parameter is incorrect.

About the partition

Hi, there,
I have a simple question: how to make the images use partial disk space (like 100G for C:)instead of using the entire disk as C:\ during the deployment process?
Thanks

Support install.esd images

Windows 10 images (at least) obtained through Microsoft's Electronic Software Download system seem to not contain an install.wim image, but rather an install.esd. I don't know how much trouble it would be to write tools to read directly out of an esd image, but they can be converted to wim images using the dism utility.

Would it make sense to add support for this directly in the WinImageBuilder.psm1 module?

How to generate VirtIO.cer for new version of virtio?

The new version of virtio is 0.8+, during windows 2012 installation, we should mannually click confirmation when installing virtio drive, is there any way to generate a new VirtIO.cer for the new version?

Thanks.

No option to specify LocalScripts for Cloudbase-Init to run

For the moment, there is no option to automate the addition of LocalScripts to be run by cloudbase-init at the first boot. It is very cumbersome on, for example, MAAS images, to untar/ungzip, then to mount them using a loopback device in order to achieve this.

I suggest adding a configuration option:

[cloudbase-init]
local_scripts_path=""

Where the value of local_scripts_path can be C:\LocalScripts
If local_scripts_path contains the file ExecuteReboot.ps1, that file will be copied over to C:\Program Files\Cloudbase Solutions\Cloudbase-Init\LocalScripts\ExecuteReboot.ps1 and it will be executed at the first reboot after the image has been generalized and reached cloud-ready state.

Does it support building ironic baremetal windows image?

I search on the internet, I didn't find any tools support building windows images for Ironic. Even any useful manual except some blueprints and some PPTs.

  1. I use ironic in master branch and other components are mitaka branch
  2. use cloudbase windows image, download from: https://cloudbase.it/windows-cloud-images/
  3. use pxe_ipmitool driver
    Anything is OK, but after dd the image(the raw windows image that is converted from cloudbase windows image) to the baremetal node's disk. baremetal reboot meet error:
    2

Invoke-WebRequest unavailable on 2008R2

Hi there,

it's impossible to build windows 2008 image with this because FirstLogon contains call Invoke-WebRequest which is unknown in 2008 powershell

Vladimir

Image creation gets stuck at Applying image

Hi Team,
This was working fine for me 5 months back, however now when i try to generate an image using the scripts it gets stuck at DISM /apply-image and doesn't proceed at all. I tried this using ADK 8.1 and ADK 10 still no go. It doesn't allow to stop the process and the only way out is to do a Hard reboot of the VM from the console. Tried this in two different VM and facing similar issue with windows different windows image - tried with 2012R2 and STD wim images.
Even dism mount commands get stuck at around 52%.
dismerror

No ping after instance spin up

Hi Team,

After I build the new images with the Examples/create-windows-cloud-image.ps1, Windows 10 does not ping in OpenStack. I'm only using the virtio drivers that are in the script and a vanilla Windows 10 iso from MS. My OpenStack team says they modified mkfs.fat in hypervisors to make old images work after an upgrade, but the new upgrade still doesn't make win 10 images pingable.
Openstack creates their disk image and related disk.config and libvirt.xml files and marks VMs as active but they are not pingable. Any pointers?

INACCESSIBLE_BOOT_DEVICE

Hi Alex,

First of all, this is great! I tried it and it works flawlessly with WS2012R2 but I'm less fortunate with WS2012 as I get INACCESSIBLE_BOOT_DEVICE when I try to boot the VM in KVM with the virtio drivers ... Did you do anything different for that OS?

Dave

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.