Skip to content
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

Allow creation of local users (non microsoft-account user) #50

Closed
Joly0 opened this issue Jan 18, 2024 · 12 comments
Closed

Allow creation of local users (non microsoft-account user) #50

Joly0 opened this issue Jan 18, 2024 · 12 comments

Comments

@Joly0
Copy link

Joly0 commented Jan 18, 2024

Hey, would it be possible to specify a local user through env variables? I see you are using unattended xml files, so i guess, adjusting them and adding the needed lines for a pre-configured username+password should be possible using some kind of text file manipulation tool like sed or something.

@kroese
Copy link
Contributor

kroese commented Jan 18, 2024

The unattended xml creates an user called Docker with an empty password. It would be possible to change the name in the way you describe.

But it is already possible in the current version. You can download the win11x64.xml, modify it (replace all instances of Docker with the username you want) and then bind mount the xml file in your compose file:

volumes:
  - /path/custom.xml:/run/assets/win11x64.xml

Ofcourse your suggestion of an environment variable would be easier than overriding the xml file, but I am sure we would end up providing variables for almost every entry in the xml (because if you can modify the username, why not the computername?, etc).

@Joly0
Copy link
Author

Joly0 commented Jan 18, 2024

Ohh, and btw, is the unnattend file automatically used? As i just tried reinstalling my win11 instance, deleted everything and rerun the docker run command and it seems not to be working correctly. The bypass nro feature doesnt seem to work to be precise. I tried installing windows 11 and i could only install it using a microsoft account. I tried installing the netkvm driver before and tried without it. No luck. In both situations, i was unable to get beyond the "login with your microsoft account" or the "you are not connected through the internet" message.

@Joly0
Copy link
Author

Joly0 commented Jan 18, 2024

The unattended xml creates an user called Docker with an empty password. It would be possible to change the name in the way you describe.

But it is already possible in the current version. You can download the win11x64.xml, modify it (replace all instances of Docker with the username you want) and then bind mount the xml file in your compose file:

volumes:
  - /path/custom.xml:/run/assets/win11x64.xml

Ofcourse your suggestion of an environment variable would be easier than overriding the xml file, but I am sure we would end up providing variables for almost every entry in the xml (because if you can modify the username, why not the computername?, etc).

Hm, interesting. Maybe i´ll look into it and make a pr for this functionality, if you want. I think this feature might come in handy, though the unattended file would need to be applied automatically, without placing and bind mounting it in the compose file or docker run command

@kroese
Copy link
Contributor

kroese commented Jan 18, 2024

Do you have set MANUAL=Y or have a custom.iso file in your storage folder? In all other cases the installation should be fully automatic without user interaction or account creation screens.

@Joly0
Copy link
Author

Joly0 commented Jan 18, 2024

I had to place a custom win11 iso in the /storage folder, as i got banned by microsoft for automatic downloading. Will try without the iso

@Joly0
Copy link
Author

Joly0 commented Jan 18, 2024

Though wouldnt it be possible to add the unattended xml even to a custom.iso file?

@kroese
Copy link
Contributor

kroese commented Jan 18, 2024

That explains why your installation is not automatic. If you use a custom.iso then two things change:

  • Its not modified to remove the "Press any key to boot from DVD..." prompt. So you will always end up in UEFI shell and must boot it manually
  • The unattend.xml is not used, because its different for every Windows version, and I cannot know which version is inside the custom ISO.

@Joly0
Copy link
Author

Joly0 commented Jan 18, 2024

Ok, interesting

@Joly0
Copy link
Author

Joly0 commented Jan 18, 2024

Maybe there could be an env variable to overwrite any existing unattended.xml for custom.iso if the version variable is set aswell? This could make it easier to identify the version of windows. Afaik the unattended options only change between larger windows updates (so 10->11) and not between smaller uipdates (11 22h2 -> 11 23h2).
Or the default behaviour could be to replace any custom.iso with the pre-configured unattended.xml if the version varialbe is set, and dont do it, if another variable is set. Something like "overwriteUnattended", which is true by default and can be set to false. So users who had to download a custom.iso due to download limitations can still use your modifications, IF they set the version parameter correctly.

I knows this would imply, that users would have to configure this correctly, but i think it might be more useful than doing nothing for custom.iso´s. But thats just my opinion :)

@kroese
Copy link
Contributor

kroese commented Jan 18, 2024

Yeah, you have some valid points, but Im afraid applying the .xml will bring more problems than it solves.

Basicly the only situations where its necessary to use a custom.iso are:

  • When you want to install an ISO like Tiny11. So something that is very similar to Windows, but with heavy modifications.
  • When you want to install old versions (like Windows 7 or XP)
  • When you want to install an ISO with a different language pack

In all these 3 cases it will not work to apply an XML. For Tiny11 or Win7 they dont exist in the assets folder, and for a different language ISO you dont want it applied because it sets the language to English during installation.

Outside of these situations, I can not see a need to use a custom.iso, and yours was an exception because you were blocked by the server.

To get back to the original issue: that there were no local accounts created. We figured out the reason for that, so I guess that solves the issue.

@kroese kroese closed this as completed Jan 18, 2024
@kroese
Copy link
Contributor

kroese commented Jan 19, 2024

@Joly0 In the new version (v1.06) I decided to implement your suggestion. For custom ISO's, it will now detect the version inside the ISO, and automaticly applies the corresponding .xml file.

However, this is only done when supplying an URL in the VERSION variable. The behaviour of the custom.iso file was not changed, as it is more of a fallback method and not even described in the readme.

@kroese
Copy link
Contributor

kroese commented May 18, 2024

This feature has now been added in v3.07, you can now set:

environment:
  USERNAME: "john"
  PASSWORD: "secret"

to customize the local username and password.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants