No matter which installation option you chose, thanks to the
flexibility of Server 2012, you can switch install modes after
installation without losing existing configurations.
What are the benefits of switching from the full interface to a Server
Core install or a Server Core install to the full interface? One reason
could be the full install is consuming too many server resources. Maybe
you want to reduce the threat attack surface that comes with a full
installation. Or, perhaps you have become comfortable enough administering
the server through PowerShell that you can afford to streamline the server
and get rid of the full interface.
Whatever your reason, you have a couple of options to convert from
the full install mode. You can convert through a simple PowerShell
command, or you can remove the graphical shell of a full install to trim
down to a core install.
Converting Server Core to Server with a GUI
To convert a Server Core install into a Server with a GUI install, you will need to create
a folder to mount a Windows Imaging File (WIM). WIM files are images of the
operating system and reside on the installation media, in the sources folder. The image file that gets
mounted is the install.wim file,
which is located inside the sources
folder.
To get started, first run the command mkdir
from the command prompt to create a
directory named mountdir. The syntax is mkdir c:\mountdir
. (See Figure 1.)
After you run the mkdir
command, the mountdir folder is listed under the
root of the C:\ drive (see Figure 2).
Next, you need to find the index number associated with the Server
with a GUI image you want to install. For example, I am converting from
Server Core with the Datacenter edition of Windows Server 2012. I want
to find the Server with a GUI image located on my installation media and
the index number that references that image. To do so, use the Dism
command at an
elevated command prompt. The proper syntax is runas /user:administrator
to elevate
permissions within the command prompt. Click Enter, and you will be
prompted to enter the administrator password.
Then run the following to get the correct index number (also shown
in Figure 3):
Dism /get-wiminfo /wimfile:drive where installation media
is located
:\sources\install.wim
Upon successfully running the command, you’ll see the Deployment Image Servicing and Management tool load. Find
the index number of the Server with a GUI image you want to install (see
Figure 4).
Mount the appropriate image file with the following command (also
shown in Figure 5):
Dism /mount-wim /WimFile:drive where installation media is
located
:\sources\install.wim /Index:#_from_step_2
/MountDir:c:\mountdir/readonly
This again launches the Deployment Image Servicing and Management
tool. The Server with a GUI image is mounted.
After the message “The operation completed successfully” appears
on screen, the image mount is complete. The final step requires
installing the GUI from the mounted image with PowerShell. Launch
PowerShell by simply typing powershell
at the command line. Again, you must run PowerShell with the
administrator account’s elevated permissions for the installation to
work.
Run the cmdlet:
Install-WindowsFeature Server-Gui-Mgmt-Infra,Server-Gui-Shell –Restart –Source
c:\mountdir\windows\winsxs
If the cmdlet is successfully executed, you will see the GUI
installation start within PowerShell (see Figure 6).
After install, the server reboots. When the server comes back up,
the Ctrl-Alt-Delete screen is displayed. Login and the Server Core
interface are now replaced with the full Windows 2012 Server
shell.
You can also use Windows Update as the source, instead of a WIM
file, by using this Windows PowerShell cmdlet (make sure you have an Internet connection):
Install-WindowsFeature Server-Gui-Mgmt-Infra,Server-Gui-Shell –Restart
Converting Server with a GUI to Server Core
To convert from Server with a GUI to a Server Core installation with
Windows PowerShell, run the following cmdlet:
Uninstall-WindowsFeature Server-Gui-Mgmt-Infra -restart
Successful execution of the preceding cmdlet starts the removal
process of the server shell (see Figure 7).
The server reboots once the graphical interface is removed. When
the server comes back up, after login, the core interface is
loaded.
If you initially install with the Server with a GUI option and
then use the preceding command to convert to a Server Core installation,
you can later revert to a Server with a GUI installation without
specifying a source. This is because the necessary files remain stored
on the disk, even though they are no longer installed.
If you convert to a Server Core installation, Windows features,
server roles, and GUI management tools that require a Server with a GUI
installation will be uninstalled automatically. You can specify the
-WhatIf
option in PowerShell
to see exactly which features will be affected by the
conversion.