Tag: WIM

PowerShell Get-WindowsImage Windows Server 2019 Editions

Add Drivers to a Windows Server 2019 ISO Image

In this blog article, I am going to show you how you can add drivers to a Windows Server 2019 ISO Image or WIM file using PowerShell and the DISM module. This will allow you to already have the latest drivers within the Windows Server installation image when you install Windows Server 2019. We will add drivers to a Windows Server 2019 WIM file (WIM stands for Windows Imaging Format), which then can be used to create a new ISO image or for example in Windows Deployment Services.

Preparation

Folder for adding drivers to Windows Server 2019

Folder for adding drivers to Windows Server 2019

First, you will need to create three new folders called Drivers, ISO, and Mount. In my example, I created these in C:\Images.

  • Drivers – This is the folder where you put all your extracted drivers, which you want to add to your Windows Server 2019 Image.
  • ISO – This is where you can extract the Windows Server 2019 ISO Image. Basically all the files on the ISO file.
  • Mount – This is an empty folder, which will be used to mount the WIM files.

You can now mount the ISO using Windows Explorer or the following PowerShell commands and copy the files to the ISO folder.

Mount ISO PowerShell

Mount ISO PowerShell

Mount-DiskImage -ImagePath C:\Temp\17763.379.190312-0539.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us.iso
Copy-Item D:\* C:\Image\ISO\ -Recurse

In your case, the ISO may be mounted on a different drive letter instead of my D: drive.

Add drivers to the Windows Server 2019 Image

First, you can check in which Windows editions you want to add the drivers. To check that you can use the following PowerShell command:

Get-WindowsImage -ImagePath C:\Image\ISO\sources\install.wim
PowerShell Get-WindowsImage Windows Server 2019 Editions

PowerShell Get-WindowsImage Windows Server 2019 Editions

The Get-WindowsImage cmdlet will show you the different editions included in the WIM file.

After we have seen the Index numbers, we can now mount the Windows Image our Mount folder. In my example, I use Image Index 3, which is the Windows Server 2019 Datacenter Core Edition. If you want to check which editions of Windows Server 2019 you should use, check out the Microsoft Docs.

Mount-WindowsImage -Path C:\Image\Mount -ImagePath C:\Image\ISO\sources\install.wim -Index 3
Mount-WindowsImage

Mount-WindowsImage

After the image is mounted you can now add the drivers to the Windows Server 2019 Image using the following command:

Add-WindowsDriver -Path C:\Image\Mount -Driver C:\Image\Drivers -Recurse
Add Drivers to Windows Server 2019 ISO Image

Add Drivers to Windows Server 2019 ISO Image

After you have added all the drivers to the image, you need to dismount the image and save it.

Dismount-WindowsImage -Path C:\Image\Mount -Save

We have now added the drivers to the Install image, and you should also add the drivers to your boot image if it is, for example, a network or storage controller driver you might need to install the server. To do this do the same steps to the C:\Image\ISO\sources\boot.wim.

Now you can use these WIM files with Windows Deployment services or create a USB drive to install Windows Server 2019. If you want to create an ISO file, you can use the oscdimg command-line tool. The oscdimg tool comes with the Windows Assessment and Deployment Kit (Windows ADK), which you can get here.

oscdimg -n -m -bc:\temp\ISO\boot\etfsboot.com C:\temp\ISO C:\temp\mynew.iso

I hope this post helps you to add drivers to your Windows Server image. If you have any questions, feel free to leave a comment.



Nano Server Image Builder

Create a Nano Server using the Nano Server Image Builder

Last week Microsoft released Windows Server 2016 to the public and at the weekend Microsoft released the Nano Server Image Builder. I already wrote a few blog posts how you can create new Nano Server Images using PowerShell. The Nano Server Image Builder is a UI based wizard to create new Nano Server Images. The Nano Server Image Builder helps you create a custom Nano Server image and bootable USB media with a graphical interface. Based on the inputs you provide, it generates images for deployment and it also creates reusable PowerShell scripts that allow you to create installations of Nano Server.

The Nano Server Image Builder can help you with the following tasks:

  • Graphical UI to create Nano Server Images
  • Adding drivers
  • Choose Windows Server Edition
  • Adding roles and features
  • Adding drivers
  • Adding updates
  • Configuration of Network Settings
  • Configuration of Domain settings
  • Set Remoting Options
  • Create an ISO file to boot from DVD or BMC (remote connection like HP ILO)

First download and install the Windows Assessment and Deployment Kit (ADK) and the Nano Server Image Builder.

