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

Configuration of DHCP role fails when using non-English Windows Server iso #290

Open
jetkiwi opened this issue Nov 11, 2019 · 13 comments
Open

Comments

@jetkiwi
Copy link

jetkiwi commented Nov 11, 2019

The script looks for an interface with an alias Ethernet while configuring the DHCP role, but will fail if you use an non-English Windows Server iso. In my case I was using 14393.0.161119-1705.RS1_REFRESH_SERVER_EVAL_X64FRE_JA-JP.ISO for the iso and the interface alias was イーサネット.
https://github.com/microsoft/WSLab/blob/95408e80df8587b445af9b0e21078d8b5779b53c/Scripts/2_CreateParentDisks.ps1#L735

As an workaround, I had to logon and rename the interface to Ethernet to proceed.

@jaromirk
Copy link
Collaborator

That's a cool alias! I'm afraid the change would be bit more complex. In theory I could query it with posh what's the name. I guess easier for you will be to use en ISO. What do you think?

@dcfou
Copy link

dcfou commented Mar 25, 2020

I have suggestions for this. Why don't add a "LocalizeYourLab.ps1" file to the project.
"LocalizeYourLab.ps1" should be something like this for the english version :
############################
$LocalizedLab = @{ DefaultAdminAccount = "Administrator";
DomainAdminsGroup = "Domain Admins";
DomainSchemaAdminGroup = "Schema Admins";
DomainEnterpriseAdminGroup = "Enterprise Admins";
DNSAdminGroup = "DnsAdmins";
AdminsGroup = "Administrators";
AuthenticatedUsersGroup = "Authenticated Users";
EveryoneGroup = "Everyone";
VMGuestServiceInterfaceName = "Guest Service Interface";
S2DClusterTest = "Storage Spaces Direct";
StorageClusterTest = "Storage";
InventoryClusterTest = "Inventory";
NetworkClusterTest = "Network";
SystemClusterTest = "System Configuration";
HyperVClusterTest = "Hyper-V Configuration"
}
############################

Example of "LocalizeYourLab.ps1" for a french version :
############################
$LocalizedLab = @{ DefaultAdminAccount = "Administrateur";
DomainAdminsGroup = "Admins du domaine";
DomainSchemaAdminGroup = "Administrateurs du schéma";
DomainEnterpriseAdminGroup = "Administrateurs de l’entreprise";
DNSAdminGroup = "DnsAdmins";
AdminsGroup = "Administrateurs";
AuthenticatedUsersGroup = "Utilisateurs authentifiés";
EveryoneGroup = "Tout le monde";
VMGuestServiceInterfaceName = "Interface de services d’invité";
S2DClusterTest = "Storage Spaces Direct";
StorageClusterTest = "Stockage";
InventoryClusterTest = "Inventaire";
NetworkClusterTest = "Réseau";
SystemClusterTest = "Configuration du système";
HyperVClusterTest = "Configuration Hyper-V"
}
############################

You only need to change few lines for "2_CreateParentDisk.ps1" and "3_Deploy.ps1" :

