Vagrant configuration to provide users with virtual environment for hassle-free fun with SQL Server 2017.
Looking for SQL Server 2017 on Linux VM? Check https://github.com/mloskot/vagrant-sqlserver
- Hyper-V Server 2012 R2
- SQL Server 2017
- Pre-configured with
- Vagrant default user:
vagrant
with passwordvagrant
- Port forwarding from host
3433
to guest1433
(default). - Default instance name
MSSQLSERVER
. - Database user
sa
with passwordPassword123
. - Database
master
. - Guest local account
vagrant
is member of sysadmin role; authenticated from inside the VM, without password.
- Vagrant default user:
- VirtualBox installed.
- Vagrant installed.
- Run
vagrant plugin install vagrant-reload
in command prompt (used to reboot after Hyper-V Server updates) - Downloaded
SQLServer2017RC2-x64-ENU.iso
(1.5GB, see below)
- Download SQL Server 2017 installer for Windows.
- Run the installer and choose to download SQL Server 2017 full ISO.
- Copy the ISO next to this Vagrantfile.
NOTE: Provision runs several steps: installs KB2919355
update required by SQL Server, reboots, installs SQL Server.
That is why the vagrant-reload
is required.
git clone
this repository or download ZIP.cd vagrant-sqlserver-windows
- Copy the downloaded
SQLServer2017RC2-x64-ENU.iso
into the cloned repository (next toVagrantfile
). - Follow the Usage section.
-
vagrant up
to create and boot the guest virtual machine. First time run, this may take quite a while as the base box image is downloaded and provisioned, packages installed. -
vagrant ssh
to get direct access to the guest shell via SSH. You'll be connected as the vagrant user. You can get root access withsudo
command. -
vagrant halt
to shutdown the guest machine. -
vagrant destroy
to wipe out the guest machine completely. You can re-create it and start over withvagrant up
.
Using SSMS as SA
or using sqlcmd client:
- Connect to SQL Server instance from inside the guest VM
vagrant ssh
sqlcmd -Q "SELECT @@version;" # as vagrant user, no password
sqlcmd -S localhost,3433 -U sa -P Password123 -Q "SELECT name FROM sys.databases;"
- Connect to SQL Server instance from host
sqlcmd -S localhost,2433 -U SA -P Password123 -Q "SELECT name FROM sys.databases;"
- Marc Abramowitz for his Microsoft Hyper-V Server 2012 R2 Vagrant image.