-
Notifications
You must be signed in to change notification settings - Fork 134
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
xUser: Returns 'The variable '$user' cannot be retrieved' error inside Windows 2022 Server Core container #757
Comments
Verify that these lines work setting the variable xPSDesiredStateConfiguration/source/DSCResources/DSC_xUserResource/DSC_xUserResource.psm1 Lines 661 to 666 in 7703bb1
|
The first line fails
|
So then the current implementation is not supported in a container. The following line is used on a Nano server, does it work in the container? xPSDesiredStateConfiguration/source/DSCResources/DSC_xUserResource/DSC_xUserResource.psm1 Line 1135 in 7703bb1
If that works, can you see what this outputs? (Get-CimInstance -ClassName Win32_OperatingSystem).OperatingSystemSKU |
Yes, that line works fine inside the container
|
Okay so then the resource might need to switch to the same logic as used in a Nano server. Looking at the list of SKUs here https://learn.microsoft.com/en-us/windows/win32/cimwin32prov/win32-operatingsystem the container reports as a normal Desktop Experience. Must be some other why to determine that it runs in a container. 🤔 But if you want to test out the full functionality of when running in Nano (might be other problems) you could replace the following lines in your local installed module to xPSDesiredStateConfiguration/source/DSCResources/DSC_xUserResource/DSC_xUserResource.psm1 Line 45 in 7703bb1
xPSDesiredStateConfiguration/source/DSCResources/DSC_xUserResource/DSC_xUserResource.psm1 Line 144 in 7703bb1
xPSDesiredStateConfiguration/source/DSCResources/DSC_xUserResource/DSC_xUserResource.psm1 Line 239 in 7703bb1
|
So what we need is new logic to test if running in a container and then run the same logic as Nano (if it works) or other logic that is needed for a Windows container. |
Problem description
When I attempt to run the
xUser
resource inside a Docker build of Windows 2022 Server Core, I get the following errorDocker image
mcr.microsoft.com/windows/servercore ltsc2022 b53d206693f6
Verbose logs
DSC configuration
Suggested solution
I'm not sure what the problem is
Operating system the target node is running
PowerShell version and build the target node is running
xPSDesiredStateConfiguration version
The text was updated successfully, but these errors were encountered: