Introducing the Nano Server Image Builder


Hi there,

Scott Johnson here to talk about the new Nano Server Image Builder tool, my new favorite time-saver. The Nano Server Image Builder helps you create a custom Nano Server image and bootable USB media with the aid of a graphical interface. Based on the inputs you provide, it generates images for deployment and creates reusable PowerShell scripts that allow you to create installations of Nano Server running either Windows Server 2016 Datacenter or Standard editions. The Nano Server Image Builder is now available for download on the Microsoft download center. If you need to download it later you can use this memorable shortcut: http://aka.ms/NanoServerImageBuilder. To run the tool, you must also install the Windows Assessment and Deployment Kit (ADK).

Nano Server is 20 to 25 times smaller than a full version of Windows Server 2016 with desktop experience. 
To make a version of Windows this small, we had to remove some things that were not critical to running server workloads – and one of the things we removed was setup.exe, including the Windows Welcome experience. To setup and configure a Nano Server, we need to leverage Sysprep services in Windows and use an unattended.xml file to automate the installation sequences.

Deploying Headless Servers – A New Challenge!

The Nano Server Image Builder creates VHD, VHDX and .WIM files that can be used to deploy Nano Server in a virtual machine or directly on hardware, even without a display monitor, a.k.a. the “Headless Server”. You will find a /NanoServerImageGenerator folder on the Windows Server 2016 media – it contains new cmdlets, such as New-NanoServerImage, which is supported on Windows 8.1, Windows 10, Windows Server 2012 R2, and Windows Server 2016. This new cmdlet enables you to create a custom Nano Server image using the computer name of your choice and a couple dozen other unique settings.
~
Creating the perfect syntax for these PowerShell cmdlets can be challenging and so this tool was created to simplify these tasks:
1) Graphical UI creation of Nano Server media with dozens of custom settings.
2) Create a USB key to detect the firmware and hardware settings of a server.
3) Creation of a bootable USB key that can be used to deploy Nano Server directly on hardware.
4) Optionally create a bootable ISO file that can be used to deploy from DVD or BMC-connected servers.
5) Create PowerShell commands that can be reused by simply changing the machine name.

The Nano Server Image Builder automates deployment settings:

• Accepting the license agreement terms.
• Choose from VHD, VHDX or WIM formats and an option to create a bootable ISO.
• Select server roles to install.
• Add device drivers to install.
• Set machine name, administrator password, logfile path, and time zone.
• Join a domain by using an existing Active Directory account or a harvested domain-join blob.
• Enable WinRM for communication outside the local subnet.
• Enable Virtual LAN IDs and configure static IP addresses.
• Inject new servicing packages on the fly.
• Add a setupcomplete.cmd or other custom scripts to run after the unattend.xml is processed.
• Enable Emergency Management Services (EMS) for serial port console access.
• Enable development services to enable test signed drivers and unsigned applications, PowerShell default shell.
• Enable debugging over serial, USB, TCP/IP, or IEEE 1394 protocols.
• Create USB media using WinPE that will partition the server and deploy the Nano Server image.

 

Hardware Detection USB Drive
The Nano Server Image Builder can also create a USB drive using WinPE that will detect your existing Nano Server hardware configuration and report the details on-screen and in a log file.

This hardware detection includes:

  1. Network interface index – We use it to target IP address assignments. In the future, we will move to use MAC-address targeting. Occasionally the network interface index will randomly change as Tron battles inner electrons in a race to see which networking card enumerates first.
  2. Boot firmware type – The system creates different partitions depending on your firmware type. Most new servers are UEFI.
  3. System board information – Validate that you are targeting the right server.
  4. Disks and volumes – Choose wisely when selecting a disk partition to format.
  5. Devices without a driver! - List devices that have no driver in the Server Core drivers package. Useful!

 

Hardware Detection Experience:

a1

hw2

a3


