Switching Between GUI and Server Core in Windows Server 2012

32564

In this post we will take a look at switching between GUI and Server core in Windows Server 2012. One of the most interesting feature in Windows server 2012 is it allows you to switch from GUI mode to Core mode. In other words GUI mode in windows server 2012 is optional, that means you can uninstall the GUI and install it back whenever required. In the previous post we saw the installation of Windows Server 2012 in core mode, during the installation of windows server 2012 the user is asked to choose between server core installation and server with a GUI installation. The benefits of installing windows server 2012 in core mode includes reduced attack surface, reduced maintenance, server consumes fewer hardware resources than server installed in GUI mode. Note that when you browse the internet looking for switching between GUI and Core in server 2012 you might find the scripts written by IT professionals that will help you switch between GUI and Server core. In this post we will doing it without using any scripts.

Switching from Windows Server 2012 Core to GUI

I have installed Windows Server 2012 Datacenter Edition (Server Core Installation) on a virtual machine. I have mounted the Windows Server 2012 DVD on to the virtual machine. Log in to the server with the administrator account and you must see a command prompt.

We will be creating two folders, Install and Mount. The folder Install will contain the Install.wim copied from the source DVD and folder Mount will contain the Install.wim, this folder is used for the purpose of mounting Install.wim.

Create two folders Install and Mount using mkdir command.

Switching Between GUI and Server Core in Windows Server 2012 Snap 1

Change drive to where you have mounted Windows Server 2012 DVD. In my case it’s the D drive where the DVD is mounted, next step is to change your directory to Sources where the Install.wim is present.

Switching Between GUI and Server Core in Windows Server 2012 Snap 2

Lets get the details about the Image that we have mounted. Use the command “dism /get-wiminfo /Wimfile:<Path of .wim file>”. In the below screenshot we can see that there are 2 editions of windows server 2012, Standard and Datacenter each with core and GUI mode. We will be using Windows Server 2012 Datacenter edition for installing the server features. Make a note of Index number which will be helpful while mounting the file.

Switching Between GUI and Server Core in Windows Server 2012 Snap 3

To mount the .wim file, use the command “dism /mount-wim /wimfile:<path of .wim file> /Index:Indexnumber /mountdir:<path where you want to mount the .wim file> /readonly”.
Wait until the image file is mounted.

Switching Between GUI and Server Core in Windows Server 2012 Snap 4

To install the GUI and Server Manager use the powershell command Install-WindowsFeature Server-GUI-Mgmt-Infra, Server-GUI-Shell -Source <“path to winsxs folder”>. If you do not specify the Source folder, the features will not be installed.

Switching Between GUI and Server Core in Windows Server 2012 Snap 5

Wait until the installation is completed.

Switching Between GUI and Server Core in Windows Server 2012 Snap 6

Once the features are installed, restart the computer.

Switching Between GUI and Server Core in Windows Server 2012 Snap 7

Now after the restart, lets login with the Administrator account and see what’s installed.

Switching Between GUI and Server Core in Windows Server 2012 Snap 8

We see that the Server manager is installed and GUI too. We have switched from Server core mode to GUI mode successfully.

Switching Between GUI and Server Core in Windows Server 2012 Snap 9

 

 Switching from Windows Server 2012 GUI  to Core

Now we know how to switch from server core mode to server GUI mode. We will now switch back from GUI to Core mode, I think this is very simple and can be done in less time.

Open the command prompt and start the powershell. To uninstall GUI and Server Manager feature, type the command Uninstall-WindowsFeature Server-Gui-Shell, Server-Gui-Mgmt-Infra -Restart.

Note :- If you want only the server manager in the core mode you can skip Server-Gui-Mgmt-Infra from the above command.

Switching Between GUI and Server Core in Windows Server 2012 Snap 10

  • roy

    Why not using this command. Without mounting installing features directly from source.

    Install-WindowsFeature Server-GUI-Mgmt-Infra,Server-GUI-Shell -Restart –Source wim:D:\sources\install.wim:2

    • Yes your question is valid and the command is correct, I prefer to copy the install.wim file first because reading from source DVD might take a little more time, however your method is also correct.

  • Firoz

    Thanks.

  • HurPR

    Working like a charm, Perfect, you saved me some time. Thanks.

  • Samuel Roth

    Thank you!