Add Package To Existing Windows Server 2016 TP4 Nano Server

Following my Windows Server 2016 Nano Server blog series I wroth another post about how to add a package to existing Nano Server Virtual machine.Update: If you are running TP5 you can use the online option using the Package Management With Windows Nano Server 2016 article.

Before you start, open PowerShell and Import the NanoServer PowerShell module.

(module is located Inside the NanoServer Folder In the Windows Server 2016 TP4 ISO Image).

Import-Module C:\NanoVMs\NanoServer\NanoServerImageGenerator.psm1

Shutdown the Nano server VM

Add Packages using the cmdlet below:

Note: You will need to use the Base packages folder that was created during the Nano Server setup, If you can’t find you will need to create a new Base Image folder.

In the line below I’m adding IIS role:

Edit-NanoServerImage -BasePath .\base -TargetPath .\NanoServerVM\Nano01.vhd -Packages Microsoft-NanoServer-IIS-Package

In the line below I’m adding the file storage role:

Edit-NanoServerImage -BasePath .\base -TargetPath .\NanoServerVM\Nano01.vhd -storage

Note: You can add multiple roles In on cmdlet.

Once you Issue the cmdlets the packages will be loaded from the Base folder to the VHD.

2 Replies to “Add Package To Existing Windows Server 2016 TP4 Nano Server”

  1. Hi,

    When i use -packages microsoft-nanoserver-iis-package, i get the following error:
    Edit-NanoServerImage : A parameter cannot be found that matches parameter name ‘packages’.
    At line:1 char:78
    + … epath c:\tmp -TargetPath c:\tmp\NanoTestServer.vhdx -packages microso …
    + ~~~~~~~~~
    + CategoryInfo : InvalidArgument: (:) [Edit-NanoServerImage], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Edit-NanoServerImage

    When i change the -packages line to just -compute, it installs the hyper-v role. What am i dong wrong here?

  2. Tested some more. Eventhough the book server 2016 and multiple websites state the parameter is packageS, it seems to work just fine with package as parameter.

Comments are closed.