VMmanager Knowledge Base
en En
es Es

How do I add drivers to the Windows template?

If additional drivers are required for the server to work with Windows, you can add them to the OS template. You will need a Windows PC or virtual machine (VM) to add the drivers. The PC or server with a VM may be located outside the location. The main requirement is the ability to upload files from your workstation.

This article describes an example of adding drivers to OS templates for Windows 10 and Windows Server 2012 R2, 2016, 2019, 2022. The DISM utility is used to edit the templates.

Preparation

  1. Prepare a Windows PC (VM). System requirements:
    1. OS version — Windows 10 or higher, Windows Server 2016 or higher;
    2. disk space — at least 70 GB for each template to be edited.
  2. Create copies of the OS template. For instructions on copying a template, see the article Creating an own template.
  3. Download the template copies to a Windows PC (VM):
    scp root@<server_IP>:/opt/ispsystem/dci/os_templates/filename C:\Path\To\Save\Template_Name 
    Comments

Example of adding

On the Windows PC (VM):

  1. Create directories:

    C:\win_update\  
    C:\win_update\wim\  
    C:\win_update\win_templates\  
    C:\win_update\win_templates\10\          
    C:\win_update\win_templates\2012\       
    C:\win_update\win_templates\2016\       
    C:\win_update\win_templates\2019\      
    C:\win_update\win_templates\2022\        
    C:\win_update\updates\  
    C:\win_update\updates\10\               
    C:\win_update\updates\2012\              
    C:\win_update\updates\2016\              
    C:\win_update\updates\2019\               
    C:\win_update\updates\2022\
  2. Download the required drivers and save them in the following directories:

    • C:\win_update\updates\10\
    • C:\win_update\updates\2012\
    • C:\win_update\updates\2016\
    • C:\win_update\updates\2019\
    • C:\win_update\updates\2022\

      Example of directory structure

      If the version of Windows on the PC (VM) matches the version of Windows in the template, you can install the downloaded drivers and then import them into the required directory:
      Example of command
      DISM /online /export-driver /destination:C:\win_update\updates\2016
  3. Save the boot.wim and install.wim files from the templates in the following directories:
    • C:\win_update\updates\10\
    • C:\win_update\updates\2012\
    • C:\win_update\updates\2016\
    • C:\win_update\updates\2019\
    • C:\win_update\updates\2022\
      The boot.wim file is in the /undionly-kpxe.0 directory of the template, the install.wim file is in the /sources directory.
  4. Open the Windows (Cmd) command line and navigate to the directory with the templates and drivers:

    cd C:\win_update\
  5. Add the drivers to the templates:

    1. Windows 10:
      1. To the boot.wim file:
        DISM /Mount-Wim /WimFile:win_templates\10\boot.wim /Index:2 /Mountdir:wim
        DISM /image:wim /Add-Driver /Driver:updates/10 /recurse
        DISM /Unmount-Wim /Mountdir:wim /commit
      2. To the install.wim file:
        DISM /Mount-Wim /WimFile:win_templates\10\install.wim /Index:6 /Mountdir:wim  
        DISM /image:wim /Add-Driver /Driver:updates/10 /recurse  
        DISM /Unmount-Wim /Mountdir:wim /commit  
    2. Windows Server 2012 R2:

      1. To the boot.wim file:

        DISM /Mount-Wim /WimFile:win_templates\2012\boot.wim /Index:1 /Mountdir:wim
        DISM /image:wim /Add-Driver /Driver:updates/2012 /recurse
        DISM /Unmount-Wim /Mountdir:wim /commit
      2. To the install.wim file:

        DISM /Mount-Wim /WimFile:win_templates\2012\install.wim /Index:2 /Mountdir:wim
        DISM /image:wim /Add-Driver /Driver:updates/2012 /recurse
        DISM /Unmount-Wim /Mountdir:wim /commit
    3. Windows Server 2016:

      1. To the boot.wim file:

        DISM /Mount-Wim /WimFile:win_templates\2016\boot.wim /Index:2 /Mountdir:wim
        DISM /image:wim /Add-Driver /Driver:updates/2016 /recurse
        DISM /Unmount-Wim /Mountdir:wim /commit
      2. To the install.wim file:

        DISM /Mount-Wim /WimFile:win_templates\2016\install.wim /Index:2 /Mountdir:wim
        DISM /image:wim /Add-Driver /Driver:updates/2016 /recurse
        DISM /Unmount-Wim /Mountdir:wim /commit
    4. Windows Server 2019:

      1. To the boot.wim file:

        DISM /Mount-Wim /WimFile:win_templates\2019\boot.wim /Index:2 /Mountdir:wim
        DISM /image:wim /Add-Driver /Driver:updates/2019 /recurse
        DISM /Unmount-Wim /Mountdir:wim /commit
      2. To the install.wim file:

        DISM /Mount-Wim /WimFile:win_templates\2019\install.wim /Index:2 /Mountdir:wim
        DISM /image:wim /Add-Driver /Driver:updates/2019 /recurse
        DISM /Unmount-Wim /Mountdir:wim /commit
    5. Windows Server 2022:
      1. To the boot.wim file:
        DISM /Mount-Wim /WimFile:win_templates\2022\boot.wim /Index:2 /Mountdir:wim
        DISM /image:wim /Add-Driver /Driver:updates/2022 /recurse
        DISM /Unmount-Wim /Mountdir:wim /commit
      2. To the install.wim file:
        DISM /Mount-Wim /WimFile:win_templates\2022\install.wim /Index:2 /Mountdir:wim
        DISM /image:wim /Add-Driver /Driver:updates/2022 /recurse
        DISM /Unmount-Wim /Mountdir:wim /commit
  6. Replace the boot.wim and install.wim files in the templates with files from the following directories:
    • C:\win_update\updates\10\
    • C:\win_update\updates\2012\
    • C:\win_update\updates\2016\
    • C:\win_update\updates\2019\
    • C:\win_update\updates\2022\

The article was last updated on 02.10.2023. The article was prepared by technical writers of ISPsystem