Note: For troubleshooting tips, scroll down to the end of the post.
If you initially set up your Windows Server using Server Core installation and later try to convert to GUI, you may receive the following error:
Error: install-windowsfeature: The request to add or remove features on the specified server failed. The source files could not be downloaded.
“The source files could not be downloaded”
This happens because the Server Core cannot connect to the Internet to download the necessary files. There are two ways around this: One way is to configure your Server Core’s TCP/IP settings with PowerShell for Internet access. The second is to use a DISM Windows Image file to retrieve the files locally. Using a DISM Image speeds up the Server Core to GUI conversion process from a few hours (depending on your Internet speed) to just a few minutes.
Install-Windows-Features using a DISM Image
First, we must create a DISM image file. To create a DISM Image file, follow these steps:
Create a folder to mound the image file (WIM). To do this, open PowerShell and execute the following command:
mkdir c:\mountdir
Next, make sure that your Windows 2012 install CD in the CD ROM and execute the following command:
Dism /get-wiminfo /wimfile:<drive>:sources\install.wim
Determine the index number for the installation. Since we are running a Standard Core in this example, our index is 1. Execute the following command:
Dism /mount-wim /WimFile:<drive>:\sources\install.wim /Index:1 /MountDir:c:\mountdir /readonly
Once the image installation has completed, execute the following command to convert for Server Core to GUI without the need to have Internet access.
Install-WindowsFeature Server-Gui-Mgmt-Infra,Server-Gui-Shell –Restart –Source c:\mountdir\windows\winsxs
Server Core will restart and begin installing the GUI Interface.
Troubleshooting
Error
DISMAPI_Error__Cbs_Download_Failure,Microsoft.Windows.ServerManager.Commands.AddWindowsFeatureCommand
This error can be caused by the WinSXS folder not having permissions for machine account or by Windows updates superseding the feature version available from the install image. See post below.
Error
800F0906 equals CBS_E_DOWNLOAD_FAILURE, Windows couldn’t connect to the Internet to download necessary files; The source files could not be downloaded; The source files could not be found.
The system is trying to use the Internet instead of teh local source. Use the parameter /LimitAccess to prevent DISM from contacting WU/WSUS