How to deploy Nano Server on a VM? [Quick Guide]

2:26 pm November 2, 20169510

I. introduction

A. Nano Server, what is?

Nano Server, this is one of the novelties that accompanies Windows Server 2016, and this version of Windows is, as its name suggests, extremely light and saving resource . For those who know the “Core” of Windows Server mode, be aware that Nano Server is much lighter, Microsoft having only left the essential.

Share its lightness, a VM Nano Server may be deployed in 3 minutes about , which is very fast compared to 15-20 minutes to install Windows. Nano Server should be considered a building block on which to added elements to build a server with only need, not superfluous.

Nano Server administration is done exclusively remotely through PowerShell via PowerShell Remoting or PowerShell Direct, if not by configuration management tools or consoles.

By the way, who says fewer items, said reduced attack surface, and therefore fewer safety updates to install on Server Nano.

nano-server-comparaison

B. Nano Server deployment

in this tutorial, we will deploy Nano Server on a virtual machine , first we’re going to generate a VHDX with the deployed image of Nano Server, then in a second step we will create a VM that will use this VHDX. There are different ways to do this, and especially you can customize your Nano Server deployment, but for this first deployment we stay on something basic and simple.

Before you begin, make sure you have an ISO of Windows Server 2016.

II. create a VM Nano Server

I manipulate directly since the Hyper-V host . Start by mounting the ISO on the host by double clicking the ISO file so that it is mounted in a virtual drive. Then, browse the content and in the folder “ NanoServer ‘ copy the subfolder” NanoServerImageGenerator “on the server in the directory you want.

deployer-vm-nano-server-2

As soon as that’s done, open a PowerShell console and import the module, by positioning itself in the directory “ NanoServerImageGenerator ‘ that you have copied to the server.

 Import-Module. NanoServerImageGenerator

Si you activate verbose mode on the import of the module, here’s what you get:

 COMMENTS: loading of the module from the path 'V:NANONanoServerImageGeneratorNanoServerImageGenerator.psd1 '.
COMMENTS: Loading of the module from the path 'V:NANONanoServerImageGeneratorNanoServerImageGenerator.psm1 '.
COMMENTS: Import of the function "Edit-NanoServerImage.
COMMENTS: Import of the function "Get-NanoServerPackage".
COMMENTS: Import of the function "New-NanoServerImage. 

Luckily, we’ll use the command ‘ New-NanoServerImage “.”

 New-NanoServerImage - Standard - DeploymentType Guest - MediaPath E: - TargetPath V:VMVHDXNanoServer-01.vhdx Edition - ComputerName NanoServer-01 

in the example above, I deploy NanoServer in Standard version (the other possibility is Datacenter) using the ISO of Windows Server 2016 mounted in the drive E: (MediaPath), and I want to store the VHDX in ‘V:VMVHDXNanoServer-01.vhdx’ to a server that is named “NanoServer-01” (the name of the server in Windows).

Note 1 : DeploymentType – type “Guest” can include Hyper-V Guest drivers as if we would create a VHD (X) for deployment on a physical host, it would have indicated “Host”.

Note 2 : If called the virtual disk ‘VHD’ is to create a VM from Generation 1, if it is called VHDX is to create a VM from Generation 2.

When you validate the command, you will be asked for a password. It’s the password for the administrator account on the Server VM Nano.

Deployment on the virtual disk will take 2-3 minutes…

deployer-vm-nano-server-3

At the end of the operation gives a 500 MB virtual disk about, for a server that’s really light.

deployer-vm-nano-server-4

Now, we must create a VM on Hyper-V and provide this VHDX file as the virtual disk to the VM. For those who wish to, we can do it in PowerShell:

 New - VM - Name NanoServer-01 - SwitchName "LAN" - VHDPath "V:VMVHDXNanoServer-01.vhdx" - Generation 2 - MemoryStartupBytes 512 MB - BootDevice VHD 

I created a VM called “NanoServer-01” I connect to vSiwtch ‘LAN’ and that I affect 512 MB RAM as well as the VHDX “V:VMVHDXNanoServer-01.vhdx”. Finally, I said that it is generation 2 and the VHD is a priority for the boot order.

Then, you start the VM:

 Start-VM NanoServer-01 

deployer-vm-nano-server-5

from the Hyper-V Manager, you can connect to the VM and enter the “Administrator” account and the password defined during deployment of VHD/VHDX. Beware, the keyboard is QWERTY.

deployer-vm-nano-server-6

There is no access command-line on the VM directly, as I said in the introduction everything is done remotely. What you can do locally is configure an IP or view the IP settings, or define firewall rules.

Coming up on the console ‘Nano Server Recovery Console’. If you go in Networking…

deployer-vm-nano-server-7

Then we press ENTER to validate the selection of the network card…

deployer-vm-nano-server-8

We arrive on a screen that shows the IP of the server in DHCP, but this also allows you to set a static IP if needed by pressing F11.

deployer-vm-nano-server-9

Then, to start Configure Server to connect remotely from a machine on the Nano Server VM, for example in PowerShell Remoting. However, WinRM default security policy does not allow to connect to a remote host ‘unknown’, so we add the VM Nano Server in the list of guests of trust:

 Set-Item WSMan:localhostClientTrustedHosts - Value "NanoServer-01, 192.168.1.2" 

in the above command match the IP address and the name, knowing that you are not obliged to put the two the name will suffice if you arrive to resolve (DNS).

Finally, we’re going to open remote PowerShell session on our host Nano Server:

 Enter-PSSession - ComputerName 192.168.1.2 - Credential (Get-Credential) 

need to enter credentials, that is to say ‘Administrator’ with the password defined during the creation of the VHD.

deployer-vm-nano-server-10

Your Nano Server virtual machine is ready to use! We will see through other tutorials how to use and configure Nano Server. For those interested, I’ve published on GitHub a script that automates the creation of a VM NanoServer within Hyper-V from ISO Windows Server 2016: New-NanoServerVM

Finally, it is important to specify that the command “New-NanoServerImage” and therefore the module for been used in this tutorial, maybe used on Windows 8.1 and Windows 10 as well as on Windows Server 2012 R2 and well heard Windows Server 2016.