Skip to main content
Blog

Windows Nano Server – Early Learnings in Deployment

by Dan Newton

With Microsoft’s announcement and release of Windows Server 2016 (official name) Technical Preview 2, they have also released Nano Server.

Think of Nano server as the new, even smaller version of “Server Core”. This is a headless install of Windows Server. NO local logons are possible – beyond a serial connection.

Ever since the early announcement of Nano Server I’ve been very anxious to try it out. One thing is for sure….it’s not easy to get going. And I hope that changes once 2016 is RTM’ed.

The sole source of documentation right now is a single doc on Technet and/or MSDN (https://technet.microsoft.com/en-us/library/mt126167.aspx?f=255&MSPPError=-2147217396). The doc is detailed and gives some good guidance but it’s a bit unclear in many of the steps.

All that being said…here’s my experience so far with Windows Nano Server:

The best way I’ve found to get a VM up and running is to start with Windows 10 build 10074 (or higher) OR a full build of Windows Server 2012 Technical Preview 2. The reason for this is the use of DISM. This is the imaging tool that will be used to add the drivers, the package files for the Hyper-V role and the Unattend file that will assign the Nano Server a Name and Admin password at first boot.

The Technet doc starts off describing the dism files needed which are a bit misleading…I could never find any provider* in the Sources Directory on the Windows 2016 media, thus I end up using a Windows Server 2016 VM to build the VHD. The convert PowerShell script mentioned in the article works as advertised J. So I took the resulting VHD and simply added the cabs as the article describes.

When it came time to apply the unattend file…I had no success…just dism error 0x80220001. Looking in the dism.log showed that dism couldn’t access reg files in the VHD, not much help there. Bing and Google didn’t come up with much either. So I tried and copied/paste the same data from the Technet article again…same result, UGH. So I took a break. Fast forward a couple of days later, I decided to look at the second unattend example and modify it…and BOOM all is well with dism /Apply-Unattend J. If you’d like to use my file you can find it here: http://1drv.ms/1P8OHle Lesson on this is if you get the error 0x80220001, check the file.

So now I have a VHD that will boot and get on the network (after each update I copied the resulting VHD to my Hyper-V host and ran a test boot).

Next I wanted to assign an IP and open the firewall for file/print so I added a netsh command to the Technet’s example “SetupComplete.cmd”:

powershell.exe -command “Import-Module C:\windows\system32\windowspowershell\v1.0\Modules\Microsoft.PowerShell.Utility\Microsoft.PowerShell.Utility.psd1; Import-Module C:\windows\system32\WindowsPowerShell\v1.0\Modules\NetAdapter\NetAdapter.psd1; $ifa = (Get-NetAdapter -Name Ethernet).ifalias; netsh interface ip set address $ifa static 192.168.0.3”

netsh advfirewall firewall set rule group=”File and Printer Sharing” new enable=yes

Copied file and Next boot…I’m pinging 192.168.0.3 …also the Nano Server display of the output of the script looks cool:

Windows Nano Server

Running Hyper-V

I have the Newton Lab now booting from VHD and running Nano Server. To boot from VHD you’ll need to setup a new boot record via BCDEDIT. I ran this from my server while it was still running Window Server 2012 R2:

Bcdedit /copy {current}

Copy the GUID that is returned

bcdedit /set {GUID} device vhd=[c:]\NanoServer\NanoServer.vhd
bcdedit /set {GUID} osdevice vhd=[c:]\NanoServer\NanoServer.vhd
bcdedit /set {GUID} path \windows\system32\boot\winload.exe

Hyper-V is installed with the Microsoft-NanoServer-Compute-Package.cab but you must also enable hyper-v via BCDEDIT:

bcdedit /set HypervisorLaunchType Auto

I rebooted and had new selection in the boot menu.

DNS client:

The setup script only set the IP…(I have a todo to try to add DNS setting to the startup/setup script) so for now I needed to connect via PowerShell to the Nano Server…Here’s how:

  • From an elevated command prompt run WinRM quickconfig and select Yes when prompted
  • Open PowerShell ISE run the following:

$ip = “192.168.0.3”

Set-Item WSMan:\localhost\Client\TrustedHosts $ip

$user = “$ip\Administrator”

Enter-PSSession -ComputerName $ip -Credential $user

netsh interface ipv4 add dnsserver “Ethernet” address=192.168.0.20 index=1

After getting DNS client working I used the Technet documents to djoin (I always think of mustard) to the Newton Lab domain.

Well great now I have a new Hyper-V host but all my VMs are not there. So prior to reboot I ran this code from my good friend www.foxdeplopy.com :

get-vm | ForEach-Object {

$ID = $_.VMId

$path = $_.ConfigurationLocation

Get-ChildItem -Path $path “*.xml” -Recurse | Where-Object {$_.Name -eq “$ID.xml”}

} | Copy-item -Destination ‘E:\Virtual Machines\MassExport’

The code will dump on the configs to xml in a single folder and then I manually import the ones I want to use/test as Nano-Hyper-V guests.

Conclusion:

This is a very manual method to deploy a server and as previously stated I hope it is not the long term solution. The performance seems good so far but it’s very early in the testing. I’ll post an update later after a few weeks of real live testing.


Leave a comment