Archive | September 2015

How to install server GUI on Windows Server 2016 from PowerShell

 

As you probably know, Microsoft Windows Server 2016 Technical Preview 3 has been released and you can get it from Microsoft Technet Evaluation center for free.

You can install server system with or without GUI, you have two choices:

  • install core edition

Windows Server 2016 Technical Preview 3

  • install server with GUI

Windows Server 2016 Technical Preview 3 – Server with Desktop Experience

Windows Server 2016 installation type

Windows Server 2016 installation type

if you choose the second installation option, that’s all in this case. After server OS installation you will get Windows Server desktop with complete GUI.

What if you decided to install full core edition and after some time you don’t want to use it anymore. There is an option to use PowerShell and install missing features to have full server with GUI. This time with Windows Server 2016 it is not so simple as it was in Windows Server 2012/2012R2.

When you try to install missing feature from PowerShell console and your server has no access to the Internet, installation fails!

This happens because from Windows Server 2016, GUI features are removed from installation image and you cannot simply activate them to turn on/off core edition.

Open PowerShell console and search for features name to install

Get-WindowsFeature -Name *GUI*
Get-WindowsFeature PowerShell cmd-let

Get-WindowsFeature PowerShell cmd-let

in “Install state” column you will see that features state is “removed”.

If you simply try to install these features and your server has no access to the Internet or installation source is not defined by Group Policy, operation will fail. This is highly possible that your server has no access to the Internet and if this is the first Windows Server 2016 installation, you would probably not have central location where shared components for this system are available.

In case where your server has access to the Internet, simply type in PowerShell console this syntax and wait couple of minutes

Install-WindowsFeature -Name Server-Gui-Shell,Server-Gui-Mgmt-Infra
Install-WindowsFeature PowerShell cmd-let

Install-WindowsFeature PowerShell cmd-let

but if you have no access to the Internet, you will see similar error in the console

Error during Windows feature installation

Error during Windows feature installation

then you have to use your installation media to successfully install server GUI features. Before you can do that, you need to identify appropriate index of Windows Server 2016 edition from which you want to install features. They are only available in full editions, so you need to skip indexes for core editions in the list. To get information of available editions in install.wim installation file, you need to use below PowerShell cmd-let

Get-WindowsImage -ImagePath d:\sources\install.wim

where d:\ is a letter of you drive with installation media

install.wim Windows Server 2016 editions and their index

install.wim Windows Server 2016 editions and their index

Check index number for Standard of Datacenter edition and remember it. As you can see in the screen above, appropriate image index is 2 or 4

In these images, all required features are available and they can be used as a source of installation.

To install feature from non-default location, you need to specify -Source switch to Install-WindowsFeature cmd-let. The switch requires appropriate syntax

InstallationProvider:WIMFileLocation:ImageIndex

wim:d:\sources\install.wim:2

or

wim:d:\sources\install.wim:4

the full installation syntax is available below

Install-WindowsFeature -Name Server-Gui-Shell,Server-Gui-Mgmt-Infra -Source wim:d:\sources\install.wim:2
Install-WindowsFeature cmd-let with -Source switch

Install-WindowsFeature cmd-let with -Source switch

and now, you installation should succeed even if your server does not have an access to the Internet

Windows feature installation progress

Windows feature installation progress

after some time, you would be prompted to reboot the server to apply the changes

Prompt for server restart

Prompt for server restart

use PowerShell cmd-let to restart server and wait couple of minutes to apply changes

Restart-Computer
Restarting server

Restarting server

when server is booting you should see on the screen features configuration

Feature configuration at server's startup

Feature configuration at server’s startup

when it is done, you should see logon screen

Log in into Windows Server 2016

Log in into Windows Server 2016

Provide appropriate credentials and check if you can see desktop

Server GUI in Windows Server 2016

Server GUI in Windows Server 2016

If you are able to see START tile and other desktop features, congratulations. Everything is configured properly. You can do whatever you want with your server, now.

 

Author: Krzysztof Pytko