I will not go trough all the options but here is just quickly how you can use it.

First create a new Nano Server Image (this can be a VHD, VHDX or WIM file. If you want to use it on a USB drive or ISO save it as a WIM file)

Nano Server Image Builder

Make sure you have prepared everything like the Windows Server 2016 files and drivers etc

Prepapre Nano Server Files

Select the Windows Server 2016 source

Nano Server Sources

Set more options, choose packages (roles and feature), drivers and more.

Nano Server Packages and Drivers

You can also configure some advanced options

Nano Server Image Builder Advanced Configuration

You can now create the Nano Server Image. The Nano Server Image Builder will also show you the PowerShell command to create more Nano Servers.

Nano Server Image Builder PowerShell Creation

You can also use this tool to create a bootable USB drive or ISO using an existing Nano Server Image.

Select the Nano Server Image you have already created

Nano Server Image Builder WIM file

As an option you can also create a ISO file

Nano Server Image ISO

 

You can now boot from USB drive or ISO and you can get the following WinPE Image to boot and this copies the Nano Server Image to the server

Nano Server WinPe

If you want to know more, check out the blog post from Scott Johnson (Microsoft): Introducing the Nano Server Image Builder



Cisco UCS Hyper-V Cluster – Create Hyper-V Image for Blade Servers – Part 2

We use Microsoft Hyper-V Server 2008 R2 as Operating System for our Cisco Blade Notes. The Cisco UCS does need some special drivers which are not included in Hyper-V Server Image (Network and HBA). So I created a Hyper-V Server 2008 R2 ISO file which includes the Drivers from the Cisco UCS.

I made a blog post about adding Drivers to a Windows ISO, this is pretty much the same.

  1. First Download the Hyper-V Server 2008 R2 ISO from microsoft.com
  2. Download the Drivers from Cicso.com, you can download the Bundle File which also includes firmware.
  3. Download and install the Windows Automated Installation Kit
  4. Extract the Hyper-V ISO to C:\temp\hypervr2
  5. Extract the Windows Driver folder in the Cisco Driver ISO (In my case ucs-b2xx-drivers-1.3.1g.iso) to C:\temp\Drivers\Windows
  6. Create a folder for the WIM mount point C:\temp\WIM
    Folders
  7. Start Windows AIK Deployment Tools Command Prompt from Start menu
    Windows AIK Deployment Tools Command Prompt
  8. Now mount the install.wim file form the original Hyper-V Image (C:\temp\hypervr2\SOURCES) to C:\temp\WIM
    imagex /mountrw C:\temp\hypervr2\SOURCES\install.wim 1 C:\temp\wim
  9. Add Drivers with dism
    CD C:\temp\Drivers\Windows\Network\Emulex\M72KR\W2K8R2\x64
    dism /image:C:\temp\WIM /add-driver /driver:. /recurse
  10. After adding all drivers to the Image you can unmout the WIM Image
    imagex /unmount /commit C:\temp\wim
  11. Now create the new ISO file
    oscdimg -n -m -bc:\temp\hypervr2\boot\etfsboot.com C:\temp\hypervr2 C:\temp\hypervr2drivers.iso

Now you can use this new Image to deploy the Hyper-V Hosts on your Cisco UCS Blades.



Create an OS Image in Windows Deployment Services (Capture Image)

Here I will show you how you can simply create a new Image in WDS (Windows Deployment Services). You can use this to create own Images for your Servers or PCs or update existing Images.

  1. Add Capture Images to your WDS
    Windows Deployment Services
  2. Update your Computer or VM with the latest Software.
    Windows Deployment Services
  3. Use Sysprep to generalize the Machine. You can find sysprep.exe in C:\Windows\System32\sysprep
    Sysprep
  4. After the Reboot boot into PXE and boot the Windows Capture Image
    Capture Image
  5. Now you can use the Image Capture Wizard
    Capture Image Wizard
  6. Choose which volume you want to capture if you have just one partion in your installed Image the Volume would be D:\ (C: is the booted Windows PE from the Windows Deployment Service)
    Capture Volume
  7. Now you have to choose the name of the WIM file and the location, before you can upload it to the WDS Server you have to save it on a local partion. After that you can choose your WDS Server and the Image Group you want to upload the image after the Volume is captured.
    Image
  8. Now the capturing process will start
  9. After the capturing process is finished and the image is uploaded you can find the Image in the Image group on your WDS Server
    Capture ImageWDS
  10. Now you can Rollout this new Image