To GUI or not to GUI
After adding the basic parameters, it's now time to add some comfort to our Zero-Touch installation.
In Windows System Image Manager, add amd64_Microsoft-Windows-Shell-Setup_neutral
to Pass4
and Pass7
.
Edit the XML file to set your time zone settings (run tzutil /l
in a Shell to get a list of all the valid time zones) and your local administrator password. Don't worry about entering a password into Windows System Image Manager; it will encrypt the password while saving the file. The following code shows how to set the regional and user information:
<settings pass="specialize"><component language="neutral" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" versionScope="nonSxS" publicKeyToken="31bf3856ad364e35" processorArchitecture="amd64" name="Microsoft-Windows-Shell-Setup"><TimeZone>W. Europe Standard Time</TimeZone></component></settings><settings pass="oobeSystem"><component language="neutral" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" versionScope="nonSxS" publicKeyToken="31bf3856ad364e35" processorArchitecture="amd64" name="Microsoft-Windows-Shell-Setup"><UserAccounts><AdministratorPassword><Value>UABAAHMAcwB3ADAAcgBkAEEAZABtAGkAbgBpAHMAdAByAGEAdABvAHIAUABhAHMAcwB3AG8AcgBkAA==</Value><PlainText>false</PlainText></AdministratorPassword></UserAccounts></component></settings>
To allow a rapid deployment of hosts, I have not entered a computer name at this stage, so the setup will generate a random computer name for each node installed. If you want to enter a computer name, add the following code to your XML-specialized section:
<ComputerName>Hyper-V01</ComputerName>
Tip
Downloading the example code
You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.
Another optional feature was selected right at the beginning of our XML creation: the GUI. By selecting the Windows Server Standard edition and not the Standard Core edition, we have included the complete GUI of Windows Server in our setup. Unlike previous versions of Windows Server with Hyper-V, the GUI is now a feature that can be activated and deactivated at a later stage. Please note that the GUI is not available on the free Hyper-V Server 2012 R2. The full GUI installation process offers the same great user experience we know for many versions of Windows Server and Windows Client operating systems, but Server Core is the recommended installation method by Microsoft for Windows Server 2012 R2 and Hyper-V. The Core installation option offers a reduced attack surface with less patching efforts and fewer reboots. It even comes with a smaller resource footprint than its Full GUI equivalent. However, offering only a PowerShell Window as the single point of local administration discouraged many system administrators in the past, so Core setups aren't found often. Don't forget that all administrative APIs are active on a Core Server, so you can connect with your MMC consoles from other servers or clients without the need to use the PowerShell modules. With Windows Server 2012 R2, you have even more choices; Microsoft added the MinShell installation mode where, in addition to PowerShell, all administrative consoles, known from the Remote Server Administrations Tools (RSAT), are available locally, but security critical elements such as Internet Explorer still aren't presented locally. Following customer feedback, MinShell is getting more attention than the older Core setup. Both Core and MinShell do offer another huge advantage: they don't allow the installation of programs and configurations that require a GUI, though these systems are typically very clean in terms of software onboard, adding to a seamless operation in a production environment. The following best practice model was established by our customers to manage the GUI:
- Install the Server with Full GUI. Make yourself familiar with the operating system and its roles.
- After finishing the initial configuration, uninstall the GUI and run the server in the MinShell or Core mode.
- To switch from Full Server GUI to Minshell later on, open a PowerShell Window with administrative privileges and run
Uninstall-WindowsFeature Server-Gui-Shell –Restart
for MinShell andGet-WindowsFeature *gui* | Uninstall-WindowsFeature –Restart
for Server Core. - To reinstall MinShell, run the following command:
Install-WindowsFeature Server-Gui-Mgmt-Infra –Restart
- To reinstall Full Server GUI, run the following command:
Install-WindowsFeature Server-Gui-Mgmt-Infra, Server-Gui-Shell -Restart
In every case, a reboot of the host will occur. Look at the Windows Server Core PowerShell shown in the following screenshot: