Getting Started with Server Core 2012 R2

I finally did it. I deployed my first production Server Core 2012 R2 VM. Here’s what I learned along the way.

Overview:

  • Installing Server Core
  • Configuring the IP Address, Name, Domain, etc.
  • Switching from Core to Desktop mode and back.
  • Installing .Net 3.5.
  • Removing unneeded features to reduce the server footprint (Features on Demand).
  • Windows Updates

Installing Server Core

There’s nothing special to write here. Install windows from the media as usual, but select the ‘Server Core’ option when presented with the edition selection page.

Configuration

First, get the interface name that you’d like to work on:

PS C:\Users\Administrator> Get-NetAdapter | Select Name,MacAddress
Name, MacAddress
Ethernet, 00-15-5D-1D-C1-1C

In our case, we want the interface named ‘Ethernet’. Next, let’s set an IP and DNS server.

New-NetIPAddress -IPAddress x.x.x.x -InterfaceAlias "Ethernet" -DefaultGateway x.x.x.x -PrefixLength yy
#example: New-NetIPAddress -IPAddress 192.168.2.50 -InterfaceAlias "Ethernet" -DefaultGateway 192.168.2.1 -PrefixLength 24

Set-DnsClientServerAddress -InterfaceAlias "Ethernet" -ServerAddresses ("x.x.x.x","y.y.y.y")
#example: Set-DnsClientServerAddress -InterfaceAlias "Ethernet" -ServerAddresses ("192.168.2.3","192.168.2.4")
 

Now, let’s join a domain. This is easy also.

Add-Computer -DomainName "contoso.com" -DomainCredential (Get-Credential) -NewName "ComputerName"
Restart-Computer

Great. Now we have basic connectivity. Onwards.

Switching between Core and Desktop

Everyone pretends that this is the simplest thing ever. That’s not quite true. If you install Windows Server in desktop mode, it’s easy to remove the GUI. However, if you install Windows Server in server core mode, it’s a little tricky to get the GUI back because the source files for the GUI are not installed.

Here’s the procedure to install the GUI on a system installed as sever core:

  1. Insert the Windows Server 2012 R2 media.
  2. Run the following commands:
    mkdir C:\mountdir
    dism /get-wiminfo /wimfile:d:\sources\install.wim
    #note the index number the 'GUI' version of the Windows Server edition that you're working with. This will probably be '1' for server standard or '3' for server datacenter.
    dism /mount-wim /wimfile:d:\sources\install.wim /index:3 /mountdir:c:\mountdir /readonly
    Install-WindowsFeature Server-Gui-Mgmt-Infra,Server-Gui-Shell -source c:\mountdir\windows\winsxs
    

In order to remove the GUI:

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

Installing .Net 3.5

The source files for .Net 3.5 are in a different location than the source files for the GUI.

  1. Insert the Windows Server 2012 R2 media.
  2. Run the following command:
Install-WindowsFeature net-framework-core -source D:\sources\sxs

Removing Unneeded Features aka Features on Demand

In server 2012 R2, you can actually remove the source files for unused features from the disk to save space. This is useful for high density VM installs.

The command is:

Uninstall-WindowsFeature FeatureName -Remove

To uninstall all unused features:

Get-WindowsFeature | ?{$_.InstallState -eq "Available"} | Uninstall-WindowsFeature -Remove

Windows Updates

For this, I just used sconfig. Just type ‘sconfig’ into the command prompt, then choose the windows update feature. Sconfig is neat, but I’m generally more interested in scriptable solutions. I’ll revisit command-line windows update searching in the future.

All-in-all, server core is pretty cool!

I wish you the best with your sever core adventures.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s