Skip to content

Instantly share code, notes, and snippets.

Last active February 10, 2022 03:19
What would you like to do?
Vagrantfile for SQL Server on Linux with WideWorldImporters sample database and tSQLt framework included
Vagrant.configure("2") do |config| = "centos/7" "forwarded_port", guest:1433, host:1433
config.vm.provider :libvirt do |libvirt|
libvirt.memory = "4096"
config.vm.provision "shell",
inline: <<-SHELL
yum -y update
curl > /etc/yum.repos.d/mssql-server.repo
curl > /etc/yum.repos.d/msprod.repo
curl > /vagrant/DbBackup/WideWorldImporters-Full.bak
yum install -y epel-release
yum install -y tcping
export ACCEPT_EULA=y
yum install -y mssql-server mssql-tools unixODBC-devel
export SA_PASSWORD='Vagrant2017'
/opt/mssql/bin/mssql-conf setup accept-eula
while ! tcping localhost 1433;do sleep 1; done
/opt/mssql-tools/bin/sqlcmd -Usa -PVagrant2017 -i /vagrant/Restore-DB.sql
/opt/mssql-tools/bin/sqlcmd -Usa -PVagrant2017 -dWideWorldImporters -i /vagrant/tSQLt/SetClrEnabled.sql
/opt/mssql-tools/bin/sqlcmd -Usa -PVagrant2017 -dWideWorldImporters -i /vagrant/tSQLt/tSQLt.class.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment