A Windows Server 2008 R2 VM with SQL Server Express 2008 R2 SP2 powered by Vagrant.
This was just an experiment on how to set things up for a project I worked on the past, I'm not planning to keep this project up to date with latest Vagrant / SQL Server updates or making additional improvements to it.
12GB
of disk space (3GB
for base box + ~9GB
for the VM)More information can be found on the box page at Vagrant Cloud.
git clone https://github.com/fgrehm/vagrant-mssql-express.git
cd vagrant-mssql-express
# Download SQL Server with Tools installer
wget http://download.microsoft.com/download/0/4/B/04BE03CD-EAF3-4797-9D8D-2E08E316C998/SQLEXPRWT_x64_ENU.exe
vagrant up
# Get a coffee as it will take a while for it to finish provisioning
Then test the connection with the SQL Server using telnet 192.168.50.4 1433
192.168.50.4
sa
#SAPassword!
If you are using Rails, apart from installing tiny_tds
dependencies with brew install freetds
/ apt-get install freetds-*
and
the activerecord-sqlserver-adapter gem,
this is what you'll have on your database.yml
:
development:
adapter: sqlserver
database: <YOUR DB>
host: 192.168.50.4
username: sa
password: '#SAPassword!'
More information on https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/wiki/Using-TinyTDS
An example Sinatra app can be found on sinatra-app.
If you need to perform administrative tasks like importing a DB dump or creating
new databases, you can use the vagrant rdp
command
and log in with the vagrant
user and password.
For the vagrant rdp
command to work on Ubuntu, you'll need to apt-get install rdesktop
first. On Macs, you will need Microsoft Remote Desktop from the Mac App Store.
If you want to know more about how the provisioning process work, check out this blog post
This project was made possible thanks to HE:labs
Here's some links I collected along the way while building this: