title: SQL Server service fails to start on Docker Windows container
body: <p>I'm automating a SQL Server install on a Windows container.  Here's my install command:</p>
  
  <pre><code>c:\setup.exe /q /ACTION=Install /INSTANCENAME=MSSQLSERVER /FEATURES=SQLEngine /UPDATEENABLED=0 /SQLSVCACCOUNT='NT AUTHORITY\Network Service' /SQLSYSADMINACCOUNTS='BUILTIN\ADMINISTRATORS' /TCPENABLED=1 /NPENABLED=0 /IACCEPTSQLSERVERLICENSETERMS
  </code></pre>
  
  <p>I receive error <a href="https://stackoverflow.com/questions/19538089/wait-on-the-database-engine-recovery-handle-failed-check-the-sql-server-error-l">0x851A001A</a> in the C:\Program Files\Microsoft SQL Server\130\Setup Bootstrap\Log\Summary.txt.  </p>
  
  <p>So I tried SQLSVCACCOUNT='NT AUTHORITY\Network Service' and SQLSVCACCOUNT='NT AUTHORITY\SYSTEM'.  Both fail the same way.</p>
  
  <p>Despite the error SQL Server service will actually install, so I tried to start manually from powershell:</p>
  
  <pre><code>Start-Service SQLSERVERAGENT
  </code></pre>
  
  <p>That command <a href="https://social.microsoft.com/Forums/en-US/cc7d9f78-60ad-4417-8855-5b445ec47181/startservice-failing?forum=Offtopic" rel="nofollow noreferrer">failed</a>. It seems my Docker container account doesn't have permissions to start the service.  A whoami command within the Docker container shows my user as "Manager\ContainerAdministrator"</p>
  
  <p>Setting SQLSVCACCOUNT="Manager\ContainerAdministrator" won't even install SQL Server.</p>
  
  <p>Note that using the same install files and install command, SQL Server will install correctly on a VMWare machine.  Only when installing on Docker do I see this error.</p>
  
  <p>Is there a way to force start the SQL Server service?  Running powershell as admin didn't do the trick.  Are my Docker container credentials out of sync with the credentials I'm installing SQL Server with?</p>
  
  <p>Possibly related issue:
  <a href="https://github.com/Microsoft/mssql-docker/issues/279" rel="nofollow noreferrer">https://github.com/Microsoft/mssql-docker/issues/279</a></p>