Configure Nano Server Container Host

Setup Windows Containers on Nano Server

With the release of Windows Server 2016 Technical Preview 4 Microsoft allows you to use Windows Server Containers and Hyper-V Containers on Nano Server. In this blog post I will cover how you can setup a Nano Server on Hyper-V and let it use as a Container Host for your Windows Server and Hyper-V Containers inside this Nano Server VM. I already described how you can create a Nano Server VHDX file and how you can manage your Nano Server using PowerShell or PowerShell Direct so you can use this quick guide to set this up.

Create Nano Server Container Host VM

Create a new Nano Server Container Host VHDX file using the following features:

  • GuestDrivers (VM Drivers for Hyper-V)
  • Containers
  • Compute (Hyper-V role, if you want to run Hyper-V Containers)
  • ReverseForwarders

Create Nano Server Container Host VM PowerShell

Create Nano Server VM

This will create a new VHDX and you can create a new Virtual Machine. The Virtual Machine you create has to have at least 2 vCPUs.

If you want to use Hyper-V Containers inside this Virtual Machine, you have to setup the Virtual Machine to use Nested Virtualization. For this you can use this PowerShell command:

Configure Nano Server Container Host

Startup your Nano Server Virtual Machine and use PowerShell remoting to connect to it:

Configure Nano Server Container Host

You have to configure networking for your container host, you can create a External Switch or a new NAT Switch. If you use a new NAT Switch you can use the following commands:

Now you can download the Nano Server Container Image to your Container Host, so you can create new Containers based on this Image.

Now you can start using Containers inside your Nano Server Container Host.First thing you may notice is how fast and light weight everything is. For example, on my Surface Book it takes 7-8 seconds for the first initial boot of my Nano Server VM and new containers are created and started in less than a second. I really think that the concept of Nano Server and Container will bring a lot of benefits which will make both solutions a great success. When you deploy new servers today it takes several minutes until they are ready, with Nano Server it only takes seconds. If you copy for example a Windows Server Full Installation VHD you copy around 12GB, with Nano Server you copy around 400-500MB.