Windows Server 2016 will be the first version of Windows ever to support Nano Server deployments. Although Nano Server has been described as a Windows Server deployment with a minimal footprint, and has been compared to Server Core, it is a completely different animal. When you install Windows Server, there is no option to install Nano Server. That’s because you don’t really install Nano Server, you build it.
Because Windows Server 2016 has yet to be released, the best practices for Nano Server are still evolving. In fact, it is likely that those best practices will continue to evolve for some time. Even so, Microsoft seems to be telling its customers they should configure Nano Server as a part of the creation process. That’s all well and good, but let’s face it, sometimes life happens. Suppose your boss wants you to change a Nano Server’s configuration after the Nano Server has already been deployed? It has been suggested that the server should be rebuilt from scratch in this type of situation, but where is the fun in that? In spite of what you may have read, it is possible to reconfigure a Nano Server that has already been deployed.
For those who might not be familiar with Nano Server, it is similar to Server core, but much, much smaller. Microsoft provides a Nano Server VHD that you can download if you want to play with Nano Server. The VHD is only 624,515KB in size. Did you catch that? An entire operating system’s footprint is measured in kilobytes, not gigabytes.
So how did Microsoft get Nano Server to be so small? First, Microsoft got rid of the user interface. There is a very small, text-based interface that can be used for low level configuration tasks, but you can’t manage the server through the interface. Here is what the Nano Server interface looks like:
The other thing that Microsoft did was to get rid of a lot of management commands. Nano Server does not contain PowerShell, but you can connect to it using a remote PowerShell session. Even so, many PowerShell cmdlets do not work with Nano Server, so you might find yourself having to resort to using old-school Command Prompt commands.
If you want to customize Nano Server, the first thing that you will usually have to do is to configure network connectivity. Nano Server will try to acquire an IP address from your DHCP server if possible, but there are plenty of situations in which that might not be desirable. For instance, maybe you need to provision the server with a static IP address.
In my case, I had to make a change to Nano Server’s DNS settings. Nano Server reached out to my DHCP server, but my DHCP server provides IP addresses to my production network. The problem was that I wanted to join the Nano Server to my lab domain, which has its own DNS server.
To fix the problem, I went into the Networking menu, which you can see in the previous screen capture, and made note of the Nano Server’s current IP address. Next, I went to a different PC and edited the C:\Windows\System32\Drivers\Etc\Hosts file to include the Nano Server’s current computer name and IP address. The reason I did this is simple. PowerShell won’t let you establish a session by specifying the IP address (except under a few very special circumstances), and establishing a session by specifying the name of the Nano Server won’t work either unless the computer you are using is able to locate the target computer. You can see the errors generated in the figure below.
Once the Hosts file has been modified, open PowerShell and enter the following commands:
Enter-PSSession -ComputerName <Nano Server name> -Credential $Cred
You can see what this looks like below. If you have trouble connecting, make sure that the Nano Server’s firewall is configured correctly for remote administration. The Nano Server menu shown in the first figure in this article contains an option for accessing the firewall rules.
Now that you have established a PowerShell session to the Nano Server, it’s time to configure the server’s DNS address (assuming that you need to). The first step in doing so is to determine the network interface index number. You can get this number by entering the following command:
Netsh interface ipv4 show interfaces
Make note of the IDX value associated with your interface. Next, enter this command:
Set-DNSClientServerAddress -InterfaceIndex <your interface index number> -ServerAddress (“<your DNS server address>”)
If you need to enter multiple DNS server addresses, you can separate the primary and secondary address with a coma. Once this process is complete, you can verify the operation by entering this command:
You can see what all of this looks like in the figure below:
Since the proper DNS server address has been set, it becomes possible to reference the server by name. Don’t forget to remove any modifications from your Hosts file if you had to use the Hosts file to enable connectivity.
Now, let’s rename the Nano Server. Assuming that the server is not yet domain joined, you can accomplish this by using the following command:
Rename-Computer -Newname “<new name>”
As you can see in the figure below, I have renamed my server from MINWINPC to Nano2. You will also notice that I received a warning message indicating that the server needs to be rebooted. You can reboot a Nano Server by going into the server console and pressing Ctrl+F6. After the server reboots, you will need to close PowerShell and enter a new session with the Nano Server, using the Nano Server’s new name.
Now, let’s go ahead and join the Nano Server to a domain. Normally, servers can be domain joined through PowerShell by using the Add-Computer cmdlet. However, because of Nano Server’s tiny footprint, it does not recognize this cmdlet. Remember, Microsoft’s presumption is that everything will be configured when the Nano Server is initially created, not after the fact. Fortunately, there is a way to join the server to your domain. However, the method is a bit unorthodox, to say the least.
The first step in the process is to log onto a different server that is running Windows Server 2016 (not a Nano Server). This server must be a domain member, because we have to harvest a data blob from this server. To do so, open an administrative PowerShell session, and enter this command:
Djoin /provision /domain <your domain name> /machine <your Nano Server name> /savefile .\odjblob
In case you are wondering, the DJOIN command is a Windows command for offline domain provisioning. You can see what the command looks like in action in the figure below:
Now that we have created a blob, we have to copy it to the Nano Server. There are several different ways of doing this, but here’s how I did it: From an administrative PowerShell session on the server containing the blob, I entered these commands:
NET USE Z: \\<Nano Server name>\C$
Copy objblob Z:\Temp
This set of commands maps the Z: drive to the Nano Server’s C: drive. It then creates a folder called Temp on the Nano Server and copies the blob into the Temp folder. You can see the actual process in the figure below:
Now, establish a remote PowerShell session to the Nano Server using the same method that we used earlier. Once the session is established, enter the following command to use the blob to join the Nano Server to the domain:
Djoin /requestodj /loadfile C:\Temp\odjblob /WindowsPath C:\Windows /localOS
Here is what the process looks like:
Now, reboot the Nano Server and it will be domain joined
Following the advice in this tutorial, you should be able to configure a Nano Server that has already been deployed. Keep in mind that the processes described in this article are really just the beginning. You can also deploy and configure server roles through a remote PowerShell session.
Photo Credit: Fabien Lavocat