Setup Nano Server in Azure and Configure DNS Role in the Nano Server

Setup Nano Server in Azure and Configure DNS Role in the Nano Server

Nano Server was first made available a part of Windows Server 2016 Technical Preview 2. Nano Server can be called as a stripped-down version of Windows Server released by Microsoft specifically for running cloud applications and containers. Nano server has
been officially announced as part of Microsoft Server 2016 launch which will act as a headless installation of Windows Server with minimal-footprint. It lacks a graphical user interface and does not come with a Windows installer. Hence all the management tasks
are done using PowerShell and Remote Server management tools. Due to this fact we cannot physically access the server using Remote Desktop Connection. Due to the above mentioned facts, the resources consumed by Nano Server have drastically reduced with respect
to a Full Server installation. It also offers greater speed, stability and security.

Specify the Virtual Machine Name, Size and the administrator credentials.

On proceeding to the next page, we will have to provide a cloud service DNS name and Region/Virtual Network. If we already have a Virtual network created and want the Nano server to be part of the virtual network we can specify the virtual network name.
Else use the region from which you will be accessing the server.

Finally select to install the VM agent and start the creation of the Azure Nano Server Virtual Machine.

After some time the Virtual Machine will be provisioned and we can see the status and details of the Nano Server Virtual Machine by going to the dashboard of the virtual machine.

Create Nano Server Virtual Machine using PowerShell

In this section we will see how to provision the Nano Server using PowerShell. Before creating the Nano Server we will have to fulfill some prerequisites.

Add Trusted Host

In order to remotely connect to the Nano Server from our local machine we will have to register the local computer as a trusted host. The
WS-Management TrustedHosts list is a list of trusted resources for your computer. The list consists of comma separated list of computer names which are considered as trusted hosts. Let’s spin up Windows PowerShell as administrator and see if the computer
is already added to trusted hosts by running the command:

get-item wsman:\localhost\Client\TrustedHosts

However since WinRM service is not started yet, we will have to start the WinRM service first.

Start the WinRM service by running the command

Start-Service WinRM

Now let’s run the get-item command once again. This time we can see that the computer is not listed as trusted host.

In order to add the local machine to trusted hosts, we will run the below command:

The parameters are quite self-explanatory and we are using the Resource Group and key Vault created earlier. Make sure that you use only numbers and lowercase letters for the VM Name, else we will get the below error.

Connect to Azure Nano Server

We can go ahead and create a secure PowerShell remote session with the Nano server. In order to do that we must first get the fully qualified domain name of the Nano Server which can be obtained by running the below command:

Get-AzureRmPublicIpAddress -ResourceGroupName "NanoGroup"

Copy the Fqdn from the DnsSettings section and use it in the below “Enter-PSSession” cmdlet.