Installing and Configuring Windows Server Core

Starting to get a lot of servers in my HomeLab which are consuming a lot of resources. Decided to start reducing core services footprint by running Windows Core where I can.

The benefits of running Windows Server Core include:

  1. low resource usage
  2. and greatly reduced attack surface.

Here are the steps that I followed to build my Windows Server Core Domain Controller.

The following settings were used for this build:

 Value
PlatformHyper-V
vCPU1
Memory2048MB
Harddrive160GB
Harddrive 240GB
Network1x NIC

Mount the ISO and install as per normal.

Enter password for the local administrator account to log in.

To configure a dedicated disk to store the AD objects, we need to run Diskpart.

In the command prompt, enter the following commands:

Diskpart

List disk

Create Partition Primary

Select Partition 1

Active

Format FS=NTFS label=App

Assign letter=e

Exit

Now that you are back in Command Prompt, enter the following commands:

sconfig

Now select the relevant number to change the settings.
For this example, i will change the computer name.

2

Enter the new name for the computer.
Restart when prompted.

Log into the server, and run sconfig again.
Time to change the network settings.

8

1

1

S

Enter the IPv4 details

4

Now to install Server Roles.

Type powershell.exe to convert to Windows Powershell.

Install-WindowsFeature AD-Domain-Services -IncludeManagementTools

Install-ADDSForest -Domainname <NameofForest> -DatabasePath “E:\AD\DB” -LogPath “E:\AD\Log” -SysvolPath “E:\AD\SYSVOL”

Enter the safemode administrator password

Select Yes to All

You have now successfully created a Windows Core Domain Controller.

To add another domain controller to the domain, build to the same specs as the above server.

Run the following commands:

                Type the word Powershell to run powershell.

                Install-WindowsFeature AD-Domain Services -IncludeManagementTools

Install-ADDSForest -Domainname <NameofForest> -DatabasePath “E:\AD\DB” -LogPath “E:\AD\Log” -SysvolPath “E:\AD\SYSVOL”

Enter the Admin password.

Reboot

Make sure you run DCDiag and confirm that there are no issues.

MySQL Windows Installation Guide

MySQL Software can be downloaded from here. You will need to need to create a free Oracle account to access the software.

  1. Run the executable.

mysqlinstall1

  1. Tick ‘I accept the license terms’

mysqlinstall2

  1. Select ‘No, I either don’t have My Oracle Support or don’t want to use it now’, and tick the Don’t Ask Again box.

mysqlinstall3

  1. Select Custom. This allows you to specify whether to install 32x or 64x.

mysqlinstall4

 

  1. Install the following roles:
    1. MySQL x64
    2. MySQL Workbench – x64
    3. MySQL Notifier – Any
    4. Connector/ODBC – x64
    5. Connector/C++ – x64
    6. Connector/C – 64

Install any other additional Connectors you may need.

mysqlinstall5

 

 

  1. No need to do anything on this next step:

mysqlinstall6

  1. Select Yes and will install the failed requirements pre-reqs.

mysqlinstall7

  1. Select ‘Execute’

mysqlinstall8

  1. Will install the MySQL products selected.

mysqlinstall9

 

  1. There is a known issue that the ODBC Connector fails on installation. This is a known issue and the workaround is to run a separate Connector/OOBC installer post-install.

mysqlinstall10

  1. Select Next for Product Configuration.

mysqlinstall11

  1. Select the Config Type.
    1. If you are using this as a Development machine, then select Development Machine;
    2. Else, select Server Machine if installed on server with the web application;
    3. Or the preferred choice, MySQL running on a Dedicated Machine.

mysqlinstall12

 

  1. Select what TCP/IP port number. I would suggest not using the default port.
    Tick ‘Show Advanced Options’.

mysqlinstall13

  1. Add a password for the current Root Account, and create a MySQL user with DB Admin privileges.

mysqlinstall14

  1. Change the Windows Service name from MySQL56 to MySQL, leave the rest as is.

mysqlinstall15

  1. Under advanced options, you can change the type of logging.

mysqlinstall16

  1. Then select Execute once ready.

mysqlinstall17

  1. Select Finish once all green ticks.

mysqlinstall18

 

Uninstallation of MySQL

To uninstall MySQL from a Windows based machine, follow the below steps:

  1. Run a Command Prompt as an Administrator and running the following commands:
    1. Net stop MySQL
    2. Sc delete MySQL
  2. Under Control Panel à Programs à Program and Features, right click on MySQL Server 5.6 and select uninstall.
  3. Uninstall any other additional features from MySQL through Program and Features.
  4. Restart the machine.