How-To: Injecting Updates for WDS (Windows Server 2008 R2)

Injecting Windows Updates into an Image

This guide will go through the steps necessary to download windows update packages, inject them into your WIM image, and upload them to your WDS server

Requirements // You will need the following to complete the tasks in this guide

  1. WSUS Offline Tool (Or WSUS Server) for downloading updates – Download Here!
  2. Windows Automated Installation Kit for command line tools – Download Here!
  3. A full sized .WIM image (Cannot be a referenced RWM file)

Downloading Windows Updates // This will go over how to download the Windows packages so you will be able to inject them into your image

  1. Open WSUS Offline Tool UpdateGenerator.exe
  2. Select which updates you would like to download, for example. If we want 64bit Windows 7 updates, we would check ‘x64 Global’ under Windows 7
  3. If you need to include service packs and additional updates, check appropriate boxes in the ‘Options’ field. Office updates are located in the ‘Office’ Tab
  4. Select ‘Start’

This will begin downloading all the updates that meet the parameters you selected. Depending on how many updates you have selected and your connection, it could take several minutes to hours. The update packages will be stored in “C:\wsusoffline\client\ARCHICTECTURE\glb” where Architecture is what you picked for your updates.

Injecting the Updates // This will go over how to take the updates you just downloaded, and inject them into your image (NOTE: Turn off your Anti-Virus when running DISM commands)

  1. If your image is currently used in your WDS server, you will have to convert it to an offline image and export it
    1. In your WDS Server Manager, navigate to Roles > WDS > Servers > YOURSERVER > Install Images
    2. Find the image you want to change and Right-Click > Disable, this will allow you to make changes
    3. Right-click on the same image and select ‘Export Image…’ and it will export the full wim for you
  2. It is always best practice to back up your image before making any changes, especially if you are using this image on your deployment server! (seriously, backup your image)
  3. Create an empty folder named ‘Mount’ at the root of your C: drive and open an elevated command prompt
  4. Now we need to mount the WIM image to be able to make real-time changes to it, so type ‘dism /Mount-Wim /wimfile:C:\Path\To\Image /MountDir:C:\Mount /index:1’ This may take several minutes to complete
  5. Now that the wim is mounted and we can see the file structures within the C:\Mount\ directory, we can apply the package updates by issuing the following:‘dism /image:C:\Mount /Add-Package /PackagePath:C:\wsusoffline\client\w61-x64\glb’
  6. Dism will now begin adding each individual update you selected. Depending on the size of your updates, this could take several minutes to hours
  7. Once this is complete you will unmount the WIM and commit the changes, which saves all changes made, or discard the changes, which gets rid of any changes made.
    1. Commit – dism /Unmount-Wim /MountDir:C:\Mount /commit
    2. Discard – dism /Unmount-Wim /MountDir:C:\Mount /discard

Unmounting your WIM can take a long time, it is recommended that you turn off your Anti-Virus or real time protection when using DISM commands in order to improve performance. Once this finishes, you can compare the filesize of your original wim image, and the modified one to see the difference.

Uploading Image to your WDS Server // This step will go over how to properly upload the new image to your server

  1. In your WDS Server Manager, navigate to Roles > WDS > Servers > YOURSERVER > Install Images
  2. Right-Click on the old image you have made changes to and select ‘Replace Image…’ (Make sure you have a backup of the original images!)
  3. Select ‘Browse..’ and find your new image, then select ‘Next’
  4. Verify that is the image you want and select ‘Next’
  5. You may rename and give a new description to the image, I typically update the description to reflect when the last time this image was changed. Then select ‘Next’
  6. This will replace your old image with the new image, replacing any resource files in your RWM file for that image

You should now have an updated image! Always test your new image out to make sure it is working properly. If you are having any issues and need to revert back to what you had before, just go back and replace the new image with your Original backed up image.

Extras

Always make a backup of any image you are working on in case something goes wrong

DISM Commands are not case sensitive, capitals are purely for readability

This guide used Windows 7 x64 directories, some directories and file names will be different in other operating systems

This entry was posted in Tutorials & How-To's and tagged , , , , , , , , , . Bookmark the permalink.

2 Responses to How-To: Injecting Updates for WDS (Windows Server 2008 R2)

  1. daikonran says:

    This was really helpful. Maybe useful to note that DISM must be used from the directory it is installed in. I had a lot of errors using the outdated default windows version of DISM. But otherwise the guide was spot on. Thanx a lot.

  2. Peter says:

    The injection aspect works but when deploying the image, it fails configuring devices.

Leave a comment