Archive | Nano Server

Deploy a Windows Container Host to a New Hyper-V Virtual Machine based on the Windows Server 2016 ISO

The following documentation “Deploy a Windows Container Host to a New Hyper-V Virtual Machine” explains in a very nice way how to deploy a Windows Container Host. In the example a Windows Server 2016 TP4 image will be downloaded to the computer that the script is ran on.

If you already have downloaded a copy of the Windows Server 2016 you can use the example below to deploy your Windows Container Host to a new Hyper-V VM without downloading a new copy of the OS.

Start by downloading the “New-ContainerHost.ps1” script.

wget -uri https://aka.ms/tp4/New-ContainerHost -OutFile c:\New-ContainerHost.ps1

To build the Windows Container Host on a new Hyper-V VM from a Windows Server 2016 ISO run the following and make a note of the parameter “-IsoPath” that points to the ISO.

c:\New-ContainerHost.ps1 -IsoPath C:\iso\Server2016TP4\10586.0.151029-1700.TH2_RELEASE_SERVER_OEMRET_X64FRE_EN-US.ISO -VmName ConTP401 -WindowsImage NanoServer -HyperV -Verbose

0

Creating Nano Container VM with New-ContainerHost.ps1 script and not language en-us

If you, like me, are running an OS that do not use the language en-us then you can run into problems when building an Nano Container server with the script New-ContainerHost.ps1.

This is the error you can get.
12/08/2015 09:50:39 ========================================
12/08/2015 09:50:39 New-NanoServerImage Cmdlet Started
12/08/2015 09:50:39 ========================================
12/08/2015 09:50:39 The ‘sv-se’ directory does not exist in the ‘Packages’ directory (‘D:\NanoServer\Packages’).
at Test-Paths, D:\NanoServer\NanoServerImageGenerator.psm1: line 1406
at New-NanoServerImage<Process>, D:\NanoServer\NanoServerImageGenerator.psm1: line 634
at Cache-HostFiles, C:\New-ContainerHost.ps1: line 323
at New-ContainerHost, C:\New-ContainerHost.ps1: line 660
at <ScriptBlock>, C:\New-ContainerHost.ps1: line 1455
at <ScriptBlock>, <No file>: line 1
12/08/2015 09:50:39 Terminating due to an error. See log file at: C:\Users\u\AppData\Local\Temp\NanoServerImageGenerator.log

Creating Nano Container VM with New-ContainerHost.ps1 script and not language en-us1

To fix this, edit the script at line 323 by adding the parameter “-language en-us” at the end of the line.

New-NanoServerImage -MediaPath “$($driveLetter):\” -TargetPath $global:localVhdPath -Compute -Containers -ReverseForwarders -GuestDrivers -AdministratorPassword $Password -Language en-us

0