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

winget configure can not install ubuntu for multiple users #4036

Open
jtnord opened this issue Jan 6, 2024 · 2 comments
Open

winget configure can not install ubuntu for multiple users #4036

jtnord opened this issue Jan 6, 2024 · 2 comments
Labels
Command-Configure Issue related to WinGet Configuration DSC-Resource Issue related to DSC Resources

Comments

@jtnord
Copy link

jtnord commented Jan 6, 2024

Brief description of your issue

trying to use winget configure to install apps for users.

the ubuntu store app is installed per user so users get their own linux env.

the install works for the first (admin) user but then performing the same operation when run as a user it can not proceed because it is both installed (by another user) and not installed at the same time),

Steps to reproduce

2 users (one admin and one regular)
ensure wsl is already correctly installed

as an admin run winget configure with a file containing

  - resource: Microsoft.WinGet.DSC/WinGetPackage
    id: ubuntu
    directives:
      description: Install Ubuntu WSL
      allowPrerelease: true
    settings:
      id: Canonical.Ubuntu.2204
      source: winget

check the install has worked by running bash

restart the machine and login as a regular user

verify ubuntu is not available with wsl --list

the output will e like

C:\workarea\source\github\jtnord\os-config-as-code>wsl --list
Windows Subsystem for Linux has no installed distributions.
Distributions can be installed by visiting the Microsoft Store:
https://aka.ms/wslstore

run winget configure with a configuration containing:

  - resource: Microsoft.WinGet.DSC/WinGetPackage
    id: ubuntu
    directives:
      description: Install Ubuntu WSL
      allowPrerelease: true
    settings:
      id: Canonical.Ubuntu.2204
      source: winget

Expected behaviour

ubuntu is installed

Actual behaviour

unbuntu fails to install

  The configuration unit failed while attempting to apply the desired state.
WinGetPackage Failed installing Canonical.Ubuntu.2204. InstallStatus 'InstallError' InstallerErrorCode '2147942402' ExtendedError '-2147024894'
<See the log file for additional details>
Some of the configuration was not applied successfully.

logs contain

2024-01-06 13:38:36.739 [CORE] Starting StagePackageAsync operation #0: https://wslstorestorage.blob.core.windows.net/wslblob/Ubuntu2204-221101.AppxBundle
2024-01-06 13:38:36.740 [CORE] Begin waiting for operation #0
2024-01-06 13:38:36.740 [CORE] Begin blocking for operation #0
2024-01-06 13:38:46.662 [CORE] Successfully completed #0
2024-01-06 13:38:46.662 [CORE] Starting RegisterPackageByFullNameAsync operation #1: CanonicalGroupLimited.Ubuntu_2204.1.7.0_neutral_~_79rhkp1fndgsc
2024-01-06 13:38:46.666 [CORE] Begin waiting for operation #1
2024-01-06 13:38:46.666 [CORE] Begin blocking for operation #1
2024-01-06 13:38:46.667 [CORE] Deployment operation #1: Windows cannot perform the RegisterByPackageFullName operation because it could not find CanonicalGroupLimited.Ubuntu_2204.1.7.0_neutral_~_79rhkp1fndgsc in the repository. Make sure CanonicalGroupLimited.Ubuntu_2204.1.7.0_neutral_~_79rhkp1fndgsc has been staged or was installed by another user.
2024-01-06 13:38:46.667 [FAIL] C:\__w\1\s\external\pkg\src\AppInstallerCommonCore\Deployment.cpp(191)\WindowsPackageManager.dll!00007FF954FF1E81: (caller: 00007FF954F4989D) Exception(12) tid(2c54) 80070002 The system cannot find the file specified.

2024-01-06 13:38:46.667 [CORE] Starting RemovePackage operation #2: CanonicalGroupLimited.Ubuntu_2204.1.7.0_neutral_~_79rhkp1fndgsc
2024-01-06 13:38:46.674 [CORE] Begin waiting for operation #2
2024-01-06 13:38:46.674 [CORE] Begin blocking for operation #2
2024-01-06 13:38:46.695 [CORE] Deployment operation #2: Windows cannot remove CanonicalGroupLimited.Ubuntu_2204.1.7.0_neutral_~_79rhkp1fndgsc because the current user does not have that package installed. Use Get-AppxPackage to see the list of packages installed.
2024-01-06 13:38:46.696 [FAIL] C:\__w\1\s\external\pkg\src\AppInstallerCommonCore\Deployment.cpp(54)\WindowsPackageManager.dll!00007FF954FF0C60: (caller: 00007FF954FF226C) Exception(13) tid(2c54) 80073CF1 Package was not found.
    Msg:[Operation failed: Windows cannot remove CanonicalGroupLimited.Ubuntu_2204.1.7.0_neutral_~_79rhkp1fndgsc because the current user does not have that package installed. Use Get-AppxPackage to see the list of packages installed.] 

2024-01-06 13:38:46.696 [FAIL] C:\__w\1\s\external\pkg\src\AppInstallerCommonCore\Deployment.cpp(126)\WindowsPackageManager.dll!00007FF95516C0D1: (caller: 00007FF954FF3783) LogHr(1) tid(2c54) 80073CF1 Package was not found.
    Msg:[C:\__w\1\s\external\pkg\src\AppInstallerCommonCore\Deployment.cpp(54)\WindowsPackageManager.dll!00007FF954FF0C60: (caller: 00007FF954FF226C) Exception(13) tid(2c54) 80073CF1 Package was not found.
    Msg:[Operation failed: Windows cannot remove CanonicalGroupLimited.Ubuntu_2204.1.7.0_neutral_~_79rhkp1fndgsc because the current user does not have that package installed. Use Get-AppxPackage to see the list of packages installed.] 
] 

which says it is both installed and not installed... we have a schrodinger's install

Environment

>winget --info
Windows Package Manager v1.6.3482
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.22631.2861
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.21.3482.0

Winget Directories
-------------------------------------------------------------------------------------------------------------------------------
Logs                               %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir
User Settings                      %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json
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
Installer Downloads                %USERPROFILE%\Downloads

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
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Triage Issue need to be triaged label Jan 6, 2024
@jtnord jtnord changed the title can not install ubuntu for multiple users winget configure can not install ubuntu for multiple users Jan 6, 2024
@Trenly
Copy link
Contributor

Trenly commented Jan 6, 2024

[Policy] Command-Configure

@microsoft-github-policy-service microsoft-github-policy-service bot added the Command-Configure Issue related to WinGet Configuration label Jan 6, 2024
@stephengillie stephengillie added DSC-Resource Issue related to DSC Resources and removed Needs-Triage Issue need to be triaged labels Jan 8, 2024
@denelon
Copy link
Contributor

denelon commented Jan 8, 2024

I'm not a WSL expert, but I did a quick search to see if I could figure out what that error was. It looks like it might be a file path related error based on: https://askubuntu.com/questions/1421805/error-2147942402-0x80070002-when-launching-ubuntu-18-04-in-wsl

I also asked @craigloewen-msft about multiple installs of ubuntu for per user scenarios. He said they would need different WSL distro names. His suggestion was to run wsl --import to be able to set it yourself. I think that means we're going to need a DSC resource for WSL to cover this scenario gracefully. For now, it might necessitate the use of a script based resource.

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
Projects
None yet
Development

No branches or pull requests

4 participants