Screenshot Walkthrough
Two sequences:    Create Nano Server images or bootable USB media :
a4
You’ll need a copy of Windows Server 2016:
a5

Choose your deployment type:

Virtual machine images can be .vhd or .vhdx
Physical machine images can be .vhd, .vhdx or .wim
a6

Accept the License Agreement (Nano Server requires customers have Software Assurance on the device)

a0
 
Create a hardware-detection USB drive to analyze your system: 
a7
See the WinPE screenshots above to see how the USB hardware detection works.
~
Choose the roles you want to run - Nano Server only loads what you are planning to use:
a8


 Add special device drivers to the image if you need them:
a9
Use the USB hardware detection process to see which devices need drivers.   Pro-tip:  Audio drivers are not necessary.



Choose your machine name and password:

a23

Join the Active Directory domain:
a11

Enable WinRM, Virtual LAN and set static IP addresses:

a12
Use the hardware detection USB drive to figure out which network adapter interface index to target.

~
You are ready to create a basic Nano Server image – or continue to advanced settings:

a13

 

 

Update Nano Server to the latest revision using a servicing package:

a14
Learn about the servicing options for Nano Server.

~

 

Add your own scripts to the deployment process:

a15
~
Emergency Management Services:
Get out your serial cable and an RS-232-accessible console. If you have no monitor and no networking is working, this might be your only way into the server.
I use putty.exe or my 1998 copy of hyper-terminal.
a16
~
Developers like to debug their code using a wide variety of connections:
a17
 ~
Final review of all the settings:
a18
~
Image creation is done, now you can create a bootable USB key:
a19
Pro-tip:  Copy the PowerShell script somewhere to use it directly without using the GUI tool in the future.
Just change the machine name and you can have a new Nano Server image in a matter of minutes.

 

 

Select your USB drive:
a20

 

Select boot firmware type and optionally modify the partition schema:
a21
Now you have a bootable USB drive to deploy and you can optionally create a bootable ISO file using the same binaries:
a22

I hope you enjoy the new Nano Server Image Builder, if you have any feature suggestions or error reports, please let us know on the user voice web site.

Cheers,
Scott Johnson
Senior Program Manager
Windows Storage Server
@Supersquatchy


