LabBuilder
LabBuilder copied to clipboard
DSC Not being applied to Windows 10
- [ ] Verison of PowerShell you're using - 5.1
- [ ] PowerShell host you're using (eg. Console Host, ISE, Visual Studio) - Console host
- [ ] Operating system you're running - Window 10 Education - 1709
- [ ] Version of LabBuilder you're using (use
Get-Module -Name LabBuilder
) - 0.8.3.1140
Trying to use the "MEMBER_DEFAULT" provided DSC in the project against a Windows 10 x64 host. At no point does it appear to get applied. Is this meant to work with Client builds? Based on my research in the code, XML and elsewhere, it seems like it should work. I've also tried x86 version of Windows 10. Server 2012R2 is being joined to the domain just fine.
XML Config provided below.
<templatevhd name="Windows 10 Enterprise x64"
iso="SW_DVD5_WIN_ENT_10_64BIT_English_MLF_X20-26061.iso"
url="https://www.microsoft.com/"
vhd="Windows 10 Enterprise x64.vhdx"
ostype="Client"
vhdformat="vhdx"
vhdtype="dynamic"
generation="2"
vhdsize="40GB" />
<template name="Windows 10 Enterprise x64"
templatevhd="Windows 10 Enterprise x64"
memorystartupbytes="1GB"
processorcount="1"
administratorpassword="P@ssword!1"
timezone="PST"
generation="2"
ostype="Client" />
<vm name="Windows 10 x64"
template="Windows 10 Enterprise x64"
computername="Win10x64" >
<dsc configname="MEMBER_DEFAULT"
configfile="MEMBER_DEFAULT.DSC.ps1">
<parameters>
DomainName = "ACME.COM"
DomainAdminPassword = "P@ssword!1"
DCname = "SA-DC1"
PSDscAllowDomainUser = $True
</parameters>
</dsc>
<adapters>
<adapter name="Domain Nat"
switchname="ACME Domain Nat">
</adapter>
</adapters>
</vm>
Thanks for building this - LOVE watching a whole lab emerge from code, and then tearing it down. Getting some domain joined workstations would complete my project requirement.s
Hi @bneg - thank you! I'm really glad it is useful! :grin:
I have in the past used to deploy Win10 x64 clients with this, so it should work, but the deployment process for client OS's does work slightly differently.
If you log onto the Windows 10 VM, does the following file exist:
C:\WINDOWS\Setup\Scripts\SetupComplete.log
If so, could you post the content of it?
Hm, I'll have to fire it up again in a day or two and test. I don't remember that existing. The build script output detailed info when deploying the servers, about mounting the drives, side-loading the software, uploading the DSC's etc. But none of that for Win10. It went straight from copying from the snapshot to turning it on. It really seemed like something was missing in the config to tell LabBulider that it needed to prep the image before starting it up.
It really looks like switching from "Client" to "Server" for a host that I want DSC files to run on at least makes that part work. Still not quite getting it to connect to the domain right away though. Looks like it might be a Network location setting, ie. a Public network on a host prevents winrm from working.
- Tried changing the adapter NetConnectionProfile to "Private" in the unattended.xml, not the fix
PS E:\Lab> Install-Lab -ConfigPath .\Clients.xml -verbose
VERBOSE: Repository details, Name = 'PSGallery', Location = 'https://www.powershellgallery.com/api/v2/'; IsTrusted = 'True'; IsRegistered = 'True'.
VERBOSE: [13:43:07]: Initializing Lab Folders.
VERBOSE: [13:43:08]: Initializing Hyper-V Components.
VERBOSE: [13:43:09]: Skip building VM template VHD file 'E:\Lab\.\VHDFiles\Windows 10 Enterprise x64 1703.vhdx' for 'Windows 10 Enterprise x64 1703' because it already exists.
VERBOSE: [13:43:09]: Skip copying parent VHD file 'c:\LAB\LAB.COM\Virtual Hard Disk Templates\Windows 10 Enterprise x64 1703.vhdx' for 'Windows 10 Enterprise x64 1703' because it already e
xists.
VERBOSE: [13:43:09]: Creating VM 'LAB.COM Windows 10 x64 1703'.
VERBOSE: [13:43:09]: Creating Differencing Boot disk 'c:\LAB\LAB.COM\LAB.COM Windows 10 x64 1703\Virtual Hard Disks\LAB.COM Windows 10 x64 1703 Boot Disk.vhdx' for VM 'LAB.C
OM Windows 10 x64 1703'.
VERBOSE: [13:43:10]: Created Initialization files for VM 'LAB.COM Windows 10 x64 1703'.
VERBOSE: [13:43:10]: Mounting VM 'LAB.COM Windows 10 x64 1703' VHD Boot Disk 'c:\LAB\LAB.COM\LAB.COM Windows 10 x64 1703\Virtual Hard Disks\LAB.COM Windows 10 x64 1703 Boot
Disk.vhdx'.
VERBOSE: [13:43:12]: Applying Unattend file 'Unattend.xml' to VHD Boot Disk for VM 'LAB.COM Windows 10 x64 1703'.
VERBOSE: [13:43:12]: Creating Panther folder to VHD Boot Disk for VM 'LAB.COM Windows 10 x64 1703'.
VERBOSE: [13:43:12]: Applying Setup Complete CMD file 'SetupComplete.cmd' to VHD Boot Disk for VM 'LAB.COM Windows 10 x64 1703'.
VERBOSE: [13:43:12]: Applying Setup Complete PowerShell file 'SetupComplete.ps1' to VHD Boot Disk for VM 'LAB.COM Windows 10 x64 1703'.
VERBOSE: [13:43:12]: Applying Certificate Create Script file 'New-SelfSignedCertificateEx.ps1' to VHD Boot Disk for VM 'LAB.COM Windows 10 x64 1703'.
VERBOSE: [13:43:12]: Dismounting VM 'LAB.COM Windows 10 x64 1703' VHD Boot Disk 'c:\LAB\LAB.COM\LAB.COM Windows 10 x64 1703\Virtual Hard Disks\LAB.COM Windows 10 x64 1703 Boot Disk.vhdx'.
VERBOSE: Perform operation 'Query CimInstances' with following parameters, ''queryExpression' = SELECT Caption FROM Msvm_VssComponentSettingData,'queryDialect' = WQL,'namespaceName' = Root\Virtualization\V2'.
VERBOSE: Perform operation 'Query CimInstances' with following parameters, ''queryExpression' = SELECT Caption FROM Msvm_ShutdownComponentSettingData,'queryDialect' = WQL,'namespaceName' = Root\Virtualization\V2'.
VERBOSE: Perform operation 'Query CimInstances' with following parameters, ''queryExpression' = SELECT Caption FROM Msvm_TimeSyncComponentSettingData,'queryDialect' = WQL,'namespaceName' = Root\Virtualization\V2'.
VERBOSE: Perform operation 'Query CimInstances' with following parameters, ''queryExpression' = SELECT Caption FROM Msvm_HeartbeatComponentSettingData,'queryDialect' = WQL,'namespaceName' = Root\Virtualization\V2'.
VERBOSE: Perform operation 'Query CimInstances' with following parameters, ''queryExpression' = SELECT Caption FROM Msvm_GuestServiceInterfaceComponentSettingData,'queryDialect' = WQL,'namespaceName' = Root\Virtualization\V2'.
VERBOSE: Perform operation 'Query CimInstances' with following parameters, ''queryExpression' = SELECT Caption FROM Msvm_KvpExchangeComponentSettingData,'queryDialect' = WQL,'namespaceName' = Root\Virtualization\V2'.
VERBOSE: [13:43:14]: The 'Guest Service Interface' Integration Service has been enabled in VM 'LAB.COM Windows 10 x64 1703'.
VERBOSE: [13:43:14]: Adding Management network adapter LAB.COM Lab Management to VM 'LAB.COM Windows 10 x64 1703'.
VERBOSE: [13:43:14]: Setting VLAN on Management network adapter LAB.COM Lab Management in VM 'LAB.COM Windows 10 x64 1703' to 99.
VERBOSE: [13:43:14]: Adding LAB.COM Domain Nat network adapter LAB.COM LAB Domain Nat to VM 'LAB.COM Windows 10 x64 1703'.
VERBOSE: [13:43:15]: Setting VLAN on network adapter LAB.COM Domain Nat in VM 'LAB.COM Windows 10 x64 1703' to 5.
VERBOSE: [13:43:15]: Starting VM 'LAB.COM Windows 10 x64 1703'.
VERBOSE: [13:43:15]: Waiting for Virtual Machine 'LAB.COM Windows 10 x64 1703' heartbeat, retrying in 1 seconds.
[... SNIP ...]
VERBOSE: [13:43:41]: Waiting for Virtual Machine 'LAB.COM Windows 10 x64 1703' heartbeat, retrying in 1 seconds.
VERBOSE: [13:43:44]: Waiting for valid IP Address to be assigned to VM 'LAB.COM Windows 10 x64 1703', retrying in 5 seconds.
[... SNIP ...]
VERBOSE: [13:45:09]: Waiting for valid IP Address to be assigned to VM 'LAB.COM Windows 10 x64 1703', retrying in 5 seconds.
VERBOSE: [13:45:17]: Adding IP Address '169.254.251.188' to WS-Man Trusted Hosts to allow remoting to 'LAB.COM Windows 10 x64 1703'.
VERBOSE: [13:45:17]: Connecting to VM 'LAB.COM Windows 10 x64 1703' on '169.254.251.188'.
VERBOSE: [13:45:38]: Connection to VM 'LAB.COM Windows 10 x64 1703' failed (Connecting to remote server 169.254.251.188 failed with the following error message : WinRM cannot complete t
he operation. Verify that the specified computer name is valid, that the computer is accessible over the network, and that a firewall exception for the WinRM service is enabled and allows ac
cess from this computer. By default, the WinRM firewall exception for public profiles limits access to remote computers within the same local subnet. For more information, see the about_Remo
te_Troubleshooting Help topic.), retrying in 5 seconds.
VERBOSE: [13:45:44]: Connecting to VM 'LAB.COM Windows 10 x64 1703' on '169.254.251.188'.
VERBOSE: [13:46:05]: Connection to VM 'LAB.COM Windows 10 x64 1703' failed (Connecting to remote server 169.254.251.188 failed with the following error message : WinRM cannot complete t
he operation. Verify that the specified computer name is valid, that the computer is accessible over the network, and that a firewall exception for the WinRM service is enabled and allows ac
cess from this computer. By default, the WinRM firewall exception for public profiles limits access to remote computers within the same local subnet. For more information, see the about_Remo
te_Troubleshooting Help topic.), retrying in 5 seconds.
VERBOSE: [13:46:10]: Connecting to VM 'LAB.COM Windows 10 x64 1703' on '169.254.251.188'.
VERBOSE: [13:46:31]: Connection to VM 'LAB.COM Windows 10 x64 1703' failed (Connecting to remote server 169.254.251.188 failed with the following error message : WinRM cannot complete t
he operation. Verify that the specified computer name is valid, that the computer is accessible over the network, and that a firewall exception for the WinRM service is enabled and allows ac
cess from this computer. By default, the WinRM firewall exception for public profiles limits access to remote computers within the same local subnet. For more information, see the about_Remo
te_Troubleshooting Help topic.), retrying in 5 seconds.
VERBOSE: [13:46:37]: Connecting to VM 'LAB.COM Windows 10 x64 1703' on '169.254.251.188'.
VERBOSE: [13:46:47]: Disconnecting from VM 'LAB.COM Windows 10 x64 1703' on '169.254.251.188'.
VERBOSE: [13:46:47]: Removing IP Address '169.254.251.188' from WS-Man Trusted Hosts.
VERBOSE: [13:46:47]: Certificate download from VM 'LAB.COM Windows 10 x64 1703' started.
VERBOSE: [13:46:47]: Adding IP Address '169.254.251.188' to WS-Man Trusted Hosts to allow remoting to 'LAB.COM Windows 10 x64 1703'.
VERBOSE: [13:46:47]: Connecting to VM 'LAB.COM Windows 10 x64 1703' on '169.254.251.188'.
VERBOSE: [13:46:49]: Disconnecting from VM 'LAB.COM Windows 10 x64 1703' on '169.254.251.188'.
VERBOSE: [13:46:49]: Removing IP Address '169.254.251.188' from WS-Man Trusted Hosts.
VERBOSE: [13:46:49]: Certificate download from VM 'LAB.COM Windows 10 x64 1703' complete.
VERBOSE: Populating RepositorySourceLocation property for module posh-git.
VERBOSE: Loading module from path 'C:\Users\da_jjohnson\Documents\WindowsPowerShell\Modules\posh-git\0.7.1\posh-git.psm1'.
VERBOSE: Populating RepositorySourceLocation property for module LabBuilder.
VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\LabBuilder\0.8.3.1140\LabBuilder.psm1'.
VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\Microsoft.PowerShell.Operation.Validation\1.0.1\Microsoft.PowerShell.Operation.Validation.psm1'.
VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\Pester\3.4.0\Pester.psm1'.
VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1'.
VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\PSReadline\1.2\Microsoft.PowerShell.PSReadLine.dll'.
VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\PSReadline\1.2\PSReadLine.psm1'.
VERBOSE: Populating RepositorySourceLocation property for module xActiveDirectory.
VERBOSE: Populating RepositorySourceLocation property for module xComputerManagement.
VERBOSE: Populating RepositorySourceLocation property for module xDhcpServer.
VERBOSE: Populating RepositorySourceLocation property for module xDnsServer.
VERBOSE: Populating RepositorySourceLocation property for module xNetworking.
VERBOSE: Populating RepositorySourceLocation property for module xPendingReboot.
VERBOSE: Populating RepositorySourceLocation property for module xPSDesiredStateConfiguration.
VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\xPSDesiredStateConfiguration\7.0.0.0\DSCPullServerSetup\PublishModulesAndMofsToPullServer.psm1'.
VERBOSE: Loading module from path 'C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\Microsoft.PowerShell.Utility\Microsoft.PowerShell.Utility.psm1'.
[... SNIP ...]
VERBOSE: Loading module from path 'C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\WindowsUpdateProvider\MSFT_WUSettings.cdxml'.
VERBOSE: Loading module from path 'C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\WindowsUpdateProvider\MSFT_WUOperations.cdxml'.
VERBOSE: Loading module from path 'C:\Program Files\Intel\IntelNetCmdlets\IntelNetCmdlets.dll'.
VERBOSE: [13:46:52]: Identifying Modules used by DSC Config File 'E:\Lab\DSCLibrary\MEMBER_DEFAULT.DSC.ps1' in VM 'LAB.COM Windows 10 x64 1703'.
VERBOSE: [13:46:52]: Saving Module 'PSDesiredStateConfiguration' required by DSC Config File 'E:\Lab\DSCLibrary\MEMBER_DEFAULT.DSC.ps1' in VM 'LAB.COM Windows 10 x64 1703' to LabBuilder files.
VERBOSE: [13:46:52]: Copying Module 'PSDesiredStateConfiguration' required by DSC Config File 'E:\Lab\DSCLibrary\MEMBER_DEFAULT.DSC.ps1' in VM 'LAB.COM Windows 10 x64 1703' from 'C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\PSDesiredStateConfiguration' to 'c:\LAB\LAB.COM\LAB.COM Windows 10 x64 1703\LabBuilder Files\DSC Modules\'.
VERBOSE: [13:46:52]: Saving Module 'xNetworking' required by DSC Config File 'E:\Lab\DSCLibrary\MEMBER_DEFAULT.DSC.ps1' in VM 'LAB.COM Windows 10 x64 1703' to LabBuilder files.
VERBOSE: [13:46:52]: Copying Module 'xNetworking' required by DSC Config File 'E:\Lab\DSCLibrary\MEMBER_DEFAULT.DSC.ps1' in VM 'LAB.COM Windows 10 x64 1703' from 'C:\Program Files\WindowsPowerShell\Modules\xNetworking' to 'c:\LAB\LAB.COM\LAB.COM Windows 10 x64 1703\LabBuilder Files\DSC Modules\'.
VERBOSE: [13:46:53]: Adding IP Address '169.254.251.188' to WS-Man Trusted Hosts to allow remoting to 'LAB.COM Windows 10 x64 1703'.
VERBOSE: [13:46:53]: Connecting to VM 'LAB.COM Windows 10 x64 1703' on '169.254.251.188'.
VERBOSE: [13:46:55]: Creating DSC LCM Config file 'C:\Users\DA_JJO~1\AppData\Local\Temp\Win10x64-2-1703.meta.mof' in VM 'LAB.COM Windows 10 x64 1703'.
VERBOSE: [13:46:55]: Creating DSC Config file 'E:\Lab\DSCLibrary\MEMBER_DEFAULT.DSC.ps1' in VM 'LAB.COM Windows 10 x64 1703'.
VERBOSE: Populating RepositorySourceLocation property for module xNetworking.
VERBOSE: [13:46:55]: Preparing to compile DSC Config 'MEMBER_DEFAULT' for VM 'LAB.COM Windows 10 x64 1703'.
VERBOSE: [13:46:58]: DSC MOF File 'E:\Lab\DSCLibrary\MEMBER_DEFAULT.DSC.ps1' for VM 'LAB.COM Windows 10 x64 1703'. was created successfully.
VERBOSE: [13:46:59]: Connecting to VM 'LAB.COM Windows 10 x64 1703' on '169.254.251.188'.
VERBOSE: [13:47:00]: Copying DSC Files to VM 'LAB.COM Windows 10 x64 1703'.
VERBOSE: [13:47:02]: Copying DSC Module xNetworking Files to VM 'LAB.COM Windows 10 x64 1703'.
VERBOSE: [13:47:45]: Starting DSC on VM 'LAB.COM Windows 10 x64 1703'.
VERBOSE: [13:47:51]: Disconnecting from VM 'LAB.COM Windows 10 x64 1703' on '169.254.251.188'.
VERBOSE: [13:47:51]: Removing IP Address '169.254.251.188' from WS-Man Trusted Hosts.
VERBOSE: [13:47:51]: The Lab 'Client' has been installed into folder 'c:\LAB\LAB.COM'.
PS E:\Lab> ```