This TechNet Wiki article provides an overview on how to deploy Windows Server 2016 Nano Server as a Virtual Machine in VMware vSphere virtualization platform. This page focuses on Windows Server 2016 Technical Previews and General Availability (GA) Nano Server deployment preparation in VMware virtualization environment.
Have you heard of the new awesome Microsoft Windows Nano Server? Most of the built articles are revolving on physical hardware, Hyper-V and not forget, Azure. If your hypervisor environment is using VMware vSphere, those may just slightly miss the bandwagon to test Nano Server in their environment. Well, this article is going to change the game play a bit because we want you to test it out on vSphere 6.0 and we just cannot let the Hyper-V hypervisor enthusiasts have all the fun.
Other Hypervisor Articles;
So this article will handle integration of Windows Server 2016 Nano Server guest on VMware hypervisor host. Let us begin the journey with;
↑ Return to Top
At the time of creating this article, we will be focusing on Windows Server 2016 Technical Preview 3 and VMware vSphere 6.0. The technique on this article will not contribute huge differences between VMware vSphere ESXi hypervisor versions. Older version of VMware vSphere ESXi hypervisor may not support Windows Technical Preview as the Guest Operating System when creating a new Virtual Machine.
With the release of Windows Server 2016 Technical Preview 4 on 20/11/2015, Technical Preview 5 on 28/04/2016 and General Availability (GA) on 26/09/2016, we have updated this article with the same concept and proof the technique is still achievable with minor changes on some commands that also shows the progressive improvements between each preview to the release to market edition.
The NanoServer folder reside in the Windows Server 2016 Technical Preview / General Availability (GA) DVD Media.
Copy the NanoServer folder from the media to the local drive using PowerShell.
Firstly, find out the CD/DVD-ROM drive letter.
# Find out the CD-ROM Drive Letter
Get-Volume | `
?{$_.DriveType -eq "CD-ROM"} ;
Next, copy the Nano Server content from the Windows Server 2016 Technical Preview X / General Availability (GA) media to the local drive.
# Copy the NanoServer folder from the Windows Server 2016
# Technical Preview 3 DVD media
Copy-Item `
-Path Z:\NanoServer `
-Destination C:\ `
-Recurse `
-Verbose ;
Which Nano Server image format should I choose? VHD, VHDX or WIM format? This really depends on your environment and your infrastructure planning for the future.
This section focuses on extracting VMware Tools in preparation to slipstream the mandatory drivers. If you are struggling with this, you may want to collaborate with your VMware evangelist and work together.
SSH to VMware vSphere ESXi 6.0 Host using PuTTY.
ls -l vmimages/tools-isoimages/win*
Download the vmimages/tools-isoimages/windows.iso file using WinSCP to the machine for content extraction
If your machine is also a VMware virtual machine, you can manually mount the ISO by following the article below;
This is how to extract the VMware Tools content using the ISO Media with VMware Tools Installation Wizard to the destination folder below using PowerShell.
Firstly, we create an extracted folder to store all the VMware Tools content.
# Create a VMware_Tools_Extracted folder for extracting
# VMware Tools installation content
New-Item `
-Path C:\NanoServer\VMware_Tools_Extracted `
-Type directory ;
Next, we mount the VMware Tools for Windows ISO image.
# Mount the Windows VMware Tools ISO
Mount-DiskImage `
-ImagePath C:\windows.iso ;
Once it is mounted, we need to know the drive letter of the mounted image.
# Find the mounted Windows VMware Tools ISO Drive Letter
(Get-DiskImage -ImagePath C:\windows.iso | Get-Volume).DriveLetter
With the drive letter identified, we can manually execute the command to extract the VMware Tools installation to the destination folder.
# Execute VMware Tools Setup64.exe and extract the content to
# C:\NanoServer\VMware_Tools_Extracted folder using the
# Installation Wizard
<# Drive Letter #>:\setup64.exe /a /p C:\NanoServer\VMware_Tools_Extracted
# Eg. d:\setup64.exe /a /p C:\NanoServer\VMware_Tools_Extracted
Unfortunately, the VMware Tools command will prompt the VMware Tools Installation Wizard graphical user interface and therefore it cannot be scripted. User intervention on the graphical user interface is required to complete the extraction to the destination folder as shown on the screenshots below;
Once the VMware Tools Installation Wizard has completed the extraction to the destination folder, remember to dismount the VMware Tools ISO media using the PowerShell.
# Dismount the Windows VMware Tools ISO
Dismount-DiskImage `
Create a folder to contain the extracted VMware Tools content using PowerShell.
If your machine is also a VMware virtual machine and you have already mounted the VMware Tools ISO image, you can extract the VMware Tools content by following the article below;
Extract the content into the destination folder using the VMware Tools Installation Wizard graphical user interface and unmount the ISO image.
Before we prepare the VMware Tools drivers to be included in NanoServer, I like to be a bit tidy in containing what I need in a separate folder so that I don't get confuse. Create a VMware Drivers folder within the parent NanoServer folder using PowerShell.
# Create a VMware Drivers folder
-Path C:\NanoServer\VMware-Drivers `
-ItemType directory ;
Selecting the VMware drivers required for NanoServer as a guest virtual machine is very important. In order to understand what are those from the documentation link below;
# Copy VMware Tools Memory Control Driver - This driver is Mandatory
-Path 'C:\NanoServer\VMware_Tools_Extracted\VMware\VMware Tools\VMware\Drivers\memctl\*' `
-Destination C:\NanoServer\VMware-Drivers `
# Copy VMware Tools Paravirtual SCSI (PVSCSI) Drivers - Optional
-Path 'C:\NanoServer\VMware_Tools_Extracted\VMware\VMware Tools\VMware\Drivers\pvscsi\*' `
# Copy VMware Tools SVGA 3D Video (SVGA) Drivers - Optional
-Path 'C:\NanoServer\VMware_Tools_Extracted\VMware\VMware Tools\VMware\Drivers\video_wddm\*' `
# Copy VMware Tools Virtual Machine Communication Interface (VMCI)
# Drivers - Optional
-Path 'C:\NanoServer\VMware_Tools_Extracted\VMware\VMware Tools\VMware\Drivers\vmci\device\*' `
# Copy VMware Tools VMXNet NIC (VMXNET3) Drivers - This
# driver is Mandatory for using VMXNET3 Network Interface.
-Path 'C:\NanoServer\VMware_Tools_Extracted\VMware\VMware Tools\VMware\Drivers\vmxnet3\NDIS6\*' `
With Windows Server 2016 Technical Preview 3, Microsoft has simplified the Nano Server creation with 2 PowerShell scripts that we have copied across to the local drive during the preparation for Nano Server image and we will use them in the example below.
Firstly, we need to ensure that we are at the working folder where the New-NanoServerImage PowerShell script is located. The reason is that if you are not in that working folder, you may encounter errors when the script is going to invoke the Convert-WindowsImage PowerShell script written by Pronichkin.
# Ensure you are at C:\NanoServer working folder
Set-Location `
-Path C:\NanoServer ;
Secondly, we will have to import the New-NanoServerImage PowerShell script module using PowerShell.
# Import New-NanoServerImage PowerShell Module for Technical Preview 3
Import-Module `
-Global C:\NanoServer\new-nanoserverimage.ps1 ;
You will notice that Microsoft had made some improvement changes to the PowerShell module and renamed the file to NanoServerImageGenerator.psm1.
# Import New-NanoServerImage PowerShell Module for Technical Preview 4
-Global C:\NanoServer\NanoServerImageGenerator.psm1 ;
With Technical Preview 5 and General Availability (GA), you will notice that Microsoft had made some improvement changes to the PowerShell module and moved the file NanoServerImageGenerator.psm1 to a NanoServerImageGenerator folder.
# Import New-NanoServerImage PowerShell Module for Technical Preview 5
-Global C:\NanoServer\NanoServerImageGenerator\NanoServerImageGenerator.psm1 ;
Next, we will create a basic NanoServer image with no role or feature except for the basic necessities. For a more detail documentation of how to create a NanoServer, you can read up more from the link below;
With Technical Preview 4 or older, we need to ensure that -GuestDrivers parameter is included to allow you to have keyboard functionality when you launch the remote console using VMware vSphere 6.0 Web Client.
Remember the VMware Tools drivers that we have extracted and copied to another destination folder just now? We will need to include the -DriversPath parameter and specify the copied VMware drivers folder path.
Using the PowerShell command, we will concatenate those parameters into a single command to initiate the creation of a new basic Nano Server.
# Create New Basic NanoServer Image for Technical Preview 3
New-NanoServerImage `
-MediaPath Z: `
-BasePath C:\NanoServer\Base `
-TargetPath C:\NanoServer\NanoServer `
-ComputerName NanoServer `
-EnableRemoteManagementPort `
-Language 'en-us' `
-GuestDrivers `
-DriversPath C:\NanoServer\VMware-Drivers `
-AdministratorPassword (ConvertTo-SecureString -String "Password" -AsPlainText -Force) ;
Since there are improvement changes on the PowerShell module, we need to include the filename of the VHD file type in the -TargetPath parameter now that also mean that you can change the filename of the VHD file type to be different from the computer name.
# Create New Basic NanoServer Image for Technical Preview 4
-TargetPath C:\NanoServer\NanoServer\NanoServer.vhd `
Done. We have a Nano Server created on a Generation 1 VHD virtual disk that can be mounted and boot up on a Hyper-V host. If you have included the VMware Paravirtual SCSI (PVSCSI) Drivers, you definitely can boot it up on your VMware vSphere ESXi 6.0 host provided that your virtual machine is using PVSCSI controller for the VMDK disk. But. Firstly, we generally prefer LSI SAS controller for Windows. Secondly, how do you get it running in vSphere?
With Technical Preview 5 and General Availability (GA), we can use the the New-NanoServerImage cmdlet to slipstream all the required drivers during the build process and simplify the Nano Server deployment. In the first example, we will demonstrate how to create a Nano Server image in VHD/VHDX format for development environment where it is possible to mount multiple different Nano Server VHD/VHDX to the boot manager within a single VMDK file for development or user acceptance testing.
# Create New Basic NanoServer Image for General Availability (GA)
-MediaPath 'D:\' `
-Edition 'Datacenter' `
-DeploymentType Guest `
-TargetPath 'C:\NanoServer\NanoServer.vhdx' `
-MaxSize 3GB `
-DriverPath ('C:\NanoServer\VMware-Drivers\pvscsi.inf', `
'C:\NanoServer\VMware-Drivers\vm3d.inf', `
'C:\NanoServer\VMware-Drivers\vmci.inf', `
'C:\NanoServer\VMware-Drivers\vmxnet3ndis6.inf', `
'C:\Windows\System32\DriverStore\FileRepository\lsi_sas.inf_amd64_2bd0ac9c0d7785b0' `
-ComputerName 'NanoServer' `
-SetupCompleteCommand ('tzutil.exe /s "New Zealand Standard Time"') `
In the second example, we will demonstrate how to create a Nano Server image in WIM format for production environment where the operating system is stored in a single volume within the VMDK file.
-TargetPath 'C:\NanoServer\NanoServer.wim' `
In this example, it will demonstrates how we can manually inject the LSI SAS storage controller driver to an existing Nano Server image that does not contain the lsi_sas.sys driver. This step is totally optional if you have already defined the lsi_sas.sys driver when you are creating a new Nano Server image.
This example is to provide the concept on how you can incorporate any other additional drivers into an existing Nano Server image and servicing the Nano Server image with any new driver requirement due to changes in production environment.
In order to get started with this example demonstration, we will need to find the LSI SAS storage controller driver folder path within a Windows Operating System since it is a Microsoft driver. Make sure that you are injecting the driver that comes from the same operating system version or release that your Nano Server image is generated. This is to ensure that the Nano Server will be able to load the LSI SAS storage controller driver that has the compatible or verified driver digital signature.
# Find lsi_sas.sys Storage Driver
Get-ChildItem `
-Path C:\Windows\System32\DriverStore `
-Filter lsi_sas.sys `
-Recurse ;
Next, we need to create an empty mountdir folder for DISM to mount the VHD.
# Create a MountDir folder for Deployment Image Servicing and Management (DISM)
-Path C:\NanoServer\mountdir `
Next, we use DISM to mount the NanoServer in VHD format into the mountdir folder.
# Mount NanoServer.vhd vDisk on C:\MountDir folder
dism /mount-image /imagefile:c:\nanoserver\nanoserver\nanoserver.vhd /index:1 /mountdir:c:\nanoserver\mountdir
If your Nano Server image is in VHDX format, follow the command below:
# Mount NanoServer.vhdx vDisk on C:\MountDir folder
dism /mount-image /imagefile:c:\nanoserver\nanoserver\nanoserver.vhdx /index:1 /mountdir:c:\nanoserver\mountdir
If your Nano Server image is in WIM format, follow the command below:
# Mount NanoServer.wim vDisk on C:\MountDir folder
dism /mount-image /imagefile:c:\nanoserver\nanoserver\nanoserver.wim /index:1 /mountdir:c:\nanoserver\mountdir
Once we done that, we can inject the LSI SAS storage controller driver by specifying the folder path.
# Add the lsi_sas.sys storage controller driver into C:\MountDir folder
dism /add-driver /image:c:\nanoserver\mountdir /driver:C:\Windows\System32\DriverStore\FileRepository\lsi_sas.inf_amd64_2bd0ac9c0d7785b0
After that, we dismount the mountdir folder.
# Unmount NanoServer.vhd vDisk from C:\MountDir folder
dism /unmount-image /mountdir:c:\nanoserver\mountdir /commit
Once this is performed, the Nano Server will be able to boot up on LSI SAS storage controller with VMDK disk attached. We can also safely regard this NanoServer.vhd is the new base image for your VMware environment although I haven't shown you how to get it into the vSphere 6.0 yet.
With the General Availability (GA) release of Windows Server 2016, you can also use the Edit-NanoServerImage cmdlet from the NanoServerImageGenerator PowerShell module to easily and quickly add additional drivers or other configuration changes to the image with ease.
In this example below, it will demonstrate how to inject additional vmmouse.sys and vmusbmouse.sys VMware drivers into an existing Nano Server image by using Edit-NanoServerImage cmdlet.
# Edit Nano Server and add more additional drivers
Edit-NanoServerImage `
-BasePath '.\Base' `
-TargetPath 'C:\NanoServer\Target\NanoServer.vhdx' `
-DriverPath ( `
'C:\NanoServer\VMware_Tools_Extracted\VMware\VMware Tools\VMware\Drivers\mouse\vmmouse.inf', `
'C:\NanoServer\VMware_Tools_Extracted\VMware\VMware Tools\VMware\Drivers\mouse\vmusbmouse.inf') ;
Alright, a Nano Server without any role or feature will not be of any use to anyone. Since we currently have a proper NanoServer.vhd base image, we can use the new base image to recreate another Nano Server VHD with roles or feature.
Let's find out the full path of our base image that we created just now.
# Verify the existing NanoServer VHD Path
-Path C:\NanoServer\NanoServer\ | `
Select `
FullName, `
Length ;
In this process of adding a Hyper-V role, we included the -Compute parameter on the PowerShell command. This will instruct it to include the Microsoft-NanoServer-Compute-Package.cab file during repackaging. We also need to include the -ExistingVHDPath parameter and specify our existing base image full path.
For a full reference of the available Nano Server role and feature included in Windows Server 2016 Technical Preview 3, you can find them in the link of the documentation below;
# Create a New NanoServer with Hyper-V role
# using existing NanoServer Base Image with Technical Preview 3
-TargetPath C:\NanoServer\NanoServer-Compute `
-ExistingVHDPath C:\NanoServer\NanoServer\NanoServer.vhd `
-Compute `
Once this is completed, you will notice that the new NanoServer-Compute.vhd has a different file length size now. It is slightly bigger than the base image.
# Verify the new NanoServer with Hyper-V role VHD Path
-Path C:\NanoServer\NanoServer-Compute\ | `
Unfortunately with Windows Server 2016 Technical Preview 4 or higher, the -ExistingVHDPath parameter is deprecated and is no longer available. Therefore you will need to repeat the process of Getting Started with Nano Server Creation to recreate a new Nano Server image with all the required role or feature from the beginning. Alternatively, you can make a copy of the original NanoServer VHD image, use the Edit-NanoServerImage cmdlet to edit the copied VHD image and rename the copied VHD image as version 2.
With General Availability (GA) release of Windows Server 2016, the example below will demonstrate on how to create a Nano Server with Hyper-V, Containers and Clustering roles with Defender and ShieldedVM features including SCVMM agent to the image as an example.
-TargetPath 'C:\NanoServer\NanoServer-HV.vhdx' `
-Clustering `
-Containers `
-Package Microsoft-NanoServer-SCVMM-Package, Microsoft-NanoServer-ShieldedVM-Package `
-Defender `
'C:\Windows\System32\DriverStore\FileRepository\lsi_sas.inf_amd64_2bd0ac9c0d7785b0\lsi_sas.inf') `
-ComputerName 'NanoServer-HV' `
In this example, it will demonstrate on using Edit-NanoServerImage cmdlet to add the required roles and features on an existing Nano Server image instead of recreating a new Nano Server image with the required roles and features. This alternate method will overwrite your existing Nano Server image and therefore you may want to make a copy of the original Nano Server image.
# Edit Nano Server to change the hostname and
# add Hyper-V and other roles or features
-ComputerName 'NanoServer-HV' ;
Since we have found out that adding a role or feature increases the NanoServer-Compute.vhd file size, we need to find out the actual size of our VHD because it represent the hard disk size of the Nano Server operating system volume. This section on reducing the Nano Server disk footprint is absolutely optional but it is a great knowledge for anyone who wish to obtain a leaner Nano Server disk or reclaiming disk consumption.
# Get the NanoServer-Compute.vhd current default disk size information
Get-VHD `
-Path C:\NanoServer\NanoServer-Compute\NanoServer-Compute.vhd | `
@{L='Path';E={$_.Path}}, `
VhdFormat, `
VhdType, `
@{L='FileSize in Byte';E={$_.FileSize}},`
@{L='FileSize in KB';E={$_.FileSize/1KB}}, `
@{L='FileSize in MB';E={$_.FileSize/1MB}}, `
@{L='FileSize in GB';E={$_.FileSize/1GB}}, `
@{L='Size in Byte';E={$_.Size}}, `
@{L='Size in GB';E={$_.Size/1GB}}, `
@{L='MinimumSize in Byte';E={$_.MinimumSize}}, `
@{L='MinimumSize in GB';E={$_.MinimumSize/1GB}}, `
FragmentationPercentage ;
By default using New-NanoServerImage command in Windows Server 2016 Technical Preview 3, the Nano Server will be created with Generation 1 VHD in Dynamic VHD Type with 40GB disk partition containing about ~461MB of files. For VMware enthusiasts, it means 40GB Thin Provisioned Disk with about ~461MB consumed space for files.
True, Nano Server is indeed very small and it can be less than 1GB depending on how many drivers, roles or features has been included in the built. But do we really need 40GB Dynamic VHD? I do not have an answer for it. But the process below demonstrates on how to reduce the disk from 40GB to less than 4GB to fit into a 4GB VMDK.
Firstly, we need to convert the Nano Server Generation 1 VHD to a Generation 2 VHD. If your Nano Server image is already a Generation 2 VHD, you can skip the conversion.
# Convert the NanoServer-Compute.vhd Generation 1 VHD to
# NanoServer-Compute.vhdx Generation 2 VHDX format
Convert-VHD `
-Path C:\NanoServer\NanoServer-Compute\NanoServer-Compute.vhd `
-DestinationPath C:\NanoServer\NanoServer-Compute\NanoServer-Compute.vhdx `
-VHDType Dynamic `
-DeleteSource ;
Prior to resizing, we will get the current disk information of the VHDX to prove that the resizing has performed accordingly to plan.
# Get the new NanoServer-Compute.vhdx current default disk size
# information
-Path C:\NanoServer\NanoServer-Compute\NanoServer-Compute.vhdx | `
Next, we mount the VHDX locally and get the virtual disk internal volume information to verify the volume structure is correct as stated before any manipulation made.
# Mount the NanoServer-Compute.vhdx and get the NanoServer
# system drive partition volume size
Mount-VHD `
-Path C:\NanoServer\NanoServer-Compute\NanoServer-Compute.vhdx `
-Passthru | `
Get-Disk | `
Get-Partition | `
Get-Volume ;
By default, the New-NanoServerImage.ps1 PowerShell Module utilise the Convert-WindowsImage.ps1 PowerShell Module to create the VHD vDisk with the default size value of 40GB and the default size of 40GB may not fit into a USB Flash Thumb Drive if your solution implementation required although it is a Dynamic VHD Type.
With the VHD being mounted, we can start resizing the VHD virtual disk internal partition.
# Resize the Partition inside Generation 2 VHD
Resize-Partition `
-DriveLetter D `
-Size (((4GB - ((512KB * 2) + (512KB * 2))) - 300MB ) - 600MB) ;
Well, it is arguable that the Disk Size in GB is going to be far less than 4GB and that is because;
Next, we dismount the VHD vDisk from the local machine to resize the VHD.
# Dismount the NanoServer-Compute.vhdx Generation 2 VHD
Dismount-VHD `
-Path C:\NanoServer\NanoServer-Compute\NanoServer-Compute.vhdx ;
Once the VHD has been dismounted, the VHD file will not be locked and we can start resizing the VHD.
# Resize the NanoServer-Compute.vhdx Generation 2 VHD
Resize-VHD `
-ToMinimumSize ;
After the VHD has been resized, we can start converting the Generation 2 VHD back to Generation 1 VHD to keep consistent file type with the script output.
# Convert the NanoServer-Compute.vhdx Generation 2 VHD back
# to NanoServer-Compute.vhd Generation 1 VHD format
-DestinationPath C:\NanoServer\NanoServer-Compute\NanoServer-Compute.vhd `
Now the moment of truth, we will obtain the VHD information and verify it has been reduced in size.
# Get the new NanoServer.vhd current default disk size information
Now we have Nano Server with Hyper-V role that is less than 4GB in VHD which can fit into a 4GB VMDK, but it is still in a VHD format for Hyper-V Host and we need to get it hosted within a vSphere ESXi host.
Before we start, we will have to ensure that have created a Virtual Machine on vSphere ESXi host with the correct virtual hardware specification where the Nano Server image will boot up from. We will also requires a Windows Preinstallation Environment (WinPE) to boot up and perform some system preparation configuration on the Virtual Machine.
We will need to download and install the Windows Assessment and Deployment Kit (ADK) for Windows 10 and install the Windows Preinstallation Environment (Windows PE) feature to allows us to create a Windows PE image.
To obtain Windows Assessment and Deployment Kit (ADK) for Windows 10, you can download it from the here.
With all the preparation of the Nano Server VHD completed, we will need to prepare a media to boot into Windows Preinstallation Environment with our Nano Server VHD file. This is because we cannot mount the VHD file type into the Guest Virtual Machine on ESXI using vSphere 6.0 Web Client.
Let's jump into the Windows Assessment and Deployment environment now.
001 002 003 # Enter into the Windows Assessment and Deployment # Kit (ADK) environment from PowerShell console C:\Windows\system32\cmd.exe /k "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\DandISetEnv.bat"
002
# Kit (ADK) environment from PowerShell console
C:\Windows\system32\cmd.exe /k "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\DandISetEnv.bat"
Use the command script provided in that environment to copy the Windows PE media content.
This is how we will using the CopyPE command script to create a WIndows PE media content folders with all the required files.
001 002 003 004 # Copy the Windows Preinstallation Environment (WinPE) # media content for amd64 into your working folder # for Technical Preview 3 "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\copype.cmd" amd64 "C:\NanoServer\WindowsPE AMD64 - Windows Server 2016 TP3 - Nano Server"
004
# media content for amd64 into your working folder
# for Technical Preview 3
"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\copype.cmd" amd64 "C:\NanoServer\WindowsPE AMD64 - Windows Server 2016 TP3 - Nano Server"
There is no difference in term of the command between Technical Preview 3, Technical Preview 4, Technical Preview 5 or GA except for the destination path.
001 002 003 004 # Copy the Windows Preinstallation Environment (WinPE) # media content for amd64 into your working folder # for Technical Preview 4 "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\copype.cmd" amd64 "C:\NanoServer\WindowsPE AMD64 - Windows Server 2016 TP4 - Nano Server"
# for Technical Preview 4
"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\copype.cmd" amd64 "C:\NanoServer\WindowsPE AMD64 - Windows Server 2016 TP4 - Nano Server"
Let's exit the ADK environment into PowerShell environment.
001 002 # Return back to PowerShell Console PowerShell
PowerShell
We will have to manually create an empty VHD folder within the Windows PE media folder to keep our Nano Server VHD file.
001 002 003 004 005 # Create a VHD folder in Windows PE Media Folder # for Technical Preview 3 New-Item ` -Path "C:\NanoServer\WindowsPE AMD64 - Windows Server 2016 TP3 - Nano Server\media\VHD" ` -Type directory ;
005
-Path "C:\NanoServer\WindowsPE AMD64 - Windows Server 2016 TP3 - Nano Server\media\VHD" `
There is no difference in term of the command between Technical Preview 3, Technical Preview 4, Technical Preview 5 or GA except for the folder path.
001 002 003 004 005 # Create a VHD folder in Windows PE Media Folder # for Technical Preview 4 New-Item ` -Path "C:\NanoServer\WindowsPE AMD64 - Windows Server 2016 TP4 - Nano Server\media\VHD" ` -Type directory ;
-Path "C:\NanoServer\WindowsPE AMD64 - Windows Server 2016 TP4 - Nano Server\media\VHD" `
Copy the Nano Server VHD file to that newly create VHD folder in the Windows PE media folder. It has to be in the media folder so that the file will be included when we compile it into an ISO image.
001 002 003 004 005 006 007 # Copy NanoServer-Compute.vhd vDisk to Windows PE # Media VHD Folder for Technical Preview 3 Copy-Item ` -Path C:\NanoServer\NanoServer-Compute\NanoServer-Compute.vhd ` -Destination "C:\NanoServer\WindowsPE AMD64 - Windows Server 2016 TP3 - Nano Server\media\VHD" ` -Recurse ` -Verbose ;
006
007
# Media VHD Folder for Technical Preview 3
-Destination "C:\NanoServer\WindowsPE AMD64 - Windows Server 2016 TP3 - Nano Server\media\VHD" `
001 002 003 004 005 006 007 # Copy NanoServer-Compute.vhd vDisk to Windows PE # Media VHD Folder for Technical Preview 4 Copy-Item ` -Path C:\NanoServer\NanoServer-Compute\NanoServer-Compute.vhd ` -Destination "C:\NanoServer\WindowsPE AMD64 - Windows Server 2016 TP4 - Nano Server\media\VHD" ` -Recurse ` -Verbose ;
# Media VHD Folder for Technical Preview 4
-Destination "C:\NanoServer\WindowsPE AMD64 - Windows Server 2016 TP4 - Nano Server\media\VHD" `
Let's return back to the ADK environment to use another command script for compiling to ISO image.
001 002 003 # Return back into the Windows Assessment and Deployment # Kit (ADK) environment from PowerShell console C:\Windows\system32\cmd.exe /k "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\DandISetEnv.bat"
Using the command script, we begin the compilation by specifying the Windows PE folder and the ISO Image file destination path.
001 002 003 # Create the Windows PE ISO from the Windows PE # Media folder for Technical Preview 3 "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\MakeWinPEMedia.cmd" /ISO "C:\NanoServer\WindowsPE AMD64 - Windows Server 2016 TP3 - Nano Server" "C:\NanoServer\NanoServer-Compute\Windows_Server_2016_TP3_-_Nano_Server_for_vSphere_6.0.ISO"
# Media folder for Technical Preview 3
"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\MakeWinPEMedia.cmd" /ISO "C:\NanoServer\WindowsPE AMD64 - Windows Server 2016 TP3 - Nano Server" "C:\NanoServer\NanoServer-Compute\Windows_Server_2016_TP3_-_Nano_Server_for_vSphere_6.0.ISO"
There is no difference in term of the command between Technical Preview 3, Technical Preview 4, Technical Preview 5 or GA except for the source and destination path.
001 002 003 # Create the Windows PE ISO from the Windows PE # Media folder for Technical Preview 4 "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\MakeWinPEMedia.cmd" /ISO "C:\NanoServer\WindowsPE AMD64 - Windows Server 2016 TP4 - Nano Server" "C:\NanoServer\NanoServer-Compute\Windows_Server_2016_TP4_-_Nano_Server_for_vSphere_6.0.ISO"
# Media folder for Technical Preview 4
"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\MakeWinPEMedia.cmd" /ISO "C:\NanoServer\WindowsPE AMD64 - Windows Server 2016 TP4 - Nano Server" "C:\NanoServer\NanoServer-Compute\Windows_Server_2016_TP4_-_Nano_Server_for_vSphere_6.0.ISO"
Once you obtained the ISO image file, you will need to mount the ISO image file on the Guest Virtual Machine using vSphere 6.0 Web Client and Power On the Guest VM.
Powering On the Guest for the first time with Windows PE, we will automatically boot into Windows PE with a Command Prompt and it will be the interface that we will be using to partition the VMDK.
Firstly, we will use DiskPart to clean the VMDK Disk to ensure that the disk has no volume or partition structure.
001 002 003 004 :: Clean the Disk 0 diskpart select disk 0 clean
diskpart
select disk 0
clean
If you prefer to do this using PowerShell instead of DiskPart within Windows Preinstallation Environment (Windows PE), you will have to follow this guide on how to add PowerShell support into Windows PE prior creating the bootable ISO Image below.
Next, we will have to manually create a System Reserved partition to store the Boot file configuration.
001 002 003 004 005 :: Create the System Reserved 300MB Partition create partition primary size=300 format fs=ntfs label="System Reserved" quick assign letter=s active
create partition primary size=300
format fs=ntfs label="System Reserved" quick
assign letter=s
active
Next, we will use the remaining free space to create an Operating System partition where the Nano Server VHD file will be located and exit DiskPart.
001 002 003 004 005 :: Create the Operating System Partition create partition primary format fs=ntfs label="Operating System" quick assign letter=c exit
create partition primary
format fs=ntfs label="Operating System" quick
assign letter=c
exit
With the Operating System partition created, we will copy the Nano Server VHD file to the Operating System drive.
001 002 :: Copy the NanoServer-Compute.vhd from WindowsPE ISO to C:\ Operating System Drive xcopy D:\VHD\NanoServer-Compute.vhd C:\ /V /F
xcopy D:\VHD\NanoServer-Compute.vhd C:\ /V /F
Next, we will using DiskPart again to attach the Nano Server VHD file as a vDisk volume.
001 002 003 004 005 :: Attach the NanoServer.vhd vDisk using Diskpart diskpart select vDisk File=C:\NanoServer-Compute.vhd attach vDisk list volume
select vDisk File=C:\NanoServer-Compute.vhd
attach vDisk
list volume
If your Nano Server image is in WIM Format for production environment, you will need to apply the WIM image to the Operating System drive and proceed to section 6.4 to create the boot information in boot manager.
001 002 :: Apply the NanoServer-Compute.wim from WindowsPE ISO to C:\ Operating System Drive dism /apply-image /imagefile:D:\VHD\NanoServer-Compute.wim /index:1 /applydir:C:\
dism /apply-image /imagefile:D:\VHD\NanoServer-Compute.wim /index:1 /applydir:C:\
To make our life easy, we will assign a drive letter to identify the vDisk volume and exit DiskPart. And this is not the end of it because the attached vDisk volume is still not bootable due to the fact that the System Reserved partition do not have a boot file configuration of this virtual disk volume.
001 002 003 004 :: Assign a Drive Letter to the NanoServer-Compute.vhd vDisk volume select volume 3 assign letter=v exit
select volume 3
assign letter=v
With the vDisk drive letter assigned and exited the DiskPart, we will change to the vDisk drive and navigate to the Windows\System32 folder. We will use the BCDboot tool and specify the source of the boot environment file that requires to be copied to the System Reserved drive.
001 002 003 004 :: Create boot file on System Reserved drive V: cd V:\Windows\System32 bcdboot V:\Windows /s S:
V:
cd V:\Windows\System32
bcdboot V:\Windows /s S:
If you are not using a vDisk for Nano Server image that is in VHD/VHDX format and have already applied the Nano Server image in WIM format to the operating system drive, we will use the BCDboot tool and specify the source of the boot environment file that requires to be copied to the System Reserved drive.
001 002 003 004 :: Create boot file on System Reserved drive C: cd C:\Windows\System32 bcdboot C:\Windows /s S:
C:
cd C:\Windows\System32
bcdboot C:\Windows /s S:
If you are interested in understanding BCDBoot, you can refer to this document link below;
Once the boot files has created successfully, we will return to DiskPart, detach the virtual disk volume and exit everything for an automatic reboot.
001 002 003 004 005 006 :: Detach the vDisk and exit to reboot diskpart select vDisk File=C:\NanoServer-Compute.vhd detach vDisk exit exit
detach vDisk
After exiting Windows PE environment and reboot automatically, you can view login screen on your Remote Console. Check that the keyboard is working on the Remote Console and you can really type to login.
After logging into the Nano Server through Remote Console, there is nothing much except text information of the Server Configuration. We cannot do anything in here except for these 4 tasks;
With Technical Preview 4, there are a lot of significant improvements with the console and these are the things you can do;
With Technical Preview 5, there are a few enhancements with the console such as:
With the General Availability (GA) release of Windows Server 2016, the Nano Server Recovery Console has not changed since Technical Preview 5 except that it is now displaying the official operating system name and edition instead.
Since it has no Graphical User Interface and it limited on what we can do in remote console, the most preferred method will be using PowerShell to remotely connect to the Nano Server for any management at this stage.
# Verify if the Nano Server is a Trusted Hosts
Get-Item `
-Path WSMan:\localhost\Client\TrustedHosts ;
# Set the Nano Server IP Address to be a Trusted Hosts
Set-Item `
-Path WSMan:\localhost\Client\TrustedHosts `
-Value 192.168.100.14 `
-Force ;
# Establish a remote PowerShell Session to the Nano Server
Enter-PSSession `
-ComputerName 192.168.100.14 `
-Credential (New-Object `
-TypeName System.Management.Automation.PSCredential `
-ArgumentList "192.168.100.14\Administrator", `
(ConvertTo-SecureString `
-String "Password" `
-AsPlainText `
-Force) `
) ;
Hey, this is a great and comprehensive article: thanks for your effort. I followed some suggestion from this like the drivers that are mandatory or optional to add (and thanks for link to extract vmware tools).
I used a different approach when I have the vhd: in my case I do a conversion of the disk with qemu-img utility (cloudbase.it/qemu-img-windows) with the simple command "qemu-img convert source.vhd -O vmdk destination.vmdk" and the system works well: I've tested it in VMWare 5.5; maybe I can write a similar document including the different apporach for the disk and test on either VMWare 5.5 and 6; I'm also working to test it on VMWare Workstation 12.
Hi Marco,
Firstly, I have to thank you for your complement.
Your approach with qemu-img conversion of VHD to VMDK is definitely a good third party (Cloudbase) solution and thank you for sharing your positive result with this approach.
Hi, I have tried to follow this, but after attaching the vhd in diskpart, and running the bcdboot command, and then dismounting it; after the reboot it can't find an operating system? Any ideas spring to mind?
Hi Daniel,
I assume that you have followed the sequence of this article including adding the LSI Storage Controller Driver.
Did you change to your “<vDisk Drive Letter>:\Windows\System32” path and configure “bcdboot <vDisk Drive Letter>:\Windows /s <System Reserved Drive Letter>:” ?
If you have received the message that it cannot find an operating system, it is most likely that it cannot read the boot configuration in System Reserved partition or the operating system path configured in the boot configuration is incorrect.
For more understanding about BCDBOOT, refer to this article below;
technet.microsoft.com/.../hh824874.aspx
Hope it helps.
Get-VHD : The term 'Get-VHD' is not recognized as the name of a cmdlet, do anyone know why this not working? please advice thanks
Hi Longlanh,
Get-VHD is a Hyper-V Cmdlet. You will need to enable Hyper-V role and feature on the operating system that you are working on.
For more information about Get-VHD cmdlet, please kindly refer to the following articles based on your operating system version below;
- Windows Server Technical Preview and Windows 10
technet.microsoft.com/.../hh848611.aspx
- Windows Server 2012 R2 and Windows 8.1
technet.microsoft.com/.../hh848611(v=wps.630).aspx
- Windows Server 2012 and Windows 8
technet.microsoft.com/.../hh848611(v=wps.620).aspx
Hey Ryen.
Great article first of all. However I've encounter an issue, that after the deplyment and startup of virtual NanoServer on VMWare Workstation 12, no network adapters shows up in the recovery console. I assume this is because of incompatible drivers. I did however added the VMWare drivers package taken from VMWare Tools for Windows ISO. Is there any know issue of NanoServer TP4 not being compatible with Workstation's 12 virtual ethernet adapters?
On Hyper-V everything runs smoothly obviously.
Hi Michał,
This article has been fully tested on VMware ESXi 6.0 or higher. Thanks to Marco, it has been tested on VMware ESXi 5.5.
Unfortunately, I have not tested the approach on VMware Workstation 12 and believe that your assumption maybe positive in regards to VMware driver compatibility issue with Windows Server 2016 Technical Preview guest operating system.
Please refer to VMware Compatibility Guide below;
www.vmware.com/.../search.php
Since VMware Workstation networking is usually either NAT or Bridge, the network adapter driver may be different from VMware ESXi’s VMXNET, VMXNET2 or VMXNET3 drivers. As for E1000 network adapter, the Windows Server 2016 TP3 or TP4 media has already included the Intel network driver.
Thanks Tang!
in your config info I cannot find anything talking about how to config nano server ip address or how to join the nano server to domain? please have some of this info. Thank you for all your work.
Hi!
very helpful !