Robert's SQL Blog

My thoughts on SQL Server, PowerShell and Microsoft products in general.
@rhartskeerl
Follow me on Twitter

Installing SQL Denali on Windows Core Ed. Can it be done?

When SQL Server 2008 was released within the timeframe of Windows Server 2008 R2 some people posted on installing SQL on Windows Core Edition. The installation required .NET so we had to wait for Windows Server 2008 R2. The Windows Core editions are console based, there is no GUI, no taskbar, no start button and no way to accidentally click on Shutdown Server.
Installing Core edition is faster because less stuff is needed, less memory is used and less patches and hotfixes are needed. And who needs a GUI on a server anyway. I have used Linux in the past, at present and will in the future and I like how easy it is to set up servers with it. Installation is quick, startup is fast and typing commands is a lot quicker than clicking through intuitive user interfaces. Luckily Windows can provide you the same experience with the Core edition.
I’ve installed SQL 2008 on Core Ed. before and I wanted to see if it could be done with Denali, the next version of SQL Server. I tried this back in november when CTP1 was released and found it unsuccessful. Why, because Denali needs the .NET Framework 4.0 which cannot be installed on Core editions. That is, up until now. With the release of SP1 for Windows 2008 R2 support for installing the .NET Framework 4.0 is added. You might missed it between all the news about virtualization changes but it is there. Download this special .NET 4.0 Core installation package. To install Denali on 2008 R2 Core follow the following steps.

  1. Install Windows 2008 R2 Core Edition with SP1. This is a breeze, just follow onscreen instructions.
  2. Change password upon first login when prompted.
  3. Use sconfig to rename the server, configure the network etc. Restart the machine if needed.
  4. Install WOW64: DISM /Online /Enable-Feature /FeatureName:ServerCore-WOW64
  5. Install .NET 2.0: DISM /Online /Enable-Feature /FeatureName:NetFx2-ServerCore
  6. Install .NET 2.0 WOW64: DISM /Online /Enable-Feature /FeatureName:NetFx2-ServerCore-WOW64
  7. Install .NET 3.5: DISM /Online /Enable-Feature /FeatureName:NetFx3-ServerCore
  8. Install .NET 3.5 WOW64: DISM /Online /Enable-Feature /FeatureName:NetFx3-ServerCore-WOW64
  9. Install .NET 4.0 by running the downloaded package.
  10. Enable PowerShell: DISM /Online /Enable-Feature /FeatureName:MicrosoftWindowsPowerShell
  11. Run sconfig and apply all patches.

Now there is a problem running the SQL installation. SQL failed because it will need a reboot package. This is the same on a normal installation but I could not get it installed on Core edition. I kept getting back the message that the update did not apply to my system. Either the package is confused or I already have the update. But SQL would not install and fail on the check if this fix was already installed.
To get around this problem I used a trick,an undocumented feature in the installation which you should never use on production machines. But who’s running CTP1 in production? Nobody right? This is the full command I used to install SQL on my Core installation.

setup.exe /q /ACTION=Install /FEATURES=SQL /INSTANCENAME=MSSQLSERVER /SQLSVCACCOUNT="NT AUTHORITYSYSTEM" /AGTSVCACCOUNT="NT AUTHORITYNETWORK SERVICE" /IACCEPTSQLSERVERLICENSETERMS /INDICATEPROGRESS /AGTSVCSTARTUPTYPE=Automatic /SQLSYSADMINACCOUNTS=DOMAINUSER /TCPENABLED=1 /SkipRules=NoReboot

To break it down (it’s all in Books Online though):

  • - ACTION=Install means install it.
  • - FEATURES=SQL means to only install the DB Engine,Full-Text Search and Replication
  • - Then Instancename, SQL Service account, Agent Service account
  • - IACCEPTSQLSERVERLICENCETERMS is mandatory when performing unattended installations.
  • - INDICATEPROGRESS puts the output to the console. Handy if you are a fast reader.
  • - SQLSYSADMINACCOUNTS is required to gain access to SQL after installation.
  • - TCPENABLED is to enable TCP connection. Remember to open up the correct port in the windows firewall.
  • - SkipRules=NoReboot is the catch. This will skip the rule that checks the existence of the required package.

And when that’s all finished, reboot again (shutdown -r -t 0) et voila (SKU 13 is Standard Core Edition, see the WIN32_OperatingSystem class for more info).

Denali Core Install