############################
For "2_CreateParentDisk.ps1"
Add on Line 560 (this is an empty line, don't line break after to keep line numbering)
. "$PSScriptRoot\LocalizeYourLab.ps1"

Line 561
$username = "$($LabConfig.DomainNetbiosName)\Administrator"
replaced by
$username = "$($LabConfig.DomainNetbiosName)$($LocalizedLab.DefaultAdminAccount)"

Line 716
GroupName = "Domain Admins"
replaced by
GroupName = $LocalizedLab.DomainAdminsGroup

Line 723
GroupName = "Schema Admins"
replaced by
GroupName = $LocalizedLab.DomainSchemaAdminGroup

Line 731
GroupName = "Enterprise Admins"
replaced by
GroupName = $LocalizedLab.DomainEnterpriseAdminGroup

Line 740
UserName = "Administrator"
replaced by
UserName = $LocalizedLab.DefaultAdminAccount
############################

############################
For "3_Deploy.ps1"
Line 221
Administrator
replaced by
$($LocalizedLab.DefaultAdminAccount)

Line 271
Administrators
replaced by
$($LocalizedLab.AdminsGroup)

Add on Line 665 (this is an empty line, don't line break after to keep line numbering)
. "$PSScriptRoot\LocalizeYourLab.ps1"

Line 1068
$username = "$($Labconfig.DomainNetbiosName)\Administrator"
replaced by
$username = "$($LabConfig.DomainNetbiosName)$($LocalizedLab.DefaultAdminAccount)"

Line 1365
Get-VM -VMName "$($labconfig.Prefix)" | Where-Object {$.state -eq "Running" -or $.state -eq "Off"} | Enable-VMIntegrationService -Name "Guest Service Interface"
replaced by
Get-VM -VMName "$($labconfig.Prefix)
" | Where-Object {$.state -eq "Running" -or $.state -eq "Off"} | Enable-VMIntegrationService -Name $LocalizedLab.VMGuestServiceInterfaceName
############################

Please note that this is only for the core files. Tools and "Scenario.ps1" files should be updated accordingly

I'm new to github, I hope this is the right place to these suggestions

@jaromirk
Copy link
Collaborator

What I really don't want to do is adding another ps1 files. Many things can now be customized already - like keyboard can be switched/language installed as a script injected to answer file. Is there a specific case you would like to use this with?

@dcfou
Copy link

dcfou commented Mar 25, 2020

Ok, I undestand that, it was just a suggestion after all.
The deal was only to use other ISOs than the english one (for somes - manies? - who don't speak english at all or just a few words), and the keyboard layout is not enough for them.

@dcfou
Copy link

dcfou commented Mar 26, 2020

May be Well-known SIDs can be a way (and it's far better than my first suggestion) :

$LocalAdminGroupSID = New-Object System.Security.Principal.SecurityIdentifier ("S-1-5-32-544")
$LocalAdminGroupAccount = ($LocalAdminGroupSID.Translate( [System.Security.Principal.NTAccount])).Value -replace "^.+\\(.+)$",'$1'

and for domain related :

$rootDomain = ([adsi]"LDAP://RootDSE").rootDomainNamingContext[0]
$domain = ([adsi]"LDAP://RootDSE").defaultNamingContext[0]
$rootDomainId = New-Object System.Security.Principal.SecurityIdentifier(([adsi]"LDAP://$rootDomain").objectSID[0], 0)
$domainId = New-Object System.Security.Principal.SecurityIdentifier(([adsi]"LDAP://$domain").objectSID[0], 0)

# Example for Enterprise Admins
$EnterpriseAdminGroupSID = New-Object System.Security.Principal.SecurityIdentifier ("$rootDomainId-519")
$EnterpriseAdminGroupAccount = ($EnterpriseAdminGroupSID.Translate( [System.Security.Principal.NTAccount])).Value -replace "^.+\\(.+)$",'$1'

# Example for Domain Admins
$DomainAdminGroupSID = New-Object System.Security.Principal.SecurityIdentifier ("$domainId-512")
$DomainAdminGroupAccount = ($DomainAdminGroupSID.Translate( [System.Security.Principal.NTAccount])).Value -replace "^.+\\(.+)$",'$1'

For the cluster test, it's obviously different, I'm stucked here :)
Test-Cluster -List | Select Category | Sort Category -Unique
(many edits because it is still painful for me to insert code :)) )

@mgonzcast
Copy link

So there is no way to use non-english isos? I am trying to use Spanish ISOs but I get an endless loop when installing (unattend.xml file is missing)

@jaromirk
Copy link
Collaborator

there are some different strings in different languages (Administrator, Ethernet,...) so multiple things are failing. Either DSC, or later as you mention unattend.xml application. You can build DC with EN media and then later you should be able to create additional VHDs in parentdisks folder (using createparentdisk.ps1 script) which can be Spanish/Japanese/...

@mgonzcast
Copy link

My intention is to build test labs for 2012R2. Is that doable with WSLab? If not, which parts could I take for reuse to create my own set of scripts? I just want to test VMs running DC, Exchange, Sharepoint and a CA

I already have a DC running 2012R2. I already tried myself manually to build a lab on my Windows 10 laptop creating 2-nodes hyper-v 2016 core guest cluster. The issue with hyper-v core is that you can´t use S2D.

@jaromirk
Copy link
Collaborator

of course! Just build lab with 2019 (DC) and create 2012R2 media with createparentdisk.ps1... You just need different unattend type https://github.com/microsoft/WSLab/blob/master/Scripts/LabConfig.ps1#L335

@mgonzcast
Copy link

Or create my own vhd disk isn´t it? Why 2019 DC? Can´t I have a 2012R2 DC? I don´t mind to have 2016 guest hyper-v guest hosts as long as all my VMs are 2012R2.

@jaromirk
Copy link
Collaborator

Yeah, gen2 VHD for sure :). But createparentdisk.ps1 from ParentDisks folder is easiest... 2012 OS cannot process DSC that is generated with WSLab ... so it will fail building.. 2016 is the lowest version of DC you can have... VMs can be anything 2008R2 and newer...

@Karl-WE
Copy link
Contributor

Karl-WE commented Jan 9, 2022

@jaromirk from my point of view the localization (not language packs but native non en-us ISOs) always cause a lot of headaches. Many of these due to the localization of predefined groups and stuff.

I understand the idea of the discussion but be aware that Microsoft teams itself does not invest much love into non en-US installations anymore.

One example is Windows Admin Center that has serious issues exactly due to the same fact that it pretends every OS is en-us otherwise cause troubles with WSMAN / WinRM / wmic / PowerShell interally too, as they expect en-us group names etc.

There have been Windows patches lately that caused havoc post patch on non en-us installations for same reasons. Windows and other products.

Another sign is that long standing issue with RDP in WAC with non en-us keyboard layout that is officially fixed but otherwise still not working for many things.

there is a number of admins that cannot understand english and that's ok. The idea in #290 (comment) is valid and could be added to the code in a customizable section as Jaromir does not want to create more external functions or scripts, understandably for maintenance reasons and dependencies.

On the same page we have the cons of using non en-us ISOs that are raising. We have passed the patching and language issues with Vista / 2008 but some things are clearly going down the route that en-us is the norm and LIP or language pack need to be applied which do not alter internal things.

tl:dr, it is not easy and becomes harder to weight and implement the usage of non en-us ISOs, from many sides, including Microsoft but also other vendors. Also helpful community scripts and solutions come with clear warnings being untested on non en-us installations.

hope it helps to rethink and decide, pro language packs or LIPs (language interface packages).

@Karl-WE
Copy link
Contributor

Karl-WE commented May 4, 2024

@jaromirk do you plan to implement language packs during createparentdisk phase (in addition to LCU)?
This is something that could be feasible for @jetkiwi @dcfou
We could use Labconfig that is then checking the language required during 2_createparentdisks.ps1 and later 3_Deploy,ps1

Otherwise, I would suggest closing this and leave it to the users how to localize the en-us ISO

Offtopic:

2-nodes hyper-v 2016 core guest cluster. The issue with hyper-v core is that you can´t use S2D.

@mgonzcast that is true, please use the S2D scenario, Most feasible with WS 2022 Core installation.
Since it is a lab, it does not change licensing / costs. using Hyper-V core doesn't make sense. The Hyper-V Server SKU - not Hyper-V itself - is dead.

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

5 participants