none
RESOLVED - TP4 -"Install-PackageProvider ContainerProvider" set-up script error RRS feed

  • Question

  • Hello everyone,

    If you are trying to get set up to use Windows Server Containers and Hyper-V Containers using our set-up script, you might see the error below. The script might fail while downloading the base OS images for containers. We are working to get this worked out as soon as possible. Please stay tuned.


    Thursday, November 19, 2015 4:34 PM
    Moderator

Answers

All replies

  • Hello again,

    We have successfully uploaded the Package Provider, and things should now be working. Thanks for your patience, and enjoy trying out containers in TP4.


    Thursday, November 19, 2015 7:31 PM
    Moderator
  • Still doesn't work. ContainerProvider hasn't been found.
    Friday, November 20, 2015 1:43 PM
  • Hi Ruslan,

    Are you running on a Server TP4 system? If so, can you please share the following information:

    1. Launch PowerShell.exe

    2. In the PowerShell.exe console, please run the following command and share me the output

        (a) Get-PSRepository

        (b) Find-Module ContainerProvider

        (c) Get-Module PowershellGet | % modulebase

    Thanks

    Krishna

    Windows PowerShell Team

    Friday, November 20, 2015 7:13 PM
  • Hi Krishna,

     (a) Get-PSRepository

    Name: PSGallery

    PackageManagementProvider:NUGET

    InstallationPolicy: Untrusted

    SourceLocation: powershellg.....

    (b) Find-Module ContainerProvider

    Version: 0.5.2

    Name: ContainerProvider

    Type: Module

    Repository: PSGallery

    Description: ContainerProvider

        (c) Get-Module PowershellGet | % modulebase

    output: C:\program Files\WindowsPowershell\Modules\PowershellGet\1.0.0.1

    Tuesday, November 24, 2015 8:15 AM
  • Thanks for the response with details. As per the output from (b) in your response, you were able to find ContainerProvider Module. Can you try installing it using "Install-Module ContainerProvider" command instead of Install-PackageProvider. The rest of the steps like Find-ContainerImage, Install-ContainerImage should work after this.

    Thanks

    Krishna

    Tuesday, November 24, 2015 7:51 PM
  • I have installed a Windows server core with GUI (in a virtualbox VM) and trying to install containers using the script. I keep on getting the following error.

    Install-PackageProvider : No match was found for the specified search
    criteria for the provider 'ContainerProvider'. The package provider
    requires 'PackageManagement' and 'Provider' tags. Please check if the
    specified package has the tags.
    At C:\Install-ContainerHost.ps1:873 char:9
    +         Install-PackageProvider ContainerProvider -Force | Out-Null
    +         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidArgument: (Microsoft.Power...PackagePr
       ovider:InstallPackageProvider) [Install-PackageProvider], Exception
        + FullyQualifiedErrorId : NoMatchFoundForProvider,Microsoft.PowerShell.
       PackageManagement.Cmdlets.InstallPackageProvider

    C:\Install-ContainerHost.ps1 : Could not install ContainerProvider
    At line:1 char:1
    + C:\Install-ContainerHost.ps1
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorEx
       ception
        + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorExcep
       tion,Install-ContainerHost.ps1

    Then i tried following the steps here and this is my output.

    (a) Get-PSRepository

    PSGallery                 NuGet                     Untrusted            http

    (b)

    PS C:\Windows\system32> Find-Module ContainerProvider

    NuGet provider is required to continue
    PowerShellGet requires NuGet provider version '2.8.5.201' or newer to
    interact with NuGet-based repositories. The NuGet provider must be available
     in 'C:\Program Files\PackageManagement\ProviderAssemblies' or
    'C:\Users\Administrator\AppData\Local\PackageManagement\ProviderAssemblies'.
     You can also install the NuGet provider by running 'Install-PackageProvider
     -Name NuGet -MinimumVersion 2.8.5.201 -Force'. Do you want PowerShellGet to
     install and import the NuGet provider now?
    [Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"):

    If i select Y i get the following error .

    PackageManagement\Install-PackageProvider : No match was found for the
    specified search criteria for the provider 'NuGet'. The package provider
    requires 'PackageManagement' and 'Provider' tags. Please check if the
    specified package has the tags.
    At C:\Program
    Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:5921
    char:21
    + ...     $null = PackageManagement\Install-PackageProvider -Name $script:N
    ...
    +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidArgument: (Microsoft.Power...PackagePr
       ovider:InstallPackageProvider) [Install-PackageProvider], Exception
        + FullyQualifiedErrorId : NoMatchFoundForProvider,Microsoft.PowerShell.
       PackageManagement.Cmdlets.InstallPackageProvider

    PackageManagement\Import-PackageProvider : No match was found for the
    specified search criteria and provider name 'NuGet'. Try
    'Get-PackageProvider -ListAvailable' to see if the provider exists on the
    system.
    At C:\Program
    Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:5927
    char:21
    + ...     $null = PackageManagement\Import-PackageProvider -Name $script:Nu
    ...
    +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidData: (NuGet:String) [Import-PackagePr
       ovider], Exception
        + FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.
       PackageManagement.Cmdlets.ImportPackageProvider

    PackageManagement\Get-PackageProvider : Unable to find package provider
    'NuGet'. It may not be imported yet. Try 'Get-PackageProvider
    -ListAvailable'.
    At C:\Program
    Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:5931
    char:30
    + ... tProvider = PackageManagement\Get-PackageProvider -Name $script:NuGet
    ...
    +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : ObjectNotFound: (Microsoft.Power...PackagePro
       vider:GetPackageProvider) [Get-PackageProvider], Exception
        + FullyQualifiedErrorId : UnknownProviderFromActivatedList,Microsoft.Po
       werShell.PackageManagement.Cmdlets.GetPackageProvider

    Find-Module : NuGet provider is required to interact with NuGet-based
    repositories. Please ensure that '2.8.5.201' or newer version of NuGet
    provider is installed.
    At line:1 char:1
    + Find-Module ContainerProvider
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (:) [Find-Module], InvalidO
       perationException
        + FullyQualifiedErrorId : CouldNotInstallNuGetProvider,Find-Module

    What might be going on ?


    Vidh

    Sunday, November 29, 2015 11:04 AM
  • Hi Vidh,

    Is it possible for you to check if there is internet connectivity in your virtual box VM? If there is connectivity, can  you please try the following command in a PowerShell console and send us the output:

    Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Verbose -Force

    Thanks

    Krishna

    Wednesday, December 2, 2015 7:12 PM
  • Hi Krishna, 

    I think the problem was that our company firewall had some rule for downloading certain types of files. Looks like it did not like the files that were being downloaded from oneget.org. 

    However when i ran the command again from home (different network ) nuget did get installed. and i am able to work with docker containers. 

    Thanks a lot. 


    Vidh

    Thursday, December 3, 2015 10:52 AM
  • I am glad the problem is solved. Thanks for confirming Vidh!

    -Krishna

    Friday, December 4, 2015 9:13 PM
  • Sorry to interrupt you.

    It is not resolved in my lab. I have installed Windows Container successfully with full GUI install but I have failed to install Windows Container with Server Core...orz

    Here is my environment.

    • Host OS: Windows Server 2012 R2
    • Guest OS: Windows Server 2016 TP4 (Server Core) <-- I try to install Windows Container on this.
    • Guest OS must use proxy server to access the Internet.
    • Guest OS uses NAT to go outside of Host OS.

    I have couple of questions.

    1. wget needs -Proxy option

    Even though I set up proxy server using "netsh winhttp" command, I need -Proxy option to run wget. 

    2. NuGet is missing...?

    I have got the following error on Server Core.

    PS C:\Container> Get-PSRepository
    WARNING: Unable to find module repositories.

    3. Install-Container.ps1 failed

    I have pasted the error log at the bottom of my reply.

    Any advice would be very welcome!

    Thank you :-)

    -----

    Install-Container error log

    PS C:\Container> .\Install-ContainerHost.ps1
    Querying status of Windows feature: Containers...
    Feature Containers is already enabled.
    Waiting for Hyper-V Management...
    Networking is already configured.  Confirming configuration...
    Installing ContainerProvider package...
    WARNING: Unable to download the list of available providers. Check your internet
    connection.
    Install-PackageProvider : No match was found for the specified search criteria for the
    provider 'ContainerProvider'. The package provider requires 'PackageManagement' and
    'Provider' tags. Please check if the specified package has the tags.
    At C:\Container\Install-ContainerHost.ps1:873 char:9
    +         Install-PackageProvider ContainerProvider -Force | Out-Null
    +         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidArgument: (Microsoft.Power...PackageProvider:Install
       PackageProvider) [Install-PackageProvider], Exception
        + FullyQualifiedErrorId : NoMatchFoundForProvider,Microsoft.PowerShell.PackageManagem
       ent.Cmdlets.InstallPackageProvider

    C:\Container\Install-ContainerHost.ps1 : Could not install ContainerProvider
    At line:1 char:1
    + .\Install-ContainerHost.ps1
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
        + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Install-C
       ontainerHost.ps1


    Friday, December 11, 2015 4:28 AM
  • For everyone who is still searching for a solution.

    1. Get the OneGet assembly Microsoft.PackageManagement.NuGetProvider.dll from somewhere (I don't remember where I got mine from, but probably from another machine - you can alternatively try to get it from the OneGet project)

    Probably the hardest step :) Sorry, can't remember how I found it. Perhaps I can upload it somewhere, or the Containers team from MSFT could upload it for us somewhere here.

    2. Place it here: %ProgramFiles%\PackageManagement\ProviderAssemblies\nuget\2.8.5.202\

    3. In PowerShell, execute Add-Type -Path %ProgramFiles%\PackageManagement\ProviderAssemblies\nuget\2.8.5.202\Microsoft.PackageManagement.NuGetProvider.dll

    Run Install-ContainerHost.ps1 again, it should hopefully work now.


    Monday, February 8, 2016 3:54 PM
  • Hi Folks,

    For me the issue was PowerShell is using the .NET WebClient and this wasn't passing proxy credentials. Thsi also affects Update-Help

    Try the following

    $wc = New-Object System.Net.WebClient
    
    $wc.Proxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials
    
    Install-PackageProvider NuGet -MinimumVersion '2.8.5.201' -Force 


    Regards,

    Michael

    Friday, March 11, 2016 11:02 AM
  • Thank you very much, Ferdi and Michael. 

    Unfortunately, Lady Luck is NOT on my side ... :-<

    Something is wrong in my network. I can install Container on Windows Server 2016 with GUI but cannot install it on Windows Server 2016 Core installation. Even though I set up proxy with netsh command, I need "-Proxy" option to run wget command. I think I need something to run some Container cmdlets.

    BTW, now, I'm trying to find out the other way to install Container on Server Core. For example, download ContainerBaseImage.wim with the other machine, first. Second, copy it to Server Core machine and run Install-ContainerHost.ps1 with "-WimPath" option.

    Thank you.

    Fukunaga, Takaaki

    Tuesday, March 15, 2016 4:04 AM
  • Also failing to install package provider too.  

    Running TP4 on Virtual Box (its host is Win7).

    Get-PSRepository

    returns

    WARNING: Unable to find module repositories.

    I can ping yahoo.com - but we are behind a corp firewall.  wget with -Proxy works fine.

    Thursday, April 7, 2016 6:37 AM
  • Here is a link to the stack overflow article that I just replied to on this Issue.

    Hopefully the same solution will help you


    Saturday, April 30, 2016 10:48 AM
  • I ran into the same issue with TP5 and the following command solved my issue:

    Register-PSRepository -Name "PSGallery" –SourceLocation "https://www.powershellgallery.com/api/v2/" -InstallationPolicy Trusted

    Thanks Stonesbg!

    Cheers,

    Ryan

    • Proposed as answer by Markus Kühn Friday, May 26, 2017 3:07 PM
    Monday, May 2, 2016 6:44 AM
  • I can confirm the solution from Ryan has solved the same issue on WinServ 2016 TP5.

    Cheers

    Tuesday, May 31, 2016 12:52 PM
  • In some VMs everything works fine but often it doesn't work at all. I too faced the issue you have reported multiple times. There is an easy workaround though mentioned at http://sbytestream.pythonanywhere.com/blog/Windows-Container-Workaround

    Monday, October 3, 2016 12:35 PM
  • Seems that the package "ContainerProvider" was renamed.  One should now use:

    Install-PackageProvider ContainerImage


    -Noel
    Wednesday, February 8, 2017 8:23 PM