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

Enable WSL fails during configuration #3348

Open
denelon opened this issue Jun 15, 2023 · 4 comments
Open

Enable WSL fails during configuration #3348

denelon opened this issue Jun 15, 2023 · 4 comments
Labels
Command-Configure Issue related to WinGet Configuration DSC-Resource Issue related to DSC Resources Issue-Bug It either shouldn't be doing this or needs an investigation.

Comments

@denelon
Copy link
Contributor

denelon commented Jun 15, 2023

Brief description of your issue

@MeikTranel reported in #3346

# Enable WSL
   - resource: PSDscResources/WindowsOptionalFeature
     directives:
       description: Enable WSL
     settings:
       Name: Microsoft-Windows-Subsystem-Linux

image

WSL Enabling fails because apparently winget configure runs pwsh.exe which cannot run PS Code regarding windows optional feature management.

Steps to reproduce

Build a configuration with the above resource.

Expected behavior

Windows Subsystem for Linux will be anabled

Actual behavior

An error reporting "Class not registered".

Environment

Not reported.
@denelon denelon added Issue-Bug It either shouldn't be doing this or needs an investigation. Command-Configure Issue related to WinGet Configuration labels Jun 15, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Triage Issue need to be triaged label Jun 15, 2023
@denelon denelon removed the Needs-Triage Issue need to be triaged label Jun 15, 2023
@MeikTranel
Copy link

winget --info:

Windows Package Manager (Preview) v1.6.1573-preview
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.23481.1000
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.21.1573.0

Winget Directories
-----------------------------------------------------------------------------------------------------------------------
Logs                               %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\Diag…
User Settings                      %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\sett…
Portable Links Directory (User)    %LOCALAPPDATA%\Microsoft\WinGet\Links
Portable Links Directory (Machine) C:\Program Files\WinGet\Links
Portable Package Root (User)       %LOCALAPPDATA%\Microsoft\WinGet\Packages
Portable Package Root              C:\Program Files\WinGet\Packages
Portable Package Root (x86)        C:\Program Files (x86)\WinGet\Packages

Links
---------------------------------------------------------------------------
Privacy Statement   https://aka.ms/winget-privacy
License Agreement   https://aka.ms/winget-license
Third Party Notices https://aka.ms/winget-3rdPartyNotice
Homepage            https://aka.ms/winget
Windows Store Terms https://www.microsoft.com/en-us/storedocs/terms-of-sale

Admin Setting                             State
--------------------------------------------------
LocalManifestFiles                        Disabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride                     Disabled
LocalArchiveMalwareScanOverride           Disabled

$PSVersionTable (powershell.exe):

Name                           Value
----                           -----
PSVersion                      5.1.23481.1000
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.23481.1000
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

$PSVersionTable (pwsh.exe):

Name                           Value
----                           -----
PSVersion                      7.3.4
PSEdition                      Core
GitCommitId                    7.3.4
OS                             Microsoft Windows 10.0.23481
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

@rlabrecquefsg
Copy link

I tried to do the same using xPSDesiredStateConfiguration/xWindowsFeature on Windows 11 Pro (Insiders Dev Channel) running winget as admin, hoping maybe this one would work but:

# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2
properties:
  configurationVersion: 0.2.0
  resources:
    - resource: "xPSDesiredStateConfiguration/xWindowsFeature"
      directives:
        description: "Enable Windows Subsystem for Linux"
      settings:
        Name: "Microsoft-Windows-Subsystem-Linux"
        Ensure: "Present"
Apply :: xWindowsFeature
  The configuration unit failed while attempting to test the current system state.
System.InvalidOperationException: Installing roles and features using PowerShell Desired State Configuration is supported only on Server SKU's. It is not supported on Client SKU.
<See the log file for additional details>

Not entirely sure where the log is but the error is pretty clear.

@jtnord
Copy link

jtnord commented Jan 4, 2024

log contains not much more other than failed with code 0x8a15c105 and error message: Class not registered
along with the call trace
PSDscResources\2.12.0.0\.......\MSFT_WindowsOptionalFeature.psm1: line 286

jtnord added a commit to jtnord/os-config-as-code that referenced this issue Jan 4, 2024
jtnord added a commit to jtnord/os-config-as-code that referenced this issue Jan 4, 2024
@denelon denelon added the DSC-Resource Issue related to DSC Resources label Mar 13, 2024
@denelon
Copy link
Contributor Author

denelon commented Mar 13, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Command-Configure Issue related to WinGet Configuration DSC-Resource Issue related to DSC Resources Issue-Bug It either shouldn't be doing this or needs an investigation.
Projects
None yet
Development

No branches or pull requests

4 participants