Comments (57)

  1. Noam Brosh says:

    What about installing the nano servers image on sd cards? Hyper convergence systems, blade servwrs, etc’

    1. Tim Cerling says:

      SD cards are not currently supported as boot devices under Windows. Microsoft provided for OEM-only support of Hyper-V installation on USB devices (https://technet.microsoft.com/en-us/jj733589(v=ws.11).aspx), and that may be how some SD devices are presented to Windows. So you would need to work with an OEM to get support for SD as Windows bootable devices.

      Not sure why there is any special need for hyper-converged or blade servers – they should work with this just fine. Of course, your mileage may vary depending upon the capabilities offered by the particular hardware platform, but the blade servers and hyper-converged servers with which I am familiar offer no issues with this.

  2. Rolf says:

    I agree with Johan Arwidmark that it’s stupid to spend this much time of creating an alternative deployment method instead of just implementing Nano server to MDT.
    It’s like there is NO cooperation within Microsoft at all…..

  3. I’m getting an Exception after selecting “Create” at the “Confirmation” step…

    System.Windows.Markup.XamlParseException occurred
    Message: Exception thrown: ‘System.Windows.Markup.XamlParseException’ in PresentationFramework.dll
    Additional information: Set property ‘System.Windows.FrameworkElement.Style’ threw an exception.

    Any ideas?

    1. Shayu Wang says:

      Hi Pedro,

      Could you please tell me about your OS version, .Net framework version? And if possible do you have a dump file or call stack (try to search the eventvwr) to help me understand the problem?

      Thanks

    2. Jérémy Jeanson says:

      As Pedro M. Sousa, i have an ex exception. I haven’t the same message, but application crash at creation state.

    3. I’m having the same issue as Pedro.

      When trying to create the image the NanoBuilder crashes with a XAML exception:
      System.Windows.Markup.XamlParseException occurred
      HResult=0x80131501
      Message=Set property ‘System.Windows.FrameworkElement.Style’ threw an exception.
      Inner Exception 1:
      FormatException: Input string was not in a correct format.

      OS: Win10 Enterprise x64 1607 14393.321

      It would be nice if we could have the prepared Powershell Command at the build step to copy and build the vhd by ourselves, as this works perfectly fine.

      Cheers.

      1. Shayu Wang says:

        Hi,

        We are trying our best to have a repro in our own environment. And would be very helpful if any of you can provide the logs under %temp%\NanoServerImageBuilder\logs to us. You can pack the files and send it to shawang@microsoft.com

        Thanks

      2. Sakari K says:

        I had the same problem that as soon as you click create, the application crashes. I fixed it by changing the Windows to use US regional settings.

        1. Jouni says:

          Thanks Sakari. That also fixed the issue I had.

          1. Fysme says:

            Many thanks, this fixed my issu also

    4. Jan Ringoš says:

      Same issue here; and I can’t get Visual Studio to give me the call stack.

      1. Sakari K says:

        I have also this error, even though I have tried Windows 2016 and 2012 R2 with numerous input options. Problem Signature 09: System.Windows.Markup.XamlParse. Problem Event Name: CLR20r3.

      2. Sakari K says:

        Now I changed the regional settings to English US, after which the tool doesn’t crash anymore. So it seems that another regional setting makes it crash.

  4. Hi Scott,

    Great app, the creation of the Nano server image went without an error!

    The creation of the bootable USB drive is showing me a strange error. It’s failing according the logs with the following error:
    1018.214427.8672: Error: copype amd64 C:\Users\MYUSERNAME\AppData\Local\Temp\NanoImageBuilder 2>&1 failed with 1.

    To investigate i checked the script you use to create the bootable USB drive in:
    C:\Program Files\Nano Server Image Builder\NanoSetupUsbGenerator\NanoSetupUsbGenerator.psm1

    On line 181 you import the DISM powershell module based on an environment variable. Looking in powershell using the get-childitem Env: command i can’t see the $env:DISMRoot environment variable. Possible this could be the case that the error is generated?

    Hope you can help me out, really like the tool you created!

    1. Shayu Wang says:

      Hi Bram,

      Thanks for using the tool!
      The environment variable is set in the UI application while launching the PS cmdlet, thus you can’t find it from a normal PS host.
      However this cmdlet can also be run from an elevated ADK “Deployment and Imaging tools environment”. You should be able to try this “copype XXX” command recorded in the log file in this environment. And if there’s really an issue blocking this operation, you can see errors and investigate further.
      Meanwhile, if you can pack the tool’s logs and send it to shawang@microsoft.com, I can know better of your problem and try to provide more helpful info.

      Thanks
      Shayu

    2. Gary says:

      I get the same problem – any fixes yet?

    3. I have same error and I located at least one issue.

      If the username contains a space eg “firstname lastname” – any command including a space is not handled in the module.

      In the module you line 469 you might need to add `”before $script:WorkingDir and again after.

      Line 469 (AS IS)
      $copypeCmd = “copype $Script:SupportedArch $Script:WorkingDir”

      My updated line 469:

      $copypeCmd = “copype $Script:SupportedArch `”$Script:WorkingDir`””

      One more time in line 494

      Before
      $Cmd = “makewinpemedia /UFD /f $Script:WorkingDir $UsbVolumeLetter”

      After
      $Cmd = “makewinpemedia /UFD /f `”$Script:WorkingDir`” $UsbVolumeLetter”

      Same thing seems to be the issue in line 722

      Before:
      Invoke-ExternalCommand “reg load $MonitorAgentRegistryPath\$PeSystemHive $PeMountDir\Windows\System32\config\system”

      After:
      Invoke-ExternalCommand “reg load $MonitorAgentRegistryPath\$PeSystemHive `”$PeMountDir\Windows\System32\config\system`””

      Save the script and replace it.

    4. I have same error (Error: copype amd64 C:\Users\MYUSERNAME\AppData\Local\Temp\NanoImageBuilder 2>&1 failed with 1)

      I located at least one issue.

      If the username contains a space eg “firstname lastname” – any command including a space is not handled in the module.

      In the module you line 469 you might need to add `”before $script:WorkingDir and again after.

      Line 469 (AS IS)
      $copypeCmd = “copype $Script:SupportedArch $Script:WorkingDir”

      My updated line 469:

      $copypeCmd = “copype $Script:SupportedArch `”$Script:WorkingDir`””

      One more time in line 494

      Before
      $Cmd = “makewinpemedia /UFD /f $Script:WorkingDir $UsbVolumeLetter”

      After
      $Cmd = “makewinpemedia /UFD /f `”$Script:WorkingDir`” $UsbVolumeLetter”

      Same thing seems to be the issue in line 722

      Before:
      Invoke-ExternalCommand “reg load $MonitorAgentRegistryPath\$PeSystemHive $PeMountDir\Windows\System32\config\system”

      After:
      Invoke-ExternalCommand “reg load $MonitorAgentRegistryPath\$PeSystemHive `”$PeMountDir\Windows\System32\config\system`””

      Save the script and replace it.

      1. Rob says:

        Why add ‘” at the beginning and the same ‘” at the end. That’s not working…?
        Only add ‘ before and after the text: $copypeCmd = “copype $Script:SupportedArch `$Script:WorkingDir`”

        That worked…. until next error: ERROR: Failed to format “M:”; DiskPart errorlevel -2147212269

        1. Rob says:

          Manually Diskparted en Formatted the USB drive,
          It’s working now;)

        2. Danny says:

          Thanks! Adding the ‘ to described lines worked for me.

    5. BramHendriks88 says:

      Hi Guys,

      Not been able to fix it on my W10 notebook. Installed the Nano Server Image Builder on my 2012R2 server and that worked without any problem…

  5. Ram says:

    I get error “cannot load packages from the wim file located .wim. Check the media path and try again” during the packages selection screen. I can see that Nanoserver.wim is there in the path but unable to load the packages. Any help?

    1. Shayu Wang says:

      Hi Ram,

      Would you please run the tool to have a repro and send the logs at the following locations to shawang@microsoft.com? Maybe I can figure out what’s the problem.
      %temp%\NanoServerImageBuilder\logs
      %SystemRoot%\logs\dism\dism.log
      %SystemRoot%\logs\cbs\cbs.log

      Thanks

    2. Matt says:

      I’m getting that same error in the GUI. I’m in the process of trying again on a different computer to see if that makes a difference.

    3. LE2Strat says:

      I am getting the exact same error.

      1. Chris says:

        Checked the builder log and it looks like the tool is trying to set the powershell execution policy to unrestricted. Our domain has group policy in place that forces RemoteSigned, which cannot be overridden. I’m going to try reinstalling the ADK and the image builder on a non-domain system to check my theory.

        1. Hi Chris,

          I have tried changing my dev environment GPO to allow all scripts for PowerShell execution policy which automatically set MachinePolicy and UserPolicy scope to Unrestricted but I’m still getting the same error with the Nano Server Image Builder trying to Set-ExecutionPolicy constantly when it is already Unrestricted.

          Nano Server Image Builder Log below:
          [10] 1101.184334.4407: Error: Windows PowerShell updated your execution policy successfully, but the setting is overridden by a policy defined at a more specific scope. Due to the override, your shell will retain its current effective execution policy of Unrestricted. Type “Get-ExecutionPolicy -List” to view your execution policy settings. For more information please see “Get-Help Set-ExecutionPolicy”.

          1. Damian Sleger says:

            I’m having the exact same issue. My powershell policy is already set to unrestricted (by group policy), so I’m not sure why this is failing trying to set it to what it’s already set to.

          2. Chris says:

            Hi Ryen,
            I just tested the image builder on a non-domain system and it ran fine. If a GP PS execution policy is enforced, it will cause the image builder to fail. Try moving the AD computer account to an OU that does not have the execution policy applied.

          3. Tex says:

            Clearly a bug. I’ve raised it on User Voice. Please vote to get MS to fix it: https://windowsserver.uservoice.com/forums/295068-nano-server/suggestions/18985942-nano-server-image-builder-issue-with-set-execution

            For SEO, full error:
            Error: Set-ExecutionPolicy failed with System.Management.Automation.CmdletInvocationException: Windows PowerShell updated your execution policy successfully, but the setting is overridden by a policy defined at a more specific scope. Due to the override, your shell will retain its current effective execution policy of Unrestricted. Type “Get-ExecutionPolicy -List” to view your execution policy settings. For more information please see “Get-Help Set-ExecutionPolicy”. —> System.Security.SecurityException: Security error.

        2. Caio Bauab says:

          Same Set-ExecutionPolicy error here. I voted too there at uservoice. They must sign the script an not try to decrease a security level.

  6. David Cramer says:

    Good article on this tool. Pretty easy to use, yet powerful. We did have issue with joining domain since we were joining to a different domain. Worked around by using PS and creating a blob for domain join. Syntax of PS command showed to have a ‘ around name. Once we removed the ‘ then it worked. Nano server was created, but did not keep static IP information or DNS. Still had to add the IP from console and then use PS to add DNS. Had to use PS quite a bit to get security set. Wanted to add a different set of domain accounts from trusted domain to be local administrators.

    Once we got all of permissions figured out, able to use Computer Mgmt and other tools to manage. Biggest problem is with Hyper-V. We can connect and create a VM or import existing VHDX with Hyper-V Manager, but VMs won’t start. Get a very generic message about starting the Vm’s. Basically says it times out and cant start. Not sure where to look for help.

  7. Jacob Blanco says:

    Great Job and great tool !!!
    I want to report an issue that I found. Scenario: Windows Server 2016 (10.1493.231) Datacenter with Desktop. Installed ADK for Windows 10 (1611): Deploy tools and WinPE. And NanoServerBuilder tools… until here everything works fine. Create new image, select physical machine, select packages, etc. While creating image, get error compute package not found into C:\Users\USER\AppData\Local\Temp. Closing wizard and trying over get another error imagenanoserver.wim not found on same directory, Close and trying over again, it will finish fine. So, Wizard does not copy needed files to %TEMPUSER% directory. Thanks for the tool, will be useful for many people. Well Done !!!

  8. Nice tool, definitely easier than just using PowerShell. I’ve just deployed a few images and noticed that even though I choose Manual IP (and entered the various settings) the image uses DHCP. I’ve replicated this test a few times with the same result each time. I’m just using the ‘simple’ setup option.

    1. Jacob Blanco says:

      Same problem here, IP static not working properly. It sets DHCP IP.

      1. Shayu Wang says:

        A possible issue is the mismatch of the network interface ID specified in the tool and the actual value on the server. Could you try to enumerate the server NICs with Get-NetAdapter and check if the “ifIndex” value is the one you chose on UI?
        Also there should exist a log file at %SystemRoot%\setup\scripts\setupcomplete.log of your Nano server which may contain the errors if the static IP configuration emitted errors.

        Thanks
        Shayu

        1. Tof006 says:

          I’ve posted a comment but I didn’t read all comments here.
          The ifIndex is 2 when the default ifIndex is 1 in the wizard.
          I’ve tried creating a new Nano server with specifying ifIndex = 2 but the ifindex becomes 3 in the Nano Server.
          I’ve taken the PowerShell command line and replaced ifindex by ifname (Ethernet) and it works.
          The only thing I don’t get is the way this line integrates the server in the Active Directory. It’s not specified how to achieve this using the command line.
          There seems to a be flaw in this wizard and I hope you’ll update it soon.
          Thanks

    2. Dave says:

      Identical issue here!

    3. Dave says:

      I’m experiencing exactly the same!

  9. J0F3 says:

    Great Tool!
    But please consider the ability to directly create a bootable .iso file or a .wim file (for WDS). This would be much more useful than creating a UBS Stick. Today most of the servers get installed remote over BMC (iLO, iDRAC etc.) and not by plugging in a physical UBS Stick directly to the physical host. Also in virtualized environments, the need of a USB Stick is an unnecessary hurdle. For example, when you are running the Nano Server Image Builder on a virtualized management server you cannot simple plugin in a USB Stick.

  10. Glenn says:

    Great Application! Very useful!
    Only problem for me is that on Windows 10, I get a Message With “nanoserverimagebuilder has stopped running” whenever I click “create image”

  11. Bas van Oerle says:

    Had problems creating the USB boot. 2 things helped me.

    1. diskpart – select disk – attr disk clear readonly
    2. Set-executionpolicy unrestricted

    After that I created a new wim file and created the USB stick without errors. After that I was able to create the ISO file

  12. Mike MG says:

    Hey Scott!
    Great Tool, this makes the first deployments alot easier.
    It would be nice if you could add the functionality to add further Partitions in the GUI e.g. Partition for Applications or VMs.
    Regards,
    Mike

  13. Cloud-Ras says:

    Beautyful GUI – powershell is awesome… But the GUI…- just love it 🙂

  14. Michael says:

    The VHD/VHDX Size Parameter is incorrectly transfered in the Powershell Commandlet. I specified a size of 0.8 GB and i get 8 GB.

  15. Rob says:

    VHDX create: OK, USB: OK, DVD: OK
    But when starting the server with USB or DVD: vhd boot host volume not enough space

    1. Shayu Wang says:

      Hi Rob,

      One possible reason for this is the partition size becoming too small after applying the VHD and boot. What value do you set on the max VHD size textbox and the primary partition size to install the OS? You can try to configure the partition size a little larger to accommodate the VHD.

      Thanks
      Shayu

  16. Tof006 says:

    Hi,
    I’ve been trying to use this Image Builder and I never manage to get the fixed IP address I set.
    Adding the latest Windows10.0-KB3200970-x64.cab to the image when I build it or not doesn’t change anything. It just doesn’t allow me to specify a fixed IP address.
    What should I check for this ?
    Thanks

  17. Xiang says:

    Hello

    The New-NanoServerImage has a param “-SetupUI”, but cannot find any information how to use it.
    Could you please give some tips.
    Thx.

  18. Sean Kearney says:

    Excellent job! Only one Comment.

    Please add this to future releases of Server 2016 on the media 🙂

    Thumbs up! What Nano server needed!
    Sean
    The Energized Tech

  19. Mazen Alsaadi says:

    Guyes Please help me I am trying in the last 2 days the problem that I am facing is it’s not detecting my drivers can you please suggest any solution to help me what to do.??

  20. Gtese says:

    hi Scott , it’s amazing tool !

  21. manu fourneau says:

    Might I suggested adding a slider option for the size of the partition the VHD will be mounted on, where the smallest size is the size the user entered for the VHD itself. Or at least implement a warning that pops up when the user selected a partition size smaller than the size of the VHD. I made the unfortunate error of creating a partition that was smaller than the size of my VHD, admittedly completely my own fault, which resulted in a bluescreen on my host. The error is pretty easy to resolve once you know what went wrong, but it would be nice to keep users, as myself, from making the error in the first place.

    1. Thank you for your feedback. I will bring this to the attention of the Engineering team.

Skip to main content