If you want to provision the Vagrant box with a local SQL Server Express database, using Install-MockDatabaseServer.ps1 , you need to run it with elevated privileges.
E.g. by running the provisioner using the elevated_user and elevated_password combination:
...
{
"type": "powershell",
"elevated_user": "vagrant",
"elevated_password": "vagrant",
"inline": [
"$ishBootstrapItem=& C:/Provision/ISHBootstrap/Source/Builders/Database/Install-MockDatabaseServer.ps1 -ISHVersion {{user `ishVersion`}} -MockConnectionString \"{{user `ish_mock_connectionstring`}}\""
]
},
...
Otherwise the installation will fail with the following error (in the installation log (%programfiles%\MicrosoftSQL Server\<server version>\Setup Bootstrap\Log\):
...
Exception type: Microsoft.SqlServer.Chainer.Infrastructure.ChainerInfrastructureException
Message: There was an error generating the XML document. HResult : 0x84b10001 FacilityCode : 1201 (4b1) ErrorCode : 1 (0001)
Data: DisableWatson = true Stack: at Microsoft.SqlServer.Chainer.Infrastructure.DataStoreService.SerializeObject(String rootPath, Object objectToSerialize, Boolean saveToCache)
...
Sql server installation is failing. #5472
Note: The example Vagrant packer files do not contain this provisioner out-of-the-box.