The Bloat of the Operating System
When you install a standard copy of Windows Server, it consumes roughly 10GB to 15GB of hard drive space. It includes a massive graphical user interface (GUI), audio drivers, 32-bit compatibility subsystems (WoW64), and hundreds of background services. If you are building a massive hyper-converged infrastructure and need to spin up 500 virtual machines to act as simple DNS servers or IIS web hosts, dedicating 15GB of expensive SAN storage just to hold the OS for each VM is a massive waste of resources.
Microsoft solved this by creating Nano Server. Nano Server is a brutally stripped-down, headless, 64-bit-only version of Windows Server. It has absolutely no GUI, no command prompt, and no local login screen. It is roughly 400 Megabytes in size and boots in under 3 seconds. It is designed exclusively to be managed remotely via PowerShell and WMI.
Because it lacks a traditional installer, you cannot boot from an ISO and click “Next.” You must mathematically construct the VHDX (Virtual Hard Disk) image file from scratch using PowerShell on an administrative workstation before injecting it into your hypervisor.
Step 1: Extracting the Nano Server Generator
The tools to build a Nano Server image are hidden inside the standard Windows Server installation ISO.
- Mount the Windows Server ISO on your administrative workstation (e.g., drive
D:). - Navigate to
D:\NanoServer\NanoServerImageGenerator. - Copy this entire folder to your local
C:\drive for faster processing.
Open an elevated PowerShell session and import the generator module:
Import-Module C:\NanoServerImageGenerator\NanoServerImageGenerator.psm1
Step 2: Defining the Target Image
You construct a Nano Server by executing a single, massive PowerShell cmdlet. You must specify the Edition (Standard or Datacenter), the target deployment type (Guest VM or Physical Host), and inject any required packages (like DNS or IIS) during the build process.
To create a Nano Server VHDX that will act as an IIS Web Server running as a Generation 2 Hyper-V Virtual Machine, execute:
New-NanoServerImage -Edition Standard -DeploymentType Guest -MediaPath D:\ -BasePath C:\NanoServer_Base -TargetPath C:\Nano_VMs\NanoWeb01.vhdx -ComputerName "NanoWeb01" -Packages Microsoft-NanoServer-IIS-Package
Understanding the Parameters:
- -MediaPath: The location of the mounted Windows Server ISO (where PowerShell will extract the core binaries).
- -TargetPath: The exact location and filename where the finished 400MB VHDX file will be saved.
- -ComputerName: The hostname injected permanently into the image.
- -Packages: This is critical. Because Nano Server has no GUI, you cannot use Server Manager later to add roles. You must inject the IIS binaries directly into the image during compilation.
During execution, PowerShell will prompt you to enter the local Administrator password. This password will be securely embedded into the VHDX.
Step 3: Deploying the Image into Hyper-V
Once the compilation finishes, you will be left with a tiny NanoWeb01.vhdx file in your C:\Nano_VMs\ directory.
You can now rapidly provision the Virtual Machine using standard Hyper-V PowerShell commands:
# 1. Create the new Generation 2 VM
New-VM -Name "NanoWeb01" -MemoryStartupBytes 512MB -Generation 2 -VHDPath C:\Nano_VMs\NanoWeb01.vhdx -SwitchName "vSwitch_Production"
# 2. Start the VM
Start-VM -Name "NanoWeb01"
Step 4: Managing the Headless Behemoth
When you start the VM in Hyper-V, you will see a simple black text screen displaying the IP address. You cannot interact with it.
To manage it, you must use PowerShell Remoting from your administrative workstation.
# Add the Nano server to your Trusted Hosts (if not in a domain yet)
Set-Item WSMan:\localhost\Client\TrustedHosts -Value "NanoWeb01" -Concatenate
# Establish a remote session
Enter-PSSession -ComputerName "NanoWeb01" -Credential (Get-Credential)
You are now connected to a fully functional, ridiculously fast Windows Server environment, utilizing a fraction of the hardware resources of a traditional GUI installation.