Because I have a small server at home, I try to win a maximum of space, for the storage and for the memory, by installing VM in Server Core. To note, it is very good for security/patches management.
It’s why, after installing my Hyper-V host and my first domain controller, on Windows Server 2016, I tried to install the SQL on a Server Core.
To start, I installed the VM and I added a second volume to store databases, logs and TempDb.
Use the Get-Disk command to see your second disks with his number, that will help you to format the volume:
To format and mount the volume, used the following command:
1 |
Get-Disk -Number 1 | Initialize-Disk -PartitionStyle MBR -PassThru | New-Partition -UseMaximumSize -DriveLetter S | Format-Volume -FileSystem NTFS -NewFileSystemLabel "SQL_Data" -AllocationUnitSize 65536 -Confirm:$false |
I can now see my volume SQL_Data :
We can start the installation for SQL Server, in command line. You need to adapt this command with your values. To note that I’ll use this SQL for my System Center environment, it’s why, by installing my products in English, I used the SQL_Latin1_General_CP1_CI_AS collation:
1 |
.\Setup.exe /QS /ACTION=Install /FEATURES=SQL /INSTANCENAME=SC /SQLSVCACCOUNT=FLORENTAPPOINTA\svc-sqldb /SQLSVCPASSWORD="P@ssword!123" /AGTSVCACCOUNT=FLORENTAPPOINTA\svc-sqlagent /AGTSVCPASSWORD="P@ssword!123" /RSSVCACCOUNT=FLORENTAPPOINTA\svc-sqlreporting /RSSVCPASSWORD="P@ssword!123" /SQLSYSADMINACCOUNTS=FLORENTAPPOINTA\SQLAdmins /TCPENABLED=1 /IACCEPTSQLSERVERLICENSETERMS=1 /UPDATEENABLED=True /SECURITYMODE=SQL /SAPWD="P@ssword!123" /SQLTEMPDBDIR="S:\TempDB\" /SQLUSERDBDIR="S:\Data\" /SQLUSERDBLOGDIR="S:\Logs\" /SQLBACKUPDIR="S:\Backup\" /SQLCOLLATION="SQL_Latin1_General_CP1_CI_AS" |
I noted that the reporting services can’t be installed on a Server Core. The installation was faster than in GUI 🙂
From my laptop, I opened the ERRORLOG file on the SQL Server, to see the port used by SQL Server, to open it in the firewall :
1 |
\\FLOAPP-SQL01.domain.local\C$\Program Files\Microsoft SQL Server\MSSQL13.SC\MSSQL\Log |
For me, I opened the port, with a GPO and I’ve done a gpupdate /force. I tested the connection from my laptop, where I installed SQL Server Management Studio :
Enjoy 🙂