cloudbase / windows-imaging-tools

Tools to automate the creation of a Windows image for OpenStack, supporting KVM, Hyper-V, ESXi and more.
Apache License 2.0
680 stars 227 forks source link

add windows 11 support #366

Closed aeloyq closed 2 years ago

MrEasy commented 2 years ago

Hi, Gave it a try, but the version check in Add-VirtIODrivers results in "w10" for me. Might not make a difference in output, since the mapped virtIO build-numbers are equal.

Example output of Get-WimFileImagesInfo. Note the version for Win11 still is 10. Also note the difference in ImageName and ImageDisplayName:

Handle                  : WIMInterop.NativeMethods+WimImageHandle
ImageIndex              : 6
ImageName               : Windows 10 Pro
ImageEditionId          : Professional
ImageFlags              : Professional
ImageProductType        : WinNT
ImageInstallationType   : Client
ImageDescription        : Windows 10 Pro
ImageSize               : 16161670096
ImageArchitecture       : AMD64
ImageDefaultLanguage    : en-GB
ImageVersion            : 10.0.22000.318
ImageDisplayName        : Windows 11 Pro
ImageDisplayDescription : Windows 11 Pro
aeloyq commented 2 years ago

Hi, Gave it a try, but the version check in Add-VirtIODrivers results in "w10" for me. Might not make a difference in output, since the mapped virtIO build-numbers are equal.

Example output of Get-WimFileImagesInfo. Note the version for Win11 still is 10. Also note the difference in ImageName and ImageDisplayName:

Handle                  : WIMInterop.NativeMethods+WimImageHandle
ImageIndex              : 6
ImageName               : Windows 10 Pro
ImageEditionId          : Professional
ImageFlags              : Professional
ImageProductType        : WinNT
ImageInstallationType   : Client
ImageDescription        : Windows 10 Pro
ImageSize               : 16161670096
ImageArchitecture       : AMD64
ImageDefaultLanguage    : en-GB
ImageVersion            : 10.0.22000.318
ImageDisplayName        : Windows 11 Pro
ImageDisplayDescription : Windows 11 Pro

Could you please try to print out $image.ImageVersion.Major in WinImageBuilder.psm1 to make sure you got the right win11 installer image.

And, please comfirm that w11 does exsist in your virtio driver pack.

Also, please provide your auto generated Examples\config.ini which may be helpful to locate the problem.

MrEasy commented 2 years ago

Hi @aeloyq,

Here is the output (matches the Get-WimFileImagesInfo):

$majorvVersion = $image.ImageVersion.Major
$minorVersion = $image.ImageVersion.Minor
$imageInstallationType = $image.ImageInstallationType
$imageName = $image.ImageName
$imageDisplayName = $image.ImageDisplayName

Write-Log "Major: $majorvVersion"
Write-Log "Minor: $minorVersion"
Write-Log "ImageInstallationType: $imageInstallationType"
Write-Log "ImageName: $imageName"
Write-Log "ImageDisplayName: $imageDisplayName"

12.06.2022 18:28:22 - Major: 10
12.06.2022 18:28:22 - Minor: 0
12.06.2022 18:28:22 - ImageInstallationType: Client
12.06.2022 18:28:22 - ImageName: Windows 10 Home N
12.06.2022 18:28:22 - ImageDisplayName: Windows 11 Home N

This is a Win11 installer ISO (and installs Win11 definitely ;)). Confirm: Using virtio-win-0.1.217.iso, which does contain amd64\w11

Config: config.ini.txt

aeloyq commented 2 years ago

Hi @aeloyq,

Here is the output (matches the Get-WimFileImagesInfo):

$majorvVersion = $image.ImageVersion.Major
$minorVersion = $image.ImageVersion.Minor
$imageInstallationType = $image.ImageInstallationType
$imageName = $image.ImageName
$imageDisplayName = $image.ImageDisplayName

Write-Log "Major: $majorvVersion"
Write-Log "Minor: $minorVersion"
Write-Log "ImageInstallationType: $imageInstallationType"
Write-Log "ImageName: $imageName"
Write-Log "ImageDisplayName: $imageDisplayName"

12.06.2022 18:28:22 - Major: 10
12.06.2022 18:28:22 - Minor: 0
12.06.2022 18:28:22 - ImageInstallationType: Client
12.06.2022 18:28:22 - ImageName: Windows 10 Home N
12.06.2022 18:28:22 - ImageDisplayName: Windows 11 Home N

This is a Win11 installer ISO (and installs Win11 definitely ;)). Confirm: Using virtio-win-0.1.217.iso, which does contain amd64\w11

Config: config.ini.txt

Hi @MrEasy,

That's really strange!

If you don't mind, please have another try with this image link, or simply call dism /Get-WimInfo /WimFile:install.wim to fetch some information of installer image and make sure the index of win11 version here matches the one in $image = (Get-WimFileImagesInfo -WimFilePath $wimFilePath)[1] (note that the former one is 1-indexed and the latter one is 0-indexed, so you should minus one before checking).

MrEasy commented 2 years ago

Output of Get-WimInfo attached - looks good to me. Get-WimInfo.txt

@aeloyq Also downloaded your ISO .- this is the same actually, only difference is yours is English (US), mine was English (international). Both show the same: Get-WimFileImagesInfo returning the info provided in comment above (major version: 10), Get-WimInfo showing result attached (Win 11 as expected). Would expect you to retrieve the same result from it.

Btw: Generated Win11 machine works fine in openStack - only an issue with corrupt OneNote, which sysprep also moaned about while generating.

ader1990 commented 2 years ago

Hello,

We have not added support for the W11 on the drivers side as the versions of the virtio drivers (I mean the files), were exact matches for the ones in the w10 folder. Are the drivers different right now?

aeloyq commented 2 years ago

Hello,

We have not added support for the W11 on the drivers side as the versions of the virtio drivers (I mean the files), were exact matches for the ones in the w10 folder. Are the drivers different right now?

Unfortunately, this is still the case.

However, w11 (same as w10) drivers have worked for me (over kvm supervisor) so far with Windows 11. Perhaps it's because they both use the same major and minor version of the Windows NT kernel.

Interop.ps1 retrieves the erroneous image name information from the Windows 11 WIM file, which is the current issue. This could be due to the fact that the Windows 11 installer image contains unmodified information or that WIM file has a different data structure.

aeloyq commented 2 years ago

Seems already changed on master :)