Deploying Nano Server to a Bare-Metal Machine using a WIM and WinPE

There are several ways to deploy Nano Server to a physical machine:

  1. Dual-boot a Nano Server vhd or vhdx
  2. PxE-boot a bare-metal machine and install Nano Server from WDS using a vhd or vhdx
  3. PxE-boot a bare-metal machine and install Nano Server from WDS using a wim file
  4. Booting a bare-metal machine into WinPE and deploying Nano Server using a .wim file

In this blog, we’ll talk about the last one.  For the first two, check out Getting Started with Nano Server & How to use WDS to PxE Boot a Nano Server VHD

To build the .wim image, please follow the instructions in Getting Started with Nano Server and use New-NanoServerImage. Make sure to use a .wim extension with the -TargetPath parameter.

Boot into WinPE and make sure that the .wim file you just created is accessible from WinPE. (I copied the .wim file to a bootable WinPE image on a USB thumb drive).

Once WinPE boots, use diskpart.exe to prepare the target machine’s hard drive. Enter the following diskpart commands (modify accordingly, if you’re not using UEFI & GPT):

Note that these commands will wipe out all data from the hard drive!!!


Select disk 0


Convert GPT

Create partition efi size=100

Format quick FS=FAT32 label="System"

Assign letter="s"

Create partition msr size=128

Create partition primary

Format quick FS=NTFS label="NanoServer"

Assign letter="n"

List volume


Apply the Nano Server image (adjust the path of the .wim file):

Dism.exe /apply-image /imagefile:.\ServerDatacenterNano.wim /index:1 /applydir:n:\ 

Bcdboot.exe n:\Windows /s s:

Remove the DVD media or USB drive and reboot your system using:

Wpeutil.exe reboot

That’s it. Looking forward to your feedback.




Comments (11)

  1. Jan Ringoš says:

    Hi Refaat. I’m getting INACCESSIBLE_BOOT_DEVICE blue screen after following this. I deployed the wim from Server 2012 R2 (on other drive) onto an MMC which WinPE didn’t see (since I only have old 6.1.7600-based PE at hand right now). Could any of those things have caused it?

    1. Hi Jan Ringoš,

      Based on the BSOD Message “INACCESSIBLE_BOOT_DEVICE”, you may be experiencing missing Storage Controller Driver file in your WIM and you should find out what storage controller driver is needed for your hardware and use DISM to Add the required storage driver to your Windows.

      1. Jan Ringoš says:

        Hi Ryen, thanks for you reply, it was exactly that. I was missing “sdstor.sys” driver.

  2. Chris says:

    Hi Refaat. I followed all the instructions and I am getting “Select proper Boot Device”. The proper boot path is setup correctly in the bios. Any suggestions?

    1. Hi Chris,
      You may have to use bcdboot to properly initialize the device.

      1. Chris says:

        I’ve run Bcdboot.exe n:\Windows /s s: and it completes successfully. Still does not boot. Also tried to partition as MBR and that doesn’t work either.

    2. Eric says:

      I think you need to add the “” package to your WIM file.

  3. JRPritchard says:

    Might wish to add a warning about the “select disk 0” if the user has more than one disk installed on the system. Should be common sense, but at least I missed it 🙂

    Thanks for an otherwise good guide, so close to getting it to boot.

  4. Athila Mattos says:

    It doesn’t work for me at all. I am able to generate the WIM file using New-NanoServerImage module but it doesn’t boot.
    The computer I am trying to install Nano Server doesn’t support UEFI, so the article above is says “modify accordingly, if you’re not using UEFI & GPT”, but how? What the partition layout should look like?

    I am using WinPE to apply the image to the “n” drive, but my system doesn’t boot, even after executing : Bcdboot.exe n:\Windows /s s:
    In my case, the S: drive is another primary partition, which I am unsure if it’s correct.

    The message I am receiving is:
    No bootable device — insert bot disk and press any key

    1. Marima says:

      For Bios/MBR try:

      Select disk 0
      Create partition primary size=350
      Format quick fs=ntfs label=”System”
      Assign letter=”s”
      Create partition primary
      Format quick fs=ntfs label=”NanoServer”
      Assign letter=”c”
      List volume

      Dism.exe /apply-image /imagefile:.\ServerDatacenterNano.wim /index:1 /applydir:c:\

      Bcdboot.exe c:\Windows /s s:

    2. I am replying to my own post because when I asked the question I wasn’t logged in.
      Apparently, the problem with my computer is that it does support UEFI.
      The bottomline is: If you are using WIM to deploy a bare metal Nano Server, you need to have a UEFI-based computer, described here:

      I tried to boot to Nano Server using VHD that I generated on a Windows Server 2016 on the same machine and it boots with no problems, but I was looking forward to have the bare metal deployment. I will try to find an alternative way to do it.

Skip to main content