Server 2016

How to deploy Nano Server?

Nano Server in a virtual machine

Follow these steps to create a Nano Server VHD that will run in a virtual machine.

To quickly deploy Nano Server in a virtual machine

  1. Copy NanoServerImageGenerator.psm1 and Convert-WindowsImage.ps1 from the \NanoServer folder in the Windows Server Technical Preview ISO to a folder on your hard drive.

  2. Start Windows PowerShell as an administrator, change directory to the folder where you’ve placed these scripts and then import the NanoServerImageGenerator script with Import-Module NanoServerImageGenerator.psm1 -Verbose

  3. Create a VHD that sets a computer name and includes the Hyper-V guest drivers by running the following command which will prompt you for an administrator password for the new VHD:

    > New-NanoServerImage -MediaPath <path to root of media> -BasePath .\Base -TargetPath .\NanoServerVM\NanoServerVM.vhd -ComputerName <computer name> -GuestDrivers

    where

    • <path to root of media> is the path that you provide to the root of the contents of the Technical Preview ISO. For example if you have copied the contents of the ISO to d:\TP4ISO you would use that path.
    • BasePath specifies a folder that will be created to copy the Nano Server WIM and packages to.
    • TargetPath specifies the full path, including the filename and extension, where the resulting VHD or VHDX will be created.
    • Computer_name is the computer name you provide for the Nano Server virtual machine you are creating.

    Example:

    New-NanoServerImage -MediaPath E:\ -BasePath .\Base -TargetPath .\NanoFolder\NanoVM01.vhd -ComputerName NanoVM01 –GuestDrivers

    This example creates a VHD from an ISO mounted as E:\. When creating the VHD it will use a folder called Base in the same directory where you ran New-NanoServerImage; it will place the VHD (called NanoVM01.vhd) in a folder called NanoVM01 in the folder from where the command is run. The computer name will be NanoVM01 and will have virtual machine drivers installed for running Hyper-V. If you choose ..\NanoFolder\NanoVM01.vhd, the result uses the MBR layout. If you want the GPT layout, use .\NanoFolder\NanoVM01.vhdx, which support Generation 2 virtual machines.

    System_CAPS_noteNote
    New-NanoServerImage is supported on Windows 8.1, Windows 10, Windows Server 2012 R2, and Windows Server 2016 Threshold Preview.
  4. In Hyper-V Manager, create a new virtual machine and use the VHD created in Step 3.

  5. Boot the virtual machine and in Hyper-V Manager connect to the virtual machine.

  6. Log on to the Recovery Console (see the “Nano Server Recovery Console” section in this guide), using the administrator and password you supplied while running the script in Step 3.

  7. Obtain the IP address of the Nano Server virtual machine and use Windows PowerShell remoting or other remote management tool to connect to and remotely manage the virtual machine.

Nano Server on a physical computer

You can also create a Nano Server VHD that will run Server Core on a physical computer, using the pre-installed device drivers. If your hardware requires a driver that is not already provided in order to boot or connect to a network, follow the steps in the “Adding Additional Drivers” section of this guide.

To quickly deploy Nano Server on a physical computer

  1. Copy NanoServerImageGenerator.psm1 and Convert-WindowsImage.ps1 from the \NanoServer folder in the Windows Server Technical Preview ISO to a folder on your hard drive

  2. Start Windows PowerShell as an administrator, change directory to the folder where you’ve placed these scripts and then import the NanoServerImageGenerator script with Import-Module NanoServerImageGenerator.psm1 -Verbose.

  3. Create a VHD that sets a computer name and includes the OEM drivers and Hyper-V by running the following command which will prompt you for an administrator password for the new VHD:

    New-NanoServerImage -MediaPath <path to root of media> -BasePath .\Base -TargetPath .\NanoServerPhysical\NanoServer01.vhd -ComputerName <computer name> -OEMDrivers -Compute where

    • <path to root of media> is the path to the root of the contents of the Technical Preview ISO. For example if you have copied the contents of the ISO to d:\TP4ISO you would use that path.
    • BasePath is a folder that will be created to copy the Nano Server WIM and packages to. (This parameter is optional.)
    • TargetPath is a folder that will be created where the resulting VHD will be created.
    • Computer_name is the computer name for the Nano Server virtual machine you are creating.

    Example: New-NanoServerImage -MediaPath E:\ -BasePath .\Base -TargetPath .\NanoFolder\NanoServer01.vhd -ComputerName NanoServer01 -OEMDrivers –Compute -Clustering

    This example creates a VHD from an ISO mounted as E:\. When creating the VHD it will use a folder called Base in the same directory where you ran New-NanoServerImage; it will place the VHD in a folder called NanoFolder in the folder from where the command is run. The computer name will be NanoServer01 and will have OEM drivers installed for most common hardware and has the Hyper-V role and the clustering feature enabled. If the server uses UEFI to boot, change NanoServer01.vhd to NanoServer01.vhdx.

  4. Log in as an administrator on the physical server where you want to run the Nano Server VHD.

  5. Copy the VHD that this script creates to the physical computer and configure it to boot from this new VHD. To do that, follow these steps:

    1. Mount the generated VHD. In this example, it’s mounded under D:\.
    2. Run bcdboot d:\windows.
    3. Unmount the VHD.
  6. Boot the physical computer into the Nano Server VHD.

  7. Log on to the Recovery Console (see the “Nano Server Recovery Console” section in this guide), using the administrator and password you supplied while running the script in Step 3.

  8. Obtain the IP address of the Nano Server computer and use Windows PowerShell remoting or other remote management tool to connect to and remotely manage the virtual machine

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s