With that said, today’s post tackles the process of deploying Nano server, as shipped with pre-1709 releases, to ESXi.
Note: From release 1709 forward, the deployment process is completely different since Nano is pulled as an image from Docker Hub and hosted on a container host. I had started working on this post prior to learning about Microsoft’s plans for Nano, but nevertheless, installing it proved a bit challenging so I think sharing the experience is worth the effort. I should also mention that users running Nano in their environments will continue enjoying MS support for the coming 5-6 years. Some may want to run Nano in their environments regardless of support, so here it goes.
Requirements
There are the requirements if you’re planning on replicating the process outlined in this post.
- A Windows Server 2016 Server physical or VM. In theory, the process described will also work on Windows 8, 10 and Server 2012 R2 though I had issues on both 10 and 2012.
- A pre-1709 Windows Server 2016 ISO image. Download an evaluation copy from www.microsoft.com.
- VMware Tools for Windows, 64-bit in-guest installer. Download from my.vmware.com.
- WinImage. Download from www.winimage.com
Extracting the Nano Server binaries
Nano Server is not actually installed. Instead, you build a VHD disk which you then attached to a VM running under Hyper-V. In our case, we go one step further by converting the VHD file to VMDK thus allowing for it to be attached as a disk to a VM hosted on ESXi. To extract Nano from the Windows Server 2016 ISO, do the following:
- Mount the Windows Server 2016 ISO image as a drive on the Windows Server 2016.
- Create a root folder called Nano.
- Create the folder c:\nano\drivers.
- Copy the contents from \NanoServer to c:\Nano.
Copying the Nano distribution files from a Windows Server 2016 ISO
Extracting and Injecting VMware Tools Drivers
Nano Server does not come with inbuilt drivers. We therefore need to inject our own. Since we’ll be running Nano as a virtual machine on ESXi, for better performance I opted to include the Paravirtual SCSI adaptor and VMXNET 3 network drivers. To extract the drivers from the VMware Tools package previously downloaded, do the following: Step 1 – Open a command prompt and run VMware-tools-10.1.7-5541682-x86_64.exe /a. This command performs an administrative install. This basically means that the package contents are extracted to a folder which you can then share for remote installs.
Running a VMware Tools administrative install
Copying VMware drivers to the Nano distribution folder
Building a Nano Server image
We’re going to use PowerShell to create a bootable VHD file. The steps are as follows. Step 1 – Open an administrative PowerShell console on the Windows Server 2016 machine. Step 2 – Run mkdir c:\tmp to create a temporary folder for the script’s output and VHD file. Step 3 – Run Set-ExecutionPolicy Unrestricted to allow script execution. You can change it back to the original settings once you’re done. Step 4 – Navigate to C:\nano\NanoServer\NanoServerImageGenerator and run Import-module NanoServerImageGenerator.psm1
Importing the Nano Server Image Generator module in PowerShell
New-NanoServerImage ` -Edition "Datacenter" ` -MediaPath C:\Nano ` -BasePath C:\tmp ` -TargetPath C:\tmp\NanoServer.vhd ` -ComputerName NanoServer ` -EnableRemoteManagementPort ` -DriverPath C:\Nano\Drivers ` -AdministratorPassword (ConvertTo-SecureString -String "VMw@reRule5" -AsPlainText -Force) ` -DeploymentType Host ` -Package Microsoft-NanoServer-IIS-Package ` -verbose
Creating the Nano Server VHD using the New-NanoServerImage command
Converting from VHD to VMDK
Under the c:\tmp folder you will find the file NanoServer.vhd. If you wanted to, you could simple attach this to a VM running on Hyper-V and be done with it, but since we prefer ESXi to Hyper-V, we need to convert it to VMDK format. Here’s how.
The generated Nano VHD file
Step 3 – Select the Create Dynamically … option and press OK.
Step 4 – Type a name for the VMDK file and set Save as type to *.vmdk. Press Save.
Step 5 – WinImage will first read the VHD and will finally prompt you to select a partition to connect to. When it does, just press OK. You should find a nanoserver.vmdk file under the C:\tmp folder.
Converting a VHD file to VMDK format using WinImage
Hosting Nano Server on ESXi
Let’s go ahead and create a VM for Nano Server. I’ll be hosting it on ESXi 6.5 and using the vSphere Web Client to create it. Since the process is straight-forward, I’m only including the salient screenshots showing the settings I changed. Step 1 – Create a new VM. On the Select a guest OS screen, select Windows Server 2016 (64-bit) or Windows Server 2012 (64-bit) on older version of ESXi.
Selecting Windows Server 2012/2016 as the OS Family / version for the Nano Server VM
- Delete the default hard disk, CD-ROM and Floppy drive.
- Change the SCSI controller type from LSI Logic SAS to VMware Paravirtual.
- Change the network driver type from E1000 E to VMXNET 3.
Replacing default drivers with ones offering better performance
Uploading a VMDK to the VM’s folder using datastore browser
Attaching the Nano Server VMDK to the VM just created
Nano Server’s Recovery Console log on screen
Manually setting the network configuration via the recovery console
Testing IIS running on Nano Server
Set-Item WSMan:\localhost\Client\TrustedHosts "192.168.16.52" Enter-PSSession -ComputerName 192.168.16.52 -Credential administrator
Establishing a remote PowerShell session on Nano from a Windows client
echo "
THIS IS A TEST
" > C:\inetpub\wwwroot\default.htmRefreshing the browser window previously used to verify IIS functionality, you should now get this:
Testing IIS running on Nano Server
Conclusion
With Nano Server, Microsoft was heading in the right direction. It gave users a robust yet lightweight server capable of hosting infrastructure roles making it the ideal candidate for virtualization within the data center. Containers are a big thing and, probably, this is why Microsoft changed course abruptly, refactoring Nano solely for containerization use. Nevertheless, you can still run Nano on both Hyper-V and ESXi as a virtual machine. End-of-support is still a few years away if you still want to go for it though this is not something Microsoft would suggest unless of course, they change route once more. In today’s post, we saw how to create a Nano Server VHD disk using the New-NanoServerImage cmdlet which we then converted to a VMDK using WinImage, one of many freely available conversion tools. We then created a VM and attached the VMDK to it. Powering it up, we configured the network settings and performed a few simple tests to verify functionality. In the meantime, I’ll look into the possibility of running a Nano image using VMware containers something you can read about here. Ref
https://www.altaro.com/vmware/install-windows-nano-server-esxi/