Getting Started with Nano Server
上QQ阅读APP看书,第一时间看更新

Deploying Nano Server in a VM

Before we deploy Nano Server in a virtual machine, we need to create a Nano Server image. You can do this using PowerShell or using Nano Server image builder. In this chapter, we will use Windows PowerShell. For a more thorough explanation of deployment and configuration options for Nano Server, see Chapter 2, Getting Started with Nano Server.

First, you need to have a Windows Server 2016 or Windows 10 machine. Upon doing so, you'll have to create a folder on the machine that you can use to store the items to be used for the Nano Server creation process. For instance, you might create a folder named C:\NanoServer. After creating this folder, there are four resources you must have saved to that folder. These resources are:

  • NanoServerImageGeneratorPowerShell module
  • Convert-WindowsImage.ps1 script
  • NanoServer.wim file
  • Windows Server 2016 ISO file

In fact, all these resources are included in Windows Server 2016 ISO media in the NanoServer folder, you can mount the ISO image and copy the required components, then verify all are in the correct folder.

Next, open Windows PowerShell and import the NanoServerImageGenerator.psd1 module using the following command (see Figure 1):

Import-Module "C:\NanoServer\ NanoServerImageGenerator\NanoServerImageGenerator.psd1" -Verbose
Figure 1. Import Nano Server PowerShell module

When doing so, you can start creating the image using the New-NanoServerImage cmdlet, but you must specify a few parameters to use within the Nano Server that you are creating. These parameters are divided into required and optional.