Skip navigation
Deploy TP5 Nano Server

Deploy TP5 Nano Server

Q. How do I deploy a Nano Server VM with Windows Server 2016 TP 5?

A. The PowerShell for deployment of a Nano Server VM has changed from TP 4 and now includes the ability to integrate your own unattend answer file instead of manually adding content to the default unattend answer file that was using in TP4. Microsoft has full documentation at https://technet.microsoft.com/en-us/library/mt126167.aspx however below are the key steps for common configurations.

Firstly copy the content of the NanoServerImageGenerator folder to your local machine (I placed the content in a folder names d:\NanoTP5) then load the module using:

Import-Module 'D:\NanoTP5\NanoServerImageGenerator.psm1'

In my scenario the machine I am running this on is part of the domain I wish to join the Nano VM to so it can create the blob required for domain join. I also create a variable with the password I wish to use for the administrator account. I also created an unattend.xml file which sets the time zone which is listed below:

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="specialize">
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<TimeZone>Central Standard Time</TimeZone>
</component>
</settings>
<cpi:offlineImage cpi:source="wim:d:/temp/nanoserver.wim#Windows Server 2016 Technical Preview 5 SERVERSTANDARDNANO" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>

To use this content and create the Nano VM VHD I use:

$adminPass = ConvertTo-SecureString "Pa55word" -AsPlainText -Force
$NanoVHDPath = ".\NanoServerVM.vhd"

New-NanoServerImage -MediaPath 'S:\OS Images\Windows Server 2016 TP5\Expanded' `
-BasePath .\Base -TargetPath $NanoVHDPath -ComputerName NanoVM `
-DeploymentType Guest -Edition Standard `
-Storage -Defender -EnableRemoteManagementPort `
-Packages Microsoft-NanoServer-DSC-Package `
-UnattendPath .\unattend.xml `
-AdministratorPassword $adminPass -DomainName savilltech -ReuseDomainNode

In the example above it uses the Standard edition of Nano server (-Edition Standard), adds the storage and Defender packages, enables remote management and desired state configuration. It also sets the image as a VM (-DeploymentType Guest). The created VHD can then be used with a Generation 1 VM (if you want Generation 2 use VHDX as the VHD type).

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish