How to change between a Full Installation (GUI) and Server Core in Windows Server 2012

Windows Server 2012

Server Core was introduced in Windows Server 2008, but was confusing to a lot of administrators. This was mainly due to the fact that you as an administrator was restricted to a command line and needed to know the commands for doing your tasks. One of the main problems with it, was that if you installed your server as a Server Core, you would need to reinstall it if you wanted the GUI.

This has changed in Windows Server 2012. Now it’s possible to install your server with a GUI and remove the GUI once you’ve set everything up. It’s also possible to install your server as a Server Core and then add the GUI if needed, by just entering a simple Powershell command..

Adding the GUI to a Server Core installation

Enter this command in to a Powershell prompt, running as Administrator. To enter Powershell, simply type Powershell from the Command Prompt :)

Then run:

Install-WindowsFeature Server-Gui-Shell, Server-Gui-Mgmt-Infra

Add GUI Server Core Windows Server 2012 Powershell

Once installed, you need to restart the server. Use this command:

Restart-Computer

If you do not have Internet connectivity, the installation will hang at 68% and after a while display an error message to you:
Install-WindowsFeature : The request to add or remove features on the specified server failed.
This means that the source files for the GUI installation cannot be located.

.Installation 68% Powershell Windows Server 2012 GUI Core

Installation failed source Windows Server 2012 Powershell

To solve this, follow these steps:

Start by creating a mount directory (i.e C:\Mount)

mkdir c:\mount

Get the index number of the WIM file for the GUI (if WS2012 media is on D:). Since all of the Windows Server 2012 installations are stored in the same *.wim, we need to specify what version we want to mount. In this case, we’ll be using the Datacenter version with GUI, which is Index #4

dism /get-wiminfo /wimfile:d:\sources\install.wim

dism Windows Server 2012 GUI Powershell Index Datacenter

Mount the WIM file:

dism /mount-wim /wimfile: d:\sources\install.wim /Index:3 /mountdir:C:\Mount\ /readonly

Dism Windows Server 2012 Mount Datacenter GUI Powershell

Install and specify the source:

Install-WindowsFeature Server-Gui-Shell, Server-Gui-Mgmt-Infra -Source C:\Mount\Windows\SXS

Install GUI Server Core Windows Server 2012 Powershell Datacenter
Once installed, you need to restart the server. Use this command:

Restart-Computer

Add GUI Windows Server 2012 Server Core Powershell Windows Feature

Removing the GUI from a full installation, using the GUI:

Open Server Manager, open the Manage menu and go to Remove Roles and Features

Remove GUI Windows Server 2012 Core

Press Next until you reach the Features page

There are two different features that you can choose:

  • Graphical Management Tools and Infrastructure (server-GUI-mgmt-infra) basically provides Powershell, MMC and Server Manager.
  • Adding the Server Graphical Shell (server-GUI-shell), will add the rest of the GUI experience. This feature is dependent on the first, so you can’t just add this one.

Note that if you remove Graphical Management Tools and Infrastructure, you will also remove Server Graphical Shell.

Remove GUI Windows Server 2012 Core

Once deselecting one of the features, you will get a popup. Here, press Remove Features.

Remove GUI Windows Server 2012 Server Core

The User Interfaces and Infrastructure feature should now be deselected. Proceed by pressing Next.
Remove GUI Windows Server 2012 Server Core

The final step is to confirm the removal process. Press Remove and select Restart the destination server automatically if required.

Remove GUI Windows Server 2012 Server Core

Removing the GUI from a full installation, using Powershell:

Enter this command:

Uninstall-WindowsFeature Server-Gui-Shell, Server-Gui-Mgmt-Infra

Remove GUI Powershell Windows Server 2012

Remove GUI Server Core Windows Server 2012 Powershell Remove GUI Server Core Windows Server 2012 Powershell

Tagged with: , , , , ,
Posted in Blog, Guides, Microsoft, Powershell, Powershell, Windows Server 2012, Windows Server 2012
10 comments on “How to change between a Full Installation (GUI) and Server Core in Windows Server 2012
  1. Sathwik says:

    Install-WindowsFeature Server-Gui-Shell, Server-Gui-Mgmt-Infra
    fails..
    success:false
    restart needed:no
    what to do??
    had internet connection

  2. Did you run Powershell as elevated? (Run as Administrator)

  3. Derrick Stout says:

    I think the problem is at your section Install and specify the source: One screenshot has the source as c:\mount\windows\sxs while the other has the correct source as c:\mount\windows\winsxs

  4. Jan van Zeggelaar says:

    Hi Daniel,

    thanks for your article. Don’t know if it will work yet, it is running as I type.

    But could you please listen to Derricks remark. If you are lazy, like me, and cut ‘n paste the command line using SXS instead of WinSxS you are in for a long 68% wait again.

    Jan

    P.S. it is still at 68% :-( . Guess I wait until I click Post.

    P.P.S. :-( Still nog go. And this only because suddenly I couldn’t remotely manage my RRAS server after the last updates what a mess. I have now rebuilt a server with GUI from scratch.

    Sometimes I really want to switch to Linux completely.

  5. June says:

    Nice blog, perfect!

  6. Pramod says:

    Above steps worked in my case. Thank you.

  7. Vikir says:

    Hi, I cannot deselect User Interfaces and Infrastructure, it is not allowing me too. Using Windows Server 2012 Standard Edition.

    Please help

  8. Mario Henkel says:

    Great blog entry! Helped me a lot and saved me hours of precious time ;)

  9. Jaro says:

    When this manual doesn’t work and you are getting the error: 0x800f0906 you will need to uninstall all hotfixes – unless you know which one is causing this (run PS commands “get-hotfix” & “wusa /uninstall /norestart /kb:2887595″ for each update or scrip it if you have powershell skills)

    Mounted image as suggested in this manual will be seen as outdated by windows if you patched server core installation. The it will try to contact windows update to get newer files but it will fail even though I had internet connection.

    Once I uninstalled patches the core 2 GUI as suggested above worked.

  10. MSH says:

    Hi,

    Nice article.

    you need to make change in the code you written as it has 2 issues.
    1- index 3 should be 4
    2- after /wimfile: you do not need an space.

    so the correct one is:

    dism /mount-wim /wimfile:d:\sources\install.wim /Index:4 /mountdir:C:\Mount\ /readonly

Leave a Reply

Your email address will not be published. Required fields are marked *

*

* Copy This Password *

* Type Or Paste Password Here *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Categories