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.
This article discusses an example of adding drivers to Windows Server 2012 R2, 2016, 2019 templates. The DISM utility is used to edit the templates.
Preparation
- Prepare a Windows PC (VM). System requirements:
- OS version — Windows 10 or higher, Windows Server 2016 or higher;
- disk space — at least 70 GB for each template to be edited.
- Create a copy of the OS template.
- Download a copy of the template to a Windows PC (VM).
Example of adding
On the Windows PC (VM):
-
Create directories:
C:\win_update\ C:\win_update\wim\ C:\win_update\win_templates\ C:\win_update\win_templates\2012\ C:\win_update\win_templates\2016\ C:\win_update\win_templates\2019\ C:\win_update\updates\ C:\win_update\updates\2012\ C:\win_update\updates\2016\ C:\win_update\updates\2019\
-
Download the required drivers and save them in the C:\win_update\updates\2012\, C:\win_update\updates\2016\, C:\win_update\updates\2019\.
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 commandDISM /online /export-driver /destination:C:\win_update\updates\2016
- Save the boot.wim and install.wim files from the templates in the C:\win_update\win_templates\2012\, C:\win_update\win_templates\2016\, C:\win_update\win_templates\2019\ directories The boot.wim file is usually in the root directory of the template, the install.wim file is in the /sources directory.
-
Open the Powershell command line and navigate to the directory with the templates and drivers:
cd C:\win_update\
-
Add the drivers to the templates:
-
Windows Server 2012 R2:
-
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
-
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
-
-
Windows Server 2016:
-
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
-
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
-
-
Windows Server 2019:
-
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
-
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
-
-
- Replace the boot.wim and install.wim files in the templates with files from the C:\win_update\win_templates\2012\, C:\win_update\win_templates\2016\, C:\win_update\win_templates\2019 directories.