-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PR: Add ability to provide custom image simultaneously with a custom automatic install (answerfile / xml) #442
Conversation
adding ability to provide a custom.iso with a custom automatic install file (answerfile / custom.xml)
adding documentation to custom.iso simultaneously with customized automatic install
this addresses #441 |
I did test this in my own environment and here are the startup logs showing that the code works ❯ Starting Windows for Docker v3.00... Here is my compose file: version: "3"
services:
windows:
image: dockurr/windows
container_name: windows
devices:
- /dev/kvm
cap_add:
- NET_ADMIN
ports:
- 8007:8006
- 3389:3389/tcp
- 3389:3389/udp
stop_grace_period: 2m
restart: on-failure
volumes:
- /srv/qemu/win-test:/storage
- /srv/qemu/InstallerCustomISO/win19_cbkw.iso:/storage/custom.iso
- /srv/qemu/InstallerAnswerfiles/win2019-eval.xml:/run/assets/custom.xml
- /srv/qemu/InstallerAnswerfiles/install.sh:/run/install.sh |
If instead of: volumes:
- /srv/qemu/InstallerAnswerfiles/win2019-eval.xml:/run/assets/custom.xml you had used: volumes:
- /srv/qemu/InstallerAnswerfiles/win2019-eval.xml:/run/assets/win2019-eval.xml there was no need for this feature anymore. So I am thinking in which kind of situations it would be an advantage. Because I can think of disadvantages: for example, if you switch ISO files a lot, this method will cause problems (because the custom Server 2019 XML in custom.xml will suddenly be used for Windows Vista for example). So everytime you place a different ISO in your So can you explain a little why its useful for you to do it in this way, because I might be overlooking something obvious? |
Maybe I'm doing something wrong. because /srv/qemu/InstallerAnswerfiles/win2019-eval.xml:/run/assets/win2019-eval.xml did not work for me when I was using a custom ISO. Compose: version: "3"
services:
windows:
image: dockurr/windows
container_name: windows2
environment:
VERSION: "2019"
devices:
- /dev/kvm
cap_add:
- NET_ADMIN
ports:
- 8007:8006
- 3389:3389/tcp
- 3389:3389/udp
stop_grace_period: 2m
restart: on-failure
volumes:
- /srv/qemu/win-test2:/storage
- /srv/qemu/InstallerCustomISO/win19_cbkw.iso:/storage/custom.iso
- /srv/qemu/InstallerAnswerfiles/win2019-eval.xml:/run/assets/win2019-eval.xml Resulted in the following in the log file:
As you can see, the xml file was not picked up. Manual installation was selected. How would you recommend solving this issue? I suppose maybe you will say that the rest of the detectImage() function should be finding the name of the image, and then getVersion should be selecting '2019'. This would be very nice if it was working, and if that is the goal than I agree with you that this PR is a bad solution... Is there something I need to do to my install.wim or my custom.iso to allow the detectImage() and/or getVersion() to properly choose the .xml? For transparency I built the custom windows image myself using this KB: Very much appreciate your time. This package is incredible! EDIT: Also let me know if there is anything I need to provide to you to allow you and I to come to the best possible solution. ( I can modify the script to add additional logging, whatever you need ) |
Yes the goal is to have the It calls Without seeing that XML I cannot say if it could be fixed easily, so you could add an I will accept this pull-request anyway, because I did not realize there were cases where the detection could fail. And I agree its very useful in those cases. But I will remove the addition to the readme, because its not for normal usage. |
I did grab the XML here it is : ��<WIM><TOTALBYTES>5888548057</TOTALBYTES><IMAGE INDEX="1"><DIRCOUNT>32672</DIRCOUNT><FILECOUNT>170638</FILECOUNT><TOTALBYTES>17116351717</TOTALBYTES><HARDLINKBYTES>6027849923</HARDLINKBYTES><CREATIONTIME><HIGHPART>0x01DA9B3C</HIGHPART><LOWPART>0x83699E16</LOWPART></CREATIONTIME><LASTMODIFICATIONTIME><HIGHPART>0x01DA9B3C</HIGHPART><LOWPART>0x841ED25F</LOWPART></LASTMODIFICATIONTIME><WIMBOOT>0</WIMBOOT><WINDOWS><ARCH>9</ARCH><PRODUCTNAME>Microsoft� Windows� Operating System</PRODUCTNAME><EDITIONID>ServerStandardEval</EDITIONID><INSTALLATIONTYPE>Server</INSTALLATIONTYPE><SERVICINGDATA><GDRDUREVISION>0</GDRDUREVISION><PKEYCONFIGVERSION>10.0.17763.2989;2016-01-01T00:00:00Z</PKEYCONFIGVERSION><IMAGESTATE>IMAGE_STATE_GENERALIZE_RESEAL_TO_OOBE</IMAGESTATE></SERVICINGDATA><HAL>acpiapic</HAL><PRODUCTTYPE>ServerNT</PRODUCTTYPE><PRODUCTSUITE>Terminal Server</PRODUCTSUITE><LANGUAGES><LANGUAGE>en-US</LANGUAGE><DEFAULT>en-US</DEFAULT></LANGUAGES><VERSION><MAJOR>10</MAJOR><MINOR>0</MINOR><BUILD>17763</BUILD><SPBUILD>3650</SPBUILD><SPLEVEL>0</SPLEVEL><BRANCH>rs5_release</BRANCH></VERSION><SYSTEMROOT>WINDOWS</SYSTEMROOT></WINDOWS><NAME>19CB</NAME><DESCRIPTION>Win2019 with KW and CB</DESCRIPTION></IMAGE></WIM> I will say that when I created the .wim file I did specify a 'name' and 'description' per the KB I linked above and those strings do appear in the XML: <NAME>19CB</NAME><DESCRIPTION>Win2019 with KW and CB</DESCRIPTION> I wonder if there is a 'ProductName' option when I create the .wim. I will look into that. EDIT: there is no CLI option for 'ProductName' in dism /CaptureImage, but there are 'name' and 'description'. Maybe the true solution is to name / describe isos correctly when using dsim, and updating the bash script here to fall back to 'name' and 'description' |
For example, this an output XML that is good:
It first reads the But ISO's with the field Maybe we had a misunderstanding about what a "custom iso" is. For me, it means an iso that you downloaded yourself from the Microsoft servers. And its custom, because it was never tested unlike the automatic ISOs. But in most cases they will work. But for you a custom ISO is one that you manually modified, which will be even harder to support. |
Would you consider a pull request to add fallback of 'name' and 'description' tags? EDIT: It does look like your example also includes 'name' and 'description' |
Ow yes, I see that now. But Im not sure what to do with them, because for every ISO that Microsoft ever has released there is a DISPLAYNAME. And for ISOs that people created themselves, the NAME and DESCRIPTION are basicly free text fields. So they will in most cases not contain anything that I need, like |
I reverted the PR because there were two situations where it did not work. First was for older Windows versions like 7 and below (it needs a valid The solution was very simple, to alter only the I also realized there was a much easier solution for your initial problem, it would have been solved just by setting:
This overrides the detection, and it would not have been necessary to modify the name in your ISO or use a custom.xml. In any case, I will commit the reworked code tomorrow (which now correctly reads the NAME tag and supports custom.xml in a better way). |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Update | Change | Pending | |---|---|---|---| | [dockurr/windows](https://togithub.com/dockur/windows) | minor | `3.00` -> `3.01` | `3.02` | --- ### Release Notes <details> <summary>dockur/windows (dockurr/windows)</summary> ### [`v3.01`](https://togithub.com/dockur/windows/releases/tag/v3.01) [Compare Source](https://togithub.com/dockur/windows/compare/v3.00...v3.01) #### What's Changed - docs: Readme by [@​kroese](https://togithub.com/kroese) in [dockur/windows#440 - PR: Add ability to provide custom image simultaneously with a custom automatic install (answerfile / xml) by [@​lly-c232733](https://togithub.com/lly-c232733) in [dockur/windows#442 - fix: Revert PR by [@​kroese](https://togithub.com/kroese) in [dockur/windows#445 #### New Contributors - [@​lly-c232733](https://togithub.com/lly-c232733) made their first contribution in [dockur/windows#442 **Full Changelog**: dockur/windows@v3.00...v3.01 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "after 10pm every weekday,every weekend,before 5am every weekday" in timezone America/New_York, Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/NorkzYT/Wolflith). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMzEuMCIsInVwZGF0ZWRJblZlciI6IjM3LjMzMS4wIiwidGFyZ2V0QnJhbmNoIjoic3RhZ2luZyIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiLCJtaW5vciIsInJlbm92YXRlIl19--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Documentation of the specific feature can be found in the updated readme provided in this pull request.